#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 benchmark();
int /*<<< orphan*/ initialise_benchmark();
int /*<<< orphan*/ initialise_board();
int /*<<< orphan*/ start_trigger();
int /*<<< orphan*/ stop_trigger();
int verify_benchmark(int volatile);
int main(void) {
  int i;
  volatile int result;
  int correct;
  initialise_board();
  start_trigger();
  for (i = 0; i < (((0) > 0) ? (4096) >> (0) : (4096) << (-0)); i++) {
    initialise_benchmark();
    result = benchmark();
  }
  stop_trigger();
  correct = verify_benchmark(result);
  return correct;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <initialise_board@plt>
mov    $0x0,%al
call   1030 <start_trigger@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1000,-0x8(%rbp)
jge    11b0 <main+0x50>
mov    $0x0,%al
call   1080 <initialise_benchmark@plt>
mov    $0x0,%al
call   1060 <benchmark@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1184 <main+0x24>
mov    $0x0,%al
call   1040 <stop_trigger@plt>
mov    -0xc(%rbp),%edi
call   1050 <verify_benchmark@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1070 <initialise_board@plt>
xor    %eax,%eax
call   1030 <start_trigger@plt>
mov    $0x1000,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <initialise_benchmark@plt>
xor    %eax,%eax
call   1060 <benchmark@plt>
mov    %eax,0xc(%rsp)
add    $0xffffffff,%ebx
jne    1180 <main+0x20>
xor    %eax,%eax
call   1040 <stop_trigger@plt>
mov    0xc(%rsp),%edi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <verify_benchmark@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @initialise_board()
%6 = call i32 (...) @start_trigger()
store i32 0, i32* %2
br label %7
7: ; preds = %13, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 4096
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = call i32 (...) @initialise_benchmark()
%12 = call i32 (...) @benchmark()
store volatile i32 %12, i32* %3
br label %13
13: ; preds = %10
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %7
16: ; preds = %7
%17 = call i32 (...) @stop_trigger()
%18 = load volatile i32, i32* %3
%19 = call i32 @verify_benchmark(i32 %18)
store i32 %19, i32* %4
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @initialise_board()
%4 = tail call i32 (...) @start_trigger()
br label %5
5: ; preds = %0, %5
%6 = phi i32 [ 0, %0 ], [ %9, %5 ]
%7 = tail call i32 (...) @initialise_benchmark()
%8 = tail call i32 (...) @benchmark()
store volatile i32 %8, i32* %1
%9 = add nuw nsw i32 %6, 1
%10 = icmp eq i32 %9, 4096
br i1 %10, label %11, label %5
11: ; preds = %5
%12 = tail call i32 (...) @stop_trigger()
%13 = load volatile i32, i32* %1
%14 = tail call i32 @verify_benchmark(i32 %13)
ret i32 %14
}