#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*/ FILE;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, long);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, long *, long *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  FILE *pInputFile = NULL;
  FILE *pOutputFile = NULL;
  long a = 0, b = 0;
  pInputFile = fopen("Input.txt", "r");
  if (pInputFile == NULL) {
    printf("Can't open the Input.txt file\n");
    return EXIT_FAILURE;
  }
  pOutputFile = fopen("Output.txt", "w");
  if (pOutputFile == NULL) {
    printf("Can't open the Output.txt file\n");
    fclose(pInputFile);
    return EXIT_FAILURE;
  }
  fscanf(pInputFile, "%ld %ld", &a, &b);
  fclose(pInputFile);
  if (a > 1000000000 || b > 1000000000) {
    printf("The numbers must not exceed the %ld\n", 1000000000);
    fclose(pOutputFile);
  }
  fprintf(pOutputFile, "%ld\n", a + b);
  fclose(pOutputFile);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
lea    0xe73(%rip),%rdi
lea    0xe76(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11c7 <main+0x77>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e23(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1297 <main+0x147>
lea    0xe5d(%rip),%rdi
lea    0xe61(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1211 <main+0xc1>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2dd9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1297 <main+0x147>
mov    -0x18(%rbp),%rdi
lea    0xe3c(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x30(%rbp),%rcx
call   1050 <fscanf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
cmpq   $0x3b9aca00,-0x28(%rbp)
3b
jg     124e <main+0xfe>
cmpq   $0x3b9aca00,-0x30(%rbp)
3b
jle    126a <main+0x11a>
lea    0xe0b(%rip),%rdi
mov    $0x3b9aca00,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rdx
add    -0x30(%rbp),%rdx
lea    0xe03(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2d46(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xe80(%rip),%rdi
lea    0xe83(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     123b <main+0xdb>
mov    %rax,%rbx
lea    0xe6d(%rip),%rdi
lea    0xe71(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     1249 <main+0xe9>
mov    %rax,%r14
lea    0xe5b(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
call   1060 <fscanf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x10(%rsp),%rax
cmp    $0x3b9aca00,%rax
jg     11f3 <main+0x93>
mov    0x8(%rsp),%rdx
cmp    $0x3b9aca01,%rdx
jl     1218 <main+0xb8>
lea    0xe27(%rip),%rdi
mov    $0x3b9aca00,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    0x10(%rsp),%rax
mov    0x8(%rsp),%rdx
add    %rax,%rdx
lea    0xe1f(%rip),%rsi
mov    %r14,%rdi
call   1070 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    0x2d9f(%rip),%rax
jmp    1264 <main+0x104>
lea    0xe23(%rip),%rdi
call   1030 <puts@plt>
jmp    125d <main+0xfd>
lea    0xdf6(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x2d7c(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [31 x i8] c"Can't open the Input.txt file\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [11 x i8] c"Output.txt\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [32 x i8] c"Can't open the Output.txt file\0A\00"
@.str.6 = [8 x i8] c"%ld %ld\00"
@.str.7 = [37 x i8] c"The numbers must not exceed the %ld\0A\00"
@.str.8 = [5 x i8] c"%ld\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32* null, i32** %7
store i64 0, i64* %8
store i64 0, i64* %9
%10 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %6
%11 = load i32*, i32** %6
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* @EXIT_FAILURE
store i32 %15, i32* %3
br label %48
16: ; preds = %2
%17 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %17, i32** %7
%18 = load i32*, i32** %7
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
%22 = load i32*, i32** %6
%23 = call i32 @fclose(i32* %22)
%24 = load i32, i32* @EXIT_FAILURE
store i32 %24, i32* %3
br label %48
25: ; preds = %16
%26 = load i32*, i32** %6
%27 = call i32 @fscanf(i32* %26, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i64* %8, i64* %9)
%28 = load i32*, i32** %6
%29 = call i32 @fclose(i32* %28)
%30 = load i64, i64* %8
%31 = icmp sgt i64 %30, 1000000000
br i1 %31, label %35, label %32
32: ; preds = %25
%33 = load i64, i64* %9
%34 = icmp sgt i64 %33, 1000000000
br i1 %34, label %35, label %39
35: ; preds = %32, %25
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i32 1000000000)
%37 = load i32*, i32** %7
%38 = call i32 @fclose(i32* %37)
br label %39
39: ; preds = %35, %32
%40 = load i32*, i32** %7
%41 = load i64, i64* %8
%42 = load i64, i64* %9
%43 = add nsw i64 %41, %42
%44 = call i32 @fprintf(i32* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i64 %43)
%45 = load i32*, i32** %7
%46 = call i32 @fclose(i32* %45)
%47 = load i32, i32* @EXIT_SUCCESS
store i32 %47, i32* %3
br label %48
48: ; preds = %39, %20, %13
%49 = load i32, i32* %3
ret i32 %49
}

LLVM IR (-O2):
@.str = [10 x i8] c"Input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [11 x i8] c"Output.txt\00"
@.str.4 = [2 x i8] c"w\00"
@.str.6 = [8 x i8] c"%ld %ld\00"
@.str.7 = [37 x i8] c"The numbers must not exceed the %ld\0A\00"
@.str.8 = [5 x i8] c"%ld\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [31 x i8] c"Can't open the Output.txt file\00"
@str.9 = [30 x i8] c"Can't open the Input.txt file\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%6 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.9, i64 0, i64 0))
br label %36
11: ; preds = %2
%12 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%16 = tail call i32 @fclose(i32* %7)
br label %36
17: ; preds = %11
%18 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i64* %3, i64* %4)
%19 = call i32 @fclose(i32* %7)
%20 = load i64, i64* %3
%21 = icmp sgt i64 %20, 1000000000
%22 = load i64, i64* %4
%23 = icmp sgt i64 %22, 1000000000
%24 = select i1 %21, i1 true, i1 %23
br i1 %24, label %25, label %30
25: ; preds = %17
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i32 1000000000)
%27 = call i32 @fclose(i32* %12)
%28 = load i64, i64* %3
%29 = load i64, i64* %4
br label %30
30: ; preds = %17, %25
%31 = phi i64 [ %22, %17 ], [ %29, %25 ]
%32 = phi i64 [ %20, %17 ], [ %28, %25 ]
%33 = add nsw i64 %31, %32
%34 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i64 %33)
%35 = call i32 @fclose(i32* %12)
br label %36
36: ; preds = %30, %14, %9
%37 = phi i32* [ @EXIT_FAILURE, %9 ], [ @EXIT_FAILURE, %14 ], [ @EXIT_SUCCESS, %30 ]
%38 = load i32, i32* %37
ret i32 %38
}