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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x420(%rbp)
lea    -0x410(%rbp),%rdi
call   1050 <gets@plt>
mov    %rax,-0x418(%rbp)
mov    -0x418(%rbp),%rdi
lea    0xe82(%rip),%rsi
lea    -0x420(%rbp),%rdx
call   1060 <sscanf@plt>
lea    -0x410(%rbp),%rdi
call   1050 <gets@plt>
mov    -0x420(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x420(%rbp)
cmp    $0x0,%rax
je     11db <main+0x9b>
mov    $0x0,%al
call   1040 <ProcessCase@plt>
cmpq   $0x0,-0x420(%rbp)
je     11d6 <main+0x96>
lea    0xe33(%rip),%rdi
call   1030 <printf@plt>
jmp    1196 <main+0x56>
mov    -0x4(%rbp),%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    %rax,%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 <ProcessCase@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 = [4 x i8] c"%ul\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca i8*
%4 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %4
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%6 = call i8* @gets(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %4)
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%10 = call i8* @gets(i8* %9)
br label %11
11: ; preds = %21, %0
%12 = load i64, i64* %4
%13 = add i64 %12, -1
store i64 %13, i64* %4
%14 = icmp ne i64 %12, 0
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = call i32 (...) @ProcessCase()
%17 = load i64, i64* %4
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %15
br label %11
22: ; preds = %11
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ul\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 i8* @gets(i8* %3)
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%7 = call i8* @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 (...) @ProcessCase()
%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
}