#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*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, long);
int scanf(char *, long *, long *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  long a, b;
  while (!feof(stdin)) {
    if (scanf("%ld %ld", &a, &b) != 2)
      break;
    printf("%ld\n", a + b);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1169 <main+0x39>
jmp    11a4 <main+0x74>
lea    0xe90(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
je     118b <main+0x5b>
jmp    11a4 <main+0x74>
mov    -0x18(%rbp),%rsi
add    -0x20(%rbp),%rsi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    0x2ea4(%rip),%r13
mov    0x0(%r13),%edi
call   1040 <feof@plt>
test   %eax,%eax
jne    11a1 <main+0x71>
lea    0xea8(%rip),%r14
lea    0x8(%rsp),%r15
mov    %rsp,%rbx
lea    0xea1(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
jne    11a1 <main+0x71>
mov    (%rsp),%rsi
add    0x8(%rsp),%rsi
mov    %r12,%rdi
call   1030 <printf@plt>
mov    0x0(%r13),%edi
call   1040 <feof@plt>
test   %eax,%eax
je     1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [8 x i8] c"%ld %ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %17, %2
%9 = load i32, i32* @stdin
%10 = call i32 @feof(i32 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %22
13: ; preds = %8
%14 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %6, i64* %7)
%15 = icmp ne i32 %14, 2
br i1 %15, label %16, label %17
16: ; preds = %13
br label %22
17: ; preds = %13
%18 = load i64, i64* %6
%19 = load i64, i64* %7
%20 = add nsw i64 %18, %19
%21 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %20)
br label %8
22: ; preds = %16, %8
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [8 x i8] c"%ld %ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
%6 = bitcast i64* %4 to i8*
%7 = load i32, i32* @stdin
%8 = call i32 @feof(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %2, %13
%11 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %3, i64* %4)
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = add nsw i64 %15, %14
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %16)
%18 = load i32, i32* @stdin
%19 = call i32 @feof(i32 %18)
%20 = icmp eq i32 %19, 0
br i1 %20, label %10, label %21
21: ; preds = %13, %10, %2
ret i32 0
}