#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, int);
double sqrt(double);
double dc_pipe(double D, double Q, double g) {
  double dc;
  dc = D * pow((Q / sqrt(g) * pow(D, 2.5)) / 1.26, 1. / 3.75);
  if (dc / D < 0.85)
    dc = D * pow((Q / sqrt(g) * pow(D, 2.5)) / 0.95, 1. / 1.95);
  return dc;
}


x86 assembly (clang, -O0):
<dc_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe7f(%rip),%xmm1
divsd  %xmm1,%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
divsd  -0x8(%rbp),%xmm1
movsd  0xe49(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    122f <dc_pipe+0x10f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xdfd(%rip),%xmm1
divsd  %xmm1,%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dc_pipe>:
sub    $0x28,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
movsd  %xmm2,0x18(%rsp)
jb     1149 <dc_pipe+0x29>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1152 <dc_pipe+0x32>
movapd %xmm2,%xmm0
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0x20(%rsp),%xmm0
divsd  0xe80(%rip),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movapd %xmm0,%xmm1
divsd  %xmm2,%xmm1
movsd  0xe67(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    11fd <dc_pipe+0xdd>
xorpd  %xmm1,%xmm1
movsd  0x18(%rsp),%xmm0
ucomisd %xmm1,%xmm0
jb     11bd <dc_pipe+0x9d>
sqrtsd %xmm0,%xmm0
jmp    11c2 <dc_pipe+0xa2>
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0x8(%rsp),%xmm0
divsd  0xe20(%rip),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
mulsd  0x10(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @dc_pipe(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
%8 = load double, double* %4
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call double @sqrt(double %10)
%12 = fdiv double %9, %11
%13 = load double, double* %4
%14 = call double @pow(double %13, i32 2)
%15 = fmul double %12, %14
%16 = fdiv double %15, 1.260000e+00
%17 = call double @pow(double %16, i32 0)
%18 = fmul double %8, %17
store double %18, double* %7
%19 = load double, double* %7
%20 = load double, double* %4
%21 = fdiv double %19, %20
%22 = fcmp olt double %21, 8.500000e-01
br i1 %22, label %23, label %35
23: ; preds = %3
%24 = load double, double* %4
%25 = load double, double* %5
%26 = load double, double* %6
%27 = call double @sqrt(double %26)
%28 = fdiv double %25, %27
%29 = load double, double* %4
%30 = call double @pow(double %29, i32 2)
%31 = fmul double %28, %30
%32 = fdiv double %31, 0x3FEE666666666666
%33 = call double @pow(double %32, i32 0)
%34 = fmul double %24, %33
store double %34, double* %7
br label %35
35: ; preds = %23, %3
%36 = load double, double* %7
ret double %36
}

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