#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*/ Sequence(int);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
scalar_t__ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int main() {
  int n;
  freopen("data.in", "r", stdin);
  while (scanf("%d", &n) != EOF) {
    if (n < 0)
      break;
    Sequence(n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
lea    0xeb1(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <freopen@plt>
lea    0xea8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e6e(%rip),%rcx
cmp    (%rcx),%rax
je     1197 <main+0x67>
cmpl   $0x0,-0x8(%rbp)
jge    118a <main+0x5a>
jmp    1197 <main+0x67>
mov    -0x8(%rbp),%edi
call   1030 <Sequence@plt>
jmp    115b <main+0x2b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
lea    0xeb7(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1040 <freopen@plt>
lea    0xeae(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e73(%rip),%r15
cmp    (%r15),%rax
je     11ad <main+0x7d>
mov    0xc(%rsp),%edi
test   %edi,%edi
js     11ad <main+0x7d>
lea    0xe89(%rip),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
call   1030 <Sequence@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    (%r15),%rax
je     11ad <main+0x7d>
mov    0xc(%rsp),%edi
test   %edi,%edi
jns    1190 <main+0x60>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"data.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [3 x i8] c"%d\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @stdin
%4 = call i32 @freopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %3)
br label %5
5: ; preds = %13, %0
%6 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%7 = load i64, i64* @EOF
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
br label %16
13: ; preds = %9
%14 = load i32, i32* %2
%15 = call i32 @Sequence(i32 %14)
br label %5
16: ; preds = %12, %5
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"data.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [3 x i8] c"%d\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @stdin
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([8 x i8], [8 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 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 0
%10 = select i1 %7, i1 true, i1 %9
br i1 %10, label %20, label %11
11: ; preds = %0, %11
%12 = phi i32 [ %17, %11 ], [ %8, %0 ]
%13 = call i32 @Sequence(i32 %12)
%14 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%15 = load i64, i64* @EOF
%16 = icmp eq i64 %14, %15
%17 = load i32, i32* %1
%18 = icmp slt i32 %17, 0
%19 = select i1 %16, i1 true, i1 %18
br i1 %19, label %20, label %11
20: ; preds = %11, %0
ret i32 0
}