#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_box(double, int, double, int, double);
double Q_inlet_pipe(double, double, int, double);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  double HW, D;
  for (D = 0.6; D <= 3.; D += 0.6) {
    for (HW = 0.1; HW <= 20.; HW += 0.1)
      printf("%g %g %g %g\n", D, HW, Q_inlet_box(HW, 1., D, 1, 9.81),
             Q_inlet_pipe(HW, D, 1, 9.81));
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeb2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xead(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1235 <main+0x105>
movsd  0xea2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe9d(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1210 <main+0xe0>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    $0x1,%esi
movsd  0xe6f(%rip),%xmm2
mov    %esi,%edi
call   1050 <Q_inlet_box@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    $0x1,%edi
movsd  0xe4c(%rip),%xmm2
call   1030 <Q_inlet_pipe@plt>
movsd  -0x38(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x28(%rbp),%xmm0
lea    0xe36(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
movsd  0xe0f(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1173 <main+0x43>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  0xdda(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1153 <main+0x23>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movsd  0xeb3(%rip),%xmm0
lea    0xeec(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
mov    $0x1,%edi
movsd  0xe91(%rip),%xmm1
mov    $0x1,%esi
movsd  0xe8c(%rip),%xmm2
call   1060 <Q_inlet_box@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
movsd  0xe6c(%rip),%xmm1
mov    $0x1,%edi
movsd  0xe67(%rip),%xmm2
call   1040 <Q_inlet_pipe@plt>
movaps %xmm0,%xmm3
mov    %rbx,%rdi
movsd  0xe4c(%rip),%xmm0
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    $0x4,%al
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xe25(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe30(%rip),%xmm0
ucomisd (%rsp),%xmm0
movsd  (%rsp),%xmm0
jae    1160 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0xdf6(%rip),%xmm0
lea    0xe2f(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
mov    $0x1,%edi
movsd  0xde9(%rip),%xmm1
mov    $0x1,%esi
movsd  0xdcc(%rip),%xmm2
call   1060 <Q_inlet_box@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
movsd  0xdc4(%rip),%xmm1
mov    $0x1,%edi
movsd  0xda7(%rip),%xmm2
call   1040 <Q_inlet_pipe@plt>
movaps %xmm0,%xmm3
mov    %rbx,%rdi
movsd  0xda4(%rip),%xmm0
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    $0x4,%al
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xd65(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xd70(%rip),%xmm0
ucomisd (%rsp),%xmm0
movsd  (%rsp),%xmm0
jae    1220 <main+0xe0>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0xd36(%rip),%xmm0
lea    0xd6f(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
mov    $0x1,%edi
movsd  0xd31(%rip),%xmm1
mov    $0x1,%esi
movsd  0xd0c(%rip),%xmm2
call   1060 <Q_inlet_box@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
movsd  0xd0c(%rip),%xmm1
mov    $0x1,%edi
movsd  0xce7(%rip),%xmm2
call   1040 <Q_inlet_pipe@plt>
movaps %xmm0,%xmm3
mov    %rbx,%rdi
movsd  0xcec(%rip),%xmm0
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    $0x4,%al
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xca5(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xcb0(%rip),%xmm0
ucomisd (%rsp),%xmm0
movsd  (%rsp),%xmm0
jae    12e0 <main+0x1a0>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0xc76(%rip),%xmm0
lea    0xcaf(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
mov    $0x1,%edi
movsd  0xc79(%rip),%xmm1
mov    $0x1,%esi
movsd  0xc4c(%rip),%xmm2
call   1060 <Q_inlet_box@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
movsd  0xc54(%rip),%xmm1
mov    $0x1,%edi
movsd  0xc27(%rip),%xmm2
call   1040 <Q_inlet_pipe@plt>
movaps %xmm0,%xmm3
mov    %rbx,%rdi
movsd  0xc34(%rip),%xmm0
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    $0x4,%al
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xbe5(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xbf0(%rip),%xmm0
ucomisd (%rsp),%xmm0
movsd  (%rsp),%xmm0
jae    13a0 <main+0x260>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0xbb6(%rip),%xmm0
lea    0xbef(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
mov    $0x1,%edi
movsd  0xbc1(%rip),%xmm1
mov    $0x1,%esi
movsd  0xb8c(%rip),%xmm2
call   1060 <Q_inlet_box@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
movsd  0xb9c(%rip),%xmm1
mov    $0x1,%edi
movsd  0xb67(%rip),%xmm2
call   1040 <Q_inlet_pipe@plt>
movaps %xmm0,%xmm3
mov    %rbx,%rdi
movsd  0xb7c(%rip),%xmm0
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    $0x4,%al
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xb25(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xb30(%rip),%xmm0
ucomisd (%rsp),%xmm0
movsd  (%rsp),%xmm0
jae    1460 <main+0x320>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%g %g %g %g\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 6.000000e-01, double* %7
br label %8
8: ; preds = %30, %2
%9 = load double, double* %7
%10 = fcmp ole double %9, 3.000000e+00
br i1 %10, label %11, label %33
11: ; preds = %8
store double 1.000000e-01, double* %6
br label %12
12: ; preds = %25, %11
%13 = load double, double* %6
%14 = fcmp ole double %13, 2.000000e+01
br i1 %14, label %15, label %28
15: ; preds = %12
%16 = load double, double* %7
%17 = load double, double* %6
%18 = load double, double* %6
%19 = load double, double* %7
%20 = call double @Q_inlet_box(double %18, i32 1, double %19, i32 1, double 9.810000e+00)
%21 = load double, double* %6
%22 = load double, double* %7
%23 = call double @Q_inlet_pipe(double %21, double %22, i32 1, double 9.810000e+00)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %16, double %17, double %20, double %23)
br label %25
25: ; preds = %15
%26 = load double, double* %6
%27 = fadd double %26, 1.000000e-01
store double %27, double* %6
br label %12
28: ; preds = %12
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %28
%31 = load double, double* %7
%32 = fadd double %31, 6.000000e-01
store double %32, double* %7
br label %8
33: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%g %g %g %g\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi double [ 1.000000e-01, %2 ], [ %8, %3 ]
%5 = tail call double @Q_inlet_box(double %4, i32 1, double 6.000000e-01, i32 1, double 9.810000e+00)
%6 = tail call double @Q_inlet_pipe(double %4, double 6.000000e-01, i32 1, double 9.810000e+00)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double 6.000000e-01, double %4, double %5, double %6)
%8 = fadd double %4, 1.000000e-01
%9 = fcmp ugt double %8, 2.000000e+01
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = tail call i32 @putchar(i32 10)
br label %12
12: ; preds = %12, %10
%13 = phi double [ 1.000000e-01, %10 ], [ %17, %12 ]
%14 = tail call double @Q_inlet_box(double %13, i32 1, double 1.200000e+00, i32 1, double 9.810000e+00)
%15 = tail call double @Q_inlet_pipe(double %13, double 1.200000e+00, i32 1, double 9.810000e+00)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double 1.200000e+00, double %13, double %14, double %15)
%17 = fadd double %13, 1.000000e-01
%18 = fcmp ugt double %17, 2.000000e+01
br i1 %18, label %19, label %12
19: ; preds = %12
%20 = tail call i32 @putchar(i32 10)
br label %21
21: ; preds = %21, %19
%22 = phi double [ 1.000000e-01, %19 ], [ %26, %21 ]
%23 = tail call double @Q_inlet_box(double %22, i32 1, double 0x3FFCCCCCCCCCCCCC, i32 1, double 9.810000e+00)
%24 = tail call double @Q_inlet_pipe(double %22, double 0x3FFCCCCCCCCCCCCC, i32 1, double 9.810000e+00)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double 0x3FFCCCCCCCCCCCCC, double %22, double %23, double %24)
%26 = fadd double %22, 1.000000e-01
%27 = fcmp ugt double %26, 2.000000e+01
br i1 %27, label %28, label %21
28: ; preds = %21
%29 = tail call i32 @putchar(i32 10)
br label %30
30: ; preds = %30, %28
%31 = phi double [ 1.000000e-01, %28 ], [ %35, %30 ]
%32 = tail call double @Q_inlet_box(double %31, i32 1, double 2.400000e+00, i32 1, double 9.810000e+00)
%33 = tail call double @Q_inlet_pipe(double %31, double 2.400000e+00, i32 1, double 9.810000e+00)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double 2.400000e+00, double %31, double %32, double %33)
%35 = fadd double %31, 1.000000e-01
%36 = fcmp ugt double %35, 2.000000e+01
br i1 %36, label %37, label %30
37: ; preds = %30
%38 = tail call i32 @putchar(i32 10)
br label %39
39: ; preds = %39, %37
%40 = phi double [ 1.000000e-01, %37 ], [ %44, %39 ]
%41 = tail call double @Q_inlet_box(double %40, i32 1, double 3.000000e+00, i32 1, double 9.810000e+00)
%42 = tail call double @Q_inlet_pipe(double %40, double 3.000000e+00, i32 1, double 9.810000e+00)
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double 3.000000e+00, double %40, double %41, double %42)
%44 = fadd double %40, 1.000000e-01
%45 = fcmp ugt double %44, 2.000000e+01
br i1 %45, label %46, label %39
46: ; preds = %39
%47 = tail call i32 @putchar(i32 10)
ret i32 0
}