#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 pow(double, double);
double sqrt(double);
double Q_inlet_box_1(double B, double HW, double D, double g) {
  if (HW / D < 1.35)
    return 0.544 * sqrt(g) * B * pow(HW, 1.50);
  else
    return 0.702 * sqrt(g) * B * pow(D, 0.89) * pow(HW, 0.61);
}


x86 assembly (clang, -O0):
<Q_inlet_box_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm1
divsd  -0x20(%rbp),%xmm1
movsd  0xeb2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a3 <Q_inlet_box_1+0x83>
movsd  -0x28(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xebb(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    120c <Q_inlet_box_1+0xec>
movsd  -0x28(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe60(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe3d(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe12(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_inlet_box_1>:
sub    $0x28,%rsp
movapd %xmm0,%xmm4
movsd  %xmm1,0x20(%rsp)
movapd %xmm1,%xmm5
divsd  %xmm2,%xmm5
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jb     1149 <Q_inlet_box_1+0x29>
xorps  %xmm0,%xmm0
sqrtsd %xmm3,%xmm0
jmp    1176 <Q_inlet_box_1+0x56>
movapd %xmm3,%xmm0
movsd  %xmm2,0x8(%rsp)
movsd  %xmm4,0x18(%rsp)
movsd  %xmm5,0x10(%rsp)
call   1040 <sqrt@plt>
movsd  0x10(%rsp),%xmm5
movsd  0x18(%rsp),%xmm4
movsd  0x8(%rsp),%xmm2
movsd  0xe82(%rip),%xmm1
ucomisd %xmm5,%xmm1
jbe    11a0 <Q_inlet_box_1+0x80>
mulsd  0xe94(%rip),%xmm0
mulsd  %xmm4,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xe8a(%rip),%xmm1
jmp    11db <Q_inlet_box_1+0xbb>
mulsd  0xe60(%rip),%xmm0
mulsd  %xmm4,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xe56(%rip),%xmm1
movapd %xmm2,%xmm0
call   1030 <pow@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xe3d(%rip),%xmm1
movsd  0x20(%rsp),%xmm0
call   1030 <pow@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @Q_inlet_box_1(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%10 = load double, double* %7
%11 = load double, double* %8
%12 = fdiv double %10, %11
%13 = fcmp olt double %12, 1.350000e+00
br i1 %13, label %14, label %23
14: ; preds = %4
%15 = load double, double* %9
%16 = call double @sqrt(double %15)
%17 = fmul double 5.440000e-01, %16
%18 = load double, double* %6
%19 = fmul double %17, %18
%20 = load double, double* %7
%21 = call double @pow(double %20, double 1.500000e+00)
%22 = fmul double %19, %21
store double %22, double* %5
br label %35
23: ; preds = %4
%24 = load double, double* %9
%25 = call double @sqrt(double %24)
%26 = fmul double 0x3FE676C8B4395810, %25
%27 = load double, double* %6
%28 = fmul double %26, %27
%29 = load double, double* %8
%30 = call double @pow(double %29, double 8.900000e-01)
%31 = fmul double %28, %30
%32 = load double, double* %7
%33 = call double @pow(double %32, double 6.100000e-01)
%34 = fmul double %31, %33
store double %34, double* %5
br label %35
35: ; preds = %23, %14
%36 = load double, double* %5
ret double %36
}

LLVM IR (-O2):
define double @Q_inlet_box_1(double %0, double %1, double %2, double %3) {
%5 = fdiv double %1, %2
%6 = fcmp olt double %5, 1.350000e+00
%7 = tail call double @sqrt(double %3)
br i1 %6, label %8, label %11
8: ; preds = %4
%9 = fmul double %7, 5.440000e-01
%10 = fmul double %9, %0
br label %16
11: ; preds = %4
%12 = fmul double %7, 0x3FE676C8B4395810
%13 = fmul double %12, %0
%14 = tail call double @pow(double %2, double 8.900000e-01)
%15 = fmul double %14, %13
br label %16
16: ; preds = %11, %8
%17 = phi double [ 6.100000e-01, %11 ], [ 1.500000e+00, %8 ]
%18 = phi double [ %15, %11 ], [ %10, %8 ]
%19 = tail call double @pow(double %1, double %17)
%20 = fmul double %19, %18
ret double %20
}