#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;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double deg, rad;
  printf("Podaj kat w stopniach: ");
  scanf("%lf", &deg);
  rad = 2 * M_PI * deg / 360;
  printf("%lf deg = %lf rad\n", deg, rad);
  printf("%lf deg = %.16lf rad\n", deg, rad);
  printf("%lf deg = %.32lf rad\n", deg, rad);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe96(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xea0(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe9b(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe99(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm1
divsd  0xe9c(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
lea    0xeb3(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
lea    0xeb2(%rip),%rdi
movsd  0x10(%rsp),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
lea    0xeae(%rip),%rdi
movsd  0x10(%rsp),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Podaj kat w stopniach: \00"
@.str.1 = [4 x i8] c"%lf\00"
@M_PI = global i32 0
@.str.2 = [19 x i8] c"%lf deg = %lf rad\0A\00"
@.str.3 = [22 x i8] c"%lf deg = %.16lf rad\0A\00"
@.str.4 = [22 x i8] c"%lf deg = %.32lf rad\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load i32, i32* @M_PI
%7 = mul nsw i32 2, %6
%8 = sitofp i32 %7 to double
%9 = load double, double* %2
%10 = fmul double %8, %9
%11 = fdiv double %10, 3.600000e+02
store double %11, double* %3
%12 = load double, double* %2
%13 = load double, double* %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %12, double %13)
%15 = load double, double* %2
%16 = load double, double* %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), double %15, double %16)
%18 = load double, double* %2
%19 = load double, double* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), double %18, double %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Podaj kat w stopniach: \00"
@.str.1 = [4 x i8] c"%lf\00"
@M_PI = global i32 0
@.str.2 = [19 x i8] c"%lf deg = %lf rad\0A\00"
@.str.3 = [22 x i8] c"%lf deg = %.16lf rad\0A\00"
@.str.4 = [22 x i8] c"%lf deg = %.32lf rad\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load i32, i32* @M_PI
%6 = shl nsw i32 %5, 1
%7 = sitofp i32 %6 to double
%8 = load double, double* %1
%9 = fmul double %8, %7
%10 = fdiv double %9, 3.600000e+02
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %8, double %10)
%12 = load double, double* %1
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), double %12, double %10)
%14 = load double, double* %1
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), double %14, double %10)
ret i32 0
}