user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<Viterbi>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,0x68(%rsp)
  mov    %rsi,0x38(%rsp)
  mov    %rdx,0x40(%rsp)
  mov    %rcx,0x48(%rsp)
  mov    %r8,0x50(%rsp)
  mov    %r9,0x58(%rsp)
  mov    0xb0(%rsp),%eax
  lea    -0x1(%rax),%r14d
  mov    %r14d,0x30(%rsp)
  mov    $0x1,%eax
  mov    %eax,%edi
  mov    %r14d,%ecx
  shl    %cl,%edi
  movzbl 0xb8(%rsp),%ecx
  shl    %cl,%eax
  mov    %eax,%r12d
  mov    %eax,0x34(%rsp)
  mov    %edi,0x1c(%rsp)
  movslq %edi,%rbx
  mov    $0x4,%esi
  mov    %rbx,%rdi
  call   <calloc@plt>
  mov    %rax,%r15
  mov    $0x4,%esi
  mov    %rbx,%rdi
  call   <calloc@plt>
  mov    %rax,%rbp
  mov    %r14d,%eax
  add    0xc0(%rsp),%eax
  mov    %eax,0x18(%rsp)
  mov    %r14d,%ecx
  shl    %cl,%eax
  movslq %eax,%rbx
  mov    $0x4,%esi
  mov    %rbx,%rdi
  call   <calloc@plt>
  mov    %rax,0x28(%rsp)
  mov    $0x4,%esi
  mov    %rbx,%rdi
  call   <calloc@plt>
  mov    %rax,0x20(%rsp)
  movslq 0xb8(%rsp),%rdi
  mov    $0x4,%esi
  call   <calloc@plt>
  mov    %rax,%r13
  movslq %r12d,%rdi
  mov    $0x4,%esi
  call   <calloc@plt>
  mov    %rax,%r12
  mov    0x1c(%rsp),%edi
  test   %edi,%edi
  jle    L31
  mov    %edi,%edx
  mov    $0x0,%eax
  movss  D8(%rip),%xmm0
L211:
  movss  %xmm0,(%r15,%rax,4)
  movss  %xmm0,0x0(%rbp,%rax,4)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L211
L31:
  movl   $0x0,(%r15)
  cmpl   $0x0,0x18(%rsp)
  jle    L183
  mov    0x1c(%rsp),%eax
  lea    -0x1(%rax),%r14d
  lea    0x4(%rbp,%r14,4),%rax
  mov    %rax,0x60(%rsp)
  movl   $0x0,0x4(%rsp)
  movl   $0x0,(%rsp)
  jmp    L22
L135:
  lea    0x1(%rax),%rdx
  cmp    %r14,%rax
  je     L106
  mov    %rdx,%rax
L33:
  mov    %eax,%ecx
  movss  (%r15,%rax,4),%xmm0
  movslq (%r8,%rax,4),%rdx
  movaps %xmm0,%xmm1
  addss  (%r12,%rdx,4),%xmm1
  mov    (%r9,%rax,4),%edx
  movslq %edx,%rbx
  lea    0x0(%rbp,%rbx,4),%rbx
  comiss (%rbx),%xmm1
  jbe    L207
  movss  %xmm1,(%rbx)
  add    %r13d,%edx
  movslq %edx,%rdx
  mov    %eax,(%rdi,%rdx,4)
  movl   $0x0,(%rsi,%rdx,4)
L207:
  movslq (%r10,%rax,4),%rdx
  addss  (%r12,%rdx,4),%xmm0
  mov    (%r11,%rax,4),%edx
  movslq %edx,%rbx
  lea    0x0(%rbp,%rbx,4),%rbx
  comiss (%rbx),%xmm0
  jbe    L135
  movss  %xmm0,(%rbx)
  add    %r13d,%edx
  movslq %edx,%rdx
  mov    %ecx,(%rdi,%rdx,4)
  movl   $0x1,(%rsi,%rdx,4)
  jmp    L135
L106:
  mov    0x8(%rsp),%r13
  mov    %rbp,%rax
  pxor   %xmm1,%xmm1
  mov    0x60(%rsp),%rdx
L181:
  movss  (%rax),%xmm0
  maxss  %xmm1,%xmm0
  movaps %xmm0,%xmm1
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L181
  mov    $0x0,%eax
L219:
  movss  0x0(%rbp,%rax,4),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,(%r15,%rax,4)
  movss  D8(%rip),%xmm2
  movss  %xmm2,0x0(%rbp,%rax,4)
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rdx,%r14
  jne    L219
L115:
  addl   $0x1,(%rsp)
  mov    (%rsp),%eax
  mov    0xb8(%rsp),%ecx
  add    %ecx,0x4(%rsp)
  cmp    %eax,0x18(%rsp)
  je     L183
L22:
  cmpl   $0x0,0xb8(%rsp)
  jle    L182
  mov    0xb8(%rsp),%ecx
  movslq 0x4(%rsp),%rax
  mov    0x58(%rsp),%rdi
  lea    (%rdi,%rax,8),%rdx
  mov    $0x0,%eax
L123:
  pxor   %xmm0,%xmm0
  cvtsd2ss (%rdx,%rax,8),%xmm0
  movss  %xmm0,0x0(%r13,%rax,4)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L123
L182:
  mov    0x34(%rsp),%eax
  test   %eax,%eax
  jle    L185
  mov    %eax,%eax
  mov    $0x0,%ebx
  mov    %r14,0x8(%rsp)
  mov    %rbp,0x10(%rsp)
  mov    %rax,%r14
  mov    0xb8(%rsp),%ebp
L50:
  mov    %ebp,%edx
  mov    %ebx,%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <Gamma@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movss  %xmm0,(%r12,%rbx,4)
  add    $0x1,%rbx
  cmp    %r14,%rbx
  jne    L50
  mov    0x8(%rsp),%r14
  mov    0x10(%rsp),%rbp
L185:
  cmpl   $0x0,0x1c(%rsp)
  jle    L115
  mov    (%rsp),%esi
  movzbl 0x30(%rsp),%ecx
  shl    %cl,%esi
  mov    $0x0,%eax
  mov    0x20(%rsp),%rdi
  mov    %r13,0x8(%rsp)
  mov    %esi,%r13d
  mov    0x28(%rsp),%rsi
  mov    0x38(%rsp),%r8
  mov    0x40(%rsp),%r9
  mov    0x48(%rsp),%r10
  mov    0x50(%rsp),%r11
  jmp    L33
L183:
  mov    0x18(%rsp),%esi
  sub    $0x1,%esi
  cmp    %esi,0xc0(%rsp)
  jg     L143
  mov    0xc0(%rsp),%eax
  lea    -0x1(%rax),%edi
  mov    $0x0,%eax
  mov    0x30(%rsp),%ecx
  mov    0x20(%rsp),%r8
  mov    %eax,%edx
L154:
  mov    %esi,%eax
  shl    %cl,%eax
  add    %edx,%eax
  cltq
  mov    (%r8,%rax,4),%edx
  sub    $0x1,%esi
  cmp    %edi,%esi
  jne    L154
  mov    %edx,%eax
L129:
  mov    0xc0(%rsp),%esi
  sub    $0x1,%esi
  js     L8
  movslq %esi,%rsi
  mov    0x30(%rsp),%ecx
  mov    0x28(%rsp),%rdi
  mov    0x20(%rsp),%r8
  mov    %eax,%edx
  mov    0x68(%rsp),%r9
L162:
  mov    %esi,%eax
  shl    %cl,%eax
  add    %edx,%eax
  cltq
  mov    (%rdi,%rax,4),%edx
  mov    %edx,(%r9,%rsi,4)
  mov    (%r8,%rax,4),%edx
  sub    $0x1,%rsi
  test   %esi,%esi
  jns    L162
L8:
  mov    %r15,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L143:
  mov    $0x0,%eax
  jmp    L129
```

tool_calls: name: retrieve_data
arguments: data_label: D8
type_guessed: byte[4]

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

assistant: ```c
void Viterbi(int output_u_int[], int out0[], int state0[], int out1[], int state1[], double input_c[], int KK, int nn, int LL) {
  int i, t, state, mm, states;
  int number_symbols;
  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 = (float *)calloc(states, sizeof(float));
  next_section = (float *)calloc(states, sizeof(float));
  prev_bit = (int *)calloc(states * (LL + mm), sizeof(int));
  prev_state = (int *)calloc(states * (LL + mm), sizeof(int));
  rec_array = (float *)calloc(nn, sizeof(float));
  metric_c = (float *)calloc(number_symbols, sizeof(float));
  for (state = 0; state < states; state++) {
    prev_section[state] = -1e7;
    next_section[state] = -1e7;
  }
  prev_section[0] = 0;
  for (t = 0; t < LL + mm; t++) {
    for (i = 0; i < nn; i++)
      rec_array[i] = (float)input_c[nn * t + 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;
        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;
        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];
      }
    }
    for (state = 0; state < states; state++) {
      prev_section[state] = next_section[state] - max_val;
      next_section[state] = -1e7;
    }
  }
  state = 0;
  for (t = LL + mm - 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);
}
```