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

```asm
<gen_table>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %edi,%esi
  lea    D24(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%r15d
  jmp    L89
L191:
  cmp    %esi,%ebp
  sete   %cl
  cmp    %eax,%r13d
  sete   %al
  test   %al,%cl
  je     L55
  cmp    %edx,%r12d
  jne    L55
  jmp    L45
L69:
  xor    %r14d,%ecx
  xor    $0x1,%ecx
  mov    %ecx,%edi
  cmp    %esi,%ebp
  sete   %cl
  and    %edi,%ecx
  cmp    %edx,%r12d
  sete   %dl
  test   %dl,%cl
  je     L55
  cmp    %eax,%r13d
  je     L45
L55:
  mov    0x1c(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,0x1c(%rsp)
  cmp    $0x3,%eax
  jg     L67
L241:
  mov    0x14(%rsp),%ecx
  mov    %ecx,%r8d
  xor    0x10(%rsp),%r8d
  mov    %r8d,%esi
  and    $0x1,%esi
  mov    0x18(%rsp),%edx
  xor    0x1c(%rsp),%edx
  mov    %edx,%eax
  sar    %eax
  xor    %edx,%eax
  mov    %r8d,%edi
  sar    %edi
  xor    %r8d,%edi
  xor    %edi,%eax
  and    $0x1,%eax
  and    $0x1,%edx
  not    %edx
  and    %esi,%edx
  mov    %ecx,%edi
  xor    0x1c(%rsp),%edi
  and    $0x1,%edi
  xor    %edi,%edx
  cmp    $0x8,%ebx
  je     L191
  cmp    $0x10,%ebx
  je     L69
  cmp    $0x4,%ebx
  jne    L55
  cmp    %esi,%ebp
  jne    L55
  cmp    %edx,%r12d
  jne    L55
L45:
  mov    (%rsp),%rdi
  mov    $0x0,%eax
  call   <classify@plt>
  cmp    %r15d,%eax
  jne    L55
  mov    0x1c(%rsp),%r8d
  mov    0x18(%rsp),%ecx
  mov    0x14(%rsp),%edx
  mov    0x10(%rsp),%esi
  lea    D18(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L55
L67:
  mov    0x18(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,0x18(%rsp)
  cmp    $0x3,%eax
  jg     L9
L12:
  movl   $0x0,0x1c(%rsp)
  jmp    L241
L9:
  mov    0x14(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,0x14(%rsp)
  cmp    $0x3,%eax
  jg     L127
L109:
  movl   $0x0,0x18(%rsp)
  jmp    L12
L127:
  mov    0x10(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,0x10(%rsp)
  cmp    $0x3,%eax
  jg     L39
L200:
  movl   $0x0,0x14(%rsp)
  jmp    L109
L39:
  addl   $0x1,0xc(%rsp)
  mov    0xc(%rsp),%eax
  cmp    %eax,%ebx
  je     L163
L249:
  mov    %r15d,%edx
  mov    0xc(%rsp),%r14d
  mov    %r14d,%esi
  lea    D0(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r14d,%r12d
  and    $0x1,%r12d
  mov    %r14d,%eax
  mov    %r14d,%ebp
  sar    %ebp
  and    $0x1,%ebp
  mov    %r14d,%r13d
  sar    $0x2,%r13d
  and    $0x1,%r13d
  sar    $0x3,%eax
  mov    %eax,%r14d
  movl   $0x0,0x10(%rsp)
  jmp    L200
L163:
  add    $0x1,%r15d
  cmp    $0x2,%r15d
  je     L188
L89:
  movl   $0x0,0xc(%rsp)
  lea    0x10(%rsp),%rax
  mov    %rax,(%rsp)
  test   %ebx,%ebx
  jg     L249
  jmp    L163
L188:
  lea    D11(%rip),%rdi
  call   <puts@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L95
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L95:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D24
type_guessed: string
name: disassemble_data
arguments: data_label: D18
type_guessed: string
name: disassemble_data
arguments: data_label: D0
type_guessed: string
name: disassemble_data
arguments: data_label: D11
type_guessed: string

tool: D24: u8 trellis_trans_%d[256][4] = {


tool: D18:  { %d, %d, %d, %d },


tool: D0:  /* trans=%d y0=%d */


tool: D11: };

assistant: ```c
void gen_table(int nb_trans) {
  int Y[5], Yt[5], trans, ss[2][3], xx[2][2];
  int res, i, y0;
  printf("u8 trellis_trans_%d[256][4] = {\n", nb_trans);
  for (y0 = 0; y0 < 2; y0++) {
    for (trans = 0; trans < nb_trans; trans++) {
      printf(" /* trans=%d y0=%d */\n", trans, y0);
      Yt[1] = trans & 1;
      Yt[2] = (trans >> 1) & 1;
      Yt[4] = (trans >> 2) & 1;
      Yt[3] = (trans >> 3) & 1;
      for (xx[0][0] = 0; xx[0][0] < 4; xx[0][0]++)
        for (xx[0][1] = 0; xx[0][1] < 4; xx[0][1]++)
          for (xx[1][0] = 0; xx[1][0] < 4; xx[1][0]++)
            for (xx[1][1] = 0; xx[1][1] < 4; xx[1][1]++) {
              for (i = 0; i < 2; i++) {
                int x, y, y0, x0, y1, x1;
                x = xx[i][0];
                y = xx[i][1];
                x0 = x & 1;
                x1 = ((x & 2) >> 1);
                y0 = y & 1;
                y1 = ((y & 2) >> 1);
                ss[i][2] = x1 ^ y1 ^ y0 ^ x0;
                ss[i][1] = y0;
                ss[i][0] = y0 ^ x0;
              }
              Y[4] = ss[0][2] ^ ss[1][2];
              Y[3] = ss[0][1];
              Y[2] = ss[0][0];
              Y[1] = (ss[0][0] & ~ss[1][0] & 1) ^ ss[0][1] ^ ss[1][1];
              res = 0;
              switch (nb_trans) {
              case 4:
                res = (Yt[1] == Y[1] && Yt[2] == Y[2]);
                break;
              case 8:
                res = (Yt[1] == Y[1] && Yt[2] == Y[2] && Yt[4] == Y[4]);
                break;
              case 16:
                res = (Yt[1] == Y[1] && Yt[2] == Y[2] && Yt[3] == Y[3] && Yt[4] == Y[4]);
                break;
              }
              if (res && classify(xx) == y0) {
                printf(" { %d, %d, %d, %d },\n", xx[0][0], xx[0][1], xx[1][0], xx[1][1]);
              }
            }
    }
  }
  printf("};\n");
}
```