#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(double, int);
double atan(double x) {
  double y = 0;
  for (unsigned int i = 0; i != 8; i++)
    y += _pow(-1, i) / (2 * i + 1) * _pow(x, 2 * i + 1);
  return y;
}


x86 assembly (clang, -O0):
<atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
je     1185 <atan+0x75>
mov    -0x14(%rbp),%edi
movsd  0xebf(%rip),%xmm0
call   1030 <_pow@plt>
mov    -0x14(%rbp),%edx
mov    %edx,%ecx
lea    0x1(%rcx,%rcx,1),%edi
xor    %edx,%edx
div    %edi
mov    %eax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <_pow@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %rax,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112c <atan+0x1c>
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xedd(%rip),%xmm0
xor    %edi,%edi
call   1030 <_pow@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
mov    $0x1,%edi
call   1030 <_pow@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,(%rsp)
movsd  0xeac(%rip),%xmm0
mov    $0x1,%edi
call   1030 <_pow@plt>
mov    %eax,%eax
mov    $0xaaaaaaab,%ebx
imul   %rax,%rbx
shr    $0x21,%rbx
movsd  0x8(%rsp),%xmm0
mov    $0x3,%edi
call   1030 <_pow@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe66(%rip),%xmm0
mov    $0x2,%edi
call   1030 <_pow@plt>
mov    %eax,%eax
mov    $0xcccccccd,%ebx
imul   %rax,%rbx
shr    $0x22,%rbx
movsd  0x8(%rsp),%xmm0
mov    $0x5,%edi
call   1030 <_pow@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe20(%rip),%xmm0
mov    $0x3,%edi
call   1030 <_pow@plt>
mov    %eax,%ebx
mov    %eax,%eax
imul   $0x24924925,%rax,%rax
shr    $0x20,%rax
sub    %eax,%ebx
shr    %ebx
add    %eax,%ebx
shr    $0x2,%ebx
movsd  0x8(%rsp),%xmm0
mov    $0x7,%edi
call   1030 <_pow@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xdd1(%rip),%xmm0
mov    $0x4,%edi
call   1030 <_pow@plt>
mov    %eax,%eax
imul   $0x38e38e39,%rax,%rbx
shr    $0x21,%rbx
movsd  0x8(%rsp),%xmm0
mov    $0x9,%edi
call   1030 <_pow@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xd8d(%rip),%xmm0
mov    $0x5,%edi
call   1030 <_pow@plt>
mov    %eax,%eax
mov    $0xba2e8ba3,%ebx
imul   %rax,%rbx
shr    $0x23,%rbx
movsd  0x8(%rsp),%xmm0
mov    $0xb,%edi
call   1030 <_pow@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xd47(%rip),%xmm0
mov    $0x6,%edi
call   1030 <_pow@plt>
mov    %eax,%eax
imul   $0x4ec4ec4f,%rax,%rbx
shr    $0x22,%rbx
movsd  0x8(%rsp),%xmm0
mov    $0xd,%edi
call   1030 <_pow@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xd03(%rip),%xmm0
mov    $0x7,%edi
call   1030 <_pow@plt>
mov    %eax,%eax
mov    $0x88888889,%ebx
imul   %rax,%rbx
shr    $0x23,%rbx
movsd  0x8(%rsp),%xmm0
mov    $0xf,%edi
call   1030 <_pow@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @atan(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %2
store double 0.000000e+00, double* %3
store i32 0, i32* %4
br label %5
5: ; preds = %24, %1
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 8
br i1 %7, label %8, label %27
8: ; preds = %5
%9 = load i32, i32* %4
%10 = call i32 @_pow(double -1.000000e+00, i32 %9)
%11 = load i32, i32* %4
%12 = mul i32 2, %11
%13 = add i32 %12, 1
%14 = udiv i32 %10, %13
%15 = load double, double* %2
%16 = load i32, i32* %4
%17 = mul i32 2, %16
%18 = add i32 %17, 1
%19 = call i32 @_pow(double %15, i32 %18)
%20 = mul i32 %14, %19
%21 = uitofp i32 %20 to double
%22 = load double, double* %3
%23 = fadd double %22, %21
store double %23, double* %3
br label %24
24: ; preds = %8
%25 = load i32, i32* %4
%26 = add i32 %25, 1
store i32 %26, i32* %4
br label %5
27: ; preds = %5
%28 = load double, double* %3
ret double %28
}

LLVM IR (-O2):
define double @atan(double %0) {
%2 = tail call i32 @_pow(double -1.000000e+00, i32 0)
%3 = tail call i32 @_pow(double %0, i32 1)
%4 = mul i32 %3, %2
%5 = uitofp i32 %4 to double
%6 = tail call i32 @_pow(double -1.000000e+00, i32 1)
%7 = udiv i32 %6, 3
%8 = tail call i32 @_pow(double %0, i32 3)
%9 = mul i32 %8, %7
%10 = uitofp i32 %9 to double
%11 = fadd double %5, %10
%12 = tail call i32 @_pow(double -1.000000e+00, i32 2)
%13 = udiv i32 %12, 5
%14 = tail call i32 @_pow(double %0, i32 5)
%15 = mul i32 %14, %13
%16 = uitofp i32 %15 to double
%17 = fadd double %11, %16
%18 = tail call i32 @_pow(double -1.000000e+00, i32 3)
%19 = udiv i32 %18, 7
%20 = tail call i32 @_pow(double %0, i32 7)
%21 = mul i32 %20, %19
%22 = uitofp i32 %21 to double
%23 = fadd double %17, %22
%24 = tail call i32 @_pow(double -1.000000e+00, i32 4)
%25 = udiv i32 %24, 9
%26 = tail call i32 @_pow(double %0, i32 9)
%27 = mul i32 %26, %25
%28 = uitofp i32 %27 to double
%29 = fadd double %23, %28
%30 = tail call i32 @_pow(double -1.000000e+00, i32 5)
%31 = udiv i32 %30, 11
%32 = tail call i32 @_pow(double %0, i32 11)
%33 = mul i32 %32, %31
%34 = uitofp i32 %33 to double
%35 = fadd double %29, %34
%36 = tail call i32 @_pow(double -1.000000e+00, i32 6)
%37 = udiv i32 %36, 13
%38 = tail call i32 @_pow(double %0, i32 13)
%39 = mul i32 %38, %37
%40 = uitofp i32 %39 to double
%41 = fadd double %35, %40
%42 = tail call i32 @_pow(double -1.000000e+00, i32 7)
%43 = udiv i32 %42, 15
%44 = tail call i32 @_pow(double %0, i32 15)
%45 = mul i32 %44, %43
%46 = uitofp i32 %45 to double
%47 = fadd double %41, %46
ret double %47
}