#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_outlet_box(double, double, int, double, int, int, double, int, double);
double Q_outlet_pipe(double, double, double, int, int, double, int, double);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  double TW, D;
  for (D = 0.6; D <= 3.; D += 0.6) {
    for (TW = 0.; TW <= 1.5 * D; TW += 0.001)
      printf("%g %g %g %g\n", D, TW,
             Q_outlet_box(1.5 * D, TW, 1., D, 0., 10., 0.01, 0., 9.81),
             Q_outlet_pipe(1.5 * D, TW, D, 0., 10., 0.01, 0., 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     126e <main+0x13e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  0xe95(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1249 <main+0x119>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe6a(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    $0x1,%edi
xor    %ecx,%ecx
mov    $0xa,%edx
movsd  0xe4f(%rip),%xmm3
movsd  0xe4f(%rip),%xmm4
mov    %ecx,%esi
call   1050 <Q_outlet_box@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xe2b(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
xor    %edx,%edx
mov    $0xa,%esi
movsd  0xe15(%rip),%xmm3
movsd  0xe15(%rip),%xmm4
mov    %edx,%edi
call   1040 <Q_outlet_pipe@plt>
movsd  -0x38(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x28(%rbp),%xmm0
lea    0xe05(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
movsd  0xdee(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    116e <main+0x3e>
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xda1(%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    $0x20,%rsp
movsd  0xeb3(%rip),%xmm2
lea    0xee4(%rip),%rbx
jmp    1189 <main+0x49>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  (%rsp),%xmm2
addsd  0xe89(%rip),%xmm2
movsd  0xea9(%rip),%xmm0
ucomisd %xmm2,%xmm0
jb     125c <main+0x11c>
movsd  %xmm2,(%rsp)
mulsd  0xe72(%rip),%xmm2
ucomisd 0xe92(%rip),%xmm2
jb     1160 <main+0x20>
xorps  %xmm1,%xmm1
movsd  %xmm2,0x10(%rsp)
nopl   0x0(%rax)
movsd  %xmm1,0x8(%rsp)
movapd %xmm2,%xmm0
mov    $0x1,%edi
movsd  (%rsp),%xmm2
xor    %esi,%esi
mov    $0xa,%edx
movsd  0xe3d(%rip),%xmm3
xor    %ecx,%ecx
movsd  0xe3b(%rip),%xmm4
call   1060 <Q_outlet_box@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
xor    %edi,%edi
mov    $0xa,%esi
movsd  0xe08(%rip),%xmm3
xor    %edx,%edx
movsd  0xe06(%rip),%xmm4
call   1050 <Q_outlet_pipe@plt>
movaps %xmm0,%xmm3
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
mov    $0x4,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm1
movsd  0xddd(%rip),%xmm0
movsd  0x10(%rsp),%xmm2
addsd  %xmm0,%xmm1
ucomisd %xmm1,%xmm2
jae    11b0 <main+0x70>
jmp    1160 <main+0x20>
xor    %eax,%eax
add    $0x20,%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 = %36, %2
%9 = load double, double* %7
%10 = fcmp ole double %9, 3.000000e+00
br i1 %10, label %11, label %39
11: ; preds = %8
store double 0.000000e+00, double* %6
br label %12
12: ; preds = %31, %11
%13 = load double, double* %6
%14 = load double, double* %7
%15 = fmul double 1.500000e+00, %14
%16 = fcmp ole double %13, %15
br i1 %16, label %17, label %34
17: ; preds = %12
%18 = load double, double* %7
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fmul double 1.500000e+00, %20
%22 = load double, double* %6
%23 = load double, double* %7
%24 = call double @Q_outlet_box(double %21, double %22, i32 1, double %23, i32 0, i32 10, double 1.000000e-02, i32 0, double 9.810000e+00)
%25 = load double, double* %7
%26 = fmul double 1.500000e+00, %25
%27 = load double, double* %6
%28 = load double, double* %7
%29 = call double @Q_outlet_pipe(double %26, double %27, double %28, i32 0, i32 10, double 1.000000e-02, i32 0, double 9.810000e+00)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %18, double %19, double %24, double %29)
br label %31
31: ; preds = %17
%32 = load double, double* %6
%33 = fadd double %32, 1.000000e-03
store double %33, double* %6
br label %12
34: ; preds = %12
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %36
36: ; preds = %34
%37 = load double, double* %7
%38 = fadd double %37, 6.000000e-01
store double %38, double* %7
br label %8
39: ; 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, %14
%4 = phi double [ 6.000000e-01, %2 ], [ %16, %14 ]
%5 = fmul double %4, 1.500000e+00
%6 = fcmp ult double %5, 0.000000e+00
br i1 %6, label %14, label %7
7: ; preds = %3, %7
%8 = phi double [ %12, %7 ], [ 0.000000e+00, %3 ]
%9 = tail call double @Q_outlet_box(double %5, double %8, i32 1, double %4, i32 0, i32 10, double 1.000000e-02, i32 0, double 9.810000e+00)
%10 = tail call double @Q_outlet_pipe(double %5, double %8, double %4, i32 0, i32 10, double 1.000000e-02, i32 0, double 9.810000e+00)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %4, double %8, double %9, double %10)
%12 = fadd double %8, 1.000000e-03
%13 = fcmp ugt double %12, %5
br i1 %13, label %14, label %7
14: ; preds = %7, %3
%15 = tail call i32 @putchar(i32 10)
%16 = fadd double %4, 6.000000e-01
%17 = fcmp ugt double %16, 3.000000e+00
br i1 %17, label %18, label %3
18: ; preds = %14
ret i32 0
}