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

```asm
<redupe_correct_msg>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x460,%rsp
  mov    %rdi,-0x448(%rbp)
  mov    %esi,-0x44c(%rbp)
  mov    %edx,-0x450(%rbp)
  mov    %rcx,-0x458(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x44c(%rbp),%edx
  mov    -0x450(%rbp),%eax
  add    %edx,%eax
  cmp    $0xff,%eax
  setbe  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x44c(%rbp),%edx
  mov    -0x450(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x414(%rbp)
  movl   $0x0,-0x438(%rbp)
  movl   $0x0,-0x42c(%rbp)
  movl   $0x0,-0x434(%rbp)
  movl   $0x0,-0x430(%rbp)
  movl   $0x0,-0x428(%rbp)
  jmp    L158
L24:
  mov    -0x428(%rbp),%edx
  mov    -0x448(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x428(%rbp),%eax
  mov    %dl,-0x410(%rbp,%rax,1)
  addl   $0x1,-0x428(%rbp)
L158:
  mov    -0x428(%rbp),%eax
  cmp    -0x44c(%rbp),%eax
  jb     L24
  movl   $0x0,-0x424(%rbp)
  jmp    L168
L66:
  mov    -0x424(%rbp),%edx
  mov    -0x458(%rbp),%rax
  add    %rdx,%rax
  mov    -0x44c(%rbp),%ecx
  mov    -0x424(%rbp),%edx
  add    %ecx,%edx
  movzbl (%rax),%eax
  mov    %edx,%edx
  mov    %al,-0x410(%rbp,%rdx,1)
  addl   $0x1,-0x424(%rbp)
L168:
  mov    -0x424(%rbp),%eax
  cmp    -0x450(%rbp),%eax
  jb     L66
  lea    -0x438(%rbp),%rdi
  lea    -0x310(%rbp),%rcx
  mov    -0x450(%rbp),%edx
  mov    -0x414(%rbp),%esi
  lea    -0x410(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <redupe_calc_syndromes@plt>
  movl   $0x0,-0x420(%rbp)
  jmp    L26
L166:
  mov    -0x420(%rbp),%eax
  movzbl -0x310(%rbp,%rax,1),%eax
  movzbl %al,%eax
  add    %eax,-0x42c(%rbp)
  addl   $0x1,-0x420(%rbp)
L26:
  mov    -0x438(%rbp),%eax
  cmp    %eax,-0x420(%rbp)
  jb     L166
  cmpl   $0x0,-0x42c(%rbp)
  jne    L147
  mov    $0x0,%eax
  jmp    L44
L147:
  mov    -0x438(%rbp),%esi
  lea    -0x434(%rbp),%rdi
  lea    -0x210(%rbp),%rcx
  mov    -0x450(%rbp),%edx
  lea    -0x310(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <redupe_find_error_locator@plt>
  test   %rax,%rax
  jns    L115
  mov    $0xffffffff,%eax
  jmp    L44
L115:
  movl   $0x0,-0x41c(%rbp)
  jmp    L175
L81:
  mov    -0x41c(%rbp),%eax
  movzbl -0x210(%rbp,%rax,1),%eax
  mov    %al,-0x439(%rbp)
  mov    -0x434(%rbp),%eax
  sub    -0x41c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%eax
  movzbl -0x210(%rbp,%rax,1),%edx
  mov    -0x41c(%rbp),%eax
  mov    %dl,-0x210(%rbp,%rax,1)
  mov    -0x434(%rbp),%eax
  sub    -0x41c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edx
  movzbl -0x439(%rbp),%eax
  mov    %al,-0x210(%rbp,%rdx,1)
  addl   $0x1,-0x41c(%rbp)
L175:
  mov    -0x434(%rbp),%eax
  shr    %eax
  cmp    %eax,-0x41c(%rbp)
  jb     L81
  mov    -0x434(%rbp),%esi
  lea    -0x430(%rbp),%rdi
  lea    -0x110(%rbp),%rcx
  mov    -0x414(%rbp),%edx
  lea    -0x210(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <redupe_find_errors@plt>
  test   %rax,%rax
  jns    L102
  mov    $0xffffffff,%eax
  jmp    L44
L102:
  mov    -0x430(%rbp),%r8d
  mov    -0x438(%rbp),%ecx
  lea    -0x110(%rbp),%rdi
  lea    -0x310(%rbp),%rdx
  mov    -0x414(%rbp),%esi
  lea    -0x410(%rbp),%rax
  mov    %r8d,%r9d
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <redupe_correct_errata@plt>
  lea    -0x438(%rbp),%rdi
  lea    -0x310(%rbp),%rcx
  mov    -0x450(%rbp),%edx
  mov    -0x414(%rbp),%esi
  lea    -0x410(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <redupe_calc_syndromes@plt>
  movl   $0x0,-0x42c(%rbp)
  movl   $0x0,-0x418(%rbp)
  jmp    L88
L188:
  mov    -0x418(%rbp),%eax
  movzbl -0x310(%rbp,%rax,1),%eax
  movzbl %al,%eax
  add    %eax,-0x42c(%rbp)
  addl   $0x1,-0x418(%rbp)
L88:
  mov    -0x438(%rbp),%eax
  cmp    %eax,-0x418(%rbp)
  jb     L188
  cmpl   $0x0,-0x42c(%rbp)
  je     L56
  mov    $0xffffffff,%eax
  jmp    L44
L56:
  mov    -0x44c(%rbp),%edx
  lea    -0x410(%rbp),%rcx
  mov    -0x448(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
  mov    -0x44c(%rbp),%eax
  lea    -0x410(%rbp),%rdx
  lea    (%rdx,%rax,1),%rcx
  mov    -0x450(%rbp),%edx
  mov    -0x458(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
  mov    $0x0,%eax
L44:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L27
  call   <__stack_chk_fail@plt>
L27:
  leave
  ret
```

assistant: ```c
__attribute__((visibility("default"))) int redupe_correct_msg(unsigned char *msg, unsigned msg_sz, unsigned nsym, unsigned char *code) {
  assert(msg_sz + nsym < 256);
  unsigned char buf[256];
  const unsigned buf_sz = msg_sz + nsym;
  unsigned char synd[256];
  unsigned synd_sz = 0;
  unsigned synd_sum = 0;
  unsigned char err_loc[256];
  unsigned err_loc_sz = 0;
  unsigned char err_pos[256];
  unsigned err_pos_sz = 0;
  for (unsigned i = 0; i < msg_sz; ++i) {
    buf[i] = msg[i];
  }
  for (unsigned i = 0; i < nsym; ++i) {
    buf[msg_sz + i] = code[i];
  }
  redupe_calc_syndromes(buf, buf_sz, nsym, synd, &synd_sz);
  for (unsigned i = 0; i < synd_sz; ++i) {
    synd_sum += synd[i];
  }
  if (synd_sum == 0) {
    return 0;
  }
  if (redupe_find_error_locator(synd, synd_sz, nsym, err_loc, &err_loc_sz) < 0) {
    return -1;
  }
  for (unsigned i = 0; i < err_loc_sz / 2; ++i) {
    unsigned char tmp = err_loc[i];
    err_loc[i] = err_loc[err_loc_sz - i - 1];
    err_loc[err_loc_sz - i - 1] = tmp;
  }
  if (redupe_find_errors(err_loc, err_loc_sz, buf_sz, err_pos, &err_pos_sz) < 0) {
    return -1;
  }
  redupe_correct_errata(buf, buf_sz, synd, synd_sz, err_pos, err_pos_sz);
  redupe_calc_syndromes(buf, buf_sz, nsym, synd, &synd_sz);
  synd_sum = 0;
  for (unsigned i = 0; i < synd_sz; ++i) {
    synd_sum += synd[i];
  }
  if (synd_sum != 0) {
    return -1;
  }
  memmove(msg, buf, msg_sz);
  memmove(code, buf + msg_sz, nsym);
  return 0;
}
```