user: What is the c source code of the assembly code below:

```asm
<redupe_correct_errata>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  mov    %r9d,%ebp
  push   %rbx
  sub    $0x658,%rsp
  mov    %rdi,0x20(%rsp)
  mov    %esi,0x1c(%rsp)
  mov    %r8,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x648(%rsp)
  xor    %eax,%eax
  test   %r9d,%r9d
  je     L103
  movzbl 0x1c(%rsp),%eax
  mov    0x8(%rsp),%rdi
  mov    %r9d,%ecx
  lea    0x40(%rsp),%rbx
  lea    -0x1(%rax),%esi
  xor    %eax,%eax
  nop
L60:
  mov    %esi,%edx
  sub    (%rdi,%rax,1),%dl
  mov    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L60
L9:
  lea    0x140(%rsp),%r13
  lea    0x34(%rsp),%rcx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  mov    %r13,%rdx
  movl   $0x0,0x34(%rsp)
  call   <redupe_find_errata_locator@plt>
  mov    %r12d,0x38(%rsp)
  test   %r12d,%r12d
  je     L142
  lea    -0x1(%r12),%eax
  lea    -0x1(%r12,%r14,1),%esi
  lea    0x1(%r14,%rax,1),%rdi
  mov    %r14,%rax
  nop
L21:
  movzbl (%rax),%ecx
  mov    %esi,%edx
  sub    %eax,%edx
  add    $0x1,%rax
  mov    %cl,0x240(%rsp,%rdx,1)
  cmp    %rdi,%rax
  jne    L21
L142:
  lea    0x240(%rsp),%rax
  mov    0x34(%rsp),%ecx
  mov    %r13,%rdx
  lea    0x340(%rsp),%r9
  mov    %r9,0x10(%rsp)
  sub    $0x8,%rsp
  mov    %rax,%rdi
  mov    %r12d,%esi
  movl   $0x0,0x44(%rsp)
  lea    -0x1(%rcx),%r8d
  mov    %rax,0x8(%rsp)
  lea    0x44(%rsp),%rax
  push   %rax
  call   <redupe_find_error_evaluator@plt>
  mov    0x4c(%rsp),%edx
  pop    %rax
  pop    %rcx
  mov    %edx,%eax
  shr    %eax
  je     L25
  mov    0x10(%rsp),%rcx
  sub    $0x1,%eax
  lea    0x341(%rsp,%rax,1),%r8
  lea    -0x1(%rdx,%rcx,1),%edi
  mov    %rcx,%rax
  nopl   0x0(%rax)
L109:
  mov    %edi,%edx
  movzbl (%rax),%ecx
  sub    %eax,%edx
  add    $0x1,%rax
  movzbl 0x340(%rsp,%rdx,1),%esi
  mov    %sil,-0x1(%rax)
  mov    %cl,0x340(%rsp,%rdx,1)
  cmp    %r8,%rax
  jne    L109
L25:
  mov    %ebp,%r12d
  xor    %r14d,%r14d
  lea    0x440(%rsp),%r13
  test   %ebp,%ebp
  je     L48
  nopl   0x0(%rax)
L14:
  movzbl (%rbx,%r14,1),%esi
  mov    $0x2,%edi
  sub    $0xff,%esi
  call   <redupe_gf_pow@plt>
  mov    %al,0x0(%r13,%r14,1)
  add    $0x1,%r14
  cmp    %r14,%r12
  jne    L14
  lea    0x540(%rsp),%rax
  mov    $0x100,%edx
  xor    %esi,%esi
  xor    %ebp,%ebp
  mov    %rax,%rdi
  mov    %rax,0x28(%rsp)
  call   <memset@plt>
  nopl   0x0(%rax)
L121:
  movzbl 0x0(%r13,%rbp,1),%eax
  xor    %r14d,%r14d
  mov    $0x1,%ebx
  mov    %eax,%edi
  mov    %eax,0x18(%rsp)
  call   <redupe_gf_inv@plt>
  movzbl %al,%r15d
  nopl   (%rax)
L66:
  cmp    %ebp,%r14d
  je     L152
  movzbl 0x0(%r13,%r14,1),%esi
  mov    %r15d,%edi
  call   <redupe_gf_mul@plt>
  mov    $0x1,%edi
  movzbl %al,%esi
  call   <redupe_gf_sub@plt>
  movzbl %bl,%edi
  movzbl %al,%esi
  call   <redupe_gf_mul@plt>
  mov    %eax,%ebx
L152:
  add    $0x1,%r14
  cmp    %r14,%r12
  jne    L66
  mov    0x3c(%rsp),%esi
  mov    0x10(%rsp),%rdx
  mov    %esi,0x38(%rsp)
  lea    -0x1(%rsi),%eax
  test   %esi,%esi
  je     L86
  nopw   0x0(%rax,%rax,1)
L70:
  movzbl (%rdx),%edi
  mov    %eax,%ecx
  add    $0x1,%rdx
  mov    %dil,0x240(%rsp,%rcx,1)
  sub    $0x1,%eax
  jae    L70
L86:
  mov    (%rsp),%rdi
  mov    %r15d,%edx
  call   <redupe_gf_poly_eval@plt>
  mov    0x18(%rsp),%edi
  mov    $0x1,%esi
  movzbl %al,%r15d
  call   <redupe_gf_pow@plt>
  mov    %r15d,%esi
  movzbl %al,%edi
  call   <redupe_gf_mul@plt>
  mov    0x8(%rsp),%rcx
  movzbl %bl,%esi
  movzbl %al,%edi
  movzbl (%rcx,%rbp,1),%r14d
  add    $0x1,%rbp
  call   <redupe_gf_div@plt>
  mov    %al,0x540(%rsp,%r14,1)
  cmp    %r12,%rbp
  jne    L121
L30:
  mov    0x1c(%rsp),%ebx
  mov    0x20(%rsp),%r14
  mov    (%rsp),%r15
  mov    %ebx,%edx
  mov    %r14,%rsi
  mov    %ebx,0x38(%rsp)
  mov    %r15,%rdi
  call   <memmove@plt>
  mov    0x28(%rsp),%rdx
  mov    0x38(%rsp),%esi
  mov    %ebx,%ecx
  lea    0x38(%rsp),%r9
  mov    %r14,%r8
  mov    %r15,%rdi
  call   <redupe_gf_poly_add@plt>
  mov    0x648(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L79
  add    $0x658,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L103:
  lea    0x40(%rsp),%rbx
  jmp    L9
L48:
  lea    0x540(%rsp),%rax
  mov    $0x100,%edx
  xor    %esi,%esi
  mov    %rax,%rdi
  mov    %rax,0x28(%rsp)
  call   <memset@plt>
  jmp    L30
L79:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void redupe_correct_errata(unsigned char *msg, unsigned msg_sz, const unsigned char *synd, unsigned synd_sz, const unsigned char *err_pos, unsigned err_pos_sz) {
  unsigned char coef_pos[256];
  unsigned coef_pos_sz = err_pos_sz;
  for (unsigned i = 0; i < coef_pos_sz; ++i) {
    coef_pos[i] = msg_sz - 1 - err_pos[i];
  }
  unsigned char err_loc[256];
  unsigned err_loc_sz = 0;
  redupe_find_errata_locator(coef_pos, coef_pos_sz, err_loc, &err_loc_sz);
  unsigned char tmp[256];
  unsigned tmp_sz = synd_sz;
  for (unsigned i = 0; i < synd_sz; ++i) {
    tmp[synd_sz - i - 1] = synd[i];
  }
  unsigned char err_eval[256];
  unsigned err_eval_sz = 0;
  redupe_find_error_evaluator(tmp, tmp_sz, err_loc, err_loc_sz, err_loc_sz - 1, err_eval, &err_eval_sz);
  for (unsigned i = 0; i < err_eval_sz / 2; ++i) {
    unsigned char t = err_eval[i];
    err_eval[i] = err_eval[err_eval_sz - i - 1];
    err_eval[err_eval_sz - i - 1] = t;
  }
  unsigned char X[256];
  unsigned X_sz = coef_pos_sz;
  for (unsigned i = 0; i < coef_pos_sz; ++i) {
    int l = 255 - coef_pos[i];
    X[i] = redupe_gf_pow(2, -l);
  }
  unsigned char E[256];
  unsigned E_sz = msg_sz;
  memset(E, 0, sizeof(E));
  for (unsigned i = 0; i < X_sz; ++i) {
    unsigned char xinv = redupe_gf_inv(X[i]);
    unsigned char err_loc_prime = 1;
    for (unsigned j = 0; j < X_sz; ++j) {
      if (j == i) {
        continue;
      }
      unsigned char t = redupe_gf_mul(xinv, X[j]);
      t = redupe_gf_sub(1, t);
      err_loc_prime = redupe_gf_mul(err_loc_prime, t);
    }
    tmp_sz = err_eval_sz;
    for (unsigned j = 0; j < err_eval_sz; ++j) {
      tmp[tmp_sz - j - 1] = err_eval[j];
    }
    unsigned char y = redupe_gf_poly_eval(tmp, tmp_sz, xinv);
    y = redupe_gf_mul(redupe_gf_pow(X[i], 1), y);
    E[err_pos[i]] = redupe_gf_div(y, err_loc_prime);
  }
  tmp_sz = msg_sz;
  memmove(tmp, msg, msg_sz);
  redupe_gf_poly_add(tmp, tmp_sz, E, E_sz, msg, &tmp_sz);
}
```