user: Translate the below assembly code into C programming language:

```asm
<inconsistency_calculation_alt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r15
  mov    %edx,%r12d
  mov    %ecx,0x28(%rsp)
  movslq %edx,%rax
  mov    %rax,%rdx
  shr    $0x3,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %r12d,%xmm0
  mulsd  D9(%rip),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %rdx,%xmm1
  ucomisd %xmm1,%xmm0
  jp     L176
  mov    %edx,%r14d
  jne    L176
L103:
  lea    0x0(,%rax,4),%rdi
  call   <malloc@plt>
  mov    %rax,%rbp
  movslq %r14d,%rbx
  mov    %rbx,0x20(%rsp)
  mov    %rbx,%rdi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  mov    %rbx,%rdi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  cmp    $0x1,%r12d
  jle    L143
  lea    -0x1(%r12),%eax
  mov    %eax,0x2c(%rsp)
  movl   $0x0,0x4(%rsp)
  jmp    L163
L176:
  lea    0x1(%rdx),%r14d
  jmp    L103
L175:
  mov    $0x1,%edi
  shl    %cl,%edi
  or     %edi,%r11d
  mov    %r11b,(%rdx)
  add    $0x1,%eax
  sub    %r12d,%r9d
  mov    %r9d,0x4(%rbp,%r8,1)
  jmp    L8
L17:
  add    $0x1,%esi
  movsd  0x10(%rbx),%xmm0
  addsd  %xmm0,%xmm2
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  sub    $0x1,%eax
L8:
  test   %eax,%eax
  js     L43
L171:
  movslq %eax,%rdx
  lea    0x0(,%rdx,4),%r8
  mov    0x0(%rbp,%rdx,4),%edi
  lea    0x0(,%rdi,4),%edx
  movslq %edx,%rdx
  lea    0x0(%r13,%rdx,8),%rbx
  cmp    %eax,%r10d
  jle    L17
  cvttsd2si (%rbx),%r9d
  movsd  0x8(%rbx),%xmm0
  cmp    %r9d,%r12d
  jg     L47
  movslq %edi,%rdx
  shr    $0x3,%rdx
  add    0x8(%rsp),%rdx
  movzbl (%rdx),%r11d
  mov    %edi,%ecx
  not    %ecx
  and    $0x7,%ecx
  movzbl %r11b,%r14d
  bt     %ecx,%r14d
  jae    L175
L47:
  cvttsd2si %xmm0,%r9d
  cmp    %r9d,%r12d
  jg     L17
  movslq %edi,%rdx
  shr    $0x3,%rdx
  add    0x10(%rsp),%rdx
  movzbl (%rdx),%r11d
  mov    %edi,%ecx
  not    %ecx
  and    $0x7,%ecx
  movzbl %r11b,%edi
  bt     %ecx,%edi
  jb     L17
  mov    $0x1,%edi
  shl    %cl,%edi
  or     %edi,%r11d
  mov    %r11b,(%rdx)
  add    $0x1,%eax
  sub    %r12d,%r9d
  mov    %r9d,0x4(%rbp,%r8,1)
  jmp    L8
L43:
  pxor   %xmm0,%xmm0
  cvtsi2sd %esi,%xmm0
  mov    %r15,%r14
  movsd  %xmm0,0x10(%r15)
  movapd %xmm2,%xmm3
  divsd  %xmm0,%xmm3
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm3,(%r15)
  cmp    $0x1,%esi
  jle    L48
  mulsd  %xmm2,%xmm2
  divsd  %xmm0,%xmm2
  subsd  %xmm2,%xmm1
  sub    $0x1,%esi
  pxor   %xmm0,%xmm0
  cvtsi2sd %esi,%xmm0
  divsd  %xmm0,%xmm1
L2:
  pxor   %xmm4,%xmm4
  comisd %xmm1,%xmm4
  ja     L95
  ucomisd %xmm1,%xmm4
  ja     L26
L50:
  sqrtsd %xmm1,%xmm1
L28:
  movsd  %xmm1,0x8(%r14)
  comisd D16(%rip),%xmm1
  jbe    L215
  movsd  0x10(%rbx),%xmm0
  subsd  0x18(%rsp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,0x18(%r14)
L215:
  addl   $0x1,0x4(%rsp)
  mov    0x4(%rsp),%eax
  add    $0x20,%r15
  cmp    %eax,0x2c(%rsp)
  je     L143
L163:
  mov    0x20(%rsp),%rbx
  mov    %rbx,%rdx
  mov    $0x0,%esi
  mov    0x8(%rsp),%rdi
  call   <memset@plt>
  mov    %rbx,%rdx
  mov    $0x0,%esi
  mov    0x10(%rsp),%rdi
  call   <memset@plt>
  mov    0x4(%rsp),%eax
  mov    %eax,0x0(%rbp)
  mov    $0x0,%esi
  pxor   %xmm1,%xmm1
  movapd %xmm1,%xmm2
  mov    $0x0,%eax
  mov    0x28(%rsp),%ebx
  lea    -0x1(%rbx),%r10d
  jmp    L171
L48:
  mulsd  %xmm2,%xmm2
  subsd  %xmm2,%xmm1
  divsd  %xmm0,%xmm1
  jmp    L2
L95:
  pxor   %xmm1,%xmm1
  jmp    L50
L26:
  movapd %xmm1,%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  jmp    L28
L143:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D9
type_infered: f32[2]
name: parse_data
arguments: data_tag: D16
type_infered: f32[4]

tool: {"D9": [0.0,1.5]}

tool: {"D16": [0.0,0.0,0.0,1.5]}

assistant: ```c
void inconsistency_calculation_alt(const double *Z, double *R, int n, int d) {
  int *curNode;
  int ndid, lid, rid, i, k;
  unsigned char *lvisited, *rvisited;
  const double *Zrow;
  double *Rrow;
  double levelSum, levelStdSum;
  int levelCnt;
  const int bff = (((((double)(n)) / (double)(sizeof(unsigned char) * 8)) == ((double)(((n)) / ((sizeof(unsigned char) * 8)))) ? (((n)) / ((sizeof(unsigned char) * 8))) : (((n)) / ((sizeof(unsigned char) * 8)) + 1)));
  k = 0;
  curNode = (int *)malloc(n * sizeof(int));
  lvisited = (unsigned char *)malloc(bff);
  rvisited = (unsigned char *)malloc(bff);
  for (i = 0; i < n - 1; i++) {
    k = 0;
    levelSum = 0.0;
    levelCnt = 0;
    levelStdSum = 0.0;
    bzero(lvisited, bff);
    bzero(rvisited, bff);
    curNode[0] = i;
    for (k = 0; k >= 0;) {
      ndid = curNode[k];
      Zrow = Z + ((ndid)*4);
      lid = (int)Zrow[0];
      rid = (int)Zrow[1];
      if (k < d - 1) {
        if (lid >= n && !(((lvisited)[(ndid) / (sizeof(unsigned char) * 8)] >> (((sizeof(unsigned char) * 8) - 1) - ((ndid) % (sizeof(unsigned char) * 8)))) & 0x1)) {
          ((lvisited)[(ndid) / (sizeof(unsigned char) * 8)] |= ((0x1) << (((sizeof(unsigned char) * 8) - 1) - ((ndid) % (sizeof(unsigned char) * 8)))));
          k++;
          curNode[k] = lid - n;
          continue;
        }
        if (rid >= n && !(((rvisited)[(ndid) / (sizeof(unsigned char) * 8)] >> (((sizeof(unsigned char) * 8) - 1) - ((ndid) % (sizeof(unsigned char) * 8)))) & 0x1)) {
          ((rvisited)[(ndid) / (sizeof(unsigned char) * 8)] |= ((0x1) << (((sizeof(unsigned char) * 8) - 1) - ((ndid) % (sizeof(unsigned char) * 8)))));
          k++;
          curNode[k] = rid - n;
          continue;
        }
      }
      levelCnt++;
      levelSum += Zrow[2];
      levelStdSum += Zrow[2] * Zrow[2];
      k--;
    }
    Rrow = R + (4 * i);
    Rrow[2] = (double)levelCnt;
    Rrow[0] = levelSum / levelCnt;
    if (levelCnt < 2) {
      Rrow[1] = (levelStdSum - (levelSum * levelSum)) / levelCnt;
    } else {
      Rrow[1] = (levelStdSum - ((levelSum * levelSum) / levelCnt)) / (levelCnt - 1);
    }
    Rrow[1] = sqrt(((0 > Rrow[1]) ? (0) : (Rrow[1])));
    if (Rrow[1] > 0) {
      Rrow[3] = (Zrow[2] - Rrow[0]) / Rrow[1];
    }
  }
  free(curNode);
  free(lvisited);
  free(rvisited);
}
```