#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*/ ProcessProgram();
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sscanf(char *, char *, unsigned long *);
int main() {
  char line[1024];
  unsigned long iterations = 0;
  gets(line);
  sscanf(line, "%lu\n", &iterations);
  gets(line);
  while (iterations--) {
    ProcessProgram();
    if (iterations > 0) {
      printf("\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x410(%rbp),%rdi
lea    0xe89(%rip),%rsi
lea    -0x418(%rbp),%rdx
call   1060 <sscanf@plt>
lea    -0x410(%rbp),%rdi
call   1050 <gets@plt>
mov    -0x418(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x418(%rbp)
cmp    $0x0,%rax
je     11d4 <main+0x94>
mov    $0x0,%al
call   1040 <ProcessProgram@plt>
cmpq   $0x0,-0x418(%rbp)
jbe    11cf <main+0x8f>
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
jmp    118f <main+0x4f>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x410,%rsp
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xe9b(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1060 <sscanf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
subq   $0x1,0x8(%rsp)
jb     11b1 <main+0x71>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <ProcessProgram@plt>
cmpq   $0x0,0x8(%rsp)
je     11b1 <main+0x71>
mov    $0xa,%edi
call   1030 <putchar@plt>
subq   $0x1,0x8(%rsp)
jae    1190 <main+0x50>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = call i32 @gets(i8* %3)
%6 = call i32 @sscanf(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%7 = call i32 @gets(i8* %3)
%8 = load i64, i64* %2
%9 = add i64 %8, -1
store i64 %9, i64* %2
%10 = icmp eq i64 %8, 0
br i1 %10, label %20, label %11
11: ; preds = %0, %15
%12 = call i32 (...) @ProcessProgram()
%13 = load i64, i64* %2
%14 = icmp eq i64 %13, 0
br i1 %14, label %20, label %15
15: ; preds = %11
%16 = call i32 @putchar(i32 10)
%17 = load i64, i64* %2
%18 = add i64 %17, -1
store i64 %18, i64* %2
%19 = icmp eq i64 %17, 0
br i1 %19, label %20, label %11
20: ; preds = %15, %11, %0
ret i32 0
}