#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*/ InitBuffers();
scalar_t__ Test();
int /*<<< orphan*/ printf(char *);
int main() {
  int testNum;
  for (testNum = 0; testNum < 4; testNum++) {
    printf("---------------------------------------------------------------\n");
    InitBuffers();
    if (Test())
      return 1;
    printf("passed\n");
  }
  printf("test round passed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    119a <main+0x6a>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <InitBuffers@plt>
mov    $0x0,%al
call   1050 <Test@plt>
cmp    $0x0,%rax
je     1180 <main+0x50>
movl   $0x1,-0x4(%rbp)
jmp    11ad <main+0x7d>
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeda(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <InitBuffers@plt>
xor    %eax,%eax
call   1050 <Test@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    11f4 <main+0xc4>
lea    0xeab(%rip),%rdi
call   1040 <puts@plt>
lea    0xea6(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <InitBuffers@plt>
xor    %eax,%eax
call   1050 <Test@plt>
test   %rax,%rax
jne    11f4 <main+0xc4>
lea    0xe80(%rip),%rdi
call   1040 <puts@plt>
lea    0xe7b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <InitBuffers@plt>
xor    %eax,%eax
call   1050 <Test@plt>
test   %rax,%rax
jne    11f4 <main+0xc4>
lea    0xe55(%rip),%rdi
call   1040 <puts@plt>
lea    0xe50(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <InitBuffers@plt>
xor    %eax,%eax
call   1050 <Test@plt>
test   %rax,%rax
jne    11f4 <main+0xc4>
lea    0xe2a(%rip),%rdi
call   1040 <puts@plt>
lea    0xe13(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [18 x i8] c"test round passed\00"
@str.3 = [64 x i8] c"---------------------------------------------------------------\00"
@str.4 = [7 x i8] c"passed\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.3, i64 0, i64 0))
%2 = tail call i32 (...) @InitBuffers()
%3 = tail call i64 (...) @Test()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %26
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.3, i64 0, i64 0))
%8 = tail call i32 (...) @InitBuffers()
%9 = tail call i64 (...) @Test()
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %26
11: ; preds = %5
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.3, i64 0, i64 0))
%14 = tail call i32 (...) @InitBuffers()
%15 = tail call i64 (...) @Test()
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %26
17: ; preds = %11
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.3, i64 0, i64 0))
%20 = tail call i32 (...) @InitBuffers()
%21 = tail call i64 (...) @Test()
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %17
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %26
26: ; preds = %0, %5, %11, %17, %23
%27 = phi i32 [ 0, %23 ], [ 1, %17 ], [ 1, %11 ], [ 1, %5 ], [ 1, %0 ]
ret i32 %27
}