#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 __VERIFIER_nondet_int();
int calculate_output(int);
int main() {
  int output = -1;
  while (1) {
    int input = __VERIFIER_nondet_int();
    if (input == 1) {
    } else if (input == 2) {
    } else if (input == 3) {
    } else if (input == 4) {
    } else if (input == 5) {
    } else {
      input = 6;
    }
    output = calculate_output(input);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    114f <main+0x2f>
jmp    11a6 <main+0x86>
cmpl   $0x2,-0xc(%rbp)
jne    115e <main+0x3e>
jmp    11a1 <main+0x81>
cmpl   $0x3,-0xc(%rbp)
jne    116d <main+0x4d>
jmp    119c <main+0x7c>
cmpl   $0x4,-0xc(%rbp)
jne    117c <main+0x5c>
jmp    1197 <main+0x77>
cmpl   $0x5,-0xc(%rbp)
jne    118b <main+0x6b>
jmp    1192 <main+0x72>
movl   $0x6,-0xc(%rbp)
jmp    1197 <main+0x77>
jmp    119c <main+0x7c>
jmp    11a1 <main+0x81>
jmp    11a6 <main+0x86>
mov    -0xc(%rbp),%edi
call   1030 <calculate_output@plt>
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x6,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
lea    -0x1(%rax),%ecx
cmp    $0x5,%ecx
cmovae %ebx,%eax
mov    %eax,%edi
call   1030 <calculate_output@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
br label %4
4: ; preds = %0, %30
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %4
br label %30
9: ; preds = %4
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %9
br label %29
13: ; preds = %9
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 3
br i1 %15, label %16, label %17
16: ; preds = %13
br label %28
17: ; preds = %13
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 4
br i1 %19, label %20, label %21
20: ; preds = %17
br label %27
21: ; preds = %17
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 5
br i1 %23, label %24, label %25
24: ; preds = %21
br label %26
25: ; preds = %21
store i32 6, i32* %3
br label %26
26: ; preds = %25, %24
br label %27
27: ; preds = %26, %20
br label %28
28: ; preds = %27, %16
br label %29
29: ; preds = %28, %12
br label %30
30: ; preds = %29, %8
%31 = load i32, i32* %3
%32 = call i32 @calculate_output(i32 %31)
store i32 %32, i32* %2
br label %4
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = add i32 %2, -1
%4 = icmp ult i32 %3, 5
%5 = select i1 %4, i32 %2, i32 6
%6 = tail call i32 @calculate_output(i32 %5)
br label %1
}