#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 Q_inlet_pipe(double, double, int, double);
double Q_outlet_pipe(double, double, double, double, double, double, double,
                     double);
double Q_pipe(double HW, double TW, double D, int type, double S0, double L,
              double n, double ke, double g) {
  double Q_outlet_control = Q_outlet_pipe(HW, TW, D, S0, L, n, ke, g);
  double Q_inlet_control = Q_inlet_pipe(HW, D, type, g);
  return ((Q_outlet_control) < (Q_inlet_control) ? (Q_outlet_control)
                                                 : (Q_inlet_control));
}


x86 assembly (clang, -O0):
<Q_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm5
movsd  -0x40(%rbp),%xmm6
movsd  -0x48(%rbp),%xmm7
call   1040 <Q_outlet_pipe@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x1c(%rbp),%edi
movsd  -0x48(%rbp),%xmm2
call   1030 <Q_inlet_pipe@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11c4 <Q_pipe+0xa4>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    11ce <Q_pipe+0xae>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_pipe>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm7,(%rsp)
mov    %edi,%ebx
movsd  %xmm2,0x10(%rsp)
movsd  %xmm0,0x18(%rsp)
call   1040 <Q_outlet_pipe@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %ebx,%edi
movsd  (%rsp),%xmm2
call   1030 <Q_inlet_pipe@plt>
movsd  0x8(%rsp),%xmm1
minsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @Q_pipe(double %0, double %1, double %2, i32 %3, double %4, double %5, double %6, double %7, double %8) {
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store i32 %3, i32* %13
store double %4, double* %14
store double %5, double* %15
store double %6, double* %16
store double %7, double* %17
store double %8, double* %18
%21 = load double, double* %10
%22 = load double, double* %11
%23 = load double, double* %12
%24 = load double, double* %14
%25 = load double, double* %15
%26 = load double, double* %16
%27 = load double, double* %17
%28 = load double, double* %18
%29 = call double @Q_outlet_pipe(double %21, double %22, double %23, double %24, double %25, double %26, double %27, double %28)
store double %29, double* %19
%30 = load double, double* %10
%31 = load double, double* %12
%32 = load i32, i32* %13
%33 = load double, double* %18
%34 = call double @Q_inlet_pipe(double %30, double %31, i32 %32, double %33)
store double %34, double* %20
%35 = load double, double* %19
%36 = load double, double* %20
%37 = fcmp olt double %35, %36
br i1 %37, label %38, label %40
38: ; preds = %9
%39 = load double, double* %19
br label %42
40: ; preds = %9
%41 = load double, double* %20
br label %42
42: ; preds = %40, %38
%43 = phi double [ %39, %38 ], [ %41, %40 ]
ret double %43
}

LLVM IR (-O2):
define double @Q_pipe(double %0, double %1, double %2, i32 %3, double %4, double %5, double %6, double %7, double %8) {
%10 = tail call double @Q_outlet_pipe(double %0, double %1, double %2, double %4, double %5, double %6, double %7, double %8)
%11 = tail call double @Q_inlet_pipe(double %0, double %2, i32 %3, double %8)
%12 = fcmp olt double %10, %11
%13 = select i1 %12, double %10, double %11
ret double %13
}