#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 */
scalar_t__ EOF;
int /*<<< orphan*/ from_binary(int /*<<< orphan*/, char *, short *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
scalar_t__ scanf(char *, unsigned long long *, unsigned long long *);
int /*<<< orphan*/ sum_binary(char *, char *, char *);
int /*<<< orphan*/ to_binary(unsigned long long, char *, short *);
int main(int argc, char const *argv[]) {
  unsigned long long int a = 0, b = 0;
  while (scanf("%llu %llu", &a, &b) != EOF) {
    short index;
    index = 64 + 1 - 1 - 1;
    char binary_a[64 + 1];
    binary_a[64 + 1 - 1] = '\0';
    to_binary(a, binary_a, &index);
    index = 64 + 1 - 1 - 1;
    char binary_b[64 + 1];
    binary_b[64 + 1 - 1] = '\0';
    to_binary(b, binary_b, &index);
    index = 64 + 1 - 1 - 1;
    char binary_result[64 + 1];
    binary_result[64 + 1 - 1] = '\0';
    sum_binary(binary_a, binary_b, binary_result);
    index = 64 + 1 - 1 - 1;
    printf("%llu\n", from_binary(0, binary_result, &index));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xe80(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1070 <scanf@plt>
mov    0x2e54(%rip),%rcx
cmp    (%rcx),%rax
je     1225 <main+0xd5>
movw   $0x3f,-0x22(%rbp)
movb   $0x0,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x22(%rbp),%rdx
call   1030 <to_binary@plt>
movw   $0x3f,-0x22(%rbp)
movb   $0x0,-0x80(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
lea    -0x22(%rbp),%rdx
call   1030 <to_binary@plt>
movw   $0x3f,-0x22(%rbp)
movb   $0x0,-0xd0(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
lea    -0x110(%rbp),%rdx
call   1050 <sum_binary@plt>
movw   $0x3f,-0x22(%rbp)
lea    -0x110(%rbp),%rsi
xor    %edi,%edi
lea    -0x22(%rbp),%rdx
call   1060 <from_binary@plt>
mov    %eax,%esi
lea    0xdef(%rip),%rdi
call   1040 <printf@plt>
jmp    1179 <main+0x29>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
movq   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
lea    0xe86(%rip),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1070 <scanf@plt>
mov    0x2e58(%rip),%r13
cmp    0x0(%r13),%rax
je     1258 <main+0x108>
lea    0xc0(%rsp),%r14
lea    0xe(%rsp),%rbx
lea    0x70(%rsp),%r15
lea    0x20(%rsp),%r12
lea    0x10(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
movw   $0x3f,0xe(%rsp)
movb   $0x0,0x100(%rsp)
mov    0x18(%rsp),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <to_binary@plt>
movw   $0x3f,0xe(%rsp)
movb   $0x0,0xb0(%rsp)
mov    0x10(%rsp),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <to_binary@plt>
movw   $0x3f,0xe(%rsp)
movb   $0x0,0x60(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1050 <sum_binary@plt>
movw   $0x3f,0xe(%rsp)
xor    %edi,%edi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1060 <from_binary@plt>
lea    0xdd7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xdbf(%rip),%rdi
lea    0x18(%rsp),%rsi
mov    %rbp,%rdx
call   1070 <scanf@plt>
cmp    0x0(%r13),%rax
jne    11c0 <main+0x70>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%llu %llu\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%llu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i16
%9 = alloca [65 x i8]
%10 = alloca [65 x i8]
%11 = alloca [65 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
store i64 0, i64* %7
br label %12
12: ; preds = %16, %2
%13 = call i64 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %6, i64* %7)
%14 = load i64, i64* @EOF
%15 = icmp ne i64 %13, %14
br i1 %15, label %16, label %33
16: ; preds = %12
store i16 63, i16* %8
%17 = getelementptr inbounds [65 x i8], [65 x i8]* %9, i64 0, i64 64
store i8 0, i8* %17
%18 = load i64, i64* %6
%19 = getelementptr inbounds [65 x i8], [65 x i8]* %9, i64 0, i64 0
%20 = call i32 @to_binary(i64 %18, i8* %19, i16* %8)
store i16 63, i16* %8
%21 = getelementptr inbounds [65 x i8], [65 x i8]* %10, i64 0, i64 64
store i8 0, i8* %21
%22 = load i64, i64* %7
%23 = getelementptr inbounds [65 x i8], [65 x i8]* %10, i64 0, i64 0
%24 = call i32 @to_binary(i64 %22, i8* %23, i16* %8)
store i16 63, i16* %8
%25 = getelementptr inbounds [65 x i8], [65 x i8]* %11, i64 0, i64 64
store i8 0, i8* %25
%26 = getelementptr inbounds [65 x i8], [65 x i8]* %9, i64 0, i64 0
%27 = getelementptr inbounds [65 x i8], [65 x i8]* %10, i64 0, i64 0
%28 = getelementptr inbounds [65 x i8], [65 x i8]* %11, i64 0, i64 0
%29 = call i32 @sum_binary(i8* %26, i8* %27, i8* %28)
store i16 63, i16* %8
%30 = getelementptr inbounds [65 x i8], [65 x i8]* %11, i64 0, i64 0
%31 = call i32 @from_binary(i32 0, i8* %30, i16* %8)
%32 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %31)
br label %12
33: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%llu %llu\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%llu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i16
%6 = alloca [65 x i8]
%7 = alloca [65 x i8]
%8 = alloca [65 x i8]
%9 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%10 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%11 = call i64 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %3, i64* %4)
%12 = load i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %33, label %14
14: ; preds = %2
%15 = bitcast i16* %5 to i8*
%16 = getelementptr inbounds [65 x i8], [65 x i8]* %6, i64 0, i64 0
%17 = getelementptr inbounds [65 x i8], [65 x i8]* %6, i64 0, i64 64
%18 = getelementptr inbounds [65 x i8], [65 x i8]* %7, i64 0, i64 0
%19 = getelementptr inbounds [65 x i8], [65 x i8]* %7, i64 0, i64 64
%20 = getelementptr inbounds [65 x i8], [65 x i8]* %8, i64 0, i64 0
%21 = getelementptr inbounds [65 x i8], [65 x i8]* %8, i64 0, i64 64
br label %22
22: ; preds = %14, %22
store i16 63, i16* %5
store i8 0, i8* %17
%23 = load i64, i64* %3
%24 = call i32 @to_binary(i64 %23, i8* %16, i16* %5)
store i16 63, i16* %5
store i8 0, i8* %19
%25 = load i64, i64* %4
%26 = call i32 @to_binary(i64 %25, i8* %18, i16* %5)
store i16 63, i16* %5
store i8 0, i8* %21
%27 = call i32 @sum_binary(i8* %16, i8* %18, i8* %20)
store i16 63, i16* %5
%28 = call i32 @from_binary(i32 0, i8* %20, i16* %5)
%29 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = call i64 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %3, i64* %4)
%31 = load i64, i64* @EOF
%32 = icmp eq i64 %30, %31
br i1 %32, label %33, label %22
33: ; preds = %22, %2
ret i32 0
}