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

```asm
<__BetterVBalance>:
  endbr64
  push   %r15
  push   %r14
  mov    %r8,%r14
  push   %r13
  movslq %edi,%r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  sub    $0x18,%rsp
  cmp    $0xffffffff,%esi
  je     L94
  cmp    $0x1,%esi
  je     L105
  lea    D6(%rip),%rdi
  call   <__errexit@plt>
L100:
  add    $0x18,%rsp
  pxor   %xmm0,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L105:
  test   %r13d,%r13d
  jle    L100
  lea    -0x1(%r13),%eax
  cmp    $0x2,%eax
  jbe    L49
  mov    %r13d,%edx
  pxor   %xmm4,%xmm4
  xor    %eax,%eax
  shr    $0x2,%edx
  movaps %xmm4,%xmm3
  movaps %xmm4,%xmm1
  shl    $0x4,%rdx
  nopl   0x0(%rax,%rax,1)
L44:
  movups 0x0(%rbp,%rax,1),%xmm7
  movups (%r12,%rax,1),%xmm0
  addps  %xmm7,%xmm0
  addss  %xmm0,%xmm1
  movaps %xmm0,%xmm2
  shufps $0x55,%xmm0,%xmm2
  addss  %xmm1,%xmm2
  movaps %xmm0,%xmm1
  unpckhps %xmm0,%xmm1
  shufps $0xff,%xmm0,%xmm0
  addss  %xmm2,%xmm1
  addss  %xmm0,%xmm1
  movups (%r14,%rax,1),%xmm0
  add    $0x10,%rax
  addps  %xmm7,%xmm0
  movaps %xmm0,%xmm2
  addss  %xmm3,%xmm2
  movaps %xmm0,%xmm3
  shufps $0x55,%xmm0,%xmm3
  addss  %xmm3,%xmm2
  movaps %xmm0,%xmm3
  unpckhps %xmm0,%xmm3
  shufps $0xff,%xmm0,%xmm0
  addss  %xmm3,%xmm2
  movaps %xmm2,%xmm3
  addss  %xmm0,%xmm3
  cmp    %rdx,%rax
  jne    L44
  mov    %r13d,%edx
  and    $0xfffffffc,%edx
  mov    %edx,%eax
  cmp    %r13d,%edx
  je     L29
L2:
  mov    %r13d,%ecx
  sub    %edx,%ecx
  cmp    $0x1,%ecx
  je     L111
  movq   0x0(%rbp,%rdx,4),%xmm5
  movq   (%r12,%rdx,4),%xmm0
  addps  %xmm5,%xmm0
  addss  %xmm0,%xmm1
  shufps $0xe5,%xmm0,%xmm0
  addss  %xmm0,%xmm1
  movq   (%r14,%rdx,4),%xmm0
  mov    %ecx,%edx
  and    $0xfffffffe,%edx
  addps  %xmm5,%xmm0
  add    %edx,%eax
  movaps %xmm0,%xmm2
  shufps $0xe5,%xmm0,%xmm0
  addss  %xmm3,%xmm2
  movaps %xmm0,%xmm3
  addss  %xmm2,%xmm3
  cmp    %edx,%ecx
  je     L29
L111:
  cltq
  movss  0x0(%rbp,%rax,4),%xmm0
  movss  (%r12,%rax,4),%xmm2
  addss  %xmm0,%xmm2
  addss  (%r14,%rax,4),%xmm0
  addss  %xmm2,%xmm1
  addss  %xmm0,%xmm3
L29:
  pxor   %xmm2,%xmm2
  pxor   %xmm0,%xmm0
  cvtss2sd %xmm1,%xmm1
  pxor   %xmm7,%xmm7
  cvtsi2sd %r13d,%xmm2
  cvtss2sd %xmm3,%xmm0
  pxor   %xmm6,%xmm6
  mov    %r13d,%r13d
  xor    %ebx,%ebx
  movss  %xmm4,0x4(%rsp)
  divsd  %xmm2,%xmm1
  divsd  %xmm2,%xmm0
  cvtsd2ss %xmm1,%xmm7
  movd   %xmm7,%r15d
  cvtsd2ss %xmm0,%xmm6
  movss  %xmm6,0xc(%rsp)
  nopl   0x0(%rax)
L114:
  movss  0x0(%rbp,%rbx,4),%xmm0
  addss  (%r12,%rbx,4),%xmm0
  movd   %r15d,%xmm1
  movss  %xmm4,0x8(%rsp)
  subss  %xmm0,%xmm1
  movaps %xmm1,%xmm0
  call   <fabs@plt>
  pxor   %xmm0,%xmm0
  movss  0xc(%rsp),%xmm1
  cvtsi2ss %rax,%xmm0
  addss  0x4(%rsp),%xmm0
  movss  %xmm0,0x4(%rsp)
  movss  0x0(%rbp,%rbx,4),%xmm0
  addss  (%r14,%rbx,4),%xmm0
  add    $0x1,%rbx
  subss  %xmm0,%xmm1
  movaps %xmm1,%xmm0
  call   <fabs@plt>
  pxor   %xmm0,%xmm0
  movss  0x8(%rsp),%xmm4
  cvtsi2ss %rax,%xmm0
  addss  %xmm0,%xmm4
  cmp    %rbx,%r13
  jne    L114
  movss  0x4(%rsp),%xmm0
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  subss  %xmm4,%xmm0
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L94:
  movss  (%rdx),%xmm3
  movss  (%rcx),%xmm0
  addss  %xmm3,%xmm0
  addss  (%r8),%xmm3
  movaps %xmm0,%xmm7
  movaps %xmm3,%xmm5
  movaps %xmm3,%xmm4
  movaps %xmm0,%xmm6
  cmp    $0x1,%r13d
  jle    L87
  mov    $0x1,%eax
L54:
  movss  0x0(%rbp,%rax,4),%xmm1
  movss  (%r12,%rax,4),%xmm2
  addss  %xmm1,%xmm2
  addss  (%r14,%rax,4),%xmm1
  add    $0x1,%rax
  movaps %xmm2,%xmm8
  movaps %xmm2,%xmm9
  movaps %xmm1,%xmm10
  movaps %xmm1,%xmm11
  maxss  %xmm0,%xmm8
  minss  %xmm7,%xmm9
  maxss  %xmm3,%xmm10
  minss  %xmm5,%xmm11
  addss  %xmm2,%xmm6
  addss  %xmm1,%xmm4
  movaps %xmm8,%xmm0
  movaps %xmm9,%xmm7
  movaps %xmm10,%xmm3
  movaps %xmm11,%xmm5
  cmp    %r13,%rax
  jne    L54
L87:
  subss  %xmm7,%xmm0
  subss  %xmm5,%xmm3
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  divss  %xmm6,%xmm0
  pop    %r14
  pop    %r15
  divss  %xmm4,%xmm3
  subss  %xmm3,%xmm0
  ret
L49:
  pxor   %xmm4,%xmm4
  xor    %edx,%edx
  xor    %eax,%eax
  movaps %xmm4,%xmm3
  movaps %xmm4,%xmm1
  jmp    L2
```

tool_calls: name: parse_data
arguments: tag: D6
datatype: string

tool: D6: Unknown norm: %d


assistant: ```c
float __BetterVBalance(int ncon, int norm, float *vwgt, float *u1wgt, float *u2wgt) {
  int i;
  float sum1, sum2, max1, max2, min1, min2, diff1, diff2;
  if (norm == -1) {
    max1 = min1 = vwgt[0] + u1wgt[0];
    max2 = min2 = vwgt[0] + u2wgt[0];
    sum1 = vwgt[0] + u1wgt[0];
    sum2 = vwgt[0] + u2wgt[0];
    for (i = 1; i < ncon; i++) {
      if (max1 < vwgt[i] + u1wgt[i])
        max1 = vwgt[i] + u1wgt[i];
      if (min1 > vwgt[i] + u1wgt[i])
        min1 = vwgt[i] + u1wgt[i];
      if (max2 < vwgt[i] + u2wgt[i])
        max2 = vwgt[i] + u2wgt[i];
      if (min2 > vwgt[i] + u2wgt[i])
        min2 = vwgt[i] + u2wgt[i];
      sum1 += vwgt[i] + u1wgt[i];
      sum2 += vwgt[i] + u2wgt[i];
    }
    return ((max1 - min1) / sum1) - ((max2 - min2) / sum2);
  } else if (norm == 1) {
    sum1 = sum2 = 0.0;
    for (i = 0; i < ncon; i++) {
      sum1 += vwgt[i] + u1wgt[i];
      sum2 += vwgt[i] + u2wgt[i];
    }
    sum1 = sum1 / (1.0 * ncon);
    sum2 = sum2 / (1.0 * ncon);
    diff1 = diff2 = 0.0;
    for (i = 0; i < ncon; i++) {
      diff1 += fabs(sum1 - (vwgt[i] + u1wgt[i]));
      diff2 += fabs(sum2 - (vwgt[i] + u2wgt[i]));
    }
    return diff1 - diff2;
  } else {
    __errexit("Unknown norm: %d\n", norm);
  }
  return 0.0;
}
```