#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*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *, int *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main() {
  freopen("./1.c", "r", stdin);
  freopen("./out.c", "w", stdout);
  int a, b;
  while (scanf("%d%d", &a, &b) != EOF)
    printf("%d\n", a + b);
  fclose(stdin);
  fclose(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
lea    0xea1(%rip),%rdi
lea    0xea0(%rip),%rsi
call   1050 <freopen@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edx
lea    0xe8d(%rip),%rdi
lea    0xe8e(%rip),%rsi
call   1050 <freopen@plt>
lea    0xe84(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <scanf@plt>
mov    0x2e3e(%rip),%rcx
cmp    (%rcx),%rax
je     11c2 <main+0x82>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
jmp    1187 <main+0x47>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2df9(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
lea    0xea5(%rip),%rdi
lea    0xea4(%rip),%rsi
call   1050 <freopen@plt>
mov    0x2e62(%rip),%rbp
mov    0x0(%rbp),%edx
lea    0xe90(%rip),%rdi
lea    0xe91(%rip),%rsi
call   1050 <freopen@plt>
lea    0xe87(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <scanf@plt>
mov    0x2e41(%rip),%r13
cmp    0x0(%r13),%rax
je     11e3 <main+0xa3>
lea    0xe6b(%rip),%r14
lea    0xe5f(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rsp),%esi
add    0x4(%rsp),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1060 <scanf@plt>
cmp    0x0(%r13),%rax
jne    11c0 <main+0x80>
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x0(%rbp),%edi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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