#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 get_front_ir_dist(int /*<<< orphan*/);
int get_side_ir_dist(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ set_motors(int, int);
void adjustParallel() {
  if (get_side_ir_dist(0) > get_front_ir_dist(0) - 4) {
    set_motors(50, 30);
    printf("RIGHT SL%d FL%d\n", get_side_ir_dist(0), get_front_ir_dist(0));
  }
  if (get_side_ir_dist(0) < get_front_ir_dist(0) - 4) {
    set_motors(30, 50);
    printf("LEFT SL%d FL%d\n", get_side_ir_dist(0), get_front_ir_dist(0));
  }
}


x86 assembly (clang, -O0):
<adjustParallel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <get_side_ir_dist@plt>
mov    %eax,-0x4(%rbp)
xor    %edi,%edi
call   1050 <get_front_ir_dist@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
sub    $0x4,%ecx
cmp    %ecx,%eax
jle    119a <adjustParallel+0x5a>
mov    $0x32,%edi
mov    $0x1e,%esi
call   1060 <set_motors@plt>
xor    %edi,%edi
call   1040 <get_side_ir_dist@plt>
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1050 <get_front_ir_dist@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <get_side_ir_dist@plt>
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
call   1050 <get_front_ir_dist@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    $0x4,%ecx
cmp    %ecx,%eax
jge    11ec <adjustParallel+0xac>
mov    $0x1e,%edi
mov    $0x32,%esi
call   1060 <set_motors@plt>
xor    %edi,%edi
call   1040 <get_side_ir_dist@plt>
mov    %eax,-0x10(%rbp)
xor    %edi,%edi
call   1050 <get_front_ir_dist@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xe2a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjustParallel>:
push   %rbx
xor    %edi,%edi
call   1040 <get_side_ir_dist@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1050 <get_front_ir_dist@plt>
add    $0xfffffffc,%eax
cmp    %eax,%ebx
jle    1187 <adjustParallel+0x47>
mov    $0x32,%edi
mov    $0x1e,%esi
call   1060 <set_motors@plt>
xor    %edi,%edi
call   1040 <get_side_ir_dist@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1050 <get_front_ir_dist@plt>
lea    0xe82(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <get_side_ir_dist@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1050 <get_front_ir_dist@plt>
add    $0xfffffffc,%eax
cmp    %eax,%ebx
jge    11ce <adjustParallel+0x8e>
mov    $0x1e,%edi
mov    $0x32,%esi
call   1060 <set_motors@plt>
xor    %edi,%edi
call   1040 <get_side_ir_dist@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1050 <get_front_ir_dist@plt>
lea    0xe4d(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"RIGHT SL%d FL%d\0A\00"
@.str.1 = [16 x i8] c"LEFT SL%d FL%d\0A\00"
define void @adjustParallel() {
%1 = call i32 @get_side_ir_dist(i32 0)
%2 = call i32 @get_front_ir_dist(i32 0)
%3 = sub nsw i32 %2, 4
%4 = icmp sgt i32 %1, %3
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = call i32 @set_motors(i32 50, i32 30)
%7 = call i32 @get_side_ir_dist(i32 0)
%8 = call i32 @get_front_ir_dist(i32 0)
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %5, %0
%11 = call i32 @get_side_ir_dist(i32 0)
%12 = call i32 @get_front_ir_dist(i32 0)
%13 = sub nsw i32 %12, 4
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %20
15: ; preds = %10
%16 = call i32 @set_motors(i32 30, i32 50)
%17 = call i32 @get_side_ir_dist(i32 0)
%18 = call i32 @get_front_ir_dist(i32 0)
%19 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 %18)
br label %20
20: ; preds = %15, %10
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"RIGHT SL%d FL%d\0A\00"
@.str.1 = [16 x i8] c"LEFT SL%d FL%d\0A\00"
define void @adjustParallel() {
%1 = tail call i32 @get_side_ir_dist(i32 0)
%2 = tail call i32 @get_front_ir_dist(i32 0)
%3 = add nsw i32 %2, -4
%4 = icmp sgt i32 %1, %3
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = tail call i32 @set_motors(i32 50, i32 30)
%7 = tail call i32 @get_side_ir_dist(i32 0)
%8 = tail call i32 @get_front_ir_dist(i32 0)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %5, %0
%11 = tail call i32 @get_side_ir_dist(i32 0)
%12 = tail call i32 @get_front_ir_dist(i32 0)
%13 = add nsw i32 %12, -4
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %20
15: ; preds = %10
%16 = tail call i32 @set_motors(i32 30, i32 50)
%17 = tail call i32 @get_side_ir_dist(i32 0)
%18 = tail call i32 @get_front_ir_dist(i32 0)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 %18)
br label %20
20: ; preds = %15, %10
ret void
}