#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*/ checkWallAhead();
int get_front_ir_dist(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ set_motors(int, int);
void lookForFront() {
  if (get_front_ir_dist(1) < 25) {
    while (get_front_ir_dist(1) < 25) {
      set_motors(50, -50);
      printf(" FRONT FR%d\n", get_front_ir_dist(1));
      checkWallAhead();
    }
  }
}


x86 assembly (clang, -O0):
<lookForFront>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <get_front_ir_dist@plt>
cmp    $0x19,%eax
jge    11a7 <lookForFront+0x67>
jmp    115c <lookForFront+0x1c>
mov    $0x1,%edi
call   1050 <get_front_ir_dist@plt>
cmp    $0x19,%eax
jge    11a2 <lookForFront+0x62>
mov    $0x32,%edi
mov    $0xffffffce,%esi
call   1060 <set_motors@plt>
mov    $0x1,%edi
call   1050 <get_front_ir_dist@plt>
mov    %eax,%esi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <checkWallAhead@plt>
jmp    115c <lookForFront+0x1c>
jmp    11a7 <lookForFront+0x67>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookForFront>:
push   %rbx
mov    $0x1,%edi
call   1050 <get_front_ir_dist@plt>
cmp    $0x18,%eax
jg     11a9 <lookForFront+0x69>
mov    $0x1,%edi
call   1050 <get_front_ir_dist@plt>
cmp    $0x18,%eax
jg     11a9 <lookForFront+0x69>
lea    0xe9a(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    $0x32,%edi
mov    $0xffffffce,%esi
call   1060 <set_motors@plt>
mov    $0x1,%edi
call   1050 <get_front_ir_dist@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <checkWallAhead@plt>
mov    $0x1,%edi
call   1050 <get_front_ir_dist@plt>
cmp    $0x19,%eax
jl     1170 <lookForFront+0x30>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c" FRONT FR%d\0A\00"
define void @lookForFront() {
%1 = call i32 @get_front_ir_dist(i32 1)
%2 = icmp slt i32 %1, 25
br i1 %2, label %3, label %13
3: ; preds = %0
br label %4
4: ; preds = %7, %3
%5 = call i32 @get_front_ir_dist(i32 1)
%6 = icmp slt i32 %5, 25
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i32 @set_motors(i32 50, i32 -50)
%9 = call i32 @get_front_ir_dist(i32 1)
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 (...) @checkWallAhead()
br label %4
12: ; preds = %4
br label %13
13: ; preds = %12, %0
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c" FRONT FR%d\0A\00"
define void @lookForFront() {
%1 = tail call i32 @get_front_ir_dist(i32 1)
%2 = icmp slt i32 %1, 25
br i1 %2, label %3, label %13
3: ; preds = %0
%4 = tail call i32 @get_front_ir_dist(i32 1)
%5 = icmp slt i32 %4, 25
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = tail call i32 @set_motors(i32 50, i32 -50)
%8 = tail call i32 @get_front_ir_dist(i32 1)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = tail call i32 (...) @checkWallAhead()
%11 = tail call i32 @get_front_ir_dist(i32 1)
%12 = icmp slt i32 %11, 25
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %0
ret void
}