#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*/ motor(int, int);
int /*<<< orphan*/ msleep(int);
int /*<<< orphan*/ off(int);
int /*<<< orphan*/ printf(char *, char *);
void moveWheels(int direction) {
  char *dir = "in";
  if (direction < 0) {
    dir = "out";
  }
  printf("You put your whole self %s\n", dir);
  motor(3, 25 * direction);
  motor(1, 25 * direction);
  msleep(1000);
  off(3);
  off(1);
}


x86 assembly (clang, -O0):
<moveWheels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    116b <moveWheels+0x2b>
lea    0xe9c(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1060 <printf@plt>
imul   $0x19,-0x4(%rbp),%esi
mov    $0x3,%edi
call   1030 <motor@plt>
imul   $0x19,-0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <motor@plt>
mov    $0x3e8,%edi
call   1050 <msleep@plt>
mov    $0x3,%edi
call   1040 <off@plt>
mov    $0x1,%edi
call   1040 <off@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveWheels>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
lea    0xeb7(%rip),%rax
lea    0xead(%rip),%rsi
cmovs  %rax,%rsi
lea    0xea9(%rip),%rdi
call   1060 <printf@plt>
lea    (%rbx,%rbx,4),%eax
lea    (%rax,%rax,4),%ebx
mov    $0x3,%edi
mov    %ebx,%esi
call   1030 <motor@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1030 <motor@plt>
mov    $0x3e8,%edi
call   1050 <msleep@plt>
mov    $0x3,%edi
call   1040 <off@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1040 <off@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"in\00"
@.str.1 = [4 x i8] c"out\00"
@.str.2 = [28 x i8] c"You put your whole self %s\0A\00"
define void @moveWheels(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %7
7: ; preds = %6, %1
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i32, i32* %2
%11 = mul nsw i32 25, %10
%12 = call i32 @motor(i32 3, i32 %11)
%13 = load i32, i32* %2
%14 = mul nsw i32 25, %13
%15 = call i32 @motor(i32 1, i32 %14)
%16 = call i32 @msleep(i32 1000)
%17 = call i32 @off(i32 3)
%18 = call i32 @off(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"in\00"
@.str.1 = [4 x i8] c"out\00"
@.str.2 = [28 x i8] c"You put your whole self %s\0A\00"
define void @moveWheels(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%5 = mul nsw i32 %0, 25
%6 = tail call i32 @motor(i32 3, i32 %5)
%7 = tail call i32 @motor(i32 1, i32 %5)
%8 = tail call i32 @msleep(i32 1000)
%9 = tail call i32 @off(i32 3)
%10 = tail call i32 @off(i32 1)
ret void
}