#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 atan(double);
double cbrt(int);
int fabs(double);
double nan(char *);
int tan(int);
double ln_solve_hyp_barker(double Q1, double G, double t) {
  double S, S0, S1, Y, G1, Q2, Q3, Z1, F;
  int Z, L;
  Q2 = Q1 * t;
  S = 2 / (3 * fabs(Q2));
  S = 2 / tan(2 * atan(cbrt(tan(atan(S) / 2))));
  if (t < 0)
    S = -S;
  L = 0;
  do {
    S0 = S;
    Z = 1;
    Y = S * S;
    G1 = -Y * S;
    Q3 = Q2 + 2.0 * G * S * Y / 3.0;
  next_z:
    Z++;
    G1 = -G1 * G * Y;
    Z1 = (Z - (Z + 1) * G) / (2.0 * Z + 1.0);
    F = Z1 * G1;
    Q3 = Q3 + F;
    if (Z > 100 || fabs(F) > 10000)
      return nan("0");
    if (fabs(F) > 1e-10)
      goto next_z;
    L++;
    if (L > 100)
      return nan("0");
    do {
      S1 = S;
      S = (2 * S * S * S / 3 + Q3) / (S * S + 1);
    } while (fabs(S - S1) > 1e-10);
  } while (fabs(S - S0) > 1e-10);
  return S;
}


x86 assembly (clang, -O0):
<ln_solve_hyp_barker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1040 <fabs@plt>
imul   $0x3,%eax,%ecx
mov    $0x2,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <atan@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1060 <tan@plt>
mov    %eax,%edi
call   1070 <cbrt@plt>
call   1050 <atan@plt>
mov    %eax,%edi
shl    $0x1,%edi
call   1060 <tan@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1205 <ln_solve_hyp_barker+0xb5>
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x6c(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0xda9(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
movsd  0xd8a(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl -0x6c(%rbp),%xmm1
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x18(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x6c(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xd15(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
cmpl   $0x64,-0x6c(%rbp)
jg     1345 <ln_solve_hyp_barker+0x1f5>
movsd  -0x68(%rbp),%xmm0
call   1040 <fabs@plt>
cmp    $0x2710,%eax
jle    135b <ln_solve_hyp_barker+0x20b>
lea    0xcd4(%rip),%rdi
call   1030 <nan@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    145c <ln_solve_hyp_barker+0x30c>
movsd  -0x68(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xca7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1380 <ln_solve_hyp_barker+0x230>
jmp    1283 <ln_solve_hyp_barker+0x133>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
cmpl   $0x64,-0x70(%rbp)
jle    13a9 <ln_solve_hyp_barker+0x259>
lea    0xc86(%rip),%rdi
call   1030 <nan@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    145c <ln_solve_hyp_barker+0x30c>
jmp    13ae <ln_solve_hyp_barker+0x25e>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xc48(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xc29(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xc1a(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xbfa(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     13ae <ln_solve_hyp_barker+0x25e>
jmp    142d <ln_solve_hyp_barker+0x2dd>
movsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xbd0(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     120c <ln_solve_hyp_barker+0xbc>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_solve_hyp_barker>:
push   %rbp
push   %rbx
sub    $0x68,%rsp
movapd %xmm2,0x30(%rsp)
movsd  %xmm1,0x28(%rsp)
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x20(%rsp)
call   1040 <fabs@plt>
lea    (%rax,%rax,2),%ecx
xor    %ebp,%ebp
mov    $0x2,%eax
xor    %edx,%edx
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1050 <atan@plt>
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
call   1060 <tan@plt>
mov    %eax,%edi
call   1070 <cbrt@plt>
call   1050 <atan@plt>
lea    (%rax,%rax,1),%edi
call   1060 <tan@plt>
movsd  0x20(%rsp),%xmm8
mov    %eax,%ecx
mov    $0x2,%eax
xor    %edx,%edx
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd 0xe32(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd 0x30(%rsp),%xmm3
cmpltsd %xmm2,%xmm3
movapd %xmm3,%xmm2
andnpd %xmm0,%xmm2
andpd  %xmm1,%xmm3
orpd   %xmm2,%xmm3
movapd %xmm3,%xmm5
movsd  0x28(%rsp),%xmm1
addsd  %xmm1,%xmm1
movapd 0xdf9(%rip),%xmm2
movsd  0xe01(%rip),%xmm3
movsd  0xe01(%rip),%xmm4
movsd  %xmm1,0x40(%rsp)
movapd %xmm5,%xmm6
mulsd  %xmm5,%xmm6
movapd %xmm6,%xmm7
xorpd  %xmm2,%xmm7
mulsd  %xmm5,%xmm7
movapd %xmm7,0x10(%rsp)
movapd %xmm5,0x30(%rsp)
mulsd  %xmm5,%xmm1
movapd %xmm6,0x50(%rsp)
mulsd  %xmm6,%xmm1
divsd  %xmm3,%xmm1
addsd  %xmm8,%xmm1
movsd  %xmm1,0x8(%rsp)
mov    $0x3,%ebx
nop
lea    -0x1(%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm0,%xmm5
addsd  %xmm0,%xmm5
addsd  %xmm4,%xmm5
cmp    $0x66,%ebx
je     13bc <ln_solve_hyp_barker+0x26c>
movapd 0x10(%rsp),%xmm3
xorpd  %xmm2,%xmm3
movsd  0x28(%rsp),%xmm2
mulsd  %xmm2,%xmm3
mulsd  0x50(%rsp),%xmm3
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
mulsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
divsd  %xmm5,%xmm0
movapd %xmm3,0x10(%rsp)
mulsd  %xmm3,%xmm0
movsd  %xmm0,0x48(%rsp)
call   1040 <fabs@plt>
movsd  0x48(%rsp),%xmm1
cmp    $0x2710,%eax
jg     13bc <ln_solve_hyp_barker+0x26c>
movsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
call   1040 <fabs@plt>
movapd 0xd0d(%rip),%xmm2
add    $0x1,%ebx
test   %eax,%eax
movsd  0xd18(%rip),%xmm4
jg     1260 <ln_solve_hyp_barker+0x110>
cmp    $0x64,%ebp
je     13bc <ln_solve_hyp_barker+0x26c>
add    $0x1,%ebp
movapd 0x30(%rsp),%xmm2
nopl   0x0(%rax,%rax,1)
movapd %xmm2,%xmm1
addsd  %xmm2,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
divsd  0xcd8(%rip),%xmm2
addsd  0x8(%rsp),%xmm2
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xcca(%rip),%xmm0
divsd  %xmm0,%xmm2
movsd  %xmm2,0x10(%rsp)
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
movsd  0x10(%rsp),%xmm2
test   %eax,%eax
jg     1320 <ln_solve_hyp_barker+0x1d0>
movapd %xmm2,%xmm0
subsd  0x30(%rsp),%xmm0
call   1040 <fabs@plt>
movsd  0x10(%rsp),%xmm0
movapd %xmm0,%xmm5
test   %eax,%eax
movsd  0x20(%rsp),%xmm8
movsd  0x40(%rsp),%xmm1
movapd 0xc61(%rip),%xmm2
movsd  0xc69(%rip),%xmm3
movsd  0xc69(%rip),%xmm4
jg     121d <ln_solve_hyp_barker+0xcd>
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xc5d(%rip),%rdi
add    $0x68,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <nan@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
define double @ln_solve_hyp_barker(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca i32
%18 = alloca i32
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%19 = load double, double* %5
%20 = load double, double* %7
%21 = fmul double %19, %20
store double %21, double* %13
%22 = load double, double* %13
%23 = call i32 @fabs(double %22)
%24 = mul nsw i32 3, %23
%25 = sdiv i32 2, %24
%26 = sitofp i32 %25 to double
store double %26, double* %8
%27 = load double, double* %8
%28 = call i32 @atan(double %27)
%29 = sdiv i32 %28, 2
%30 = call i32 @tan(i32 %29)
%31 = call double @cbrt(i32 %30)
%32 = call i32 @atan(double %31)
%33 = mul nsw i32 2, %32
%34 = call i32 @tan(i32 %33)
%35 = sdiv i32 2, %34
%36 = sitofp i32 %35 to double
store double %36, double* %8
%37 = load double, double* %7
%38 = fcmp olt double %37, 0.000000e+00
br i1 %38, label %39, label %42
39: ; preds = %3
%40 = load double, double* %8
%41 = fneg double %40
store double %41, double* %8
br label %42
42: ; preds = %39, %3
store i32 0, i32* %18
br label %43
43: ; preds = %133, %42
%44 = load double, double* %8
store double %44, double* %9
store i32 1, i32* %17
%45 = load double, double* %8
%46 = load double, double* %8
%47 = fmul double %45, %46
store double %47, double* %11
%48 = load double, double* %11
%49 = fneg double %48
%50 = load double, double* %8
%51 = fmul double %49, %50
store double %51, double* %12
%52 = load double, double* %13
%53 = load double, double* %6
%54 = fmul double 2.000000e+00, %53
%55 = load double, double* %8
%56 = fmul double %54, %55
%57 = load double, double* %11
%58 = fmul double %56, %57
%59 = fdiv double %58, 3.000000e+00
%60 = fadd double %52, %59
store double %60, double* %14
br label %61
61: ; preds = %101, %43
%62 = load i32, i32* %17
%63 = add nsw i32 %62, 1
store i32 %63, i32* %17
%64 = load double, double* %12
%65 = fneg double %64
%66 = load double, double* %6
%67 = fmul double %65, %66
%68 = load double, double* %11
%69 = fmul double %67, %68
store double %69, double* %12
%70 = load i32, i32* %17
%71 = sitofp i32 %70 to double
%72 = load i32, i32* %17
%73 = add nsw i32 %72, 1
%74 = sitofp i32 %73 to double
%75 = load double, double* %6
%76 = fneg double %74
%77 = call double @llvm.fmuladd.f64(double %76, double %75, double %71)
%78 = load i32, i32* %17
%79 = sitofp i32 %78 to double
%80 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %79, double 1.000000e+00)
%81 = fdiv double %77, %80
store double %81, double* %15
%82 = load double, double* %15
%83 = load double, double* %12
%84 = fmul double %82, %83
store double %84, double* %16
%85 = load double, double* %14
%86 = load double, double* %16
%87 = fadd double %85, %86
store double %87, double* %14
%88 = load i32, i32* %17
%89 = icmp sgt i32 %88, 100
br i1 %89, label %94, label %90
90: ; preds = %61
%91 = load double, double* %16
%92 = call i32 @fabs(double %91)
%93 = icmp sgt i32 %92, 10000
br i1 %93, label %94, label %96
94: ; preds = %90, %61
%95 = call double @nan(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store double %95, double* %4
br label %142
96: ; preds = %90
%97 = load double, double* %16
%98 = call i32 @fabs(double %97)
%99 = sitofp i32 %98 to double
%100 = fcmp ogt double %99, 1.000000e-10
br i1 %100, label %101, label %102
101: ; preds = %96
br label %61
102: ; preds = %96
%103 = load i32, i32* %18
%104 = add nsw i32 %103, 1
store i32 %104, i32* %18
%105 = load i32, i32* %18
%106 = icmp sgt i32 %105, 100
br i1 %106, label %107, label %109
107: ; preds = %102
%108 = call double @nan(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store double %108, double* %4
br label %142
109: ; preds = %102
br label %110
110: ; preds = %125, %109
%111 = load double, double* %8
store double %111, double* %10
%112 = load double, double* %8
%113 = fmul double 2.000000e+00, %112
%114 = load double, double* %8
%115 = fmul double %113, %114
%116 = load double, double* %8
%117 = fmul double %115, %116
%118 = fdiv double %117, 3.000000e+00
%119 = load double, double* %14
%120 = fadd double %118, %119
%121 = load double, double* %8
%122 = load double, double* %8
%123 = call double @llvm.fmuladd.f64(double %121, double %122, double 1.000000e+00)
%124 = fdiv double %120, %123
store double %124, double* %8
br label %125
125: ; preds = %110
%126 = load double, double* %8
%127 = load double, double* %10
%128 = fsub double %126, %127
%129 = call i32 @fabs(double %128)
%130 = sitofp i32 %129 to double
%131 = fcmp ogt double %130, 1.000000e-10
br i1 %131, label %110, label %132
132: ; preds = %125
br label %133
133: ; preds = %132
%134 = load double, double* %8
%135 = load double, double* %9
%136 = fsub double %134, %135
%137 = call i32 @fabs(double %136)
%138 = sitofp i32 %137 to double
%139 = fcmp ogt double %138, 1.000000e-10
br i1 %139, label %43, label %140
140: ; preds = %133
%141 = load double, double* %8
store double %141, double* %4
br label %142
142: ; preds = %140, %107, %94
%143 = load double, double* %4
ret double %143
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define double @ln_solve_hyp_barker(double %0, double %1, double %2) {
%4 = fmul double %0, %2
%5 = tail call i32 @fabs(double %4)
%6 = mul nsw i32 %5, 3
%7 = sdiv i32 2, %6
%8 = sitofp i32 %7 to double
%9 = tail call i32 @atan(double %8)
%10 = sdiv i32 %9, 2
%11 = tail call i32 @tan(i32 %10)
%12 = tail call double @cbrt(i32 %11)
%13 = tail call i32 @atan(double %12)
%14 = shl nsw i32 %13, 1
%15 = tail call i32 @tan(i32 %14)
%16 = sdiv i32 2, %15
%17 = sitofp i32 %16 to double
%18 = fcmp olt double %2, 0.000000e+00
%19 = fneg double %17
%20 = select i1 %18, double %19, double %17
%21 = fmul double %1, 2.000000e+00
br label %22
22: ; preds = %71, %3
%23 = phi double [ %20, %3 ], [ %67, %71 ]
%24 = phi i32 [ 0, %3 ], [ %57, %71 ]
%25 = fmul double %23, %23
%26 = fneg double %25
%27 = fmul double %23, %26
%28 = fmul double %21, %23
%29 = fmul double %28, %25
%30 = fdiv double %29, 3.000000e+00
%31 = fadd double %4, %30
br label %32
32: ; preds = %53, %22
%33 = phi double [ %27, %22 ], [ %39, %53 ]
%34 = phi double [ %31, %22 ], [ %48, %53 ]
%35 = phi i32 [ 1, %22 ], [ %36, %53 ]
%36 = add nuw nsw i32 %35, 1
%37 = fneg double %33
%38 = fmul double %37, %1
%39 = fmul double %25, %38
%40 = sitofp i32 %36 to double
%41 = add nuw nsw i32 %35, 2
%42 = sitofp i32 %41 to double
%43 = fneg double %42
%44 = tail call double @llvm.fmuladd.f64(double %43, double %1, double %40)
%45 = tail call double @llvm.fmuladd.f64(double %40, double 2.000000e+00, double 1.000000e+00)
%46 = fdiv double %44, %45
%47 = fmul double %39, %46
%48 = fadd double %34, %47
%49 = icmp eq i32 %35, 100
br i1 %49, label %75, label %50
50: ; preds = %32
%51 = tail call i32 @fabs(double %47)
%52 = icmp sgt i32 %51, 10000
br i1 %52, label %75, label %53
53: ; preds = %50
%54 = tail call i32 @fabs(double %47)
%55 = icmp sgt i32 %54, 0
br i1 %55, label %32, label %56
56: ; preds = %53
%57 = add nuw nsw i32 %24, 1
%58 = icmp eq i32 %24, 100
br i1 %58, label %75, label %59
59: ; preds = %56, %59
%60 = phi double [ %67, %59 ], [ %23, %56 ]
%61 = fmul double %60, 2.000000e+00
%62 = fmul double %60, %61
%63 = fmul double %60, %62
%64 = fdiv double %63, 3.000000e+00
%65 = fadd double %48, %64
%66 = tail call double @llvm.fmuladd.f64(double %60, double %60, double 1.000000e+00)
%67 = fdiv double %65, %66
%68 = fsub double %67, %60
%69 = tail call i32 @fabs(double %68)
%70 = icmp sgt i32 %69, 0
br i1 %70, label %59, label %71
71: ; preds = %59
%72 = fsub double %67, %23
%73 = tail call i32 @fabs(double %72)
%74 = icmp sgt i32 %73, 0
br i1 %74, label %22, label %77
75: ; preds = %56, %32, %50
%76 = tail call double @nan(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %77
77: ; preds = %71, %75
%78 = phi double [ %76, %75 ], [ %67, %71 ]
ret double %78
}