#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*/ create_drive(int, int);
int /*<<< orphan*/ create_drive_straight(int);
int get_create_lbump(int /*<<< orphan*/);
int get_create_rbump(int /*<<< orphan*/);
int /*<<< orphan*/ msleep(int);
void create_wait_for_bump(int velocity) {
  while (get_create_lbump(0) != 1 || get_create_rbump(0) != 1) {
    if (get_create_lbump(0) == 0 && get_create_rbump(0) == 1) {
      create_drive(velocity, 0);
      msleep(100);
    }
    if (get_create_lbump(0) == 1 && get_create_rbump(0) == 0) {
      create_drive(0, velocity);
      msleep(100);
    }
    if (get_create_lbump(0) != 1 && get_create_rbump(0) != 1) {
      create_drive_straight(velocity);
      msleep(100);
    }
  }
}


x86 assembly (clang, -O0):
<create_wait_for_bump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1070 <get_create_lbump@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
mov    %al,-0x5(%rbp)
jne    1182 <create_wait_for_bump+0x32>
xor    %edi,%edi
call   1060 <get_create_rbump@plt>
cmp    $0x1,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1192 <create_wait_for_bump+0x42>
jmp    1231 <create_wait_for_bump+0xe1>
xor    %edi,%edi
call   1070 <get_create_lbump@plt>
cmp    $0x0,%eax
jne    11c6 <create_wait_for_bump+0x76>
xor    %edi,%edi
call   1060 <get_create_rbump@plt>
cmp    $0x1,%eax
jne    11c6 <create_wait_for_bump+0x76>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <create_drive@plt>
mov    $0x64,%edi
call   1040 <msleep@plt>
xor    %edi,%edi
call   1070 <get_create_lbump@plt>
cmp    $0x1,%eax
jne    11fa <create_wait_for_bump+0xaa>
xor    %edi,%edi
call   1060 <get_create_rbump@plt>
cmp    $0x0,%eax
jne    11fa <create_wait_for_bump+0xaa>
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1030 <create_drive@plt>
mov    $0x64,%edi
call   1040 <msleep@plt>
xor    %edi,%edi
call   1070 <get_create_lbump@plt>
cmp    $0x1,%eax
je     122c <create_wait_for_bump+0xdc>
xor    %edi,%edi
call   1060 <get_create_rbump@plt>
cmp    $0x1,%eax
je     122c <create_wait_for_bump+0xdc>
mov    -0x4(%rbp),%edi
call   1050 <create_drive_straight@plt>
mov    $0x64,%edi
call   1040 <msleep@plt>
jmp    115b <create_wait_for_bump+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_wait_for_bump>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
call   1070 <get_create_lbump@plt>
cmp    $0x1,%eax
jne    117c <create_wait_for_bump+0x2c>
xor    %edi,%edi
call   1060 <get_create_rbump@plt>
cmp    $0x1,%eax
je     1216 <create_wait_for_bump+0xc6>
xor    %edi,%edi
call   1070 <get_create_lbump@plt>
test   %eax,%eax
jne    11b0 <create_wait_for_bump+0x60>
xor    %edi,%edi
call   1060 <get_create_rbump@plt>
cmp    $0x1,%eax
jne    11b0 <create_wait_for_bump+0x60>
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <create_drive@plt>
mov    $0x64,%edi
call   1040 <msleep@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %edi,%edi
call   1070 <get_create_lbump@plt>
cmp    $0x1,%eax
jne    11e0 <create_wait_for_bump+0x90>
xor    %edi,%edi
call   1060 <get_create_rbump@plt>
test   %eax,%eax
jne    11e0 <create_wait_for_bump+0x90>
xor    %edi,%edi
mov    %ebx,%esi
call   1030 <create_drive@plt>
mov    $0x64,%edi
call   1040 <msleep@plt>
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1070 <get_create_lbump@plt>
cmp    $0x1,%eax
je     1160 <create_wait_for_bump+0x10>
xor    %edi,%edi
call   1060 <get_create_rbump@plt>
cmp    $0x1,%eax
je     1160 <create_wait_for_bump+0x10>
mov    %ebx,%edi
call   1050 <create_drive_straight@plt>
mov    $0x64,%edi
call   1040 <msleep@plt>
jmp    1160 <create_wait_for_bump+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @create_wait_for_bump(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %41, %1
%4 = call i32 @get_create_lbump(i32 0)
%5 = icmp ne i32 %4, 1
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = call i32 @get_create_rbump(i32 0)
%8 = icmp ne i32 %7, 1
br label %9
9: ; preds = %6, %3
%10 = phi i1 [ true, %3 ], [ %8, %6 ]
br i1 %10, label %11, label %42
11: ; preds = %9
%12 = call i32 @get_create_lbump(i32 0)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = call i32 @get_create_rbump(i32 0)
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %2
%19 = call i32 @create_drive(i32 %18, i32 0)
%20 = call i32 @msleep(i32 100)
br label %21
21: ; preds = %17, %14, %11
%22 = call i32 @get_create_lbump(i32 0)
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %31
24: ; preds = %21
%25 = call i32 @get_create_rbump(i32 0)
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = load i32, i32* %2
%29 = call i32 @create_drive(i32 0, i32 %28)
%30 = call i32 @msleep(i32 100)
br label %31
31: ; preds = %27, %24, %21
%32 = call i32 @get_create_lbump(i32 0)
%33 = icmp ne i32 %32, 1
br i1 %33, label %34, label %41
34: ; preds = %31
%35 = call i32 @get_create_rbump(i32 0)
%36 = icmp ne i32 %35, 1
br i1 %36, label %37, label %41
37: ; preds = %34
%38 = load i32, i32* %2
%39 = call i32 @create_drive_straight(i32 %38)
%40 = call i32 @msleep(i32 100)
br label %41
41: ; preds = %37, %34, %31
br label %3
42: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @create_wait_for_bump(i32 %0) {
br label %2
2: ; preds = %35, %1
%3 = tail call i32 @get_create_lbump(i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @get_create_rbump(i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %36, label %8
8: ; preds = %2, %5
%9 = tail call i32 @get_create_lbump(i32 0)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = tail call i32 @get_create_rbump(i32 0)
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = tail call i32 @create_drive(i32 %0, i32 0)
%16 = tail call i32 @msleep(i32 100)
br label %17
17: ; preds = %14, %11, %8
%18 = tail call i32 @get_create_lbump(i32 0)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %26
20: ; preds = %17
%21 = tail call i32 @get_create_rbump(i32 0)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = tail call i32 @create_drive(i32 0, i32 %0)
%25 = tail call i32 @msleep(i32 100)
br label %26
26: ; preds = %23, %20, %17
%27 = tail call i32 @get_create_lbump(i32 0)
%28 = icmp eq i32 %27, 1
br i1 %28, label %35, label %29
29: ; preds = %26
%30 = tail call i32 @get_create_rbump(i32 0)
%31 = icmp eq i32 %30, 1
br i1 %31, label %35, label %32
32: ; preds = %29
%33 = tail call i32 @create_drive_straight(i32 %0)
%34 = tail call i32 @msleep(i32 100)
br label %35
35: ; preds = %32, %29, %26
br label %2
36: ; preds = %5
ret void
}