#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*/ exit(int);
int fibonacci(int);
int /*<<< orphan*/ print(int);
int readCount();
int startCount();
int stopCount();
int /*<<< orphan*/ to_stdout(char);
int main() {
  int i, new, old, monotonic;
  print(startCount());
  monotonic = (0 == 0);
  for (i = 0; i < 44; i += 11) {
    old = readCount();
    print(fibonacci(i));
    new = readCount();
    monotonic = monotonic && ((new - old) > 0);
    if (monotonic == (0 == 1)) {
      to_stdout('e');
      to_stdout('r');
      to_stdout('r');
      to_stdout('\n');
      print(new);
      exit(new);
    }
  }
  to_stdout('o');
  to_stdout('k');
  to_stdout('\n');
  to_stdout('\n');
  print(stopCount());
  old = readCount();
  print(fibonacci(5));
  new = readCount();
  monotonic = monotonic && ((new - old) > 0);
  if (monotonic == (0 == 0)) {
    to_stdout('e');
    to_stdout('r');
    to_stdout('r');
    to_stdout('\n');
    print(new);
  } else {
    to_stdout('o');
    to_stdout('k');
    to_stdout('\n');
  }
  exit(new);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <startCount@plt>
mov    %eax,%edi
call   1050 <print@plt>
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2c,-0x8(%rbp)
jge    1246 <main+0xd6>
mov    $0x0,%al
call   1060 <readCount@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <fibonacci@plt>
mov    %eax,%edi
call   1050 <print@plt>
mov    $0x0,%al
call   1060 <readCount@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
je     11e6 <main+0x76>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
cmp    $0x0,%eax
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1233 <main+0xc3>
mov    $0x65,%edi
call   1040 <to_stdout@plt>
mov    $0x72,%edi
call   1040 <to_stdout@plt>
mov    $0x72,%edi
call   1040 <to_stdout@plt>
mov    $0xa,%edi
call   1040 <to_stdout@plt>
mov    -0xc(%rbp),%edi
call   1050 <print@plt>
mov    -0xc(%rbp),%edi
call   1090 <exit@plt>
jmp    1238 <main+0xc8>
mov    -0x8(%rbp),%eax
add    $0xb,%eax
mov    %eax,-0x8(%rbp)
jmp    119b <main+0x2b>
mov    $0x6f,%edi
call   1040 <to_stdout@plt>
mov    $0x6b,%edi
call   1040 <to_stdout@plt>
mov    $0xa,%edi
call   1040 <to_stdout@plt>
mov    $0xa,%edi
call   1040 <to_stdout@plt>
mov    $0x0,%al
call   1070 <stopCount@plt>
mov    %eax,%edi
call   1050 <print@plt>
mov    $0x0,%al
call   1060 <readCount@plt>
mov    %eax,-0x10(%rbp)
mov    $0x5,%edi
call   1080 <fibonacci@plt>
mov    %eax,%edi
call   1050 <print@plt>
mov    $0x0,%al
call   1060 <readCount@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x16(%rbp)
je     12bf <main+0x14f>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
cmp    $0x0,%eax
setg   %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1309 <main+0x199>
mov    $0x65,%edi
call   1040 <to_stdout@plt>
mov    $0x72,%edi
call   1040 <to_stdout@plt>
mov    $0x72,%edi
call   1040 <to_stdout@plt>
mov    $0xa,%edi
call   1040 <to_stdout@plt>
mov    -0xc(%rbp),%edi
call   1050 <print@plt>
jmp    1327 <main+0x1b7>
mov    $0x6f,%edi
call   1040 <to_stdout@plt>
mov    $0x6b,%edi
call   1040 <to_stdout@plt>
mov    $0xa,%edi
call   1040 <to_stdout@plt>
mov    -0xc(%rbp),%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <startCount@plt>
mov    %eax,%edi
call   1050 <print@plt>
xor    %eax,%eax
call   1060 <readCount@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1080 <fibonacci@plt>
mov    %eax,%edi
call   1050 <print@plt>
xor    %eax,%eax
call   1060 <readCount@plt>
mov    %eax,%ebx
cmp    %ebp,%eax
jle    1283 <main+0x113>
xor    %eax,%eax
call   1060 <readCount@plt>
mov    %eax,%ebp
mov    $0xb,%edi
call   1080 <fibonacci@plt>
mov    %eax,%edi
call   1050 <print@plt>
xor    %eax,%eax
call   1060 <readCount@plt>
mov    %eax,%ebx
cmp    %ebp,%eax
jle    1283 <main+0x113>
xor    %eax,%eax
call   1060 <readCount@plt>
mov    %eax,%ebp
mov    $0x16,%edi
call   1080 <fibonacci@plt>
mov    %eax,%edi
call   1050 <print@plt>
xor    %eax,%eax
call   1060 <readCount@plt>
mov    %eax,%ebx
cmp    %ebp,%eax
jle    1283 <main+0x113>
xor    %eax,%eax
call   1060 <readCount@plt>
mov    %eax,%ebp
mov    $0x21,%edi
call   1080 <fibonacci@plt>
mov    %eax,%edi
call   1050 <print@plt>
xor    %eax,%eax
call   1060 <readCount@plt>
mov    %eax,%ebx
cmp    %ebp,%eax
jle    1283 <main+0x113>
mov    $0x6f,%edi
call   1040 <to_stdout@plt>
mov    $0x6b,%edi
call   1040 <to_stdout@plt>
mov    $0xa,%edi
call   1040 <to_stdout@plt>
mov    $0xa,%edi
call   1040 <to_stdout@plt>
xor    %eax,%eax
call   1070 <stopCount@plt>
mov    %eax,%edi
call   1050 <print@plt>
xor    %eax,%eax
call   1060 <readCount@plt>
mov    %eax,%ebp
mov    $0x5,%edi
call   1080 <fibonacci@plt>
mov    %eax,%edi
call   1050 <print@plt>
xor    %eax,%eax
call   1060 <readCount@plt>
mov    %eax,%ebx
cmp    %ebp,%eax
jle    12b9 <main+0x149>
mov    $0x65,%edi
call   1040 <to_stdout@plt>
mov    $0x72,%edi
call   1040 <to_stdout@plt>
mov    $0x72,%edi
call   1040 <to_stdout@plt>
mov    $0xa,%edi
call   1040 <to_stdout@plt>
mov    %ebx,%edi
call   1050 <print@plt>
mov    %ebx,%edi
call   1090 <exit@plt>
mov    $0x6f,%edi
call   1040 <to_stdout@plt>
mov    $0x6b,%edi
call   1040 <to_stdout@plt>
mov    $0xa,%edi
call   1040 <to_stdout@plt>
mov    %ebx,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (...) @startCount()
%7 = call i32 @print(i32 %6)
store i32 1, i32* %5
store i32 0, i32* %2
br label %8
8: ; preds = %39, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 44
br i1 %10, label %11, label %42
11: ; preds = %8
%12 = call i32 (...) @readCount()
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = call i32 @fibonacci(i32 %13)
%15 = call i32 @print(i32 %14)
%16 = call i32 (...) @readCount()
store i32 %16, i32* %3
%17 = load i32, i32* %5
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %11
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = sub nsw i32 %20, %21
%23 = icmp sgt i32 %22, 0
br label %24
24: ; preds = %19, %11
%25 = phi i1 [ false, %11 ], [ %23, %19 ]
%26 = zext i1 %25 to i32
store i32 %26, i32* %5
%27 = load i32, i32* %5
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %38
29: ; preds = %24
%30 = call i32 @to_stdout(i8 signext 101)
%31 = call i32 @to_stdout(i8 signext 114)
%32 = call i32 @to_stdout(i8 signext 114)
%33 = call i32 @to_stdout(i8 signext 10)
%34 = load i32, i32* %3
%35 = call i32 @print(i32 %34)
%36 = load i32, i32* %3
%37 = call i32 @exit(i32 %36)
unreachable
38: ; preds = %24
br label %39
39: ; preds = %38
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 11
store i32 %41, i32* %2
br label %8
42: ; preds = %8
%43 = call i32 @to_stdout(i8 signext 111)
%44 = call i32 @to_stdout(i8 signext 107)
%45 = call i32 @to_stdout(i8 signext 10)
%46 = call i32 @to_stdout(i8 signext 10)
%47 = call i32 (...) @stopCount()
%48 = call i32 @print(i32 %47)
%49 = call i32 (...) @readCount()
store i32 %49, i32* %4
%50 = call i32 @fibonacci(i32 5)
%51 = call i32 @print(i32 %50)
%52 = call i32 (...) @readCount()
store i32 %52, i32* %3
%53 = load i32, i32* %5
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %60
55: ; preds = %42
%56 = load i32, i32* %3
%57 = load i32, i32* %4
%58 = sub nsw i32 %56, %57
%59 = icmp sgt i32 %58, 0
br label %60
60: ; preds = %55, %42
%61 = phi i1 [ false, %42 ], [ %59, %55 ]
%62 = zext i1 %61 to i32
store i32 %62, i32* %5
%63 = load i32, i32* %5
%64 = icmp eq i32 %63, 1
br i1 %64, label %65, label %72
65: ; preds = %60
%66 = call i32 @to_stdout(i8 signext 101)
%67 = call i32 @to_stdout(i8 signext 114)
%68 = call i32 @to_stdout(i8 signext 114)
%69 = call i32 @to_stdout(i8 signext 10)
%70 = load i32, i32* %3
%71 = call i32 @print(i32 %70)
br label %76
72: ; preds = %60
%73 = call i32 @to_stdout(i8 signext 111)
%74 = call i32 @to_stdout(i8 signext 107)
%75 = call i32 @to_stdout(i8 signext 10)
br label %76
76: ; preds = %72, %65
%77 = load i32, i32* %3
%78 = call i32 @exit(i32 %77)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @startCount()
%2 = tail call i32 @print(i32 %1)
%3 = tail call i32 (...) @readCount()
%4 = tail call i32 @fibonacci(i32 0)
%5 = tail call i32 @print(i32 %4)
%6 = tail call i32 (...) @readCount()
%7 = icmp sgt i32 %6, %3
br i1 %7, label %8, label %38
8: ; preds = %0
%9 = tail call i32 (...) @readCount()
%10 = tail call i32 @fibonacci(i32 11)
%11 = tail call i32 @print(i32 %10)
%12 = tail call i32 (...) @readCount()
%13 = icmp sgt i32 %12, %9
br i1 %13, label %14, label %38
14: ; preds = %8
%15 = tail call i32 (...) @readCount()
%16 = tail call i32 @fibonacci(i32 22)
%17 = tail call i32 @print(i32 %16)
%18 = tail call i32 (...) @readCount()
%19 = icmp sgt i32 %18, %15
br i1 %19, label %20, label %38
20: ; preds = %14
%21 = tail call i32 (...) @readCount()
%22 = tail call i32 @fibonacci(i32 33)
%23 = tail call i32 @print(i32 %22)
%24 = tail call i32 (...) @readCount()
%25 = icmp sgt i32 %24, %21
br i1 %25, label %26, label %38
26: ; preds = %20
%27 = tail call i32 @to_stdout(i8 signext 111)
%28 = tail call i32 @to_stdout(i8 signext 107)
%29 = tail call i32 @to_stdout(i8 signext 10)
%30 = tail call i32 @to_stdout(i8 signext 10)
%31 = tail call i32 (...) @stopCount()
%32 = tail call i32 @print(i32 %31)
%33 = tail call i32 (...) @readCount()
%34 = tail call i32 @fibonacci(i32 5)
%35 = tail call i32 @print(i32 %34)
%36 = tail call i32 (...) @readCount()
%37 = icmp sgt i32 %36, %33
br i1 %37, label %46, label %52
38: ; preds = %20, %14, %8, %0
%39 = phi i32 [ %6, %0 ], [ %12, %8 ], [ %18, %14 ], [ %24, %20 ]
%40 = tail call i32 @to_stdout(i8 signext 101)
%41 = tail call i32 @to_stdout(i8 signext 114)
%42 = tail call i32 @to_stdout(i8 signext 114)
%43 = tail call i32 @to_stdout(i8 signext 10)
%44 = tail call i32 @print(i32 %39)
%45 = tail call i32 @exit(i32 %39)
unreachable
46: ; preds = %26
%47 = tail call i32 @to_stdout(i8 signext 101)
%48 = tail call i32 @to_stdout(i8 signext 114)
%49 = tail call i32 @to_stdout(i8 signext 114)
%50 = tail call i32 @to_stdout(i8 signext 10)
%51 = tail call i32 @print(i32 %36)
br label %56
52: ; preds = %26
%53 = tail call i32 @to_stdout(i8 signext 111)
%54 = tail call i32 @to_stdout(i8 signext 107)
%55 = tail call i32 @to_stdout(i8 signext 10)
br label %56
56: ; preds = %52, %46
%57 = tail call i32 @exit(i32 %36)
unreachable
}