#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_pipe_1(double HW, double D, double g) {
  if (HW / D < 1.2)
    return 0.421 * sqrt(g) * pow(D, 0.87) * pow(HW, 1.63);
  else
    return 0.530 * sqrt(g) * pow(D, 1.87) * pow(HW, 0.63);
}


x86 assembly (clang, -O0):
<Q_inlet_pipe_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  0xeb7(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11bc <Q_inlet_pipe_1+0x9c>
movsd  -0x20(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xec8(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeaa(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe7f(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1220 <Q_inlet_pipe_1+0x100>
movsd  -0x20(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe47(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe29(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xdfe(%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_pipe_1>:
sub    $0x18,%rsp
movapd %xmm1,%xmm3
movsd  %xmm0,0x10(%rsp)
movapd %xmm0,%xmm1
divsd  %xmm3,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1146 <Q_inlet_pipe_1+0x26>
sqrtsd %xmm2,%xmm2
jmp    1169 <Q_inlet_pipe_1+0x49>
movapd %xmm2,%xmm0
movsd  %xmm3,0x8(%rsp)
movsd  %xmm1,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm3
movapd %xmm0,%xmm2
movsd  0xe8f(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
lea    0xe87(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm1
lea    0xe8b(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xe89(%rip),%rcx
mulsd  (%rcx,%rax,8),%xmm2
movsd  %xmm2,(%rsp)
movapd %xmm3,%xmm0
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @Q_inlet_pipe_1(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fdiv double %8, %9
%11 = fcmp olt double %10, 1.200000e+00
br i1 %11, label %12, label %22
12: ; preds = %3
%13 = load double, double* %7
%14 = call double @sqrt(double %13)
%15 = fmul double 4.210000e-01, %14
%16 = load double, double* %6
%17 = call double @pow(double %16, double 8.700000e-01)
%18 = fmul double %15, %17
%19 = load double, double* %5
%20 = call double @pow(double %19, double 1.630000e+00)
%21 = fmul double %18, %20
store double %21, double* %4
br label %32
22: ; preds = %3
%23 = load double, double* %7
%24 = call double @sqrt(double %23)
%25 = fmul double 5.300000e-01, %24
%26 = load double, double* %6
%27 = call double @pow(double %26, double 1.870000e+00)
%28 = fmul double %25, %27
%29 = load double, double* %5
%30 = call double @pow(double %29, double 6.300000e-01)
%31 = fmul double %28, %30
store double %31, double* %4
br label %32
32: ; preds = %22, %12
%33 = load double, double* %4
ret double %33
}

LLVM IR (-O2):
define double @Q_inlet_pipe_1(double %0, double %1, double %2) {
%4 = fdiv double %0, %1
%5 = fcmp olt double %4, 1.200000e+00
%6 = tail call double @sqrt(double %2)
%7 = select i1 %5, double 4.210000e-01, double 5.300000e-01
%8 = select i1 %5, double 8.700000e-01, double 1.870000e+00
%9 = select i1 %5, double 1.630000e+00, double 6.300000e-01
%10 = fmul double %6, %7
%11 = tail call double @pow(double %1, double %8)
%12 = fmul double %10, %11
%13 = tail call double @pow(double %0, double %9)
%14 = fmul double %12, %13
ret double %14
}