#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);
int /*<<< orphan*/ printf(char *, ...);
int print_aft_stats_log_mba(double *vertex, int nt, int *tetra) {
  double q, worst, qs;
  int stat[11], i, j;
  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++) {
    qs += 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 {
      for (j = 0; j < 9; j++) {
        if (q > 0.1)
          break;
        q *= 10.0;
      }
      stat[j]++;
    }
  }
  qs /= nt;
  printf("[mba] QS: q_avg: %15.8le  ", qs);
  printf(" ## %6d # ", stat[10]);
  for (i = 0; i < 10; i++)
    printf(" %6d ", stat[i]);
  printf("\n");
  printf("[mba] ln  q_min: %15.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_log_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    114c <print_aft_stats_log_mba+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    13c6 <print_aft_stats_log_mba+0x2a6>
movl   $0x0,-0x74(%rbp)
cmpl   $0xb,-0x74(%rbp)
jge    1177 <print_aft_stats_log_mba+0x57>
movslq -0x74(%rbp),%rax
movl   $0x0,-0x70(%rbp,%rax,4)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1153 <print_aft_stats_log_mba+0x33>
movsd  0xe81(%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_log_mba+0x190>
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   1040 <aft_tetra_qual_mba@plt>
movsd  %xmm0,-0x28(%rbp)
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1225 <print_aft_stats_log_mba+0x105>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     1241 <print_aft_stats_log_mba+0x121>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    129d <print_aft_stats_log_mba+0x17d>
movl   $0x0,-0x78(%rbp)
cmpl   $0x9,-0x78(%rbp)
jge    128e <print_aft_stats_log_mba+0x16e>
movsd  -0x28(%rbp),%xmm0
movsd  0xdb1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    126e <print_aft_stats_log_mba+0x14e>
jmp    128e <print_aft_stats_log_mba+0x16e>
movsd  0xda2(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1248 <print_aft_stats_log_mba+0x128>
movslq -0x78(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x70(%rbp,%rax,4)
jmp    12a2 <print_aft_stats_log_mba+0x182>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1193 <print_aft_stats_log_mba+0x73>
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xd51(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%esi
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x74(%rbp)
cmpl   $0xa,-0x74(%rbp)
jge    131c <print_aft_stats_log_mba+0x1fc>
movslq -0x74(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%esi
lea    0xd3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    12ee <print_aft_stats_log_mba+0x1ce>
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xd18(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cvtsi2sdl -0x48(%rbp),%xmm1
movsd  0xcbe(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xd0b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x74(%rbp)
cmpl   $0xa,-0x74(%rbp)
jge    13b1 <print_aft_stats_log_mba+0x291>
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    0xcdb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    136c <print_aft_stats_log_mba+0x24c>
lea    0xc94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_aft_stats_log_mba>:
test   %esi,%esi
jle    14fd <print_aft_stats_log_mba+0x3cd>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdx,%rbp
mov    %rdi,%r15
xorpd  %xmm0,%xmm0
movupd %xmm0,0x5c(%rsp)
movapd %xmm0,0x50(%rsp)
movapd %xmm0,0x40(%rsp)
mov    %esi,0x28(%rsp)
mov    %esi,%r12d
movsd  0xe8f(%rip),%xmm2
xor    %ebx,%ebx
xorpd  %xmm0,%xmm0
jmp    11a6 <print_aft_stats_log_mba+0x76>
nopl   0x0(%rax)
mov    %eax,%eax
addl   $0x1,0x40(%rsp,%rax,4)
movsd  0x10(%rsp),%xmm2
addsd  %xmm1,%xmm0
minsd  %xmm2,%xmm1
add    $0x1,%rbx
movapd %xmm1,%xmm2
cmp    %r12,%rbx
je     1240 <print_aft_stats_log_mba+0x110>
movsd  %xmm2,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rax
shl    $0x4,%rax
mov    0x0(%rbp,%rax,1),%esi
mov    0x4(%rbp,%rax,1),%edx
mov    0x8(%rbp,%rax,1),%ecx
mov    0xc(%rbp,%rax,1),%r8d
mov    %r15,%rdi
call   1050 <aft_tetra_qual_mba@plt>
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jae    1230 <print_aft_stats_log_mba+0x100>
xor    %eax,%eax
movsd  0xe1e(%rip),%xmm3
ucomisd %xmm3,%xmm1
movsd  0x8(%rsp),%xmm0
movsd  0xe14(%rip),%xmm4
ja     1180 <print_aft_stats_log_mba+0x50>
xor    %eax,%eax
movapd %xmm1,%xmm2
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%ecx
mulsd  %xmm4,%xmm2
lea    0x1(%rcx),%eax
cmp    $0x7,%ecx
ja     1180 <print_aft_stats_log_mba+0x50>
ucomisd %xmm3,%xmm2
jbe    1210 <print_aft_stats_log_mba+0xe0>
jmp    1180 <print_aft_stats_log_mba+0x50>
nopl   (%rax)
addl   $0x1,0x68(%rsp)
movsd  0x8(%rsp),%xmm0
jmp    1187 <print_aft_stats_log_mba+0x57>
mov    0x68(%rsp),%ebx
mov    %ebx,0x34(%rsp)
mov    0x40(%rsp),%ebp
mov    %ebp,0x3c(%rsp)
mov    0x44(%rsp),%r14d
mov    0x48(%rsp),%r13d
mov    0x4c(%rsp),%r12d
mov    0x50(%rsp),%r15d
mov    0x54(%rsp),%eax
mov    %eax,0x1c(%rsp)
mov    0x58(%rsp),%eax
mov    %eax,0x20(%rsp)
mov    0x5c(%rsp),%eax
mov    %eax,0x24(%rsp)
mov    0x60(%rsp),%eax
mov    %eax,0x10(%rsp)
mov    0x64(%rsp),%eax
mov    %eax,0x38(%rsp)
xorps  %xmm2,%xmm2
cvtsi2sdl 0x28(%rsp),%xmm2
movsd  %xmm2,0x8(%rsp)
divsd  %xmm2,%xmm0
lea    0xd82(%rip),%rdi
mov    $0x1,%al
movsd  %xmm1,0x28(%rsp)
call   1040 <printf@plt>
lea    0xd89(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd84(%rip),%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %r14d,%ebp
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x1c(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x20(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x24(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x38(%rsp),%r14d
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcec(%rip),%rdi
movsd  0x28(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x34(%rsp),%xmm0
mulsd  0xc92(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
lea    0xcdc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x3c(%rsp),%xmm0
mulsd  0xc6d(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
lea    0xcc5(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0xc47(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
mulsd  0xc27(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
mulsd  0xc07(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
mulsd  0xbe7(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x1c(%rsp),%xmm0
mulsd  0xbc6(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x20(%rsp),%xmm0
mulsd  0xba5(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x24(%rsp),%xmm0
mulsd  0xb84(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xb63(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
mulsd  0xb43(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <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: %15.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] ln q_min: %15.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_log_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
%13 = alloca i32
store double* %0, double** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %3
store i32 0, i32* %4
br label %155
17: ; preds = %3
store i32 0, i32* %12
br label %18
18: ; preds = %25, %17
%19 = load i32, i32* %12
%20 = icmp slt i32 %19, 11
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load i32, i32* %12
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 %23
store i32 0, i32* %24
br label %25
25: ; preds = %21
%26 = load i32, i32* %12
%27 = add nsw i32 %26, 1
store i32 %27, i32* %12
br label %18
28: ; preds = %18
store double 1.000000e+00, double* %9
store double 0.000000e+00, double* %10
store i32 0, i32* %12
br label %29
29: ; preds = %99, %28
%30 = load i32, i32* %12
%31 = load i32, i32* %6
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %102
33: ; preds = %29
%34 = load double*, double** %5
%35 = load i32*, i32** %7
%36 = load i32, i32* %12
%37 = mul nsw i32 4, %36
%38 = add nsw i32 %37, 0
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %35, i64 %39
%41 = load i32, i32* %40
%42 = load i32*, i32** %7
%43 = load i32, i32* %12
%44 = mul nsw i32 4, %43
%45 = add nsw i32 %44, 1
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i32, i32* %42, i64 %46
%48 = load i32, i32* %47
%49 = load i32*, i32** %7
%50 = load i32, i32* %12
%51 = mul nsw i32 4, %50
%52 = add nsw i32 %51, 2
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i32, i32* %49, i64 %53
%55 = load i32, i32* %54
%56 = load i32*, i32** %7
%57 = load i32, i32* %12
%58 = mul nsw i32 4, %57
%59 = add nsw i32 %58, 3
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i32, i32* %56, i64 %60
%62 = load i32, i32* %61
%63 = call double @aft_tetra_qual_mba(double* %34, i32 %41, i32 %48, i32 %55, i32 %62)
store double %63, double* %8
%64 = load double, double* %10
%65 = fadd double %64, %63
store double %65, double* %10
%66 = load double, double* %8
%67 = load double, double* %9
%68 = fcmp olt double %66, %67
br i1 %68, label %69, label %71
69: ; preds = %33
%70 = load double, double* %8
store double %70, double* %9
br label %71
71: ; preds = %69, %33
%72 = load double, double* %8
%73 = fcmp ole double %72, 0.000000e+00
br i1 %73, label %74, label %78
74: ; preds = %71
%75 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 10
%76 = load i32, i32* %75
%77 = add nsw i32 %76, 1
store i32 %77, i32* %75
br label %98
78: ; preds = %71
store i32 0, i32* %13
br label %79
79: ; preds = %89, %78
%80 = load i32, i32* %13
%81 = icmp slt i32 %80, 9
br i1 %81, label %82, label %92
82: ; preds = %79
%83 = load double, double* %8
%84 = fcmp ogt double %83, 1.000000e-01
br i1 %84, label %85, label %86
85: ; preds = %82
br label %92
86: ; preds = %82
%87 = load double, double* %8
%88 = fmul double %87, 1.000000e+01
store double %88, double* %8
br label %89
89: ; preds = %86
%90 = load i32, i32* %13
%91 = add nsw i32 %90, 1
store i32 %91, i32* %13
br label %79
92: ; preds = %85, %79
%93 = load i32, i32* %13
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 %94
%96 = load i32, i32* %95
%97 = add nsw i32 %96, 1
store i32 %97, i32* %95
br label %98
98: ; preds = %92, %74
br label %99
99: ; preds = %98
%100 = load i32, i32* %12
%101 = add nsw i32 %100, 1
store i32 %101, i32* %12
br label %29
102: ; preds = %29
%103 = load i32, i32* %6
%104 = sitofp i32 %103 to double
%105 = load double, double* %10
%106 = fdiv double %105, %104
store double %106, double* %10
%107 = load double, double* %10
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %107)
%109 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 10
%110 = load i32, i32* %109
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %110)
store i32 0, i32* %12
br label %112
112: ; preds = %121, %102
%113 = load i32, i32* %12
%114 = icmp slt i32 %113, 10
br i1 %114, label %115, label %124
115: ; preds = %112
%116 = load i32, i32* %12
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 %117
%119 = load i32, i32* %118
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %119)
br label %121
121: ; preds = %115
%122 = load i32, i32* %12
%123 = add nsw i32 %122, 1
store i32 %123, i32* %12
br label %112
124: ; preds = %112
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%126 = load double, double* %9
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), double %126)
%128 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 10
%129 = load i32, i32* %128
%130 = sitofp i32 %129 to double
%131 = fmul double 1.000000e+02, %130
%132 = load i32, i32* %6
%133 = sitofp i32 %132 to double
%134 = fdiv double %131, %133
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), double %134)
store i32 0, i32* %12
br label %136
136: ; preds = %150, %124
%137 = load i32, i32* %12
%138 = icmp slt i32 %137, 10
br i1 %138, label %139, label %153
139: ; preds = %136
%140 = load i32, i32* %12
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds [11 x i32], [11 x i32]* %11, i64 0, i64 %141
%143 = load i32, i32* %142
%144 = sitofp i32 %143 to double
%145 = fmul double 1.000000e+02, %144
%146 = load i32, i32* %6
%147 = sitofp i32 %146 to double
%148 = fdiv double %145, %147
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %148)
br label %150
150: ; preds = %139
%151 = load i32, i32* %12
%152 = add nsw i32 %151, 1
store i32 %152, i32* %12
br label %136
153: ; preds = %136
%154 = 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 %155
155: ; preds = %153, %16
%156 = load i32, i32* %4
ret i32 %156
}

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