#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 */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ crmode();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ reactionReport(long *, int);
int /*<<< orphan*/ srand(unsigned int);
long testReaction(int);
scalar_t__ time(int /*<<< orphan*/ *);
main() {
  int totalTests = 10;
  long resultTimes[totalTests];
  time_t t;
  srand((unsigned)time(&t));
  initscr();
  noecho();
  crmode();
  int i;
  for (i = 0; i < totalTests; i++) {
    resultTimes[i] = testReaction(i + 1);
  }
  endwin();
  reactionReport(resultTimes, totalTests);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
lea    -0x1c(%rbp),%rdi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1030 <initscr@plt>
mov    $0x0,%al
call   1090 <noecho@plt>
mov    $0x0,%al
call   10a0 <crmode@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121d <main+0x9d>
mov    -0x20(%rbp),%edi
add    $0x1,%edi
call   1040 <testReaction@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11e9 <main+0x69>
mov    $0x0,%al
call   1080 <endwin@plt>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1060 <reactionReport@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
lea    0xc(%rsp),%rdi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1030 <initscr@plt>
xor    %eax,%eax
call   1090 <noecho@plt>
xor    %eax,%eax
call   10a0 <crmode@plt>
mov    $0x1,%edi
call   1040 <testReaction@plt>
mov    %rax,0x10(%rsp)
mov    $0x2,%edi
call   1040 <testReaction@plt>
mov    %rax,0x18(%rsp)
mov    $0x3,%edi
call   1040 <testReaction@plt>
mov    %rax,0x20(%rsp)
mov    $0x4,%edi
call   1040 <testReaction@plt>
mov    %rax,0x28(%rsp)
mov    $0x5,%edi
call   1040 <testReaction@plt>
mov    %rax,0x30(%rsp)
mov    $0x6,%edi
call   1040 <testReaction@plt>
mov    %rax,0x38(%rsp)
mov    $0x7,%edi
call   1040 <testReaction@plt>
mov    %rax,0x40(%rsp)
mov    $0x8,%edi
call   1040 <testReaction@plt>
mov    %rax,0x48(%rsp)
mov    $0x9,%edi
call   1040 <testReaction@plt>
mov    %rax,0x50(%rsp)
mov    $0xa,%edi
call   1040 <testReaction@plt>
mov    %rax,0x58(%rsp)
xor    %eax,%eax
call   1080 <endwin@plt>
lea    0x10(%rsp),%rdi
mov    $0xa,%esi
call   1060 <reactionReport@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %3
%10 = alloca i64, i64 %8
store i64 %8, i64* %4
%11 = call i64 @time(i32* %5)
%12 = trunc i64 %11 to i32
%13 = call i32 @srand(i32 %12)
%14 = call i32 (...) @initscr()
%15 = call i32 (...) @noecho()
%16 = call i32 (...) @crmode()
store i32 0, i32* %6
br label %17
17: ; preds = %28, %0
%18 = load i32, i32* %6
%19 = load i32, i32* %2
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %31
21: ; preds = %17
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
%24 = call i64 @testReaction(i32 %23)
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i64, i64* %10, i64 %26
store i64 %24, i64* %27
br label %28
28: ; preds = %21
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %17
31: ; preds = %17
%32 = call i32 (...) @endwin()
%33 = load i32, i32* %2
%34 = call i32 @reactionReport(i64* %10, i32 %33)
%35 = load i8*, i8** %3
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i64]
%3 = bitcast i32* %1 to i8*
%4 = call i64 @time(i32* %1)
%5 = trunc i64 %4 to i32
%6 = call i32 @srand(i32 %5)
%7 = call i32 (...) @initscr()
%8 = call i32 (...) @noecho()
%9 = call i32 (...) @crmode()
%10 = call i64 @testReaction(i32 1)
%11 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 0
store i64 %10, i64* %11
%12 = call i64 @testReaction(i32 2)
%13 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 1
store i64 %12, i64* %13
%14 = call i64 @testReaction(i32 3)
%15 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 2
store i64 %14, i64* %15
%16 = call i64 @testReaction(i32 4)
%17 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 3
store i64 %16, i64* %17
%18 = call i64 @testReaction(i32 5)
%19 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 4
store i64 %18, i64* %19
%20 = call i64 @testReaction(i32 6)
%21 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 5
store i64 %20, i64* %21
%22 = call i64 @testReaction(i32 7)
%23 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 6
store i64 %22, i64* %23
%24 = call i64 @testReaction(i32 8)
%25 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 7
store i64 %24, i64* %25
%26 = call i64 @testReaction(i32 9)
%27 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 8
store i64 %26, i64* %27
%28 = call i64 @testReaction(i32 10)
%29 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 9
store i64 %28, i64* %29
%30 = call i32 (...) @endwin()
%31 = call i32 @reactionReport(i64* %11, i32 10)
ret i32 0
}