#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 cos(double);
int /*<<< orphan*/ printf(char *, ...);
double sin(double);
int main() {
  double y, p, q;
  printf("x\t sin x\t cos x");
  y = 0;
  while (y <= 80) {
    p = sin(y);
    q = cos(y);
    printf("%d\t%f\t%f\n", y, p, q);
    y += 15;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xea3(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11ba <main+0x8a>
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xe84(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movsd  0xe5d(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1155 <main+0x25>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf68(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf6a(%rip),%rbx
movsd  0xed2(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movsd  0xec2(%rip),%xmm0
movsd  0xec2(%rip),%xmm1
movsd  0xec2(%rip),%xmm2
mov    %rbx,%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movsd  0xeb8(%rip),%xmm0
movsd  0xeb8(%rip),%xmm1
movsd  0xeb8(%rip),%xmm2
mov    %rbx,%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movsd  0xeae(%rip),%xmm0
movsd  0xeae(%rip),%xmm1
movsd  0xeae(%rip),%xmm2
mov    %rbx,%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movsd  0xea4(%rip),%xmm0
movsd  0xea4(%rip),%xmm1
movsd  0xea4(%rip),%xmm2
mov    %rbx,%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movsd  0xe9a(%rip),%xmm0
movsd  0xe9a(%rip),%xmm1
movsd  0xe9a(%rip),%xmm2
mov    %rbx,%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"x\09 sin x\09 cos x\00"
@.str.1 = [10 x i8] c"%d\09%f\09%f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 1.500000e+01, double 0x3FE4CF2871CEC2E8, double 0xBFE84F5D069CA4F3)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 3.000000e+01, double 0xBFEF9DF47F1C903D, double 0x3FC3BE82F2505A52)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 4.500000e+01, double 0x3FEB3A9A073D9B03, double 0x3FE0CF700F3AF03F)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 6.000000e+01, double 0xBFD382046846E0C2, double 0xBFEE7A2AC9656853)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 7.500000e+01, double 0xBFD8D16A1084AA62, double 0x3FED7EFC84D074ED)
ret i32 0
}