#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*/ atan(int);
int /*<<< orphan*/ atan2(int, int);
int /*<<< orphan*/ calcAngle(int, int);
int /*<<< orphan*/ done();
int /*<<< orphan*/ moveForward(int);
int /*<<< orphan*/ problem2();
int sqrt(int);
int /*<<< orphan*/ turn(int /*<<< orphan*/);
int main() {
  problem2();
  turn(-atan(12.0 / 8));
  moveForward(sqrt(208));
  turn(calcAngle(4, 9));
  moveForward(sqrt(17));
  turn(-atan(4));
  moveForward(1);
  turn(-atan2(4, 2));
  moveForward(sqrt(20));
  done();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <problem2@plt>
mov    $0x1,%edi
call   1090 <atan@plt>
xor    %edi,%edi
sub    %eax,%edi
call   1060 <turn@plt>
mov    $0xd0,%edi
call   10a0 <sqrt@plt>
mov    %eax,%edi
call   1070 <moveForward@plt>
mov    $0x4,%edi
mov    $0x9,%esi
call   1080 <calcAngle@plt>
mov    %eax,%edi
call   1060 <turn@plt>
mov    $0x11,%edi
call   10a0 <sqrt@plt>
mov    %eax,%edi
call   1070 <moveForward@plt>
mov    $0x4,%edi
call   1090 <atan@plt>
xor    %edi,%edi
sub    %eax,%edi
call   1060 <turn@plt>
mov    $0x1,%edi
call   1070 <moveForward@plt>
mov    $0x4,%edi
mov    $0x2,%esi
call   1040 <atan2@plt>
xor    %edi,%edi
sub    %eax,%edi
call   1060 <turn@plt>
mov    $0x14,%edi
call   10a0 <sqrt@plt>
mov    %eax,%edi
call   1070 <moveForward@plt>
mov    $0x0,%al
call   1030 <done@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <problem2@plt>
mov    $0x1,%edi
call   1090 <atan@plt>
neg    %eax
mov    %eax,%edi
call   1060 <turn@plt>
mov    $0xd0,%edi
call   10a0 <sqrt@plt>
mov    %eax,%edi
call   1070 <moveForward@plt>
mov    $0x4,%edi
mov    $0x9,%esi
call   1080 <calcAngle@plt>
mov    %eax,%edi
call   1060 <turn@plt>
mov    $0x11,%edi
call   10a0 <sqrt@plt>
mov    %eax,%edi
call   1070 <moveForward@plt>
mov    $0x4,%edi
call   1090 <atan@plt>
neg    %eax
mov    %eax,%edi
call   1060 <turn@plt>
mov    $0x1,%edi
call   1070 <moveForward@plt>
mov    $0x4,%edi
mov    $0x2,%esi
call   1040 <atan2@plt>
neg    %eax
mov    %eax,%edi
call   1060 <turn@plt>
mov    $0x14,%edi
call   10a0 <sqrt@plt>
mov    %eax,%edi
call   1070 <moveForward@plt>
xor    %eax,%eax
call   1030 <done@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @problem2()
%3 = call i32 @atan(i32 1)
%4 = sub nsw i32 0, %3
%5 = call i32 @turn(i32 %4)
%6 = call i32 @sqrt(i32 208)
%7 = call i32 @moveForward(i32 %6)
%8 = call i32 @calcAngle(i32 4, i32 9)
%9 = call i32 @turn(i32 %8)
%10 = call i32 @sqrt(i32 17)
%11 = call i32 @moveForward(i32 %10)
%12 = call i32 @atan(i32 4)
%13 = sub nsw i32 0, %12
%14 = call i32 @turn(i32 %13)
%15 = call i32 @moveForward(i32 1)
%16 = call i32 @atan2(i32 4, i32 2)
%17 = sub nsw i32 0, %16
%18 = call i32 @turn(i32 %17)
%19 = call i32 @sqrt(i32 20)
%20 = call i32 @moveForward(i32 %19)
%21 = call i32 (...) @done()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @problem2()
%2 = tail call i32 @atan(i32 1)
%3 = sub nsw i32 0, %2
%4 = tail call i32 @turn(i32 %3)
%5 = tail call i32 @sqrt(i32 208)
%6 = tail call i32 @moveForward(i32 %5)
%7 = tail call i32 @calcAngle(i32 4, i32 9)
%8 = tail call i32 @turn(i32 %7)
%9 = tail call i32 @sqrt(i32 17)
%10 = tail call i32 @moveForward(i32 %9)
%11 = tail call i32 @atan(i32 4)
%12 = sub nsw i32 0, %11
%13 = tail call i32 @turn(i32 %12)
%14 = tail call i32 @moveForward(i32 1)
%15 = tail call i32 @atan2(i32 4, i32 2)
%16 = sub nsw i32 0, %15
%17 = tail call i32 @turn(i32 %16)
%18 = tail call i32 @sqrt(i32 20)
%19 = tail call i32 @moveForward(i32 %18)
%20 = tail call i32 (...) @done()
ret i32 0
}