#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 */
scalar_t__ bumperswitch_get_left();
scalar_t__ bumperswitch_get_right();
int /*<<< orphan*/ displayLCDNumber(int, int /*<<< orphan*/, scalar_t__, int);
int /*<<< orphan*/ motor_set(int, int);
void reverse_until_bumpers() {
  motor_set(-34, -34);
  while (!(bumperswitch_get_left() && bumperswitch_get_right())) {
    if (bumperswitch_get_left())
      motor_set(-40, 0);
    if (bumperswitch_get_right())
      motor_set(0, -40);
    displayLCDNumber(0, 0, bumperswitch_get_left(), 6);
    displayLCDNumber(1, 0, bumperswitch_get_right(), 6);
  }
  motor_set(0, 0);
}


x86 assembly (clang, -O0):
<reverse_until_bumpers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xffffffde,%esi
mov    %esi,%edi
call   1030 <motor_set@plt>
mov    $0x0,%al
call   1060 <bumperswitch_get_left@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     117e <reverse_until_bumpers+0x3e>
mov    $0x0,%al
call   1050 <bumperswitch_get_right@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    1190 <reverse_until_bumpers+0x50>
jmp    1202 <reverse_until_bumpers+0xc2>
mov    $0x0,%al
call   1060 <bumperswitch_get_left@plt>
cmp    $0x0,%rax
je     11ad <reverse_until_bumpers+0x6d>
mov    $0xffffffd8,%edi
xor    %esi,%esi
call   1030 <motor_set@plt>
mov    $0x0,%al
call   1050 <bumperswitch_get_right@plt>
cmp    $0x0,%rax
je     11ca <reverse_until_bumpers+0x8a>
xor    %edi,%edi
mov    $0xffffffd8,%esi
call   1030 <motor_set@plt>
mov    $0x0,%al
call   1060 <bumperswitch_get_left@plt>
mov    %rax,%rdx
xor    %esi,%esi
mov    $0x6,%ecx
mov    %esi,%edi
call   1040 <displayLCDNumber@plt>
mov    $0x0,%al
call   1050 <bumperswitch_get_right@plt>
mov    %rax,%rdx
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x6,%ecx
call   1040 <displayLCDNumber@plt>
jmp    1154 <reverse_until_bumpers+0x14>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <motor_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_until_bumpers>:
push   %rax
mov    $0xffffffde,%edi
mov    $0xffffffde,%esi
call   1030 <motor_set@plt>
jmp    1193 <reverse_until_bumpers+0x53>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <bumperswitch_get_left@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %rax,%rdx
mov    $0x6,%ecx
call   1040 <displayLCDNumber@plt>
xor    %eax,%eax
call   1050 <bumperswitch_get_right@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    %rax,%rdx
mov    $0x6,%ecx
call   1040 <displayLCDNumber@plt>
xor    %eax,%eax
call   1060 <bumperswitch_get_left@plt>
test   %rax,%rax
je     11ab <reverse_until_bumpers+0x6b>
xor    %eax,%eax
call   1050 <bumperswitch_get_right@plt>
test   %rax,%rax
jne    11dd <reverse_until_bumpers+0x9d>
xor    %eax,%eax
call   1060 <bumperswitch_get_left@plt>
test   %rax,%rax
je     11c3 <reverse_until_bumpers+0x83>
mov    $0xffffffd8,%edi
xor    %esi,%esi
call   1030 <motor_set@plt>
xor    %eax,%eax
call   1050 <bumperswitch_get_right@plt>
test   %rax,%rax
je     1160 <reverse_until_bumpers+0x20>
xor    %edi,%edi
mov    $0xffffffd8,%esi
call   1030 <motor_set@plt>
jmp    1160 <reverse_until_bumpers+0x20>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <motor_set@plt>

LLVM IR (-O0):
define void @reverse_until_bumpers() {
%1 = call i32 @motor_set(i32 -34, i32 -34)
br label %2
2: ; preds = %21, %0
%3 = call i64 (...) @bumperswitch_get_left()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = call i64 (...) @bumperswitch_get_right()
%7 = icmp ne i64 %6, 0
br label %8
8: ; preds = %5, %2
%9 = phi i1 [ false, %2 ], [ %7, %5 ]
%10 = xor i1 %9, true
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = call i64 (...) @bumperswitch_get_left()
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @motor_set(i32 -40, i32 0)
br label %16
16: ; preds = %14, %11
%17 = call i64 (...) @bumperswitch_get_right()
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @motor_set(i32 0, i32 -40)
br label %21
21: ; preds = %19, %16
%22 = call i64 (...) @bumperswitch_get_left()
%23 = call i32 @displayLCDNumber(i32 0, i32 0, i64 %22, i32 6)
%24 = call i64 (...) @bumperswitch_get_right()
%25 = call i32 @displayLCDNumber(i32 1, i32 0, i64 %24, i32 6)
br label %2
26: ; preds = %8
%27 = call i32 @motor_set(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @reverse_until_bumpers() {
%1 = tail call i32 @motor_set(i32 -34, i32 -34)
br label %2
2: ; preds = %18, %0
%3 = tail call i64 (...) @bumperswitch_get_left()
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i64 (...) @bumperswitch_get_right()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %2, %5
%9 = tail call i64 (...) @bumperswitch_get_left()
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 @motor_set(i32 -40, i32 0)
br label %13
13: ; preds = %11, %8
%14 = tail call i64 (...) @bumperswitch_get_right()
%15 = icmp eq i64 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = tail call i32 @motor_set(i32 0, i32 -40)
br label %18
18: ; preds = %16, %13
%19 = tail call i64 (...) @bumperswitch_get_left()
%20 = tail call i32 @displayLCDNumber(i32 0, i32 0, i64 %19, i32 6)
%21 = tail call i64 (...) @bumperswitch_get_right()
%22 = tail call i32 @displayLCDNumber(i32 1, i32 0, i64 %21, i32 6)
br label %2
23: ; preds = %5
%24 = tail call i32 @motor_set(i32 0, i32 0)
ret void
}