#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 acos(int);
int /*<<< orphan*/ angle_radian_to_degree(double);
int /*<<< orphan*/ assertDoubleEquals(int /*<<< orphan*/, double);
void test_angle_radian_to_degree() {
  assertDoubleEquals(angle_radian_to_degree(-1), -57.2958);
  assertDoubleEquals(angle_radian_to_degree(1), 57.2958);
  assertDoubleEquals(angle_radian_to_degree(0), 0);
  assertDoubleEquals(angle_radian_to_degree(0.1111), 6.3655611);
  assertDoubleEquals(angle_radian_to_degree(-11111), -636613.41);
  assertDoubleEquals(angle_radian_to_degree(999999), -57295722.2);
  assertDoubleEquals(angle_radian_to_degree(acos(-1)), 180);
  assertDoubleEquals(angle_radian_to_degree((acos(-1) / 180)), 1);
  assertDoubleEquals(angle_radian_to_degree(0.999999), 57.295722217);
  assertDoubleEquals(angle_radian_to_degree(0.0000001), 5.7295779513e-6);
}


x86 assembly (clang, -O0):
<test_angle_radian_to_degree>:
push   %rbp
mov    %rsp,%rbp
movsd  0xf34(%rip),%xmm0
call   1050 <angle_radian_to_degree@plt>
mov    %eax,%edi
movsd  0xf1d(%rip),%xmm0
call   1040 <assertDoubleEquals@plt>
movsd  0xec8(%rip),%xmm0
call   1050 <angle_radian_to_degree@plt>
mov    %eax,%edi
movsd  0xef9(%rip),%xmm0
call   1040 <assertDoubleEquals@plt>
xorps  %xmm0,%xmm0
call   1050 <angle_radian_to_degree@plt>
mov    %eax,%edi
xorps  %xmm0,%xmm0
call   1040 <assertDoubleEquals@plt>
movsd  0xed2(%rip),%xmm0
call   1050 <angle_radian_to_degree@plt>
mov    %eax,%edi
movsd  0xebb(%rip),%xmm0
call   1040 <assertDoubleEquals@plt>
movsd  0xea6(%rip),%xmm0
call   1050 <angle_radian_to_degree@plt>
mov    %eax,%edi
movsd  0xe8f(%rip),%xmm0
call   1040 <assertDoubleEquals@plt>
movsd  0xe7a(%rip),%xmm0
call   1050 <angle_radian_to_degree@plt>
mov    %eax,%edi
movsd  0xe63(%rip),%xmm0
call   1040 <assertDoubleEquals@plt>
mov    $0xffffffff,%edi
call   1030 <acos@plt>
cvtsi2sd %eax,%xmm0
call   1050 <angle_radian_to_degree@plt>
mov    %eax,%edi
movsd  0xe39(%rip),%xmm0
call   1040 <assertDoubleEquals@plt>
mov    $0xffffffff,%edi
call   1030 <acos@plt>
mov    $0xb4,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
call   1050 <angle_radian_to_degree@plt>
mov    %eax,%edi
movsd  0xe07(%rip),%xmm0
call   1040 <assertDoubleEquals@plt>
movsd  0xdf2(%rip),%xmm0
call   1050 <angle_radian_to_degree@plt>
mov    %eax,%edi
movsd  0xddb(%rip),%xmm0
call   1040 <assertDoubleEquals@plt>
movsd  0xdc6(%rip),%xmm0
call   1050 <angle_radian_to_degree@plt>
mov    %eax,%edi
movsd  0xdaf(%rip),%xmm0
call   1040 <assertDoubleEquals@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_angle_radian_to_degree>:
push   %rax
movsd  0xec7(%rip),%xmm0
call   1050 <angle_radian_to_degree@plt>
movsd  0xec2(%rip),%xmm0
mov    %eax,%edi
call   1040 <assertDoubleEquals@plt>
movsd  0xebb(%rip),%xmm0
call   1050 <angle_radian_to_degree@plt>
movsd  0xeb6(%rip),%xmm0
mov    %eax,%edi
call   1040 <assertDoubleEquals@plt>
xorps  %xmm0,%xmm0
call   1050 <angle_radian_to_degree@plt>
xorps  %xmm0,%xmm0
mov    %eax,%edi
call   1040 <assertDoubleEquals@plt>
movsd  0xe9d(%rip),%xmm0
call   1050 <angle_radian_to_degree@plt>
movsd  0xe98(%rip),%xmm0
mov    %eax,%edi
call   1040 <assertDoubleEquals@plt>
movsd  0xe91(%rip),%xmm0
call   1050 <angle_radian_to_degree@plt>
movsd  0xe8c(%rip),%xmm0
mov    %eax,%edi
call   1040 <assertDoubleEquals@plt>
movsd  0xe85(%rip),%xmm0
call   1050 <angle_radian_to_degree@plt>
movsd  0xe80(%rip),%xmm0
mov    %eax,%edi
call   1040 <assertDoubleEquals@plt>
mov    $0xffffffff,%edi
call   1030 <acos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1050 <angle_radian_to_degree@plt>
movsd  0xe63(%rip),%xmm0
mov    %eax,%edi
call   1040 <assertDoubleEquals@plt>
mov    $0xffffffff,%edi
call   1030 <acos@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x7,%eax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1050 <angle_radian_to_degree@plt>
mov    %eax,%edi
movsd  0xde3(%rip),%xmm0
call   1040 <assertDoubleEquals@plt>
movsd  0xe1e(%rip),%xmm0
call   1050 <angle_radian_to_degree@plt>
movsd  0xe19(%rip),%xmm0
mov    %eax,%edi
call   1040 <assertDoubleEquals@plt>
movsd  0xe12(%rip),%xmm0
call   1050 <angle_radian_to_degree@plt>
movsd  0xe0d(%rip),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1040 <assertDoubleEquals@plt>

LLVM IR (-O0):
define void @test_angle_radian_to_degree() {
%1 = call i32 @angle_radian_to_degree(double -1.000000e+00)
%2 = call i32 @assertDoubleEquals(i32 %1, double -5.729580e+01)
%3 = call i32 @angle_radian_to_degree(double 1.000000e+00)
%4 = call i32 @assertDoubleEquals(i32 %3, double 5.729580e+01)
%5 = call i32 @angle_radian_to_degree(double 0.000000e+00)
%6 = call i32 @assertDoubleEquals(i32 %5, double 0.000000e+00)
%7 = call i32 @angle_radian_to_degree(double 1.111000e-01)
%8 = call i32 @assertDoubleEquals(i32 %7, double 0x40197655A624C257)
%9 = call i32 @angle_radian_to_degree(double -1.111100e+04)
%10 = call i32 @assertDoubleEquals(i32 %9, double 0xC1236D8AD1EB851F)
%11 = call i32 @angle_radian_to_degree(double 9.999990e+05)
%12 = call i32 @assertDoubleEquals(i32 %11, double 0xC18B521B5199999A)
%13 = call i32 @acos(i32 -1)
%14 = sitofp i32 %13 to double
%15 = call i32 @angle_radian_to_degree(double %14)
%16 = call i32 @assertDoubleEquals(i32 %15, double 1.800000e+02)
%17 = call i32 @acos(i32 -1)
%18 = sdiv i32 %17, 180
%19 = sitofp i32 %18 to double
%20 = call i32 @angle_radian_to_degree(double %19)
%21 = call i32 @assertDoubleEquals(i32 %20, double 1.000000e+00)
%22 = call i32 @angle_radian_to_degree(double 0x3FEFFFFDE7210BE9)
%23 = call i32 @assertDoubleEquals(i32 %22, double 0x404CA5DA39C15B99)
%24 = call i32 @angle_radian_to_degree(double 0x3E7AD7F29ABCAF48)
%25 = call i32 @assertDoubleEquals(i32 %24, double 0x3ED808166519DC0C)
ret void
}

LLVM IR (-O2):
define void @test_angle_radian_to_degree() {
%1 = tail call i32 @angle_radian_to_degree(double -1.000000e+00)
%2 = tail call i32 @assertDoubleEquals(i32 %1, double -5.729580e+01)
%3 = tail call i32 @angle_radian_to_degree(double 1.000000e+00)
%4 = tail call i32 @assertDoubleEquals(i32 %3, double 5.729580e+01)
%5 = tail call i32 @angle_radian_to_degree(double 0.000000e+00)
%6 = tail call i32 @assertDoubleEquals(i32 %5, double 0.000000e+00)
%7 = tail call i32 @angle_radian_to_degree(double 1.111000e-01)
%8 = tail call i32 @assertDoubleEquals(i32 %7, double 0x40197655A624C257)
%9 = tail call i32 @angle_radian_to_degree(double -1.111100e+04)
%10 = tail call i32 @assertDoubleEquals(i32 %9, double 0xC1236D8AD1EB851F)
%11 = tail call i32 @angle_radian_to_degree(double 9.999990e+05)
%12 = tail call i32 @assertDoubleEquals(i32 %11, double 0xC18B521B5199999A)
%13 = tail call i32 @acos(i32 -1)
%14 = sitofp i32 %13 to double
%15 = tail call i32 @angle_radian_to_degree(double %14)
%16 = tail call i32 @assertDoubleEquals(i32 %15, double 1.800000e+02)
%17 = tail call i32 @acos(i32 -1)
%18 = sdiv i32 %17, 180
%19 = sitofp i32 %18 to double
%20 = tail call i32 @angle_radian_to_degree(double %19)
%21 = tail call i32 @assertDoubleEquals(i32 %20, double 1.000000e+00)
%22 = tail call i32 @angle_radian_to_degree(double 0x3FEFFFFDE7210BE9)
%23 = tail call i32 @assertDoubleEquals(i32 %22, double 0x404CA5DA39C15B99)
%24 = tail call i32 @angle_radian_to_degree(double 0x3E7AD7F29ABCAF48)
%25 = tail call i32 @assertDoubleEquals(i32 %24, double 0x3ED808166519DC0C)
ret void
}