#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*/ add128(unsigned long long *, unsigned long long *,
                          unsigned long long *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show(unsigned long long *);
int main() {
  unsigned long long int a[2] = {0x1ULL, 0xFFFFFFFFFFFFFFFFULL},
                         b[2] = {0x8ULL, 0x9ULL}, c[2];
  printf("   ");
  show(a);
  printf(" + ");
  show(b);
  printf(" = ");
  add128(a, b, c);
  show(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <show@plt>
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <show@plt>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1030 <add128@plt>
lea    -0x40(%rbp),%rdi
call   1050 <show@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
movaps 0xec0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1050 <show@plt>
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%r15
mov    %r15,%rdi
call   1050 <show@plt>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
lea    0x20(%rsp),%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <add128@plt>
mov    %rbx,%rdi
call   1050 <show@plt>
xor    %eax,%eax
add    $0x30,%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 8, i64 9]
@.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 [2 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)
%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)
%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 [2 x i64], [2 x i64]* %4, i64 0, i64 0
%17 = call i32 @add128(i64* %14, i64* %15, i64* %16)
%18 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 0
%19 = call i32 @show(i64* %18)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [2 x i64] [i64 1, i64 -1]
@__const.main.b = [2 x i64] [i64 8, i64 9]
@.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 [2 x i64]
%4 = bitcast [2 x i64]* %1 to i8*
%5 = bitcast [2 x i64]* %2 to i8*
%6 = bitcast [2 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)
%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)
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%14 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
%15 = call i32 @add128(i64* %8, i64* %11, i64* %14)
%16 = call i32 @show(i64* %14)
ret i32 0
}