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

```asm
<draw_hex_table>:
  endbr64
  push   %r14
  lea    D17(%rip),%rdi
  lea    D67(%rip),%r14
  push   %r13
  lea    D2(%rip),%r13
  push   %r12
  lea    D0(%rip),%r12
  push   %rbp
  lea    D63(%rip),%rbp
  push   %rbx
  xor    %ebx,%ebx
  call   <puts@plt>
  xor    %eax,%eax
  xor    %edi,%edi
  xor    %esi,%esi
  jmp    L202
  xchg   %ax,%ax
L31:
  test   %esi,%esi
  je     L52
L119:
  test   %edi,%edi
  jne    L148
  lea    D69(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L299:
  add    $0x1,%ebx
  test   $0x7,%bl
  je     L137
L268:
  cmp    $0x100,%ebx
  je     L175
L236:
  mov    %ebx,%eax
  and    $0x3,%eax
  cmp    $0x2,%eax
  je     L319
  cmp    $0x3,%eax
  je     L114
  cmp    $0x1,%eax
  sete   %al
  xor    %edi,%edi
  xor    %esi,%esi
  movzbl %al,%eax
L202:
  mov    %ebx,%edx
  shr    $0x2,%edx
  and    $0x3,%edx
  cmp    $0x2,%edx
  je     L120
L198:
  cmp    $0x3,%edx
  je     L308
  mov    %eax,%ecx
  or     $0x2,%ecx
  cmp    $0x1,%edx
  cmove  %rcx,%rax
L218:
  mov    %ebx,%edx
  mov    %ebx,%ecx
  shr    $0x4,%edx
  shr    $0x6,%ecx
  and    $0x3,%edx
  cmp    $0x2,%edx
  je     L42
  cmp    $0x3,%edx
  je     L193
  cmp    $0x1,%edx
  je     L12
  cmp    $0x2,%ecx
  je     L148
  cmp    $0x3,%ecx
  je     L165
L13:
  cmp    $0x1,%ecx
  jne    L31
  or     $0x8,%eax
  test   %esi,%esi
  jne    L119
L52:
  test   %edi,%edi
  jne    L148
  movsbl 0x0(%rbp,%rax,1),%esi
  lea    D40(%rip),%rdi
  xor    %eax,%eax
  add    $0x1,%ebx
  call   <printf@plt>
  test   $0x7,%bl
  jne    L268
L137:
  mov    $0xa,%edi
  call   <putchar@plt>
  cmp    $0x100,%ebx
  jne    L236
L175:
  pop    %rbx
  lea    D38(%rip),%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1080 <puts@plt>
  nop
L114:
  mov    %ebx,%edx
  xor    %eax,%eax
  xor    %edi,%edi
  mov    $0x1,%esi
  shr    $0x2,%edx
  and    $0x3,%edx
  cmp    $0x2,%edx
  jne    L198
L120:
  add    $0x1,%edi
  jmp    L218
  nopw   0x0(%rax,%rax,1)
L42:
  add    $0x1,%edi
  cmp    $0x2,%ecx
  jne    L287
  cmp    $0x3,%edi
  jne    L148
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L299
  nopl   0x0(%rax)
L12:
  or     $0x4,%eax
L30:
  cmp    $0x2,%ecx
  je     L148
L287:
  cmp    $0x3,%ecx
  jne    L13
  add    $0x1,%esi
  cmp    $0x4,%esi
  jne    L31
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L299
  nopl   0x0(%rax)
L308:
  add    $0x1,%esi
  jmp    L218
L319:
  xor    %eax,%eax
  mov    $0x1,%edi
  xor    %esi,%esi
  jmp    L202
  xchg   %ax,%ax
L148:
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L299
  nop
L193:
  add    $0x1,%esi
  jmp    L30
  nopl   (%rax)
L165:
  add    $0x1,%esi
  jmp    L31
```

tool_calls: name: unpack_data
arguments: label: D17
type_guessed: string
name: unpack_data
arguments: label: D67
type_guessed: string
name: unpack_data
arguments: label: D2
type_guessed: string
name: unpack_data
arguments: label: D0
type_guessed: string
name: unpack_data
arguments: label: D63
type_guessed: string
name: unpack_data
arguments: label: D69
type_guessed: string
name: unpack_data
arguments: label: D40
type_guessed: string
name: unpack_data
arguments: label: D38
type_guessed: string

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

tool: D67:  'x',

tool: D2:  'z',

tool: D0:  'X',

tool: D63: 0123456789abcdef

tool: D69:  'Z',

tool: D40:  '%c',

tool: D38: };

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");
}
```