#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*/ atan(int /*<<< orphan*/);
int /*<<< orphan*/ exp(int /*<<< orphan*/);
int /*<<< orphan*/ init_uart(int /*<<< orphan*/, int);
int /*<<< orphan*/ log(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ sqrt(float);
float tan(int /*<<< orphan*/);
int main(void) {
  int i;
  float a;
  init_uart(0, 1);
  a = 1.0;
  for (i = 0; i < 500; ++i) {
    a = tan(atan(exp(log(sqrt(a * a)))));
    printf("A = %f\n", a);
    a += 1.0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1070 <init_uart@plt>
movss  0xe6d(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1f4,-0x8(%rbp)
jge    1219 <main+0xa9>
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
call   1090 <sqrt@plt>
mov    %eax,%edi
call   1080 <log@plt>
mov    %eax,%edi
call   1050 <exp@plt>
mov    %eax,%edi
call   1040 <atan@plt>
mov    %eax,%edi
call   1060 <tan@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe0a(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    119f <main+0x2f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1070 <init_uart@plt>
movss  0xe79(%rip),%xmm0
mov    $0x1f4,%ebp
lea    0xe71(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mulss  %xmm0,%xmm0
call   1090 <sqrt@plt>
mov    %eax,%edi
call   1080 <log@plt>
mov    %eax,%edi
call   1050 <exp@plt>
mov    %eax,%edi
call   1040 <atan@plt>
mov    %eax,%edi
call   1060 <tan@plt>
movss  %xmm0,0x4(%rsp)
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
addss  0xe1f(%rip),%xmm0
add    $0xffffffff,%ebp
jne    11a0 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"A = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @init_uart(i32 0, i32 1)
store float 1.000000e+00, float* %3
store i32 0, i32* %2
br label %5
5: ; preds = %23, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 500
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = load float, float* %3
%10 = load float, float* %3
%11 = fmul float %9, %10
%12 = call i32 @sqrt(float %11)
%13 = call i32 @log(i32 %12)
%14 = call i32 @exp(i32 %13)
%15 = call i32 @atan(i32 %14)
%16 = call float @tan(i32 %15)
store float %16, float* %3
%17 = load float, float* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %17)
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = fadd double %20, 1.000000e+00
%22 = fptrunc double %21 to float
store float %22, float* %3
br label %23
23: ; preds = %8
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %5
26: ; preds = %5
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str = [8 x i8] c"A = %f\0A\00"
define i32 @main() {
%1 = tail call i32 @init_uart(i32 0, i32 1)
br label %2
2: ; preds = %0, %2
%3 = phi float [ 1.000000e+00, %0 ], [ %12, %2 ]
%4 = phi i32 [ 0, %0 ], [ %13, %2 ]
%5 = fmul float %3, %3
%6 = tail call i32 @sqrt(float %5)
%7 = tail call i32 @log(i32 %6)
%8 = tail call i32 @exp(i32 %7)
%9 = tail call i32 @atan(i32 %8)
%10 = tail call float @tan(i32 %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %10)
%12 = fadd float %10, 1.000000e+00
%13 = add nuw nsw i32 %4, 1
%14 = icmp eq i32 %13, 500
br i1 %14, label %15, label %2
15: ; preds = %2
ret i32 0
}