#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 */
double xatan(double);
double satan(double arg) {
  if (arg < .414213562373095048802e0)
    return xatan(arg);
  if (arg > 2.414213562373095048802e0)
    return 1.570796326794896619231e0 - xatan(1.0 / arg);
  return .785398163397448309615e0 + xatan((arg - 1.0) / (arg + 1.0));
}


x86 assembly (clang, -O0):
<satan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1144 <satan+0x34>
movsd  -0x10(%rbp),%xmm0
call   1030 <xatan@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11c1 <satan+0xb1>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1186 <satan+0x76>
movsd  0xeb5(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <xatan@plt>
movaps %xmm0,%xmm1
movsd  0xea8(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11c1 <satan+0xb1>
movsd  -0x10(%rbp),%xmm0
movsd  0xe85(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe79(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <xatan@plt>
movaps %xmm0,%xmm1
movsd  0xe58(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<satan>:
push   %rax
movsd  0xee7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1125 <satan+0x15>
pop    %rax
jmp    1030 <xatan@plt>
ucomisd 0xedb(%rip),%xmm0
jbe    1156 <satan+0x46>
movsd  0xee1(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <xatan@plt>
movapd %xmm0,%xmm1
movsd  0xed8(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rax
ret
movsd  0xeb2(%rip),%xmm1
addsd  %xmm0,%xmm1
addsd  0xeae(%rip),%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <xatan@plt>
addsd  0xea1(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @satan(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0x3FDA827999FCEF32
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @xatan(double %7)
store double %8, double* %2
br label %25
9: ; preds = %1
%10 = load double, double* %3
%11 = fcmp ogt double %10, 0x4003504F333F9DE6
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load double, double* %3
%14 = fdiv double 1.000000e+00, %13
%15 = call double @xatan(double %14)
%16 = fsub double 0x3FF921FB54442D18, %15
store double %16, double* %2
br label %25
17: ; preds = %9
%18 = load double, double* %3
%19 = fsub double %18, 1.000000e+00
%20 = load double, double* %3
%21 = fadd double %20, 1.000000e+00
%22 = fdiv double %19, %21
%23 = call double @xatan(double %22)
%24 = fadd double 0x3FE921FB54442D18, %23
store double %24, double* %2
br label %25
25: ; preds = %17, %12, %6
%26 = load double, double* %2
ret double %26
}

LLVM IR (-O2):
define double @satan(double %0) {
%2 = fcmp olt double %0, 0x3FDA827999FCEF32
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @xatan(double %0)
br label %17
5: ; preds = %1
%6 = fcmp ogt double %0, 0x4003504F333F9DE6
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = fdiv double 1.000000e+00, %0
%9 = tail call double @xatan(double %8)
%10 = fsub double 0x3FF921FB54442D18, %9
br label %17
11: ; preds = %5
%12 = fadd double %0, -1.000000e+00
%13 = fadd double %0, 1.000000e+00
%14 = fdiv double %12, %13
%15 = tail call double @xatan(double %14)
%16 = fadd double %15, 0x3FE921FB54442D18
br label %17
17: ; preds = %11, %7, %3
%18 = phi double [ %4, %3 ], [ %10, %7 ], [ %16, %11 ]
ret double %18
}