#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 cbrt(double);
double sqrt(double);
double ln_solve_barker(double q, double t) {
  double G, Y, W;
  W = ((0.03649116245) / (q * sqrt(q))) * t;
  G = W / 2.0;
  Y = cbrt(G + sqrt(G * G + 1.0));
  return Y - 1.0 / Y;
}


x86 assembly (clang, -O0):
<ln_solve_barker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xeb9(%rip),%xmm0
divsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe96(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe65(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
addsd  %xmm1,%xmm0
call   1030 <cbrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe39(%rip),%xmm1
divsd  -0x20(%rbp),%xmm1
subsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_solve_barker>:
sub    $0x18,%rsp
movapd %xmm0,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
jb     113b <ln_solve_barker+0x1b>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1160 <ln_solve_barker+0x40>
movapd %xmm2,%xmm0
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
call   1040 <sqrt@plt>
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
xorpd  %xmm3,%xmm3
mulsd  %xmm2,%xmm0
movsd  0xe94(%rip),%xmm2
divsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
mulsd  0xe8c(%rip),%xmm2
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  0xe84(%rip),%xmm0
ucomisd %xmm3,%xmm0
jb     1198 <ln_solve_barker+0x78>
sqrtsd %xmm0,%xmm0
jmp    11a9 <ln_solve_barker+0x89>
movsd  %xmm2,0x8(%rsp)
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm2
addsd  %xmm2,%xmm0
call   1030 <cbrt@plt>
movsd  0xe5e(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ln_solve_barker(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
%8 = load double, double* %3
%9 = load double, double* %3
%10 = call double @sqrt(double %9)
%11 = fmul double %8, %10
%12 = fdiv double 0x3FA2AEF83AA1AD08, %11
%13 = load double, double* %4
%14 = fmul double %12, %13
store double %14, double* %7
%15 = load double, double* %7
%16 = fdiv double %15, 2.000000e+00
store double %16, double* %5
%17 = load double, double* %5
%18 = load double, double* %5
%19 = load double, double* %5
%20 = call double @llvm.fmuladd.f64(double %18, double %19, double 1.000000e+00)
%21 = call double @sqrt(double %20)
%22 = fadd double %17, %21
%23 = call double @cbrt(double %22)
store double %23, double* %6
%24 = load double, double* %6
%25 = load double, double* %6
%26 = fdiv double 1.000000e+00, %25
%27 = fsub double %24, %26
ret double %27
}

LLVM IR (-O2):
define double @ln_solve_barker(double %0, double %1) {
%3 = tail call double @sqrt(double %0)
%4 = fmul double %3, %0
%5 = fdiv double 0x3FA2AEF83AA1AD08, %4
%6 = fmul double %5, %1
%7 = fmul double %6, 5.000000e-01
%8 = tail call double @llvm.fmuladd.f64(double %7, double %7, double 1.000000e+00)
%9 = tail call double @sqrt(double %8)
%10 = fadd double %9, %7
%11 = tail call double @cbrt(double %10)
%12 = fdiv double 1.000000e+00, %11
%13 = fsub double %11, %12
ret double %13
}