user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r14
  lea    D39(%rip),%r14
  push   %r13
  mov    %r14,%rdi
  lea    D52(%rip),%r13
  push   %r12
  lea    D51(%rip),%r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  call   <puts@plt>
  lea    D44(%rip),%rdi
  call   <puts@plt>
  jmp    L120
  nopl   0x0(%rax)
L96:
  mov    $0x2c,%edi
  add    $0x1,%ebx
  call   <putchar@plt>
  cmp    $0x40,%ebx
  je     L52
L120:
  mov    %ebx,%ebp
  mov    $0x4,%eax
  and    $0x1,%ebp
  test   $0x2,%bl
  cmovne %eax,%ebp
  test   $0xc,%bl
  mov    $0x2,%eax
  cmovne %eax,%ebp
  test   $0x30,%bl
  mov    $0x3,%eax
  cmovne %eax,%ebp
  test   $0xf,%bl
  je     L28
L93:
  mov    %ebp,%esi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebx,%eax
  and    $0xf,%eax
  cmp    $0xf,%eax
  jne    L96
  mov    $0xa,%edi
  add    $0x1,%ebx
  call   <putchar@plt>
  cmp    $0x40,%ebx
  jne    L120
L52:
  mov    %r14,%rdi
  xor    %ebx,%ebx
  lea    D52(%rip),%r13
  call   <puts@plt>
  lea    D21(%rip),%rdi
  call   <puts@plt>
  jmp    L23
  nopl   0x0(%rax,%rax,1)
L37:
  mov    $0x2c,%edi
  add    $0x1,%ebx
  call   <putchar@plt>
  cmp    $0x40,%ebx
  je     L53
L23:
  mov    $0x3,%ebp
  test   $0x30,%bl
  jne    L22
  xor    %ebp,%ebp
  test   $0xc,%bl
  setne  %bpl
  add    %ebp,%ebp
L22:
  test   $0x2,%bl
  mov    $0x4,%eax
  cmovne %eax,%ebp
  mov    %ebx,%eax
  and    $0x1,%eax
  cmovne %eax,%ebp
  test   $0xf,%bl
  je     L129
L84:
  mov    %ebp,%esi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebx,%eax
  and    $0xf,%eax
  cmp    $0xf,%eax
  jne    L37
  mov    $0xa,%edi
  add    $0x1,%ebx
  call   <putchar@plt>
  cmp    $0x40,%ebx
  jne    L23
L53:
  pop    %rbx
  mov    $0xa,%edi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1070 <putchar@plt>
  nopl   0x0(%rax)
L28:
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L93
  nop
L129:
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L84
```

tool_calls: name: disassemble_data
arguments: data_tag: D39
type_guessed: string
name: disassemble_data
arguments: data_tag: D52
type_guessed: string
name: disassemble_data
arguments: data_tag: D51
type_guessed: string
name: disassemble_data
arguments: data_tag: D44
type_guessed: string
name: disassemble_data
arguments: data_tag: D21
type_guessed: string

tool: D39: ;

tool: D52:  db 

tool: D51: %d

tool: D44: TIADisplayToColour label byte

tool: D21: TIADisplayToColour2 label byte

assistant: ```c
void main(void) {
  int i, n;
  printf(";\n");
  printf("TIADisplayToColour label byte\n");
  for (i = 0; i < 64; i++) {
    n = 0;
    if (i & 1)
      n = 1;
    if (i & 2)
      n = 4;
    if (i & 12)
      n = 2;
    if (i & 48)
      n = 3;
    if (i % 16 == 0)
      printf(" db ");
    printf("%d", n);
    if (i % 16 != 15)
      printf(",");
    else
      printf("\n");
  }
  printf(";\n");
  printf("TIADisplayToColour2 label byte\n");
  for (i = 0; i < 64; i++) {
    n = 0;
    if (i & 12)
      n = 2;
    if (i & 48)
      n = 3;
    if (i & 2)
      n = 4;
    if (i & 1)
      n = 1;
    if (i % 16 == 0)
      printf(" db ");
    printf("%d", n);
    if (i % 16 != 15)
      printf(",");
    else
      printf("\n");
  }
  printf("\n");
}
```