#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 exp(double);
double pow(double, double);
void clccurve_coefs(int nhops, double crv, double *bbp, double *mmp) {
  if (nhops > 0) {
    double hh, ff, eff, gh;
    if (crv < 0) {
      if (crv < -1.)
        crv = -1.;
      hh = pow(((1e-20 - crv) * 1.2), 0.41) * 0.91;
      ff = hh / (1. - hh);
      eff = exp(ff) - 1.;
      gh = (exp(ff * .5) - 1.) / eff;
      *bbp = gh * (gh / (1. - (gh + gh)));
      *mmp = 1. / (((exp(ff * (1. / (double)nhops)) - 1.) / (eff * *bbp)) + 1.);
      *bbp += 1.;
    } else {
      if (crv > 1.)
        crv = 1.;
      hh = pow(((crv + 1e-20) * 1.2), 0.41) * 0.91;
      ff = hh / (1. - hh);
      eff = exp(ff) - 1.;
      gh = (exp(ff * .5) - 1.) / eff;
      *bbp = gh * (gh / (1. - (gh + gh)));
      *mmp = ((exp(ff * (1. / (double)nhops)) - 1.) / (eff * *bbp)) + 1.;
    }
  } else if (crv < 0)
    *bbp = 2., *mmp = 1.;
  else
    *bbp = *mmp = 1.;
}


x86 assembly (clang, -O0):
<clccurve_coefs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1400 <clccurve_coefs+0x2e0>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    12b6 <clccurve_coefs+0x196>
movsd  0xee0(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1170 <clccurve_coefs+0x50>
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeb8(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8f(%rip),%xmm1
call   1040 <pow@plt>
movsd  0xe7a(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe4c(%rip),%xmm1
subsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe28(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe27(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe01(%rip),%xmm1
subsd  %xmm1,%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm3
addsd  -0x40(%rbp),%xmm3
movsd  0xdd7(%rip),%xmm2
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm2
movsd  0xdb1(%rip),%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd98(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mulsd  (%rax),%xmm0
divsd  %xmm0,%xmm1
movsd  0xd7b(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xd6f(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xd57(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    13fb <clccurve_coefs+0x2db>
movsd  -0x10(%rbp),%xmm0
movsd  0xd3d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12da <clccurve_coefs+0x1ba>
movsd  0xd2b(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xd4e(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xd39(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd25(%rip),%xmm1
call   1040 <pow@plt>
movsd  0xd10(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xce2(%rip),%xmm1
subsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xcbe(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xcbd(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xc97(%rip),%xmm1
subsd  %xmm1,%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm3
addsd  -0x40(%rbp),%xmm3
movsd  0xc6d(%rip),%xmm2
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm2
movsd  0xc47(%rip),%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xc2e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
mov    -0x18(%rbp),%rax
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  0xc11(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1458 <clccurve_coefs+0x338>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1433 <clccurve_coefs+0x313>
mov    -0x18(%rbp),%rax
movsd  0xbee(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xbd6(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1453 <clccurve_coefs+0x333>
mov    -0x20(%rbp),%rax
movsd  0xbc1(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xbb1(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1458 <clccurve_coefs+0x338>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clccurve_coefs>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
test   %edi,%edi
jle    1255 <clccurve_coefs+0x135>
mov    %edi,%ebp
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1282 <clccurve_coefs+0x162>
movsd  0xeda(%rip),%xmm1
maxsd  %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  0xeaa(%rip),%xmm0
movsd  0xeaa(%rip),%xmm1
call   1040 <pow@plt>
mulsd  0xea5(%rip),%xmm0
movsd  0xe7d(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xe84(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xe7e(%rip),%xmm0
mulsd  (%rsp),%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xe5d(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe1f(%rip),%xmm3
movapd %xmm3,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm0,%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movapd %xmm3,%xmm0
divsd  %xmm1,%xmm0
mulsd  (%rsp),%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  (%rbx),%xmm1
addsd  0xdfd(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xdc9(%rip),%xmm2
addsd  %xmm2,%xmm0
movapd %xmm2,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
addsd  (%rbx),%xmm2
movsd  %xmm2,(%rbx)
jmp    138a <clccurve_coefs+0x26a>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    137a <clccurve_coefs+0x25a>
movabs $0x4000000000000000,%rax
mov    %rax,(%rbx)
movabs $0x3ff0000000000000,%rax
mov    %rax,(%r14)
jmp    138a <clccurve_coefs+0x26a>
movsd  0xd76(%rip),%xmm2
minsd  %xmm0,%xmm2
addsd  0xd72(%rip),%xmm2
mulsd  0xd72(%rip),%xmm2
movsd  0xd72(%rip),%xmm1
movapd %xmm2,%xmm0
call   1040 <pow@plt>
mulsd  0xd69(%rip),%xmm0
movsd  0xd41(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xd48(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xd42(%rip),%xmm0
mulsd  (%rsp),%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xd21(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  0xce3(%rip),%xmm3
movapd %xmm3,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm0,%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movapd %xmm3,%xmm0
divsd  %xmm1,%xmm0
mulsd  (%rsp),%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  (%rbx),%xmm1
addsd  0xcc1(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xc8d(%rip),%xmm0
movsd  %xmm0,(%r14)
jmp    138a <clccurve_coefs+0x26a>
movabs $0x3ff0000000000000,%rax
mov    %rax,(%r14)
mov    %rax,(%rbx)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @clccurve_coefs(i32 %0, double %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%13 = load i32, i32* %5
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %121
15: ; preds = %4
%16 = load double, double* %6
%17 = fcmp olt double %16, 0.000000e+00
br i1 %17, label %18, label %71
18: ; preds = %15
%19 = load double, double* %6
%20 = fcmp olt double %19, -1.000000e+00
br i1 %20, label %21, label %22
21: ; preds = %18
store double -1.000000e+00, double* %6
br label %22
22: ; preds = %21, %18
%23 = load double, double* %6
%24 = fsub double 0x3BC79CA10C924223, %23
%25 = fmul double %24, 1.200000e+00
%26 = call double @pow(double %25, double 4.100000e-01)
%27 = fmul double %26, 9.100000e-01
store double %27, double* %9
%28 = load double, double* %9
%29 = load double, double* %9
%30 = fsub double 1.000000e+00, %29
%31 = fdiv double %28, %30
store double %31, double* %10
%32 = load double, double* %10
%33 = call i32 @exp(double %32)
%34 = sitofp i32 %33 to double
%35 = fsub double %34, 1.000000e+00
store double %35, double* %11
%36 = load double, double* %10
%37 = fmul double %36, 5.000000e-01
%38 = call i32 @exp(double %37)
%39 = sitofp i32 %38 to double
%40 = fsub double %39, 1.000000e+00
%41 = load double, double* %11
%42 = fdiv double %40, %41
store double %42, double* %12
%43 = load double, double* %12
%44 = load double, double* %12
%45 = load double, double* %12
%46 = load double, double* %12
%47 = fadd double %45, %46
%48 = fsub double 1.000000e+00, %47
%49 = fdiv double %44, %48
%50 = fmul double %43, %49
%51 = load double*, double** %7
store double %50, double* %51
%52 = load double, double* %10
%53 = load i32, i32* %5
%54 = sitofp i32 %53 to double
%55 = fdiv double 1.000000e+00, %54
%56 = fmul double %52, %55
%57 = call i32 @exp(double %56)
%58 = sitofp i32 %57 to double
%59 = fsub double %58, 1.000000e+00
%60 = load double, double* %11
%61 = load double*, double** %7
%62 = load double, double* %61
%63 = fmul double %60, %62
%64 = fdiv double %59, %63
%65 = fadd double %64, 1.000000e+00
%66 = fdiv double 1.000000e+00, %65
%67 = load double*, double** %8
store double %66, double* %67
%68 = load double*, double** %7
%69 = load double, double* %68
%70 = fadd double %69, 1.000000e+00
store double %70, double* %68
br label %120
71: ; preds = %15
%72 = load double, double* %6
%73 = fcmp ogt double %72, 1.000000e+00
br i1 %73, label %74, label %75
74: ; preds = %71
store double 1.000000e+00, double* %6
br label %75
75: ; preds = %74, %71
%76 = load double, double* %6
%77 = fadd double %76, 0x3BC79CA10C924223
%78 = fmul double %77, 1.200000e+00
%79 = call double @pow(double %78, double 4.100000e-01)
%80 = fmul double %79, 9.100000e-01
store double %80, double* %9
%81 = load double, double* %9
%82 = load double, double* %9
%83 = fsub double 1.000000e+00, %82
%84 = fdiv double %81, %83
store double %84, double* %10
%85 = load double, double* %10
%86 = call i32 @exp(double %85)
%87 = sitofp i32 %86 to double
%88 = fsub double %87, 1.000000e+00
store double %88, double* %11
%89 = load double, double* %10
%90 = fmul double %89, 5.000000e-01
%91 = call i32 @exp(double %90)
%92 = sitofp i32 %91 to double
%93 = fsub double %92, 1.000000e+00
%94 = load double, double* %11
%95 = fdiv double %93, %94
store double %95, double* %12
%96 = load double, double* %12
%97 = load double, double* %12
%98 = load double, double* %12
%99 = load double, double* %12
%100 = fadd double %98, %99
%101 = fsub double 1.000000e+00, %100
%102 = fdiv double %97, %101
%103 = fmul double %96, %102
%104 = load double*, double** %7
store double %103, double* %104
%105 = load double, double* %10
%106 = load i32, i32* %5
%107 = sitofp i32 %106 to double
%108 = fdiv double 1.000000e+00, %107
%109 = fmul double %105, %108
%110 = call i32 @exp(double %109)
%111 = sitofp i32 %110 to double
%112 = fsub double %111, 1.000000e+00
%113 = load double, double* %11
%114 = load double*, double** %7
%115 = load double, double* %114
%116 = fmul double %113, %115
%117 = fdiv double %112, %116
%118 = fadd double %117, 1.000000e+00
%119 = load double*, double** %8
store double %118, double* %119
br label %120
120: ; preds = %75, %22
br label %131
121: ; preds = %4
%122 = load double, double* %6
%123 = fcmp olt double %122, 0.000000e+00
br i1 %123, label %124, label %127
124: ; preds = %121
%125 = load double*, double** %7
store double 2.000000e+00, double* %125
%126 = load double*, double** %8
store double 1.000000e+00, double* %126
br label %130
127: ; preds = %121
%128 = load double*, double** %8
store double 1.000000e+00, double* %128
%129 = load double*, double** %7
store double 1.000000e+00, double* %129
br label %130
130: ; preds = %127, %124
br label %131
131: ; preds = %130, %120
ret void
}

LLVM IR (-O2):
define void @clccurve_coefs(i32 %0, double %1, double* nocapture %2, double* nocapture writeonly %3) {
%5 = icmp sgt i32 %0, 0
%6 = fcmp olt double %1, 0.000000e+00
br i1 %5, label %7, label %73
7: ; preds = %4
br i1 %6, label %8, label %42
8: ; preds = %7
%9 = fcmp olt double %1, -1.000000e+00
%10 = select i1 %9, double -1.000000e+00, double %1
%11 = fsub double 0x3BC79CA10C924223, %10
%12 = fmul double %11, 1.200000e+00
%13 = tail call double @pow(double %12, double 4.100000e-01)
%14 = fmul double %13, 9.100000e-01
%15 = fsub double 1.000000e+00, %14
%16 = fdiv double %14, %15
%17 = tail call i32 @exp(double %16)
%18 = sitofp i32 %17 to double
%19 = fadd double %18, -1.000000e+00
%20 = fmul double %16, 5.000000e-01
%21 = tail call i32 @exp(double %20)
%22 = sitofp i32 %21 to double
%23 = fadd double %22, -1.000000e+00
%24 = fdiv double %23, %19
%25 = fadd double %24, %24
%26 = fsub double 1.000000e+00, %25
%27 = fdiv double %24, %26
%28 = fmul double %24, %27
store double %28, double* %2
%29 = sitofp i32 %0 to double
%30 = fdiv double 1.000000e+00, %29
%31 = fmul double %30, %16
%32 = tail call i32 @exp(double %31)
%33 = sitofp i32 %32 to double
%34 = fadd double %33, -1.000000e+00
%35 = load double, double* %2
%36 = fmul double %19, %35
%37 = fdiv double %34, %36
%38 = fadd double %37, 1.000000e+00
%39 = fdiv double 1.000000e+00, %38
store double %39, double* %3
%40 = load double, double* %2
%41 = fadd double %40, 1.000000e+00
store double %41, double* %2
br label %76
42: ; preds = %7
%43 = fcmp ogt double %1, 1.000000e+00
%44 = select i1 %43, double 1.000000e+00, double %1
%45 = fadd double %44, 0x3BC79CA10C924223
%46 = fmul double %45, 1.200000e+00
%47 = tail call double @pow(double %46, double 4.100000e-01)
%48 = fmul double %47, 9.100000e-01
%49 = fsub double 1.000000e+00, %48
%50 = fdiv double %48, %49
%51 = tail call i32 @exp(double %50)
%52 = sitofp i32 %51 to double
%53 = fadd double %52, -1.000000e+00
%54 = fmul double %50, 5.000000e-01
%55 = tail call i32 @exp(double %54)
%56 = sitofp i32 %55 to double
%57 = fadd double %56, -1.000000e+00
%58 = fdiv double %57, %53
%59 = fadd double %58, %58
%60 = fsub double 1.000000e+00, %59
%61 = fdiv double %58, %60
%62 = fmul double %58, %61
store double %62, double* %2
%63 = sitofp i32 %0 to double
%64 = fdiv double 1.000000e+00, %63
%65 = fmul double %64, %50
%66 = tail call i32 @exp(double %65)
%67 = sitofp i32 %66 to double
%68 = fadd double %67, -1.000000e+00
%69 = load double, double* %2
%70 = fmul double %53, %69
%71 = fdiv double %68, %70
%72 = fadd double %71, 1.000000e+00
store double %72, double* %3
br label %76
73: ; preds = %4
br i1 %6, label %74, label %75
74: ; preds = %73
store double 2.000000e+00, double* %2
store double 1.000000e+00, double* %3
br label %76
75: ; preds = %73
store double 1.000000e+00, double* %3
store double 1.000000e+00, double* %2
br label %76
76: ; preds = %8, %42, %74, %75
ret void
}