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

```asm
<draw_hex_table>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x14(%rbp)
  jmp    L24
L39:
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L85
L130:
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  mov    -0x14(%rbp),%edx
  mov    %eax,%ecx
  shr    %cl,%edx
  mov    %edx,%eax
  and    $0x3,%eax
  cmp    $0x3,%eax
  je     L115
  cmp    $0x3,%eax
  ja     L226
  cmp    $0x2,%eax
  je     L213
  cmp    $0x2,%eax
  ja     L226
  test   %eax,%eax
  je     L158
  cmp    $0x1,%eax
  jne    L226
  mov    -0x4(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  or     %eax,-0x8(%rbp)
  jmp    L226
L213:
  addl   $0x1,-0xc(%rbp)
  jmp    L226
L115:
  addl   $0x1,-0x10(%rbp)
  jmp    L226
L158:
  nop
L226:
  addl   $0x1,-0x4(%rbp)
L85:
  cmpl   $0x3,-0x4(%rbp)
  jbe    L130
  cmpl   $0x4,-0x10(%rbp)
  jne    L189
  lea    D77(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L205
L189:
  cmpl   $0x4,-0xc(%rbp)
  jne    L192
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L205
L192:
  cmpl   $0x0,-0x10(%rbp)
  je     L56
  cmpl   $0x0,-0xc(%rbp)
  jne    L56
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L205
L56:
  cmpl   $0x0,-0xc(%rbp)
  je     L26
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L205
L26:
  mov    -0x8(%rbp),%eax
  lea    D60(%rip),%rdx
  movzbl (%rax,%rdx,1),%eax
  movsbl %al,%eax
  mov    %eax,%esi
  lea    D53(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L205:
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  and    $0x7,%eax
  test   %eax,%eax
  jne    L121
  mov    $0xa,%edi
  call   <putchar@plt>
L121:
  addl   $0x1,-0x14(%rbp)
L24:
  cmpl   $0xff,-0x14(%rbp)
  jbe    L39
  lea    D72(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D3
type_infered: string
name: unpack_data
arguments: data_tag: D77
type_infered: string
name: unpack_data
arguments: data_tag: D24
type_infered: string
name: unpack_data
arguments: data_tag: D48
type_infered: string
name: unpack_data
arguments: data_tag: D21
type_infered: string
name: unpack_data
arguments: data_tag: D60
type_infered: string
name: unpack_data
arguments: data_tag: D53
type_infered: string
name: unpack_data
arguments: data_tag: D72
type_infered: string

tool: D3: extern const char hex_digits[256] = {

tool: D77:  'z',

tool: D24:  'x',

tool: D48:  'Z',

tool: D21:  'X',

tool: D60: 0123456789abcdef

tool: D53:  '%c',

tool: D72: };

assistant: ```c
void draw_hex_table() {
  unsigned idx;
  printf("extern const char hex_digits[256] = {\n");
  for (idx = 0; idx < 256; idx += 1) {
    unsigned cnt_z = 0, cnt_x = 0;
    unsigned bv = 0, bdx;
    for (bdx = 0; bdx < 4; bdx += 1) {
      switch ((idx >> (bdx * 2)) & 3) {
      case 0:
        break;
      case 1:
        bv |= 1 << bdx;
        break;
      case 2:
        cnt_x += 1;
        break;
      case 3:
        cnt_z += 1;
        break;
      }
    }
    if (cnt_z == 4)
      printf(" 'z',");
    else if (cnt_x == 4)
      printf(" 'x',");
    else if ((cnt_z > 0) && (cnt_x == 0))
      printf(" 'Z',");
    else if (cnt_x > 0)
      printf(" 'X',");
    else
      printf(" '%c',", "0123456789abcdef"[bv]);
    if (((idx + 1) % 8) == 0)
      printf("\n");
  }
  printf("};\n");
}
```