#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*/ bike(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  long return_state;
  long return_state2;
  float reinforcement;
  int action = 1;
  int to_do = 1;
  int i = 0;
  bike(action, 1);
  while (action != -1) {
    printf("\n\nEnter an action (int, -1 to exit):");
    scanf("%d", &action);
    bike(action, 2);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x20(%rbp),%edi
mov    $0x1,%esi
call   1030 <bike@plt>
cmpl   $0xffffffff,-0x20(%rbp)
je     1199 <main+0x69>
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x20(%rbp),%edi
mov    $0x2,%esi
call   1030 <bike@plt>
jmp    1161 <main+0x31>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x1,0xc(%rsp)
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <bike@plt>
lea    0xea9(%rip),%r14
lea    0xec7(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
mov    $0x2,%esi
call   1030 <bike@plt>
cmpl   $0xffffffff,0xc(%rsp)
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [37 x i8] c"\0A\0AEnter an action (int, -1 to exit):\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %5
store i32 1, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %5
%9 = call i32 @bike(i32 %8, i32 1)
br label %10
10: ; preds = %13, %0
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, -1
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%16 = load i32, i32* %5
%17 = call i32 @bike(i32 %16, i32 2)
br label %10
18: ; preds = %10
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [37 x i8] c"\0A\0AEnter an action (int, -1 to exit):\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = tail call i32 @bike(i32 1, i32 1)
br label %4
4: ; preds = %0, %4
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @bike(i32 %7, i32 2)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %4
11: ; preds = %4
ret i32 0
}