#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 /*<<< orphan*/ printf(char *, double);
double sin(double);
void main() {
  char c = 0;
  double deg = 0;
  double rad = 0;
  double rez = 0;
  printf("one rad = %lf degrees;\n", 180 / 3.1415926535897932384626433832795);
  deg = 45;
  printf("deg = %lf;\n", deg);
  rad = (180 / 3.1415926535897932384626433832795);
  printf("first step rad = %lf;\n", rad);
  rad = deg / rad;
  printf("second step rad = %lf;\n", rad);
  rez = sin(deg);
  printf("rez of sin ( deg ) = %lf;\n", rez);
  printf("rez of sin ( rad ) = %lf;\n", sin(rad));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movb   $0x0,-0x1(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xec5(%rip),%rdi
movsd  0xead(%rip),%xmm0
call   1030 <printf@plt>
movsd  0xea8(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe82(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   1040 <sin@plt>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf10(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf14(%rip),%rdi
movsd  0xed4(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
movsd  0xeb8(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf0f(%rip),%rdi
movsd  0xeb4(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf13(%rip),%rdi
movsd  0xea8(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf1a(%rip),%rdi
movsd  0xe9c(%rip),%xmm0
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"one rad = %lf degrees;\0A\00"
@.str.1 = [12 x i8] c"deg = %lf;\0A\00"
@.str.2 = [23 x i8] c"first step rad = %lf;\0A\00"
@.str.3 = [24 x i8] c"second step rad = %lf;\0A\00"
@.str.4 = [27 x i8] c"rez of sin ( deg ) = %lf;\0A\00"
@.str.5 = [27 x i8] c"rez of sin ( rad ) = %lf;\0A\00"
define void @main() {
%1 = alloca i8
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i8 0, i8* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double 0x404CA5DC1A63C1F8)
store double 4.500000e+01, double* %2
%6 = load double, double* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %6)
store double 0x404CA5DC1A63C1F8, double* %3
%8 = load double, double* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %8)
%10 = load double, double* %2
%11 = load double, double* %3
%12 = fdiv double %10, %11
store double %12, double* %3
%13 = load double, double* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), double %13)
%15 = load double, double* %2
%16 = call double @sin(double %15)
store double %16, double* %4
%17 = load double, double* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), double %17)
%19 = load double, double* %3
%20 = call double @sin(double %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), double %20)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"one rad = %lf degrees;\0A\00"
@.str.1 = [12 x i8] c"deg = %lf;\0A\00"
@.str.2 = [23 x i8] c"first step rad = %lf;\0A\00"
@.str.3 = [24 x i8] c"second step rad = %lf;\0A\00"
@.str.4 = [27 x i8] c"rez of sin ( deg ) = %lf;\0A\00"
@.str.5 = [27 x i8] c"rez of sin ( rad ) = %lf;\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double 0x404CA5DC1A63C1F8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double 4.500000e+01)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double 0x404CA5DC1A63C1F8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), double 0x3FE921FB54442D18)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), double 0x3FEB3A9A073D9B03)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), double 0x3FE6A09E667F3BCC)
ret void
}