#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ mul128(unsigned long long *, unsigned long long *,
                          unsigned long long *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show(unsigned long long *, int);
int main() {
  unsigned long long int a[2] = {0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL},
                         b[2] = {0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL},
                         c[4];
  printf("   ");
  show(a, 2);
  printf(" + ");
  show(b, 2);
  printf(" = ");
  mul128(a, b, c);
  show(c, 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea1(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
call   1050 <show@plt>
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x2,%esi
call   1050 <show@plt>
lea    0xe72(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1030 <mul128@plt>
lea    -0x50(%rbp),%rdi
mov    $0x4,%esi
call   1050 <show@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
pcmpeqd %xmm0,%xmm0
movdqa %xmm0,0x10(%rsp)
movdqa %xmm0,(%rsp)
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x2,%esi
call   1050 <show@plt>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x2,%esi
call   1050 <show@plt>
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
lea    0x20(%rsp),%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <mul128@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1050 <show@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.a = [2 x i64] [i64 -1, i64 -1]
@__const.main.b = [2 x i64] [i64 -1, i64 -1]
@.str = [4 x i8] c" \00"
@.str.1 = [4 x i8] c" + \00"
@.str.2 = [4 x i8] c" = \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i64]
%3 = alloca [2 x i64]
%4 = alloca [4 x i64]
store i32 0, i32* %1
%5 = bitcast [2 x i64]* %2 to i8*
%6 = bitcast [2 x i64]* %3 to i8*
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 0
%9 = call i32 @show(i64* %8, i32 2)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
%12 = call i32 @show(i64* %11, i32 2)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%14 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 0
%15 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
%16 = getelementptr inbounds [4 x i64], [4 x i64]* %4, i64 0, i64 0
%17 = call i32 @mul128(i64* %14, i64* %15, i64* %16)
%18 = getelementptr inbounds [4 x i64], [4 x i64]* %4, i64 0, i64 0
%19 = call i32 @show(i64* %18, i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
@.str.1 = [4 x i8] c" + \00"
@.str.2 = [4 x i8] c" = \00"
define i32 @main() {
%1 = alloca [2 x i64]
%2 = alloca [2 x i64]
%3 = alloca [4 x i64]
%4 = bitcast [2 x i64]* %1 to i8*
%5 = bitcast [2 x i64]* %2 to i8*
%6 = bitcast [4 x i64]* %3 to i8*
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %1, i64 0, i64 0
%9 = call i32 @show(i64* %8, i32 2)
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 0
%12 = call i32 @show(i64* %11, i32 2)
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%14 = getelementptr inbounds [4 x i64], [4 x i64]* %3, i64 0, i64 0
%15 = call i32 @mul128(i64* %8, i64* %11, i64* %14)
%16 = call i32 @show(i64* %14, i32 4)
ret i32 0
}