#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 M_PI;
double cos(float);
int /*<<< orphan*/ printf(char *, double, double);
double sin(float);
int main(int c, char **v) {
  int i;
  for (i = -180; i <= 180; i += 5) {
    float r = M_PI * i / 180;
    printf("(%7.2f, %7.2f)\n", 100.0 * cos(r), 100.0 * sin(r));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffff4c,-0x14(%rbp)
cmpl   $0xb4,-0x14(%rbp)
jg     11ce <main+0x9e>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
imul   -0x14(%rbp),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xe73(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  0xe50(%rip),%xmm1
mulsd  %xmm2,%xmm1
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    $0xffffff47,%ebp
mov    0x2ea4(%rip),%r14
lea    0xebd(%rip),%rbx
nopl   0x0(%rax,%rax,1)
add    $0x5,%ebp
mov    (%r14),%eax
imul   %ebp,%eax
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
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x4(%rsp)
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xe71(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movss  0x4(%rsp),%xmm0
call   1040 <sin@plt>
movapd %xmm0,%xmm1
mulsd  0xe50(%rip),%xmm1
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
cmp    $0xb0,%ebp
jl     1150 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@M_PI = global i32 0
@.str = [16 x i8] c"(%7.2f, %7.2f)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -180, i32* %6
br label %8
8: ; preds = %24, %2
%9 = load i32, i32* %6
%10 = icmp sle i32 %9, 180
br i1 %10, label %11, label %27
11: ; preds = %8
%12 = load i32, i32* @M_PI
%13 = load i32, i32* %6
%14 = mul nsw i32 %12, %13
%15 = sdiv i32 %14, 180
%16 = sitofp i32 %15 to float
store float %16, float* %7
%17 = load float, float* %7
%18 = call double @cos(float %17)
%19 = fmul double 1.000000e+02, %18
%20 = load float, float* %7
%21 = call double @sin(float %20)
%22 = fmul double 1.000000e+02, %21
%23 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %19, double %22)
br label %24
24: ; preds = %11
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 5
store i32 %26, i32* %6
br label %8
27: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@M_PI = global i32 0
@.str = [16 x i8] c"(%7.2f, %7.2f)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ -180, %2 ], [ %14, %3 ]
%5 = load i32, i32* @M_PI
%6 = mul nsw i32 %5, %4
%7 = sdiv i32 %6, 180
%8 = sitofp i32 %7 to float
%9 = tail call double @cos(float %8)
%10 = fmul double %9, 1.000000e+02
%11 = tail call double @sin(float %8)
%12 = fmul double %11, 1.000000e+02
%13 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %10, double %12)
%14 = add nsw i32 %4, 5
%15 = icmp slt i32 %4, 176
br i1 %15, label %3, label %16
16: ; preds = %3
ret i32 0
}