#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*/ cycle();
int distance(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ drive(int, int);
int /*<<< orphan*/ loc_x();
int /*<<< orphan*/ loc_y();
int plot_course(int, int);
scalar_t__ speed();
void go(int dest_x, int dest_y) {
  int course;
  course = plot_course(dest_x, dest_y);
  drive(course, 25);
  while (distance(loc_x(), loc_y(), dest_x, dest_y) > 50)
    cycle();
  drive(course, 0);
  while (speed() > 0)
    cycle();
}


x86 assembly (clang, -O0):
<go>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <plot_course@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x19,%esi
call   1070 <drive@plt>
mov    $0x0,%al
call   1050 <loc_x@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <loc_y@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
call   1090 <distance@plt>
cmp    $0x32,%eax
jle    11cf <go+0x5f>
mov    $0x0,%al
call   1080 <cycle@plt>
jmp    1199 <go+0x29>
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1070 <drive@plt>
mov    $0x0,%al
call   1060 <speed@plt>
cmp    $0x0,%rax
jle    11f6 <go+0x86>
mov    $0x0,%al
call   1080 <cycle@plt>
jmp    11d9 <go+0x69>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<go>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r12d
mov    %edi,%ebp
call   1040 <plot_course@plt>
mov    %eax,%r14d
mov    %eax,%edi
mov    $0x19,%esi
call   1070 <drive@plt>
xor    %eax,%eax
call   1050 <loc_x@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1030 <loc_y@plt>
mov    %r15d,%edi
mov    %eax,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
call   1090 <distance@plt>
cmp    $0x33,%eax
jl     11ea <go+0x7a>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <cycle@plt>
xor    %eax,%eax
call   1050 <loc_x@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <loc_y@plt>
mov    %ebx,%edi
mov    %eax,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
call   1090 <distance@plt>
cmp    $0x32,%eax
jg     11c0 <go+0x50>
mov    %r14d,%edi
xor    %esi,%esi
call   1070 <drive@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1060 <speed@plt>
test   %rax,%rax
jle    1215 <go+0xa5>
xor    %eax,%eax
call   1080 <cycle@plt>
jmp    1200 <go+0x90>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @go(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @plot_course(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @drive(i32 %9, i32 25)
br label %11
11: ; preds = %18, %2
%12 = call i32 (...) @loc_x()
%13 = call i32 (...) @loc_y()
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @distance(i32 %12, i32 %13, i32 %14, i32 %15)
%17 = icmp sgt i32 %16, 50
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = call i32 (...) @cycle()
br label %11
20: ; preds = %11
%21 = load i32, i32* %5
%22 = call i32 @drive(i32 %21, i32 0)
br label %23
23: ; preds = %26, %20
%24 = call i64 (...) @speed()
%25 = icmp sgt i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 (...) @cycle()
br label %23
28: ; preds = %23
ret void
}

LLVM IR (-O2):
define void @go(i32 %0, i32 %1) {
%3 = tail call i32 @plot_course(i32 %0, i32 %1)
%4 = tail call i32 @drive(i32 %3, i32 25)
%5 = tail call i32 (...) @loc_x()
%6 = tail call i32 (...) @loc_y()
%7 = tail call i32 @distance(i32 %5, i32 %6, i32 %0, i32 %1)
%8 = icmp sgt i32 %7, 50
br i1 %8, label %9, label %15
9: ; preds = %2, %9
%10 = tail call i32 (...) @cycle()
%11 = tail call i32 (...) @loc_x()
%12 = tail call i32 (...) @loc_y()
%13 = tail call i32 @distance(i32 %11, i32 %12, i32 %0, i32 %1)
%14 = icmp sgt i32 %13, 50
br i1 %14, label %9, label %15
15: ; preds = %9, %2
%16 = tail call i32 @drive(i32 %3, i32 0)
%17 = tail call i64 (...) @speed()
%18 = icmp sgt i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15, %19
%20 = tail call i32 (...) @cycle()
%21 = tail call i64 (...) @speed()
%22 = icmp sgt i64 %21, 0
br i1 %22, label %19, label %23
23: ; preds = %19, %15
ret void
}