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

```asm
<fors_pk_from_sig>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x300,%rsp
  mov    %rdi,-0x2d8(%rbp)
  mov    %rsi,-0x2e0(%rbp)
  mov    %rdx,-0x2e8(%rbp)
  mov    %rcx,-0x2f0(%rbp)
  mov    %r8,-0x2f8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x2c0(%rbp)
  movq   $0x0,-0x2b8(%rbp)
  movq   $0x0,-0x2b0(%rbp)
  movq   $0x0,-0x2a8(%rbp)
  movq   $0x0,-0x2a0(%rbp)
  movq   $0x0,-0x298(%rbp)
  movq   $0x0,-0x290(%rbp)
  movq   $0x0,-0x288(%rbp)
  mov    -0x2f8(%rbp),%rdx
  lea    -0x2c0(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <copy_keypair_addr@plt>
  mov    -0x2f8(%rbp),%rdx
  lea    -0x2a0(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <copy_keypair_addr@plt>
  lea    -0x2c0(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <set_type@plt>
  lea    -0x2a0(%rbp),%rax
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <set_type@plt>
  mov    -0x2e8(%rbp),%rdx
  lea    -0x280(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <message_to_indices@plt>
  movl   $0x0,-0x2c8(%rbp)
  jmp    L9
L0:
  mov    -0x2c8(%rbp),%eax
  shl    $0x9,%eax
  mov    %eax,-0x2c4(%rbp)
  lea    -0x2c0(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <set_tree_height@plt>
  mov    -0x2c8(%rbp),%eax
  mov    -0x280(%rbp,%rax,4),%edx
  mov    -0x2c4(%rbp),%eax
  add    %eax,%edx
  lea    -0x2c0(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <set_tree_index@plt>
  lea    -0x2c0(%rbp),%rcx
  mov    -0x2f0(%rbp),%rdx
  mov    -0x2e0(%rbp),%rsi
  lea    -0x200(%rbp),%rax
  mov    %rax,%rdi
  call   <fors_sk_to_leaf@plt>
  addq   $0x10,-0x2e0(%rbp)
  mov    -0x2c8(%rbp),%eax
  mov    -0x280(%rbp,%rax,4),%edx
  mov    -0x2c8(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%ecx
  lea    -0x1f0(%rbp),%rax
  lea    (%rax,%rcx,1),%rdi
  mov    -0x2e0(%rbp),%r8
  mov    -0x2c4(%rbp),%ecx
  lea    -0x200(%rbp),%rax
  lea    -0x2c0(%rbp),%rsi
  push   %rsi
  push   -0x2f0(%rbp)
  mov    $0x9,%r9d
  mov    %rax,%rsi
  call   <compute_root@plt>
  add    $0x10,%rsp
  addq   $0x90,-0x2e0(%rbp)
  addl   $0x1,-0x2c8(%rbp)
L9:
  cmpl   $0x1d,-0x2c8(%rbp)
  jbe    L0
  lea    -0x2a0(%rbp),%rcx
  mov    -0x2f0(%rbp),%rdx
  lea    -0x1f0(%rbp),%rsi
  mov    -0x2d8(%rbp),%rax
  mov    %rcx,%r8
  mov    %rdx,%rcx
  mov    $0x1e,%edx
  mov    %rax,%rdi
  call   <thash@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L5
  call   <__stack_chk_fail@plt>
L5:
  leave
  ret
```

assistant: ```c
void fors_pk_from_sig(unsigned char *pk, const unsigned char *sig, const unsigned char *m, const unsigned char *pub_seed, const uint32_t fors_addr[8]) {
  uint32_t indices[30];
  unsigned char roots[30 * 16];
  unsigned char leaf[16];
  uint32_t fors_tree_addr[8] = {0};
  uint32_t fors_pk_addr[8] = {0};
  uint32_t idx_offset;
  unsigned int i;
  copy_keypair_addr(fors_tree_addr, fors_addr);
  copy_keypair_addr(fors_pk_addr, fors_addr);
  set_type(fors_tree_addr, 3);
  set_type(fors_pk_addr, 4);
  message_to_indices(indices, m);
  for (i = 0; i < 30; i++) {
    idx_offset = i * (1 << 9);
    set_tree_height(fors_tree_addr, 0);
    set_tree_index(fors_tree_addr, indices[i] + idx_offset);
    fors_sk_to_leaf(leaf, sig, pub_seed, fors_tree_addr);
    sig += 16;
    compute_root(roots + i * 16, leaf, indices[i], idx_offset, sig, 9, pub_seed, fors_tree_addr);
    sig += 16 * 9;
  }
  thash(pk, roots, 30, pub_seed, fors_pk_addr);
}
```