user: Converte this assembly snippet into its equivalent C code:

```asm
<ViterbiTb>:
  endbr64
  push   %r15
  push   %r14
  mov    %rsi,%r14
  mov    $0x4,%esi
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    0xf0(%rsp),%eax
  mov    %rcx,0x38(%rsp)
  mov    0xf8(%rsp),%ebx
  mov    %rdi,0xa0(%rsp)
  sub    $0x1,%eax
  mov    0x108(%rsp),%r12d
  mov    %rdx,0x30(%rsp)
  mov    %eax,%ecx
  mov    $0x1,%eax
  mov    %r8,0x40(%rsp)
  mov    0x100(%rsp),%r13d
  mov    %eax,%edi
  mov    %ecx,0x98(%rsp)
  shl    %cl,%edi
  mov    %ebx,%ecx
  mov    %r9,0x48(%rsp)
  movslq %edi,%rbp
  shl    %cl,%eax
  mov    %edi,0x20(%rsp)
  mov    %rbp,%rdi
  mov    %r13d,0x24(%rsp)
  add    %r12d,%r13d
  mov    %r12d,0x8(%rsp)
  mov    %r13d,%r12d
  mov    %rbp,0xa8(%rsp)
  mov    %eax,0x28(%rsp)
  call   <calloc@plt>
  mov    %rbp,%rdi
  mov    $0x4,%esi
  mov    %rax,%r15
  call   <calloc@plt>
  mov    $0x4,%esi
  mov    %r13d,0x6c(%rsp)
  movzbl 0x98(%rsp),%ecx
  mov    %rax,%rbp
  shl    %cl,%r12d
  movslq %r12d,%r12
  mov    %r12,%rdi
  call   <calloc@plt>
  mov    %r12,%rdi
  mov    $0x4,%esi
  mov    %rax,0x18(%rsp)
  call   <calloc@plt>
  movslq %ebx,%rdi
  mov    $0x4,%esi
  mov    %rax,0x10(%rsp)
  call   <calloc@plt>
  mov    $0x4,%esi
  mov    %rax,%r13
  movslq 0x28(%rsp),%rax
  mov    %rax,%rdi
  mov    %rax,0x50(%rsp)
  call   <calloc@plt>
  mov    0x20(%rsp),%r10d
  mov    %rax,%r12
  test   %r10d,%r10d
  jle    L105
  mov    0x20(%rsp),%ecx
  lea    -0x1(%rcx),%eax
  cmp    $0x2,%eax
  jbe    L127
  shr    $0x2,%ecx
  movaps D38(%rip),%xmm0
  mov    %rbp,%rax
  mov    %ecx,%edx
  shl    $0x4,%rdx
  add    %rbp,%rdx
  nop
L192:
  movups %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L192
  mov    0x20(%rsp),%ecx
  mov    %ecx,%eax
  and    $0xfffffffc,%eax
  and    $0x3,%ecx
  je     L105
L194:
  movss  D38(%rip),%xmm0
  movslq %eax,%rdx
  mov    0x20(%rsp),%edi
  lea    0x0(,%rdx,4),%rcx
  movss  %xmm0,0x0(%rbp,%rdx,4)
  lea    0x1(%rax),%edx
  cmp    %edx,%edi
  jle    L105
  add    $0x2,%eax
  movss  %xmm0,0x4(%rbp,%rcx,1)
  cmp    %eax,%edi
  jle    L105
  movss  %xmm0,0x8(%rbp,%rcx,1)
L105:
  mov    0x8(%rsp),%eax
  neg    %eax
  mov    %eax,0x4(%rsp)
  cmp    %eax,0x6c(%rsp)
  jle    L65
  mov    0x24(%rsp),%eax
  mov    0x8(%rsp),%r9d
  imul   %ebx,%eax
  mov    %eax,0x2c(%rsp)
  test   %r9d,%r9d
  jg     L445
  mov    0x20(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x68(%rsp)
  lea    -0x1(%rbx),%eax
  mov    %eax,0x9c(%rsp)
L85:
  mov    0x9c(%rsp),%eax
  mov    0x20(%rsp),%ecx
  mov    %r14,0x80(%rsp)
  lea    0x4(,%rax,4),%rax
  mov    %rax,0x78(%rsp)
  mov    0x68(%rsp),%eax
  mov    %rax,0x8(%rsp)
  lea    0x4(%rbp,%rax,4),%rax
  mov    %rax,0x70(%rsp)
  mov    %ecx,%eax
  and    $0xfffffffc,%ecx
  shr    $0x2,%eax
  mov    %ecx,0x90(%rsp)
  sub    $0x1,%eax
  add    $0x1,%rax
  shl    $0x4,%rax
  mov    %rax,0x88(%rsp)
  mov    %r12,%rax
  mov    %rbp,%r12
  mov    %r15,%rbp
  mov    %rax,%r15
  nopl   0x0(%rax)
L219:
  mov    0x4(%rsp),%eax
  cltd
  idivl  0x24(%rsp)
  mov    0x2c(%rsp),%eax
  imul   %ebx,%edx
  add    %edx,%eax
  test   %edx,%edx
  cmovs  %eax,%edx
  test   %ebx,%ebx
  jle    L110
  mov    0x48(%rsp),%rax
  movslq %edx,%rdx
  mov    %r13,%rdi
  lea    (%rax,%rdx,4),%rsi
  mov    0x78(%rsp),%rdx
  call   <memcpy@plt>
L110:
  mov    0x28(%rsp),%esi
  test   %esi,%esi
  jle    L333
  xor    %r14d,%r14d
  mov    %rbp,0x58(%rsp)
  mov    %r14,%rbp
  mov    0x50(%rsp),%r14
  nopl   0x0(%rax)
L328:
  mov    %ebp,%esi
  mov    %ebx,%edx
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <Gamma@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movss  %xmm0,(%r15,%rbp,4)
  add    $0x1,%rbp
  cmp    %rbp,%r14
  jne    L328
  mov    0x58(%rsp),%rbp
L333:
  mov    0x20(%rsp),%ecx
  test   %ecx,%ecx
  jle    L433
  mov    0x4(%rsp),%r11d
  movzbl 0x98(%rsp),%ecx
  mov    %ebx,0x60(%rsp)
  xor    %eax,%eax
  mov    0x40(%rsp),%r14
  mov    0x30(%rsp),%rbx
  mov    %r13,0x58(%rsp)
  mov    0x80(%rsp),%r10
  mov    0x38(%rsp),%r13
  shl    %cl,%r11d
  jmp    L397
  nopw   0x0(%rax,%rax,1)
L494:
  movss  %xmm1,(%rdi)
  add    %r11d,%edx
  mov    0x10(%rsp),%rdi
  comiss (%rsi),%xmm0
  movslq %edx,%rdx
  mov    %eax,(%rdi,%rdx,4)
  mov    0x18(%rsp),%rdi
  movl   $0x0,(%rdi,%rdx,4)
  jbe    L381
  movss  %xmm0,(%rsi)
L52:
  mov    0x10(%rsp),%rdi
  add    %r11d,%ecx
  movslq %ecx,%rcx
  mov    %r9d,(%rdi,%rcx,4)
  mov    0x18(%rsp),%rdi
  movl   $0x1,(%rdi,%rcx,4)
L381:
  lea    0x1(%rax),%rdx
  cmp    0x8(%rsp),%rax
  je     L223
L451:
  mov    %rdx,%rax
L397:
  movslq (%r10,%rax,4),%rdx
  movslq (%rbx,%rax,4),%rcx
  mov    %eax,%r9d
  movss  0x0(%rbp,%rax,4),%xmm0
  movslq (%r14,%rax,4),%rsi
  movss  (%r15,%rdx,4),%xmm1
  lea    (%r12,%rcx,4),%rdi
  movslq 0x0(%r13,%rax,4),%r8
  mov    %rcx,%rdx
  mov    %rsi,%rcx
  lea    (%r12,%rsi,4),%rsi
  addss  %xmm0,%xmm1
  comiss (%rdi),%xmm1
  addss  (%r15,%r8,4),%xmm0
  ja     L494
  comiss (%rsi),%xmm0
  jbe    L381
  mov    0x4(%rsp),%edx
  movss  %xmm0,(%rsi)
  test   %edx,%edx
  jns    L52
  lea    0x1(%rax),%rdx
  cmp    0x8(%rsp),%rax
  jne    L451
L223:
  mov    0x58(%rsp),%r13
  mov    0x60(%rsp),%ebx
  mov    %r12,%rax
  pxor   %xmm0,%xmm0
  mov    0x70(%rsp),%rdx
  nopw   0x0(%rax,%rax,1)
L501:
  movss  (%rax),%xmm1
  add    $0x4,%rax
  maxss  %xmm0,%xmm1
  movaps %xmm1,%xmm0
  cmp    %rdx,%rax
  jne    L501
  cmpl   $0x2,0x68(%rsp)
  jbe    L373
  mov    0x88(%rsp),%rdx
  movaps %xmm0,%xmm2
  xor    %eax,%eax
  shufps $0x0,%xmm2,%xmm2
L280:
  movups (%r12,%rax,1),%xmm1
  movaps D38(%rip),%xmm3
  subps  %xmm2,%xmm1
  movups %xmm3,(%r12,%rax,1)
  movups %xmm1,0x0(%rbp,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L280
  mov    0x90(%rsp),%eax
  mov    %eax,%edx
  cmp    %eax,0x20(%rsp)
  je     L433
L125:
  mov    0x20(%rsp),%ecx
  sub    %edx,%ecx
  cmp    $0x1,%ecx
  je     L106
  lea    (%r12,%rdx,4),%rsi
  movaps %xmm0,%xmm2
  mov    D38(%rip),%rdi
  movq   (%rsi),%xmm1
  shufps $0xe0,%xmm2,%xmm2
  mov    %rdi,(%rsi)
  subps  %xmm2,%xmm1
  movlps %xmm1,0x0(%rbp,%rdx,4)
  mov    %ecx,%edx
  and    $0xfffffffe,%edx
  add    %edx,%eax
  cmp    %ecx,%edx
  je     L433
L106:
  cltq
  lea    (%r12,%rax,4),%rdx
  movss  (%rdx),%xmm1
  movl   $0xcb189680,(%rdx)
  subss  %xmm0,%xmm1
  movss  %xmm1,0x0(%rbp,%rax,4)
L433:
  addl   $0x1,0x4(%rsp)
  mov    0x4(%rsp),%eax
  cmp    %eax,0x6c(%rsp)
  jg     L219
  mov    %r15,%rax
  mov    %rbp,%r15
  mov    %r12,%rbp
  mov    %rax,%r12
L65:
  xor    %eax,%eax
  cmpl   $0x1,0x20(%rsp)
  movss  (%r15),%xmm0
  mov    $0x1,%edx
  mov    0xa8(%rsp),%rcx
  jle    L384
  nopl   0x0(%rax)
L467:
  movss  (%r15,%rdx,4),%xmm1
  comiss %xmm0,%xmm1
  maxss  %xmm0,%xmm1
  cmova  %edx,%eax
  add    $0x1,%rdx
  movaps %xmm1,%xmm0
  cmp    %rcx,%rdx
  jne    L467
L384:
  mov    0x6c(%rsp),%esi
  mov    0x24(%rsp),%ebx
  sub    $0x1,%esi
  lea    -0x1(%rbx),%edi
  cmp    %esi,0x24(%rsp)
  jg     L43
  mov    0x24(%rsp),%edi
  mov    0x98(%rsp),%ecx
  mov    %eax,%edx
  mov    0x10(%rsp),%r8
  sub    $0x1,%edi
  nopl   (%rax)
L323:
  mov    %esi,%eax
  sub    $0x1,%esi
  shl    %cl,%eax
  add    %edx,%eax
  cltq
  mov    (%r8,%rax,4),%edx
  cmp    %esi,%edi
  jne    L323
  mov    %edx,%eax
L43:
  movslq %edi,%rsi
  test   %edi,%edi
  js     L477
  mov    0x98(%rsp),%ecx
  mov    0x18(%rsp),%rdi
  mov    %eax,%edx
  mov    0x10(%rsp),%r8
  mov    0xa0(%rsp),%r9
  nop
L1:
  mov    %esi,%eax
  shl    %cl,%eax
  add    %edx,%eax
  cltq
  mov    (%rdi,%rax,4),%edx
  mov    %edx,(%r9,%rsi,4)
  sub    $0x1,%rsi
  mov    (%r8,%rax,4),%edx
  test   %esi,%esi
  jns    L1
L477:
  mov    %r15,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  add    $0xb8,%rsp
  mov    %r12,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <free@plt>
L445:
  mov    0x6c(%rsp),%edi
  xor    %eax,%eax
  mov    %r14,0x60(%rsp)
  test   %edi,%edi
  cmovle %edi,%eax
  mov    %eax,0x58(%rsp)
  lea    -0x1(%rbx),%eax
  mov    %eax,0x9c(%rsp)
  lea    0x4(,%rax,4),%rax
  mov    %rax,0x70(%rsp)
  mov    0x20(%rsp),%eax
  lea    -0x1(%rax),%edi
  lea    0x4(%rbp,%rdi,4),%rcx
  mov    %edi,0x68(%rsp)
  mov    %rcx,0x80(%rsp)
  mov    %eax,%ecx
  shr    $0x2,%eax
  sub    $0x1,%eax
  and    $0xfffffffc,%ecx
  mov    %rdi,0x78(%rsp)
  add    $0x1,%rax
  mov    %ecx,0x88(%rsp)
  shl    $0x4,%rax
  mov    %rax,0x90(%rsp)
  mov    %r12,%rax
  mov    %rbp,%r12
  mov    %r15,%rbp
  mov    %rax,%r15
  cs nopw 0x0(%rax,%rax,1)
L173:
  mov    0x4(%rsp),%eax
  cltd
  idivl  0x24(%rsp)
  mov    0x2c(%rsp),%eax
  imul   %ebx,%edx
  add    %edx,%eax
  test   %edx,%edx
  cmovs  %eax,%edx
  test   %ebx,%ebx
  jle    L480
  mov    0x48(%rsp),%rax
  movslq %edx,%rdx
  mov    %r13,%rdi
  lea    (%rax,%rdx,4),%rsi
  mov    0x70(%rsp),%rdx
  call   <memcpy@plt>
L480:
  mov    0x28(%rsp),%r8d
  xor    %r14d,%r14d
  test   %r8d,%r8d
  jle    L439
  mov    %rbp,0x8(%rsp)
  mov    %r14,%rbp
  mov    0x50(%rsp),%r14
  xchg   %ax,%ax
L349:
  mov    %ebp,%esi
  mov    %ebx,%edx
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <Gamma@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movss  %xmm0,(%r15,%rbp,4)
  add    $0x1,%rbp
  cmp    %rbp,%r14
  jne    L349
  mov    0x8(%rsp),%rbp
L439:
  mov    0x20(%rsp),%edi
  xor    %eax,%eax
  test   %edi,%edi
  jle    L179
  mov    0x78(%rsp),%rsi
  mov    0x60(%rsp),%rdi
  mov    0x30(%rsp),%r8
  mov    0x38(%rsp),%r9
  mov    0x40(%rsp),%r10
  jmp    L443
  nopl   0x0(%rax,%rax,1)
L26:
  lea    0x1(%rax),%rdx
  cmp    %rsi,%rax
  je     L240
L80:
  mov    %rdx,%rax
L443:
  movslq (%rdi,%rax,4),%rdx
  movss  0x0(%rbp,%rax,4),%xmm0
  movslq (%r10,%rax,4),%rcx
  movslq (%r9,%rax,4),%r11
  movss  (%r15,%rdx,4),%xmm1
  movslq (%r8,%rax,4),%rdx
  lea    (%r12,%rcx,4),%rcx
  lea    (%r12,%rdx,4),%rdx
  addss  %xmm0,%xmm1
  comiss (%rdx),%xmm1
  addss  (%r15,%r11,4),%xmm0
  jbe    L9
  movss  %xmm1,(%rdx)
L9:
  comiss (%rcx),%xmm0
  jbe    L26
  movss  %xmm0,(%rcx)
  lea    0x1(%rax),%rdx
  cmp    %rsi,%rax
  jne    L80
L240:
  mov    0x80(%rsp),%rdx
  mov    %r12,%rax
  pxor   %xmm0,%xmm0
  nopl   0x0(%rax)
L385:
  movss  (%rax),%xmm1
  add    $0x4,%rax
  maxss  %xmm0,%xmm1
  movaps %xmm1,%xmm0
  cmp    %rax,%rdx
  jne    L385
  cmpl   $0x2,0x68(%rsp)
  jbe    L304
  mov    0x90(%rsp),%rdx
  movaps %xmm1,%xmm2
  xor    %eax,%eax
  shufps $0x0,%xmm2,%xmm2
L486:
  movups (%r12,%rax,1),%xmm1
  movaps D38(%rip),%xmm4
  subps  %xmm2,%xmm1
  movups %xmm4,(%r12,%rax,1)
  movups %xmm1,0x0(%rbp,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L486
  mov    0x88(%rsp),%eax
  mov    0x20(%rsp),%edi
  cmp    %edi,%eax
  je     L179
  mov    %eax,%edx
  mov    %edi,%ecx
L61:
  sub    %edx,%ecx
  cmp    $0x1,%ecx
  je     L195
  lea    (%r12,%rdx,4),%rsi
  movaps %xmm0,%xmm2
  mov    D38(%rip),%rdi
  movq   (%rsi),%xmm1
  shufps $0xe0,%xmm2,%xmm2
  mov    %rdi,(%rsi)
  subps  %xmm2,%xmm1
  movlps %xmm1,0x0(%rbp,%rdx,4)
  mov    %ecx,%edx
  and    $0xfffffffe,%edx
  add    %edx,%eax
  cmp    %edx,%ecx
  je     L179
L195:
  cltq
  lea    (%r12,%rax,4),%rdx
  movss  (%rdx),%xmm1
  movl   $0xcb189680,(%rdx)
  subss  %xmm0,%xmm1
  movss  %xmm1,0x0(%rbp,%rax,4)
L179:
  addl   $0x1,0x4(%rsp)
  mov    0x4(%rsp),%eax
  cmp    0x58(%rsp),%eax
  jl     L173
  mov    %eax,%ecx
  mov    %r15,%rax
  mov    0x60(%rsp),%r14
  mov    %rbp,%r15
  mov    %r12,%rbp
  mov    %rax,%r12
  cmp    %ecx,0x6c(%rsp)
  jg     L85
  jmp    L65
L304:
  mov    0x20(%rsp),%ecx
  xor    %edx,%edx
  xor    %eax,%eax
  jmp    L61
L373:
  xor    %edx,%edx
  xor    %eax,%eax
  jmp    L125
L127:
  xor    %eax,%eax
  jmp    L194
```

tool_calls: name: parse_data
arguments: data_tag: D38
type_infered: byte[16]

tool: {"D38": [0x80,0x96,0x18,0xcb,0x80,0x96,0x18,0xcb,0x80,0x96,0x18,0xcb,0x80,0x96,0x18,0xcb]}

assistant: ```c
void ViterbiTb(int output_u_int[], int out0[], int state0[], int out1[], int state1[], float input_c[], int KK, int nn, int LL, int depth) {
  int i, t, state, mm, states, max_state;
  int number_symbols, starting_bit;
  float metric;
  float *prev_section, *next_section;
  int *prev_bit;
  int *prev_state;
  float *metric_c;
  float *rec_array;
  float max_val;
  mm = KK - 1;
  states = 1 << mm;
  number_symbols = 1 << nn;
  prev_section = calloc(states, sizeof(float));
  next_section = calloc(states, sizeof(float));
  prev_bit = calloc(states * (LL + depth), sizeof(int));
  prev_state = calloc(states * (LL + depth), sizeof(int));
  rec_array = calloc(nn, sizeof(float));
  metric_c = calloc(number_symbols, sizeof(float));
  for (state = 0; state < states; state++) {
    prev_section[state] = 0;
    next_section[state] = -1e7;
  }
  for (t = -depth; t < LL + depth; t++) {
    starting_bit = nn * (t % LL);
    if (starting_bit < 0)
      starting_bit = nn * LL + starting_bit;
    for (i = 0; i < nn; i++) {
      rec_array[i] = input_c[starting_bit + i];
    }
    for (i = 0; i < number_symbols; i++)
      metric_c[i] = Gamma(rec_array, i, nn);
    for (state = 0; state < states; state++) {
      metric = prev_section[state] + metric_c[out0[state]];
      if (metric > next_section[state0[state]]) {
        next_section[state0[state]] = metric;
        if (t >= 0) {
          prev_state[t * states + state0[state]] = state;
          prev_bit[t * states + state0[state]] = 0;
        }
      }
      metric = prev_section[state] + metric_c[out1[state]];
      if (metric > next_section[state1[state]]) {
        next_section[state1[state]] = metric;
        if (t >= 0) {
          prev_state[t * states + state1[state]] = state;
          prev_bit[t * states + state1[state]] = 1;
        }
      }
    }
    max_val = 0;
    for (state = 0; state < states; state++) {
      if (next_section[state] > max_val) {
        max_val = next_section[state];
        max_state = state;
      }
    }
    for (state = 0; state < states; state++) {
      prev_section[state] = next_section[state] - max_val;
      next_section[state] = -1e7;
    }
  }
  max_val = prev_section[0];
  max_state = 0;
  for (state = 1; state < states; state++) {
    if (prev_section[state] > max_val) {
      max_val = prev_section[state];
      max_state = state;
    }
  }
  state = max_state;
  for (t = LL + depth - 1; t >= LL; t--) {
    state = prev_state[t * states + state];
  }
  for (t = LL - 1; t >= 0; t--) {
    output_u_int[t] = prev_bit[t * states + state];
    state = prev_state[t * states + state];
  }
  free(prev_section);
  free(next_section);
  free(prev_bit);
  free(prev_state);
  free(rec_array);
  free(metric_c);
}
```