#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 */
double M_PI;
int /*<<< orphan*/ printf(char *, double, double);
double sin(double);
int main() {
  double theta;
  double pi = M_PI;
  for (theta = 0; theta <= 2 * pi; theta += 0.1) {
    printf("%f \t %f\n", theta, sin(theta));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xeac(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11a2 <main+0x82>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe75(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <main+0x27>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rax
movsd  (%rax),%xmm1
addsd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1184 <main+0x64>
lea    0xec3(%rip),%rbx
movsd  %xmm1,0x8(%rsp)
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
call   1040 <sin@plt>
movapd %xmm0,%xmm1
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  0xe82(%rip),%xmm0
ucomisd %xmm0,%xmm1
jae    1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
@.str = [9 x i8] c"%f \09 %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = load double, double* @M_PI
store double %4, double* %3
store double 0.000000e+00, double* %2
br label %5
5: ; preds = %15, %0
%6 = load double, double* %2
%7 = load double, double* %3
%8 = fmul double 2.000000e+00, %7
%9 = fcmp ole double %6, %8
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load double, double* %2
%12 = load double, double* %2
%13 = call double @sin(double %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %11, double %13)
br label %15
15: ; preds = %10
%16 = load double, double* %2
%17 = fadd double %16, 1.000000e-01
store double %17, double* %2
br label %5
18: ; preds = %5
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
@.str = [9 x i8] c"%f \09 %f\0A\00"
define i32 @main() {
%1 = load double, double* @M_PI
%2 = fmul double %1, 2.000000e+00
%3 = fcmp ult double %2, 0.000000e+00
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi double [ %8, %4 ], [ 0.000000e+00, %0 ]
%6 = tail call double @sin(double %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %5, double %6)
%8 = fadd double %5, 1.000000e-01
%9 = fcmp ugt double %8, %2
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}