#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 getSensorArrayFront();
int /*<<< orphan*/ stop();
int /*<<< orphan*/ transmit(int, int, int, int, int);
void forward_correct() {
  int arrayCapture = getSensorArrayFront();
  if (arrayCapture == 0 || arrayCapture == 8)
    return;
  if ((arrayCapture > 0) && (arrayCapture < 8)) {
    transmit(4, 0x8A, 0x10, 0x8E, 0x10);
    forward_correct();
    stop();
    return;
  }
  if (arrayCapture > 8) {
    transmit(4, 0x88, 0x10, 0x8C, 0x10);
    forward_correct();
    stop();
    return;
  }
  return;
}


x86 assembly (clang, -O0):
<forward_correct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <getSensorArrayFront@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1166 <forward_correct+0x26>
cmpl   $0x8,-0x4(%rbp)
jne    116b <forward_correct+0x2b>
jmp    11ea <forward_correct+0xaa>
cmpl   $0x0,-0x4(%rbp)
jle    11ad <forward_correct+0x6d>
cmpl   $0x8,-0x4(%rbp)
jge    11ad <forward_correct+0x6d>
mov    $0x4,%edi
mov    $0x8a,%esi
mov    $0x10,%r8d
mov    $0x8e,%ecx
mov    %r8d,%edx
call   1050 <transmit@plt>
call   1030 <forward_correct@plt>
mov    $0x0,%al
call   1040 <stop@plt>
jmp    11ea <forward_correct+0xaa>
cmpl   $0x8,-0x4(%rbp)
jle    11e5 <forward_correct+0xa5>
mov    $0x4,%edi
mov    $0x88,%esi
mov    $0x10,%r8d
mov    $0x8c,%ecx
mov    %r8d,%edx
call   1050 <transmit@plt>
call   1030 <forward_correct@plt>
mov    $0x0,%al
call   1040 <stop@plt>
jmp    11ea <forward_correct+0xaa>
jmp    11ea <forward_correct+0xaa>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forward_correct>:
push   %rax
xor    %eax,%eax
call   1060 <getSensorArrayFront@plt>
test   $0xfffffff7,%eax
je     119e <forward_correct+0x5e>
lea    -0x1(%rax),%ecx
cmp    $0x7,%ecx
jae    116d <forward_correct+0x2d>
mov    $0x4,%edi
mov    $0x8a,%esi
mov    $0x10,%edx
mov    $0x8e,%ecx
jmp    1186 <forward_correct+0x46>
cmp    $0x9,%eax
jl     119e <forward_correct+0x5e>
mov    $0x4,%edi
mov    $0x88,%esi
mov    $0x10,%edx
mov    $0x8c,%ecx
mov    $0x10,%r8d
call   1050 <transmit@plt>
call   1030 <forward_correct@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <stop@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @forward_correct() {
%1 = alloca i32
%2 = call i32 (...) @getSensorArrayFront()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 8
br i1 %7, label %8, label %9
8: ; preds = %5, %0
br label %25
9: ; preds = %5
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 8
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = call i32 @transmit(i32 4, i32 138, i32 16, i32 142, i32 16)
%17 = call i32 (...) @stop()
br label %25
18: ; preds = %12, %9
%19 = load i32, i32* %1
%20 = icmp sgt i32 %19, 8
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = call i32 @transmit(i32 4, i32 136, i32 16, i32 140, i32 16)
%23 = call i32 (...) @stop()
br label %25
24: ; preds = %18
br label %25
25: ; preds = %24, %21, %15, %8
ret void
}

LLVM IR (-O2):
define void @forward_correct() {
%1 = tail call i32 (...) @getSensorArrayFront()
%2 = and i32 %1, -9
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = add i32 %1, -1
%6 = icmp ult i32 %5, 7
br i1 %6, label %10, label %12
7: ; preds = %10, %14
tail call void @forward_correct()
%8 = tail call i32 (...) @stop()
br label %9
9: ; preds = %7, %0, %12
ret void
10: ; preds = %4
%11 = tail call i32 @transmit(i32 4, i32 138, i32 16, i32 142, i32 16)
br label %7
12: ; preds = %4
%13 = icmp sgt i32 %1, 8
br i1 %13, label %14, label %9
14: ; preds = %12
%15 = tail call i32 @transmit(i32 4, i32 136, i32 16, i32 140, i32 16)
br label %7
}