#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*/ delay(int);
int getSensorArrayLeft();
int getSensorArrayRight();
int /*<<< orphan*/ stop();
int /*<<< orphan*/ transmit(int, int, int, int, int);
void orientation_correct() {
  int leftCapture = getSensorArrayLeft();
  int rightCapture = getSensorArrayRight();
  if (((leftCapture > 0) && (leftCapture <= 24)) || (rightCapture >= 128)) {
    transmit(4, 0x88, 0x10, 0x8E, 0x10);
    delay(1300);
    stop();
  } else if (((rightCapture > 0) && (rightCapture <= 24)) ||
             (leftCapture >= 128)) {
    transmit(4, 0x8A, 0x10, 0x8C, 0x10);
    delay(1300);
    stop();
  } else if (leftCapture == 32)
    return;
  else if (rightCapture == 32)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<orientation_correct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1070 <getSensorArrayLeft@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <getSensorArrayRight@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1180 <orientation_correct+0x30>
cmpl   $0x18,-0x4(%rbp)
jle    118d <orientation_correct+0x3d>
cmpl   $0x80,-0x8(%rbp)
jl     11c0 <orientation_correct+0x70>
mov    $0x4,%edi
mov    $0x88,%esi
mov    $0x10,%r8d
mov    $0x8e,%ecx
mov    %r8d,%edx
call   1050 <transmit@plt>
mov    $0x514,%edi
call   1040 <delay@plt>
mov    $0x0,%al
call   1030 <stop@plt>
jmp    123c <orientation_correct+0xec>
cmpl   $0x0,-0x8(%rbp)
jle    11d4 <orientation_correct+0x84>
cmpl   $0x18,-0x8(%rbp)
jle    11e1 <orientation_correct+0x91>
cmpl   $0x80,-0x4(%rbp)
jl     1214 <orientation_correct+0xc4>
mov    $0x4,%edi
mov    $0x8a,%esi
mov    $0x10,%r8d
mov    $0x8c,%ecx
mov    %r8d,%edx
call   1050 <transmit@plt>
mov    $0x514,%edi
call   1040 <delay@plt>
mov    $0x0,%al
call   1030 <stop@plt>
jmp    1237 <orientation_correct+0xe7>
cmpl   $0x20,-0x4(%rbp)
jne    1223 <orientation_correct+0xd3>
jmp    123c <orientation_correct+0xec>
cmpl   $0x20,-0x8(%rbp)
jne    1232 <orientation_correct+0xe2>
jmp    123c <orientation_correct+0xec>
jmp    123c <orientation_correct+0xec>
jmp    123c <orientation_correct+0xec>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orientation_correct>:
push   %rbx
xor    %eax,%eax
call   1070 <getSensorArrayLeft@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <getSensorArrayRight@plt>
lea    -0x1(%rbx),%ecx
cmp    $0x18,%ecx
jb     1182 <orientation_correct+0x32>
cmp    $0x80,%eax
jge    1182 <orientation_correct+0x32>
add    $0xffffffff,%eax
cmp    $0x18,%eax
jb     1198 <orientation_correct+0x48>
cmp    $0x80,%ebx
jge    1198 <orientation_correct+0x48>
pop    %rbx
ret
mov    $0x4,%edi
mov    $0x88,%esi
mov    $0x10,%edx
mov    $0x8e,%ecx
jmp    11ac <orientation_correct+0x5c>
mov    $0x4,%edi
mov    $0x8a,%esi
mov    $0x10,%edx
mov    $0x8c,%ecx
mov    $0x10,%r8d
call   1050 <transmit@plt>
mov    $0x514,%edi
call   1040 <delay@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <stop@plt>

LLVM IR (-O0):
define void @orientation_correct() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getSensorArrayLeft()
store i32 %3, i32* %1
%4 = call i32 (...) @getSensorArrayRight()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp sle i32 %8, 24
br i1 %9, label %13, label %10
10: ; preds = %7, %0
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 128
br i1 %12, label %13, label %17
13: ; preds = %10, %7
%14 = call i32 @transmit(i32 4, i32 136, i32 16, i32 142, i32 16)
%15 = call i32 @delay(i32 1300)
%16 = call i32 (...) @stop()
br label %40
17: ; preds = %10
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp sle i32 %21, 24
br i1 %22, label %26, label %23
23: ; preds = %20, %17
%24 = load i32, i32* %1
%25 = icmp sge i32 %24, 128
br i1 %25, label %26, label %30
26: ; preds = %23, %20
%27 = call i32 @transmit(i32 4, i32 138, i32 16, i32 140, i32 16)
%28 = call i32 @delay(i32 1300)
%29 = call i32 (...) @stop()
br label %39
30: ; preds = %23
%31 = load i32, i32* %1
%32 = icmp eq i32 %31, 32
br i1 %32, label %33, label %34
33: ; preds = %30
br label %40
34: ; preds = %30
%35 = load i32, i32* %2
%36 = icmp eq i32 %35, 32
br i1 %36, label %37, label %38
37: ; preds = %34
br label %40
38: ; preds = %34
br label %40
39: ; preds = %26
br label %40
40: ; preds = %33, %37, %38, %39, %13
ret void
}

LLVM IR (-O2):
define void @orientation_correct() {
%1 = tail call i32 (...) @getSensorArrayLeft()
%2 = tail call i32 (...) @getSensorArrayRight()
%3 = add i32 %1, -1
%4 = icmp ult i32 %3, 24
%5 = icmp sgt i32 %2, 127
%6 = select i1 %4, i1 true, i1 %5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 @transmit(i32 4, i32 136, i32 16, i32 142, i32 16)
br label %16
9: ; preds = %0
%10 = add i32 %2, -1
%11 = icmp ult i32 %10, 24
%12 = icmp sgt i32 %1, 127
%13 = select i1 %11, i1 true, i1 %12
br i1 %13, label %14, label %19
14: ; preds = %9
%15 = tail call i32 @transmit(i32 4, i32 138, i32 16, i32 140, i32 16)
br label %16
16: ; preds = %14, %7
%17 = tail call i32 @delay(i32 1300)
%18 = tail call i32 (...) @stop()
br label %19
19: ; preds = %16, %9
ret void
}