#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 aft_tetra_qual_mba(double *, int, int, int, int);
scalar_t__ ceil(double);
int /*<<< orphan*/ printf(char *, ...);
int print_aft_stats_linear_mba(double *vertex, int nt, int *tetra) {
  double q, worst, qs;
  int stat[11], i;
  if (nt < 1)
    return 0;
  for (i = 0; i < 11; i++)
    stat[i] = 0;
  worst = 1.0, qs = 0.0;
  for (i = 0; i < nt; i++) {
    q = aft_tetra_qual_mba(vertex, tetra[4 * i + 0], tetra[4 * i + 1],
                           tetra[4 * i + 2], tetra[4 * i + 3]);
    if (q < worst)
      worst = q;
    if (q <= 0.0)
      stat[10]++;
    else if (q > 1.0)
      stat[9]++;
    else
      stat[(int)ceil(q * 10) - 1]++;
    qs += q;
  }
  qs /= nt;
  printf("[mba] QS: q_avg: %12.8le  ", qs);
  printf(" ## %6d # ", stat[10]);
  for (i = 0; i < 10; i++)
    printf(" %6d ", stat[i]);
  printf("\n");
  printf("[mba]     q_min: %12.8le  ", worst);
  printf(" ## %6.2lf # ", 100.0 * stat[10] / nt);
  for (i = 0; i < 10; i++)
    printf(" %6.2lf ", 100.0 * stat[i] / nt);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<print_aft_stats_linear_mba>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x1,-0x14(%rbp)
jge    115c <print_aft_stats_linear_mba+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    13c6 <print_aft_stats_linear_mba+0x296>
movl   $0x0,-0x74(%rbp)
cmpl   $0xb,-0x74(%rbp)
jge    1187 <print_aft_stats_linear_mba+0x57>
movslq -0x74(%rbp),%rax
movl   $0x0,-0x70(%rbp,%rax,4)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1163 <print_aft_stats_linear_mba+0x33>
movsd  0xe71(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12b0 <print_aft_stats_linear_mba+0x180>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    -0x74(%rbp),%ecx
shl    $0x2,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x20(%rbp),%rax
mov    -0x74(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x20(%rbp),%rax
mov    -0x74(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x20(%rbp),%rax
mov    -0x74(%rbp),%r8d
shl    $0x2,%r8d
add    $0x3,%r8d
movslq %r8d,%r8
mov    (%rax,%r8,4),%r8d
call   1050 <aft_tetra_qual_mba@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    122b <print_aft_stats_linear_mba+0xfb>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     1247 <print_aft_stats_linear_mba+0x117>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1293 <print_aft_stats_linear_mba+0x163>
movsd  -0x28(%rbp),%xmm0
movsd  0xdac(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    126c <print_aft_stats_linear_mba+0x13c>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    128e <print_aft_stats_linear_mba+0x15e>
movsd  0xd9c(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1030 <ceil@plt>
sub    $0x1,%eax
cltq
mov    -0x70(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x70(%rbp,%rax,4)
jmp    1293 <print_aft_stats_linear_mba+0x163>
movsd  -0x28(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11a3 <print_aft_stats_linear_mba+0x73>
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xd49(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%esi
lea    0xd53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x74(%rbp)
cmpl   $0xa,-0x74(%rbp)
jge    131c <print_aft_stats_linear_mba+0x1ec>
movslq -0x74(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%esi
lea    0xd37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    12ee <print_aft_stats_linear_mba+0x1be>
lea    0xd21(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xd10(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cvtsi2sdl -0x48(%rbp),%xmm1
movsd  0xcbe(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xd03(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x0,-0x74(%rbp)
cmpl   $0xa,-0x74(%rbp)
jge    13b1 <print_aft_stats_linear_mba+0x281>
movslq -0x74(%rbp),%rax
cvtsi2sdl -0x70(%rbp,%rax,4),%xmm1
movsd  0xc80(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xcd3(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    136c <print_aft_stats_linear_mba+0x23c>
lea    0xc8c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_aft_stats_linear_mba>:
test   %esi,%esi
jle    1501 <print_aft_stats_linear_mba+0x3c1>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%r15
xorps  %xmm0,%xmm0
movups %xmm0,0x5c(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
mov    %esi,%r12d
shl    $0x4,%r12
movsd  0xe80(%rip),%xmm0
xor    %ebp,%ebp
movabs $0xffffffff00000000,%r13
ff ff ff
xorpd  %xmm1,%xmm1
jmp    11c6 <print_aft_stats_linear_mba+0x86>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addl   $0x1,0x68(%rsp)
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
addsd  %xmm0,%xmm1
minsd  %xmm2,%xmm0
add    $0x10,%rbp
cmp    %rbp,%r12
je     1244 <print_aft_stats_linear_mba+0x104>
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    (%rbx,%rbp,1),%esi
mov    0x4(%rbx,%rbp,1),%edx
mov    0x8(%rbx,%rbp,1),%ecx
mov    0xc(%rbx,%rbp,1),%r8d
mov    %r15,%rdi
call   1060 <aft_tetra_qual_mba@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    11a0 <print_aft_stats_linear_mba+0x60>
ucomisd 0xe04(%rip),%xmm0
jbe    1210 <print_aft_stats_linear_mba+0xd0>
addl   $0x1,0x64(%rsp)
jmp    11a5 <print_aft_stats_linear_mba+0x65>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  %xmm0,0x28(%rsp)
movsd  0x28(%rsp),%xmm0
mulsd  0xde4(%rip),%xmm0
call   1040 <ceil@plt>
movsd  0x28(%rsp),%xmm0
shl    $0x20,%rax
add    %r13,%rax
sar    $0x1e,%rax
addl   $0x1,0x40(%rsp,%rax,1)
jmp    11a5 <print_aft_stats_linear_mba+0x65>
mov    0x68(%rsp),%ebp
mov    %ebp,0x38(%rsp)
mov    0x40(%rsp),%ebx
mov    0x44(%rsp),%r13d
mov    0x48(%rsp),%r15d
mov    0x4c(%rsp),%r12d
mov    0x50(%rsp),%eax
mov    %eax,0x1c(%rsp)
mov    0x54(%rsp),%eax
mov    %eax,0x20(%rsp)
mov    0x58(%rsp),%eax
mov    %eax,0x24(%rsp)
mov    0x5c(%rsp),%eax
mov    %eax,0x10(%rsp)
mov    0x60(%rsp),%eax
mov    %eax,0x34(%rsp)
mov    0x64(%rsp),%eax
mov    %eax,0x3c(%rsp)
movsd  %xmm0,0x28(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
movsd  %xmm0,0x8(%rsp)
divsd  %xmm0,%xmm1
lea    0xd72(%rip),%rdi
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xd7b(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd76(%rip),%rbp
mov    %rbp,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    0x1c(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    0x20(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    0x24(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    0x34(%rsp),%r14d
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    0x3c(%rsp),%ebp
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcde(%rip),%rdi
movsd  0x28(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x38(%rsp),%xmm0
mulsd  0xc84(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
lea    0xcce(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0xc61(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
lea    0xcb9(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
mulsd  0xc3a(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
mulsd  0xc1a(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
mulsd  0xbfa(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x1c(%rsp),%xmm0
mulsd  0xbd9(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x20(%rsp),%xmm0
mulsd  0xbb8(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x24(%rsp),%xmm0
mulsd  0xb97(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xb76(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
mulsd  0xb56(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0xb37(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"[mba] QS: q_avg: %12.8le \00"
@.str.1 = [11 x i8] c" ## %6d # \00"
@.str.2 = [6 x i8] c" %6d \00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [27 x i8] c"[mba] q_min: %12.8le \00"
@.str.5 = [14 x i8] c" ## %6.2lf # \00"
@.str.6 = [9 x i8] c" %6.2lf \00"
define i32 @print_aft_stats_linear_mba(double* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca [11 x i32]
%12 = alloca i32
store double* %0, double** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 0, i32* %4
br label %153
16: ; preds = %3
store i32 0, i32* %12
br label %17
17: ; preds = %24, %16
%18 = load i32, i32* %12
%19 = icmp slt i32 %18, 11
br i1 %19, label %20, label %27
20: ; preds = %17
%21 = load i32, i32* %12
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 %22
store i32 0, i32* %23
br label %24
24: ; preds = %20
%25 = load i32, i32* %12
%26 = add nsw i32 %25, 1
store i32 %26, i32* %12
br label %17
27: ; preds = %17
store double 1.000000e+00, double* %9
store double 0.000000e+00, double* %10
store i32 0, i32* %12
br label %28
28: ; preds = %97, %27
%29 = load i32, i32* %12
%30 = load i32, i32* %6
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %100
32: ; preds = %28
%33 = load double*, double** %5
%34 = load i32*, i32** %7
%35 = load i32, i32* %12
%36 = mul nsw i32 4, %35
%37 = add nsw i32 %36, 0
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %34, i64 %38
%40 = load i32, i32* %39
%41 = load i32*, i32** %7
%42 = load i32, i32* %12
%43 = mul nsw i32 4, %42
%44 = add nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i32, i32* %41, i64 %45
%47 = load i32, i32* %46
%48 = load i32*, i32** %7
%49 = load i32, i32* %12
%50 = mul nsw i32 4, %49
%51 = add nsw i32 %50, 2
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i32, i32* %48, i64 %52
%54 = load i32, i32* %53
%55 = load i32*, i32** %7
%56 = load i32, i32* %12
%57 = mul nsw i32 4, %56
%58 = add nsw i32 %57, 3
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i32, i32* %55, i64 %59
%61 = load i32, i32* %60
%62 = call double @aft_tetra_qual_mba(double* %33, i32 %40, i32 %47, i32 %54, i32 %61)
store double %62, double* %8
%63 = load double, double* %8
%64 = load double, double* %9
%65 = fcmp olt double %63, %64
br i1 %65, label %66, label %68
66: ; preds = %32
%67 = load double, double* %8
store double %67, double* %9
br label %68
68: ; preds = %66, %32
%69 = load double, double* %8
%70 = fcmp ole double %69, 0.000000e+00
br i1 %70, label %71, label %75
71: ; preds = %68
%72 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 10
%73 = load i32, i32* %72
%74 = add nsw i32 %73, 1
store i32 %74, i32* %72
br label %93
75: ; preds = %68
%76 = load double, double* %8
%77 = fcmp ogt double %76, 1.000000e+00
br i1 %77, label %78, label %82
78: ; preds = %75
%79 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 9
%80 = load i32, i32* %79
%81 = add nsw i32 %80, 1
store i32 %81, i32* %79
br label %92
82: ; preds = %75
%83 = load double, double* %8
%84 = fmul double %83, 1.000000e+01
%85 = call i64 @ceil(double %84)
%86 = trunc i64 %85 to i32
%87 = sub nsw i32 %86, 1
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 %88
%90 = load i32, i32* %89
%91 = add nsw i32 %90, 1
store i32 %91, i32* %89
br label %92
92: ; preds = %82, %78
br label %93
93: ; preds = %92, %71
%94 = load double, double* %8
%95 = load double, double* %10
%96 = fadd double %95, %94
store double %96, double* %10
br label %97
97: ; preds = %93
%98 = load i32, i32* %12
%99 = add nsw i32 %98, 1
store i32 %99, i32* %12
br label %28
100: ; preds = %28
%101 = load i32, i32* %6
%102 = sitofp i32 %101 to double
%103 = load double, double* %10
%104 = fdiv double %103, %102
store double %104, double* %10
%105 = load double, double* %10
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %105)
%107 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 10
%108 = load i32, i32* %107
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %108)
store i32 0, i32* %12
br label %110
110: ; preds = %119, %100
%111 = load i32, i32* %12
%112 = icmp slt i32 %111, 10
br i1 %112, label %113, label %122
113: ; preds = %110
%114 = load i32, i32* %12
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 %115
%117 = load i32, i32* %116
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %117)
br label %119
119: ; preds = %113
%120 = load i32, i32* %12
%121 = add nsw i32 %120, 1
store i32 %121, i32* %12
br label %110
122: ; preds = %110
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%124 = load double, double* %9
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), double %124)
%126 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 10
%127 = load i32, i32* %126
%128 = sitofp i32 %127 to double
%129 = fmul double 1.000000e+02, %128
%130 = load i32, i32* %6
%131 = sitofp i32 %130 to double
%132 = fdiv double %129, %131
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), double %132)
store i32 0, i32* %12
br label %134
134: ; preds = %148, %122
%135 = load i32, i32* %12
%136 = icmp slt i32 %135, 10
br i1 %136, label %137, label %151
137: ; preds = %134
%138 = load i32, i32* %12
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 %139
%141 = load i32, i32* %140
%142 = sitofp i32 %141 to double
%143 = fmul double 1.000000e+02, %142
%144 = load i32, i32* %6
%145 = sitofp i32 %144 to double
%146 = fdiv double %143, %145
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %146)
br label %148
148: ; preds = %137
%149 = load i32, i32* %12
%150 = add nsw i32 %149, 1
store i32 %150, i32* %12
br label %134
151: ; preds = %134
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %4
br label %153
153: ; preds = %151, %15
%154 = load i32, i32* %4
ret i32 %154
}

LLVM IR (-O2):
@.str = [27 x i8] c"[mba] QS: q_avg: %12.8le \00"
@.str.1 = [11 x i8] c" ## %6d # \00"
@.str.2 = [6 x i8] c" %6d \00"
@.str.4 = [27 x i8] c"[mba] q_min: %12.8le \00"
@.str.5 = [14 x i8] c" ## %6.2lf # \00"
@.str.6 = [9 x i8] c" %6.2lf \00"
define i32 @print_aft_stats_linear_mba(double* %0, i32 %1, i32* nocapture %2) {
%4 = alloca [11 x i32]
%5 = bitcast [11 x i32]* %4 to i8*
%6 = icmp slt i32 %1, 1
br i1 %6, label %134, label %7
7: ; preds = %3
%8 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 10
%9 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 9
%10 = zext i32 %1 to i64
br label %11
11: ; preds = %7, %48
%12 = phi i64 [ 0, %7 ], [ %50, %48 ]
%13 = phi double [ 0.000000e+00, %7 ], [ %49, %48 ]
%14 = phi double [ 1.000000e+00, %7 ], [ %29, %48 ]
%15 = shl nsw i64 %12, 2
%16 = getelementptr inbounds i32, i32* %2, i64 %15
%17 = load i32, i32* %16
%18 = or i64 %15, 1
%19 = getelementptr inbounds i32, i32* %2, i64 %18
%20 = load i32, i32* %19
%21 = or i64 %15, 2
%22 = getelementptr inbounds i32, i32* %2, i64 %21
%23 = load i32, i32* %22
%24 = or i64 %15, 3
%25 = getelementptr inbounds i32, i32* %2, i64 %24
%26 = load i32, i32* %25
%27 = tail call double @aft_tetra_qual_mba(double* %0, i32 %17, i32 %20, i32 %23, i32 %26)
%28 = fcmp olt double %27, %14
%29 = select i1 %28, double %27, double %14
%30 = fcmp ugt double %27, 0.000000e+00
br i1 %30, label %34, label %31
31: ; preds = %11
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %48
34: ; preds = %11
%35 = fcmp ogt double %27, 1.000000e+00
br i1 %35, label %36, label %39
36: ; preds = %34
%37 = load i32, i32* %9
%38 = add nsw i32 %37, 1
store i32 %38, i32* %9
br label %48
39: ; preds = %34
%40 = fmul double %27, 1.000000e+01
%41 = tail call i64 @ceil(double %40)
%42 = shl i64 %41, 32
%43 = add i64 %42, -4294967296
%44 = ashr exact i64 %43, 32
%45 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = add nsw i32 %46, 1
store i32 %47, i32* %45
br label %48
48: ; preds = %36, %39, %31
%49 = fadd double %13, %27
%50 = add nuw nsw i64 %12, 1
%51 = icmp eq i64 %50, %10
br i1 %51, label %52, label %11
52: ; preds = %48
%53 = load i32, i32* %8
%54 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 0
%55 = load i32, i32* %54
%56 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 1
%57 = load i32, i32* %56
%58 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 2
%59 = load i32, i32* %58
%60 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 3
%61 = load i32, i32* %60
%62 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 4
%63 = load i32, i32* %62
%64 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 5
%65 = load i32, i32* %64
%66 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 6
%67 = load i32, i32* %66
%68 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 7
%69 = load i32, i32* %68
%70 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 8
%71 = load i32, i32* %70
%72 = load i32, i32* %9
%73 = sitofp i32 %1 to double
%74 = fdiv double %49, %73
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %74)
%76 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %53)
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %55)
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %57)
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %59)
%80 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %61)
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %63)
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %65)
%83 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %67)
%84 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %69)
%85 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %71)
%86 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %72)
%87 = tail call i32 @putchar(i32 10)
%88 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), double %29)
%89 = sitofp i32 %53 to double
%90 = fmul double %89, 1.000000e+02
%91 = fdiv double %90, %73
%92 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), double %91)
%93 = sitofp i32 %55 to double
%94 = fmul double %93, 1.000000e+02
%95 = fdiv double %94, %73
%96 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %95)
%97 = sitofp i32 %57 to double
%98 = fmul double %97, 1.000000e+02
%99 = fdiv double %98, %73
%100 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %99)
%101 = sitofp i32 %59 to double
%102 = fmul double %101, 1.000000e+02
%103 = fdiv double %102, %73
%104 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %103)
%105 = sitofp i32 %61 to double
%106 = fmul double %105, 1.000000e+02
%107 = fdiv double %106, %73
%108 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %107)
%109 = sitofp i32 %63 to double
%110 = fmul double %109, 1.000000e+02
%111 = fdiv double %110, %73
%112 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %111)
%113 = sitofp i32 %65 to double
%114 = fmul double %113, 1.000000e+02
%115 = fdiv double %114, %73
%116 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %115)
%117 = sitofp i32 %67 to double
%118 = fmul double %117, 1.000000e+02
%119 = fdiv double %118, %73
%120 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %119)
%121 = sitofp i32 %69 to double
%122 = fmul double %121, 1.000000e+02
%123 = fdiv double %122, %73
%124 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %123)
%125 = sitofp i32 %71 to double
%126 = fmul double %125, 1.000000e+02
%127 = fdiv double %126, %73
%128 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %127)
%129 = sitofp i32 %72 to double
%130 = fmul double %129, 1.000000e+02
%131 = fdiv double %130, %73
%132 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %131)
%133 = tail call i32 @putchar(i32 10)
br label %134
134: ; preds = %3, %52
ret i32 0
}