#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*/ enable_servos();
int /*<<< orphan*/ move(int, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_servo_position(int, int);
int main() {
  enable_servos();
  set_servo_position(1, 1050);
  printf("go straight\n");
  move(50, 50, 3000);
  move(50, 50, 3000);
  printf("go straight\n");
  move(-50, -50, 3000);
  move(-50, -50, 3050);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <enable_servos@plt>
mov    $0x1,%edi
mov    $0x41a,%esi
call   1050 <set_servo_position@plt>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    $0x32,%esi
mov    $0xbb8,%edx
mov    %esi,%edi
call   1060 <move@plt>
mov    $0x32,%esi
mov    $0xbb8,%edx
mov    %esi,%edi
call   1060 <move@plt>
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffce,%esi
mov    $0xbb8,%edx
mov    %esi,%edi
call   1060 <move@plt>
mov    $0xffffffce,%esi
mov    $0xbea,%edx
mov    %esi,%edi
call   1060 <move@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <enable_servos@plt>
mov    $0x1,%edi
mov    $0x41a,%esi
call   1050 <set_servo_position@plt>
lea    0xea2(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x32,%edi
mov    $0x32,%esi
mov    $0xbb8,%edx
call   1060 <move@plt>
mov    $0x32,%edi
mov    $0x32,%esi
mov    $0xbb8,%edx
call   1060 <move@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xffffffce,%edi
mov    $0xffffffce,%esi
mov    $0xbb8,%edx
call   1060 <move@plt>
mov    $0xffffffce,%edi
mov    $0xffffffce,%esi
mov    $0xbea,%edx
call   1060 <move@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"go straight\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @enable_servos()
%3 = call i32 @set_servo_position(i32 1, i32 1050)
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @move(i32 50, i32 50, i32 3000)
%6 = call i32 @move(i32 50, i32 50, i32 3000)
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @move(i32 -50, i32 -50, i32 3000)
%9 = call i32 @move(i32 -50, i32 -50, i32 3050)
ret i32 0
}

LLVM IR (-O2):
@str.1 = [12 x i8] c"go straight\00"
define i32 @main() {
%1 = tail call i32 (...) @enable_servos()
%2 = tail call i32 @set_servo_position(i32 1, i32 1050)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.1, i64 0, i64 0))
%4 = tail call i32 @move(i32 50, i32 50, i32 3000)
%5 = tail call i32 @move(i32 50, i32 50, i32 3000)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.1, i64 0, i64 0))
%7 = tail call i32 @move(i32 -50, i32 -50, i32 3000)
%8 = tail call i32 @move(i32 -50, i32 -50, i32 3050)
ret i32 0
}