#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*/ fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, float *);
int /*<<< orphan*/ stdin;
int main() {
  float radians, degrees;
  puts("Convert radians to degrees\n\n");
  for (;;) {
    printf("Enter a value in radians : ");
    scanf("%f", &radians);
    degrees = radians * 57.2957795;
    printf("%.5f radians equals %.3f degrees\n\n", radians, degrees);
    fpurge(stdin);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe76(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe8f(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    0x2e25(%rip),%rax
mov    (%rax),%edi
call   1060 <fpurge@plt>
jmp    115b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
lea    0xec5(%rip),%r14
lea    0xeda(%rip),%r15
lea    0xc(%rsp),%r12
lea    0xed1(%rip),%r13
mov    0x2e6e(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movaps %xmm0,%xmm1
mulsd  0xe56(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1060 <fpurge@plt>
jmp    1180 <main+0x40>

LLVM IR (-O0):
@.str = [29 x i8] c"Convert radians to degrees\0A\0A\00"
@.str.1 = [28 x i8] c"Enter a value in radians : \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [35 x i8] c"%.5f radians equals %.3f degrees\0A\0A\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %5, %0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fmul double %9, 0x404CA5DC1A47A9E3
%11 = fptrunc double %10 to float
store float %11, float* %3
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %13, double %15)
%17 = load i32, i32* @stdin
%18 = call i32 @fpurge(i32 %17)
br label %5
}

LLVM IR (-O2):
@.str = [29 x i8] c"Convert radians to degrees\0A\0A\00"
@.str.1 = [28 x i8] c"Enter a value in radians : \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [35 x i8] c"%.5f radians equals %.3f degrees\0A\0A\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %4, %0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%7 = load float, float* %1
%8 = fpext float %7 to double
%9 = fmul double %8, 0x404CA5DC1A47A9E3
%10 = fptrunc double %9 to float
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %8, double %11)
%13 = load i32, i32* @stdin
%14 = call i32 @fpurge(i32 %13)
br label %4
}