user: 请从给定的汇编指令推导出C源代码:

```asm
<print_aft_stats_log_mba>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  jle    L36
  movsd  D98(%rip),%xmm7
  lea    -0x1(%rsi),%eax
  mov    %rdi,%rbp
  xor    %ebx,%ebx
  pxor   %xmm0,%xmm0
  shl    $0x4,%rax
  mov    %esi,%r13d
  mov    %rdx,%r14
  movaps %xmm0,0x10(%rsp)
  lea    0x10(%rdx,%rax,1),%r12
  pxor   %xmm2,%xmm2
  movq   $0x0,0x30(%rsp)
  movl   $0x0,0x38(%rsp)
  movaps %xmm0,0x20(%rsp)
  movsd  %xmm7,(%rsp)
  jmp    L178
  nopl   0x0(%rax)
L165:
  add    $0x1,%ebx
  add    $0x10,%r14
  mov    %ebx,0x38(%rsp)
  cmp    %r14,%r12
  je     L185
L178:
  mov    0x8(%r14),%ecx
  mov    (%r14),%esi
  mov    %rbp,%rdi
  movsd  %xmm2,0x8(%rsp)
  mov    0x4(%r14),%edx
  mov    0xc(%r14),%r8d
  call   <aft_tetra_qual_mba@plt>
  pxor   %xmm6,%xmm6
  movsd  0x8(%rsp),%xmm2
  mov    D152(%rip),%rax
  movapd %xmm0,%xmm3
  comisd %xmm0,%xmm6
  minsd  (%rsp),%xmm3
  addsd  %xmm0,%xmm2
  movq   %rax,%xmm1
  movsd  %xmm3,(%rsp)
  jae    L165
  comisd %xmm1,%xmm0
  ja     L184
  mulsd  D10(%rip),%xmm0
  comisd %xmm1,%xmm0
  ja     L216
  mulsd  D10(%rip),%xmm0
  comisd %xmm1,%xmm0
  ja     L68
  mulsd  D10(%rip),%xmm0
  comisd %xmm1,%xmm0
  ja     L174
  mulsd  D10(%rip),%xmm0
  comisd %xmm1,%xmm0
  ja     L129
  mulsd  D10(%rip),%xmm0
  comisd %xmm1,%xmm0
  ja     L93
  mulsd  D10(%rip),%xmm0
  comisd %xmm1,%xmm0
  ja     L88
  mulsd  D10(%rip),%xmm0
  comisd %xmm1,%xmm0
  ja     L98
  mulsd  D10(%rip),%xmm0
  xor    %eax,%eax
  ucomisd %xmm1,%xmm0
  setbe  %al
  add    $0x8,%eax
L15:
  cltq
  add    $0x10,%r14
  addl   $0x1,0x10(%rsp,%rax,4)
  cmp    %r14,%r12
  jne    L178
L185:
  pxor   %xmm7,%xmm7
  mov    $0x1,%eax
  lea    0x10(%rsp),%rbp
  cvtsi2sd %r13d,%xmm7
  lea    0x38(%rsp),%r12
  mov    %rbp,%r13
  lea    D0(%rip),%rdi
  lea    D118(%rip),%r14
  divsd  %xmm7,%xmm2
  movsd  %xmm7,0x8(%rsp)
  movapd %xmm2,%xmm0
  call   <printf@plt>
  mov    %ebx,%esi
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  nopl   0x0(%rax,%rax,1)
L125:
  mov    0x0(%r13),%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x4,%r13
  call   <printf@plt>
  cmp    %r13,%r12
  jne    L125
  mov    $0xa,%edi
  call   <putchar@plt>
  movsd  (%rsp),%xmm0
  mov    $0x1,%eax
  lea    D86(%rip),%rdi
  call   <printf@plt>
  pxor   %xmm0,%xmm0
  mov    $0x1,%eax
  lea    D72(%rip),%rdi
  cvtsi2sd %ebx,%xmm0
  mulsd  D100(%rip),%xmm0
  lea    D126(%rip),%rbx
  divsd  0x8(%rsp),%xmm0
  call   <printf@plt>
  nopl   (%rax)
L124:
  pxor   %xmm0,%xmm0
  mov    %rbx,%rdi
  mov    $0x1,%eax
  add    $0x4,%rbp
  cvtsi2sdl -0x4(%rbp),%xmm0
  mulsd  D100(%rip),%xmm0
  divsd  0x8(%rsp),%xmm0
  call   <printf@plt>
  cmp    %r12,%rbp
  jne    L124
  mov    $0xa,%edi
  call   <putchar@plt>
L36:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L133
  add    $0x50,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L184:
  xor    %eax,%eax
  jmp    L15
L216:
  mov    $0x1,%eax
  jmp    L15
L68:
  mov    $0x2,%eax
  jmp    L15
L174:
  mov    $0x3,%eax
  jmp    L15
L129:
  mov    $0x4,%eax
  jmp    L15
L93:
  mov    $0x5,%eax
  jmp    L15
L88:
  mov    $0x6,%eax
  jmp    L15
L98:
  mov    $0x7,%eax
  jmp    L15
L133:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D98
type_infered: f64
name: retrieve_data
arguments: data_tag: D152
type_infered: f64
name: retrieve_data
arguments: data_tag: D10
type_infered: f64
name: retrieve_data
arguments: data_tag: D0
type_infered: string
name: retrieve_data
arguments: data_tag: D118
type_infered: string
name: retrieve_data
arguments: data_tag: D14
type_infered: string
name: retrieve_data
arguments: data_tag: D86
type_infered: string
name: retrieve_data
arguments: data_tag: D72
type_infered: string
name: retrieve_data
arguments: data_tag: D100
type_infered: f64
name: retrieve_data
arguments: data_tag: D126
type_infered: string

tool: D98: 1

tool: D152: 0.1

tool: D10: 10

tool: D0: [mba] QS: q_avg: %15.8le  

tool: D118:  %6d 

tool: D14:  ## %6d # 

tool: D86: [mba] ln  q_min: %15.8le  

tool: D72:  ## %6.2lf # 

tool: D100: 100

tool: D126:  %6.2lf 

assistant: ```c
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;
}
```