#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 pow(float, int);
float atan(float inp) {
  float result = inp;
  int addsub = 0;
  int i = 0;
  for (i = 3; i < 17; i += 2) {
    if (addsub == 0) {
      result -= pow(inp, i) / i;
      addsub = 1;
    } else {
      result += pow(inp, i) / i;
      addsub = 0;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x3,-0x10(%rbp)
cmpl   $0x11,-0x10(%rbp)
jge    11b8 <atan+0xa8>
cmpl   $0x0,-0xc(%rbp)
jne    117f <atan+0x6f>
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%edi
call   1030 <pow@plt>
cltd
idivl  -0x10(%rbp)
cvtsi2ss %eax,%xmm1
movss  -0x8(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
jmp    11a5 <atan+0x95>
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%edi
call   1030 <pow@plt>
cltd
idivl  -0x10(%rbp)
cvtsi2ss %eax,%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    11aa <atan+0x9a>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    113c <atan+0x2c>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0x3,%edi
call   1030 <pow@plt>
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
cvtsi2ss %eax,%xmm1
movss  0x4(%rsp),%xmm0
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
movss  %xmm2,(%rsp)
mov    $0x5,%edi
call   1030 <pow@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
sar    %eax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
addss  (%rsp),%xmm0
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
mov    $0x7,%edi
call   1030 <pow@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x2,%eax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  (%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  0x4(%rsp),%xmm0
mov    $0x9,%edi
call   1030 <pow@plt>
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
sar    %eax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
addss  (%rsp),%xmm0
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
mov    $0xb,%edi
call   1030 <pow@plt>
cltq
imul   $0x2e8ba2e9,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
sar    %eax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  (%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  0x4(%rsp),%xmm0
mov    $0xd,%edi
call   1030 <pow@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
sar    $0x2,%eax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
addss  (%rsp),%xmm0
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
mov    $0xf,%edi
call   1030 <pow@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x3,%eax
add    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movss  (%rsp),%xmm0
subss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @atan(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store float %0, float* %2
%6 = load float, float* %2
store float %6, float* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 3, i32* %5
br label %7
7: ; preds = %32, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 17
br i1 %9, label %10, label %35
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load float, float* %2
%15 = load i32, i32* %5
%16 = call i32 @pow(float %14, i32 %15)
%17 = load i32, i32* %5
%18 = sdiv i32 %16, %17
%19 = sitofp i32 %18 to float
%20 = load float, float* %3
%21 = fsub float %20, %19
store float %21, float* %3
store i32 1, i32* %4
br label %31
22: ; preds = %10
%23 = load float, float* %2
%24 = load i32, i32* %5
%25 = call i32 @pow(float %23, i32 %24)
%26 = load i32, i32* %5
%27 = sdiv i32 %25, %26
%28 = sitofp i32 %27 to float
%29 = load float, float* %3
%30 = fadd float %29, %28
store float %30, float* %3
store i32 0, i32* %4
br label %31
31: ; preds = %22, %13
br label %32
32: ; preds = %31
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 2
store i32 %34, i32* %5
br label %7
35: ; preds = %7
%36 = load float, float* %3
ret float %36
}

LLVM IR (-O2):
define float @atan(float %0) {
%2 = tail call i32 @pow(float %0, i32 3)
%3 = sdiv i32 %2, 3
%4 = sitofp i32 %3 to float
%5 = fsub float %0, %4
%6 = tail call i32 @pow(float %0, i32 5)
%7 = sdiv i32 %6, 5
%8 = sitofp i32 %7 to float
%9 = fadd float %5, %8
%10 = tail call i32 @pow(float %0, i32 7)
%11 = sdiv i32 %10, 7
%12 = sitofp i32 %11 to float
%13 = fsub float %9, %12
%14 = tail call i32 @pow(float %0, i32 9)
%15 = sdiv i32 %14, 9
%16 = sitofp i32 %15 to float
%17 = fadd float %13, %16
%18 = tail call i32 @pow(float %0, i32 11)
%19 = sdiv i32 %18, 11
%20 = sitofp i32 %19 to float
%21 = fsub float %17, %20
%22 = tail call i32 @pow(float %0, i32 13)
%23 = sdiv i32 %22, 13
%24 = sitofp i32 %23 to float
%25 = fadd float %21, %24
%26 = tail call i32 @pow(float %0, i32 15)
%27 = sdiv i32 %26, 15
%28 = sitofp i32 %27 to float
%29 = fsub float %25, %28
ret float %29
}