#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 */
typedef int /*<<< orphan*/ n2;
typedef int /*<<< orphan*/ n1;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printlong(char *);
scalar_t__ readlong(char *);
int /*<<< orphan*/ sum(char *, char *);
int main() {
  char n2[111], n1[111];
  int i, j, o;
  memset(n1, 0, sizeof(n1));
  memset(n2, 0, sizeof(n2));
  readlong(n1);
  while (readlong(n2) > 0) {
    sum(n1, n2);
    memset(n2, 0, sizeof(n2));
  }
  printlong(n1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xf0(%rbp),%rdi
xor    %esi,%esi
mov    $0x6f,%edx
call   1030 <memset@plt>
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x6f,%edx
call   1030 <memset@plt>
lea    -0xf0(%rbp),%rdi
call   1040 <readlong@plt>
lea    -0x80(%rbp),%rdi
call   1040 <readlong@plt>
cmp    $0x0,%rax
jle    11b9 <main+0x79>
lea    -0xf0(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1050 <sum@plt>
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x6f,%edx
call   1030 <memset@plt>
jmp    1181 <main+0x41>
lea    -0xf0(%rbp),%rdi
call   1060 <printlong@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xe8,%rsp
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x6f,%edx
call   1030 <memset@plt>
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x6f,%edx
call   1030 <memset@plt>
mov    %r14,%rdi
call   1040 <readlong@plt>
mov    %rbx,%rdi
call   1040 <readlong@plt>
test   %rax,%rax
jle    11b7 <main+0x77>
mov    %rsp,%r14
lea    0x70(%rsp),%rbx
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <sum@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x6f,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
call   1040 <readlong@plt>
test   %rax,%rax
jg     1190 <main+0x50>
mov    %rsp,%rdi
call   1060 <printlong@plt>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [111 x i8]
%3 = alloca [111 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = getelementptr inbounds [111 x i8], [111 x i8]* %3, i64 0, i64 0
%8 = call i32 @memset(i8* %7, i32 0, i32 111)
%9 = getelementptr inbounds [111 x i8], [111 x i8]* %2, i64 0, i64 0
%10 = call i32 @memset(i8* %9, i32 0, i32 111)
%11 = getelementptr inbounds [111 x i8], [111 x i8]* %3, i64 0, i64 0
%12 = call i64 @readlong(i8* %11)
br label %13
13: ; preds = %17, %0
%14 = getelementptr inbounds [111 x i8], [111 x i8]* %2, i64 0, i64 0
%15 = call i64 @readlong(i8* %14)
%16 = icmp sgt i64 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %13
%18 = getelementptr inbounds [111 x i8], [111 x i8]* %3, i64 0, i64 0
%19 = getelementptr inbounds [111 x i8], [111 x i8]* %2, i64 0, i64 0
%20 = call i32 @sum(i8* %18, i8* %19)
%21 = getelementptr inbounds [111 x i8], [111 x i8]* %2, i64 0, i64 0
%22 = call i32 @memset(i8* %21, i32 0, i32 111)
br label %13
23: ; preds = %13
%24 = getelementptr inbounds [111 x i8], [111 x i8]* %3, i64 0, i64 0
%25 = call i32 @printlong(i8* %24)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [111 x i8]
%2 = alloca [111 x i8]
%3 = getelementptr inbounds [111 x i8], [111 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [111 x i8], [111 x i8]* %2, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 111)
%6 = call i32 @memset(i8* %3, i32 0, i32 111)
%7 = call i64 @readlong(i8* %4)
%8 = call i64 @readlong(i8* %3)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %0, %10
%11 = call i32 @sum(i8* %4, i8* %3)
%12 = call i32 @memset(i8* %3, i32 0, i32 111)
%13 = call i64 @readlong(i8* %3)
%14 = icmp sgt i64 %13, 0
br i1 %14, label %10, label %15
15: ; preds = %10, %0
%16 = call i32 @printlong(i8* %4)
ret i32 0
}