#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 */
float atan(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
void arctan() {
  float deg, rad, angle, val;
  printf("Enter the value: \n");
  scanf("%f", &val);
  printf("The value you have input is %.2f. \n", val);
  for (int i = 0; i >= 0.0; i++) {
    angle = atan(val);
    deg = angle * (180.0 / 3.14);
    break;
  }
  printf("Arctan(%.2f) is equal to %.f degrees.", val, deg);
}


x86 assembly (clang, -O0):
<arctan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11b3 <arctan+0x83>
movss  -0x10(%rbp),%xmm0
call   1040 <atan@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe5a(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe76(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arctan>:
push   %rax
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
call   1050 <atan@plt>
cvtss2sd %xmm0,%xmm0
mulsd  0xe73(%rip),%xmm0
cvtsd2ss %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
lea    0xe89(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter the value: \0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [36 x i8] c"The value you have input is %.2f. \0A\00"
@.str.3 = [38 x i8] c"Arctan(%.2f) is equal to %.f degrees.\00"
define void @arctan() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %9)
store i32 0, i32* %5
br label %11
11: ; preds = %22, %0
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = fcmp oge double %13, 0.000000e+00
br i1 %14, label %15, label %25
15: ; preds = %11
%16 = load float, float* %4
%17 = call float @atan(float %16)
store float %17, float* %3
%18 = load float, float* %3
%19 = fpext float %18 to double
%20 = fmul double %19, 0x404CA99461D59AE7
%21 = fptrunc double %20 to float
store float %21, float* %1
br label %25
22: ; No predecessors!
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %11
25: ; preds = %15, %11
%26 = load float, float* %4
%27 = fpext float %26 to double
%28 = load float, float* %1
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %27, double %29)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [36 x i8] c"The value you have input is %.2f. \0A\00"
@.str.3 = [38 x i8] c"Arctan(%.2f) is equal to %.f degrees.\00"
@str = [18 x i8] c"Enter the value: \00"
define void @arctan() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %6)
%8 = load float, float* %1
%9 = call float @atan(float %8)
%10 = fpext float %9 to double
%11 = fmul double %10, 0x404CA99461D59AE7
%12 = fptrunc double %11 to float
%13 = load float, float* %1
%14 = fpext float %13 to double
%15 = fpext float %12 to double
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %14, double %15)
ret void
}