#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 log10(float);
double pow(double, double);
double sqrt(double);
float optd1(int n, float delt2, float df) {
  double e1, e2, e3, g1, g2, g3, delt1, beta;
  e1 = (5.309e-3) * log10(delt2) + (-2.66e-3);
  e2 = (7.114e-2) * log10(delt2) + (-5.941e-1);
  e3 = (-4.761e-1) * log10(delt2) + (-4.278e-1);
  g1 = (11.01217) - (0.51244) * log10(delt2);
  g2 = (e2 - (0.51244) * df * df) / e1;
  g3 = (e3 - g1 * df * df - (n - 1) * df) / e1;
  beta = (-g2 / 2.0 + sqrt(g2 * g2 / 4.0 - g3));
  if (beta > 0)
    beta = (-g2 / 2.0 - sqrt(g2 * g2 / 4.0 - g3));
  delt1 = pow(10.0, beta);
  return (float)delt1;
}


x86 assembly (clang, -O0):
<optd1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <log10@plt>
movsd  0xef1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeed(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <log10@plt>
movsd  0xeba(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <log10@plt>
movsd  0xe83(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <log10@plt>
movsd  0xe4c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe48(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xe19(%rip),%xmm0
mulsd  %xmm2,%xmm0
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm0
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
mulss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd57(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  0xd34(%rip),%xmm1
divsd  %xmm1,%xmm0
subsd  -0x40(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    135b <optd1+0x22b>
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xce7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  0xcc4(%rip),%xmm1
divsd  %xmm1,%xmm0
subsd  -0x40(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  0xcf0(%rip),%xmm0
call   1030 <pow@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optd1>:
push   %rbx
sub    $0x30,%rsp
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0x8(%rsp)
mov    %edi,%ebx
call   1040 <log10@plt>
mulsd  0xeb0(%rip),%xmm0
addsd  0xeb0(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
movss  0x8(%rsp),%xmm0
call   1040 <log10@plt>
mulsd  0xe9f(%rip),%xmm0
addsd  0xe9f(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
movss  0x8(%rsp),%xmm0
call   1040 <log10@plt>
mulsd  0xe8e(%rip),%xmm0
addsd  0xe8e(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
movss  0x8(%rsp),%xmm0
call   1040 <log10@plt>
movsd  0xe7d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  0xe79(%rip),%xmm0
movss  0x10(%rsp),%xmm3
xorps  %xmm1,%xmm1
cvtss2sd %xmm3,%xmm1
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  0x20(%rsp),%xmm2
movsd  0x28(%rsp),%xmm4
divsd  %xmm4,%xmm2
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x18(%rsp),%xmm1
subsd  %xmm0,%xmm1
add    $0xffffffff,%ebx
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
mulss  %xmm3,%xmm0
cvtss2sd %xmm0,%xmm0
subsd  %xmm0,%xmm1
divsd  %xmm4,%xmm1
movsd  0xe28(%rip),%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm2
mulsd  0xe20(%rip),%xmm2
subsd  %xmm1,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     123f <optd1+0x10f>
xorps  %xmm1,%xmm1
sqrtsd %xmm2,%xmm1
jmp    1268 <optd1+0x138>
movapd %xmm2,%xmm0
movsd  %xmm2,0x10(%rsp)
movsd  %xmm3,0x8(%rsp)
call   1050 <sqrt@plt>
movsd  0x8(%rsp),%xmm3
movsd  0x10(%rsp),%xmm2
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
addsd  %xmm3,%xmm1
ucomisd %xmm0,%xmm1
jbe    12a2 <optd1+0x172>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1285 <optd1+0x155>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    129a <optd1+0x16a>
movapd %xmm2,%xmm0
movsd  %xmm3,0x8(%rsp)
call   1050 <sqrt@plt>
movsd  0x8(%rsp),%xmm3
subsd  %xmm0,%xmm3
movapd %xmm3,%xmm1
movsd  0xda6(%rip),%xmm0
call   1030 <pow@plt>
cvtsd2ss %xmm0,%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @optd1(i32 %0, float %1, float %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store i32 %0, i32* %4
store float %1, float* %5
store float %2, float* %6
%15 = load float, float* %5
%16 = call double @log10(float %15)
%17 = call double @llvm.fmuladd.f64(double 5.309000e-03, double %16, double -2.660000e-03)
store double %17, double* %7
%18 = load float, float* %5
%19 = call double @log10(float %18)
%20 = call double @llvm.fmuladd.f64(double 0x3FB2363B256FFC11, double %19, double -5.941000e-01)
store double %20, double* %8
%21 = load float, float* %5
%22 = call double @log10(float %21)
%23 = call double @llvm.fmuladd.f64(double -4.761000e-01, double %22, double -4.278000e-01)
store double %23, double* %9
%24 = load float, float* %5
%25 = call double @log10(float %24)
%26 = call double @llvm.fmuladd.f64(double -5.124400e-01, double %25, double 0x4026063B256FFC11)
store double %26, double* %10
%27 = load double, double* %8
%28 = load float, float* %6
%29 = fpext float %28 to double
%30 = fmul double 5.124400e-01, %29
%31 = load float, float* %6
%32 = fpext float %31 to double
%33 = fneg double %30
%34 = call double @llvm.fmuladd.f64(double %33, double %32, double %27)
%35 = load double, double* %7
%36 = fdiv double %34, %35
store double %36, double* %11
%37 = load double, double* %9
%38 = load double, double* %10
%39 = load float, float* %6
%40 = fpext float %39 to double
%41 = fmul double %38, %40
%42 = load float, float* %6
%43 = fpext float %42 to double
%44 = fneg double %41
%45 = call double @llvm.fmuladd.f64(double %44, double %43, double %37)
%46 = load i32, i32* %4
%47 = sub nsw i32 %46, 1
%48 = sitofp i32 %47 to float
%49 = load float, float* %6
%50 = fmul float %48, %49
%51 = fpext float %50 to double
%52 = fsub double %45, %51
%53 = load double, double* %7
%54 = fdiv double %52, %53
store double %54, double* %12
%55 = load double, double* %11
%56 = fneg double %55
%57 = fdiv double %56, 2.000000e+00
%58 = load double, double* %11
%59 = load double, double* %11
%60 = fmul double %58, %59
%61 = fdiv double %60, 4.000000e+00
%62 = load double, double* %12
%63 = fsub double %61, %62
%64 = call double @sqrt(double %63)
%65 = fadd double %57, %64
store double %65, double* %14
%66 = load double, double* %14
%67 = fcmp ogt double %66, 0.000000e+00
br i1 %67, label %68, label %80
68: ; preds = %3
%69 = load double, double* %11
%70 = fneg double %69
%71 = fdiv double %70, 2.000000e+00
%72 = load double, double* %11
%73 = load double, double* %11
%74 = fmul double %72, %73
%75 = fdiv double %74, 4.000000e+00
%76 = load double, double* %12
%77 = fsub double %75, %76
%78 = call double @sqrt(double %77)
%79 = fsub double %71, %78
store double %79, double* %14
br label %80
80: ; preds = %68, %3
%81 = load double, double* %14
%82 = call double @pow(double 1.000000e+01, double %81)
store double %82, double* %13
%83 = load double, double* %13
%84 = fptrunc double %83 to float
ret float %84
}

LLVM IR (-O2):
define float @optd1(i32 %0, float %1, float %2) {
%4 = tail call double @log10(float %1)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 5.309000e-03, double -2.660000e-03)
%6 = tail call double @log10(float %1)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 0x3FB2363B256FFC11, double -5.941000e-01)
%8 = tail call double @log10(float %1)
%9 = tail call double @llvm.fmuladd.f64(double %8, double -4.761000e-01, double -4.278000e-01)
%10 = tail call double @log10(float %1)
%11 = tail call double @llvm.fmuladd.f64(double %10, double -5.124400e-01, double 0x4026063B256FFC11)
%12 = fpext float %2 to double
%13 = fmul double %12, -5.124400e-01
%14 = tail call double @llvm.fmuladd.f64(double %13, double %12, double %7)
%15 = fdiv double %14, %5
%16 = fneg double %11
%17 = fmul double %12, %16
%18 = tail call double @llvm.fmuladd.f64(double %17, double %12, double %9)
%19 = add nsw i32 %0, -1
%20 = sitofp i32 %19 to float
%21 = fmul float %20, %2
%22 = fpext float %21 to double
%23 = fsub double %18, %22
%24 = fdiv double %23, %5
%25 = fmul double %15, -5.000000e-01
%26 = fmul double %15, %15
%27 = fmul double %26, 2.500000e-01
%28 = fsub double %27, %24
%29 = tail call double @sqrt(double %28)
%30 = fadd double %29, %25
%31 = fcmp ogt double %30, 0.000000e+00
br i1 %31, label %32, label %35
32: ; preds = %3
%33 = tail call double @sqrt(double %28)
%34 = fsub double %25, %33
br label %35
35: ; preds = %32, %3
%36 = phi double [ %34, %32 ], [ %30, %3 ]
%37 = tail call double @pow(double 1.000000e+01, double %36)
%38 = fptrunc double %37 to float
ret float %38
}