#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*/ assert(int);
int fget_long(unsigned int);
unsigned int input(char *);
int /*<<< orphan*/ report(int);
void main() {
  unsigned a = input("a");
  report(fget_long(a));
  assert(fget_long(a) == 2);
  assert(fget_long(a) == 3);
  assert(fget_long(a) == 4);
  assert(fget_long(a) == 5);
  assert(fget_long(a) == 6);
  assert(fget_long(a) == 7);
  assert(fget_long(a) == 8);
  assert(fget_long(a) == 9);
  assert(fget_long(a) == 10);
  report(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <input@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <fget_long@plt>
mov    %eax,%edi
call   1060 <report@plt>
mov    -0x4(%rbp),%edi
call   1040 <fget_long@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
call   1040 <fget_long@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
call   1040 <fget_long@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
call   1040 <fget_long@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
call   1040 <fget_long@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
call   1040 <fget_long@plt>
cmp    $0x7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
call   1040 <fget_long@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
call   1040 <fget_long@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
call   1040 <fget_long@plt>
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1060 <report@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1030 <input@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <fget_long@plt>
mov    %eax,%edi
call   1060 <report@plt>
mov    %ebx,%edi
call   1040 <fget_long@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1050 <assert@plt>
mov    %ebx,%edi
call   1040 <fget_long@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1050 <assert@plt>
mov    %ebx,%edi
call   1040 <fget_long@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1050 <assert@plt>
mov    %ebx,%edi
call   1040 <fget_long@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1050 <assert@plt>
mov    %ebx,%edi
call   1040 <fget_long@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
call   1050 <assert@plt>
mov    %ebx,%edi
call   1040 <fget_long@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
call   1050 <assert@plt>
mov    %ebx,%edi
call   1040 <fget_long@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1050 <assert@plt>
mov    %ebx,%edi
call   1040 <fget_long@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
call   1050 <assert@plt>
mov    %ebx,%edi
call   1040 <fget_long@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1060 <report@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @input(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @fget_long(i32 %3)
%5 = call i32 @report(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @fget_long(i32 %6)
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %1
%12 = call i32 @fget_long(i32 %11)
%13 = icmp eq i32 %12, 3
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %1
%17 = call i32 @fget_long(i32 %16)
%18 = icmp eq i32 %17, 4
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32, i32* %1
%22 = call i32 @fget_long(i32 %21)
%23 = icmp eq i32 %22, 5
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = load i32, i32* %1
%27 = call i32 @fget_long(i32 %26)
%28 = icmp eq i32 %27, 6
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = load i32, i32* %1
%32 = call i32 @fget_long(i32 %31)
%33 = icmp eq i32 %32, 7
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = load i32, i32* %1
%37 = call i32 @fget_long(i32 %36)
%38 = icmp eq i32 %37, 8
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = load i32, i32* %1
%42 = call i32 @fget_long(i32 %41)
%43 = icmp eq i32 %42, 9
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = load i32, i32* %1
%47 = call i32 @fget_long(i32 %46)
%48 = icmp eq i32 %47, 10
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
%51 = call i32 @report(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define void @main() {
%1 = tail call i32 @input(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @fget_long(i32 %1)
%3 = tail call i32 @report(i32 %2)
%4 = tail call i32 @fget_long(i32 %1)
%5 = icmp eq i32 %4, 2
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @fget_long(i32 %1)
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = tail call i32 @fget_long(i32 %1)
%13 = icmp eq i32 %12, 4
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = tail call i32 @fget_long(i32 %1)
%17 = icmp eq i32 %16, 5
%18 = zext i1 %17 to i32
%19 = tail call i32 @assert(i32 %18)
%20 = tail call i32 @fget_long(i32 %1)
%21 = icmp eq i32 %20, 6
%22 = zext i1 %21 to i32
%23 = tail call i32 @assert(i32 %22)
%24 = tail call i32 @fget_long(i32 %1)
%25 = icmp eq i32 %24, 7
%26 = zext i1 %25 to i32
%27 = tail call i32 @assert(i32 %26)
%28 = tail call i32 @fget_long(i32 %1)
%29 = icmp eq i32 %28, 8
%30 = zext i1 %29 to i32
%31 = tail call i32 @assert(i32 %30)
%32 = tail call i32 @fget_long(i32 %1)
%33 = icmp eq i32 %32, 9
%34 = zext i1 %33 to i32
%35 = tail call i32 @assert(i32 %34)
%36 = tail call i32 @fget_long(i32 %1)
%37 = icmp eq i32 %36, 10
%38 = zext i1 %37 to i32
%39 = tail call i32 @assert(i32 %38)
%40 = tail call i32 @report(i32 1)
ret void
}