#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 pow(double, int);
double otu_descend(double time, double o2_ratio_i, double o2_ratio_f) {
  double otu = 0.0;
  if (o2_ratio_i > 0.5 || o2_ratio_f > 0.5)
    otu = ((3 / 11) * time) / (o2_ratio_f - o2_ratio_i) *
          (pow((o2_ratio_f - 0.5) / 0.5, 11 / 6) -
           pow((o2_ratio_i - 0.5) / 0.5, 11 / 6));
  return otu;
}


x86 assembly (clang, -O0):
<otu_descend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     115d <otu_descend+0x4d>
movsd  -0x18(%rbp),%xmm0
movsd  0xead(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11e2 <otu_descend+0xd2>
xorps  %xmm0,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe7b(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe6f(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x1,%edi
call   1030 <pow@plt>
mov    %eax,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe51(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe45(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x1,%edi
call   1030 <pow@plt>
movsd  -0x30(%rbp),%xmm0
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<otu_descend>:
push   %rbx
sub    $0x10,%rsp
movapd %xmm0,%xmm3
ucomisd 0xedf(%rip),%xmm1
ja     1131 <otu_descend+0x21>
xorpd  %xmm0,%xmm0
ucomisd 0xed1(%rip),%xmm2
jbe    1196 <otu_descend+0x86>
xorpd  %xmm0,%xmm0
mulsd  %xmm0,%xmm3
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
divsd  %xmm0,%xmm3
movsd  %xmm3,0x8(%rsp)
addsd  0xeb5(%rip),%xmm2
addsd  %xmm2,%xmm2
movapd %xmm2,%xmm0
mov    $0x1,%edi
movsd  %xmm1,(%rsp)
call   1030 <pow@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
addsd  0xe8f(%rip),%xmm0
addsd  %xmm0,%xmm0
mov    $0x1,%edi
call   1030 <pow@plt>
sub    %eax,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @otu_descend(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store double 0.000000e+00, double* %7
%8 = load double, double* %5
%9 = fcmp ogt double %8, 5.000000e-01
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load double, double* %6
%12 = fcmp ogt double %11, 5.000000e-01
br i1 %12, label %13, label %31
13: ; preds = %10, %3
%14 = load double, double* %4
%15 = fmul double 0.000000e+00, %14
%16 = load double, double* %6
%17 = load double, double* %5
%18 = fsub double %16, %17
%19 = fdiv double %15, %18
%20 = load double, double* %6
%21 = fsub double %20, 5.000000e-01
%22 = fdiv double %21, 5.000000e-01
%23 = call i32 @pow(double %22, i32 1)
%24 = load double, double* %5
%25 = fsub double %24, 5.000000e-01
%26 = fdiv double %25, 5.000000e-01
%27 = call i32 @pow(double %26, i32 1)
%28 = sub nsw i32 %23, %27
%29 = sitofp i32 %28 to double
%30 = fmul double %19, %29
store double %30, double* %7
br label %31
31: ; preds = %13, %10
%32 = load double, double* %7
ret double %32
}

LLVM IR (-O2):
define double @otu_descend(double %0, double %1, double %2) {
%4 = fcmp ogt double %1, 5.000000e-01
%5 = fcmp ogt double %2, 5.000000e-01
%6 = or i1 %4, %5
br i1 %6, label %7, label %20
7: ; preds = %3
%8 = fmul double %0, 0.000000e+00
%9 = fsub double %2, %1
%10 = fdiv double %8, %9
%11 = fadd double %2, -5.000000e-01
%12 = fmul double %11, 2.000000e+00
%13 = tail call i32 @pow(double %12, i32 1)
%14 = fadd double %1, -5.000000e-01
%15 = fmul double %14, 2.000000e+00
%16 = tail call i32 @pow(double %15, i32 1)
%17 = sub nsw i32 %13, %16
%18 = sitofp i32 %17 to double
%19 = fmul double %10, %18
br label %20
20: ; preds = %3, %7
%21 = phi double [ %19, %7 ], [ 0.000000e+00, %3 ]
ret double %21
}