/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>

void mul64(long int a, long int b, long int *c);
void mul128(long long int a, long long int b, long long int *c);

int main(int argc, char *argv[])
{
    long int a32 = 0x40000000L;
    long int b32 = 0x00000004L;
    long int c64[2];
    mul64(a32, b32, c64);
    printf("%08X %08X\n", c64[1], c64[0]);
    long long int a64 = 0x4000000000000000LL;
    long long int b64 = 0x0000000000000004LL;
    long long c128[2];
    mul128(a64, b64, c128);
    printf("%016LX %016LX\n", c128[1], c128[0]);
    return 0;
}
