#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 pow(int, int);
int /*<<< orphan*/ test_sinus_derivative(int, char *);
int main(int argc, char *argv[]) {
  test_sinus_derivative((3.14159265358979323846264338327950288) / 3, "π/3");
  test_sinus_derivative(
      (100 + 1 / 3.0) * (3.14159265358979323846264338327950288), "100π +π/3");
  test_sinus_derivative((pow(10, 12) + 1 / 3.0) *
                            (3.14159265358979323846264338327950288),
                        "10^12π +π/3");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
lea    0xedc(%rip),%rsi
call   1030 <test_sinus_derivative@plt>
mov    $0x13b,%edi
lea    0xec4(%rip),%rsi
call   1030 <test_sinus_derivative@plt>
mov    $0xa,%edi
mov    $0xc,%esi
call   1040 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe9c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe88(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
lea    0xe95(%rip),%rsi
call   1030 <test_sinus_derivative@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeef(%rip),%rsi
mov    $0x1,%edi
call   1030 <test_sinus_derivative@plt>
lea    0xed7(%rip),%rsi
mov    $0x13b,%edi
call   1030 <test_sinus_derivative@plt>
mov    $0xa,%edi
mov    $0xc,%esi
call   1040 <pow@plt>
cvtsi2sd %eax,%xmm0
addsd  0xea2(%rip),%xmm0
mulsd  0xea2(%rip),%xmm0
cvttsd2si %xmm0,%edi
lea    0xeab(%rip),%rsi
call   1030 <test_sinus_derivative@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\CF\80/3\00"
@.str.1 = [12 x i8] c"100\CF\80 +\CF\80/3\00"
@.str.2 = [14 x i8] c"10^12\CF\80 +\CF\80/3\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @test_sinus_derivative(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @test_sinus_derivative(i32 315, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @pow(i32 10, i32 12)
%8 = sitofp i32 %7 to double
%9 = fadd double %8, 0x3FD5555555555555
%10 = fmul double %9, 0x400921FB54442D18
%11 = fptosi double %10 to i32
%12 = call i32 @test_sinus_derivative(i32 %11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\CF\80/3\00"
@.str.1 = [12 x i8] c"100\CF\80 +\CF\80/3\00"
@.str.2 = [14 x i8] c"10^12\CF\80 +\CF\80/3\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_sinus_derivative(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @test_sinus_derivative(i32 315, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @pow(i32 10, i32 12)
%6 = sitofp i32 %5 to double
%7 = fadd double %6, 0x3FD5555555555555
%8 = fmul double %7, 0x400921FB54442D18
%9 = fptosi double %8 to i32
%10 = tail call i32 @test_sinus_derivative(i32 %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}