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

```asm
<gen_run_length_table>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,0xc(%rsp)
  mov    %rdx,%rbx
  test   %edi,%edi
  jne    L78
  mov    %esi,%r13d
  mov    %rdx,%rsi
  lea    D40(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D20(%rip),%rdi
  call   <puts@plt>
  lea    D109(%rip),%rdi
  call   <puts@plt>
  mov    0xc(%rsp),%r12d
  lea    D102(%rip),%r14
  lea    D54(%rip),%r15
  jmp    L79
L78:
  lea    D104(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rsi
  lea    D40(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D51(%rip),%rdi
  call   <puts@plt>
  jmp    L56
L109:
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r13d,%edx
  mov    %r12d,%esi
  mov    %ebx,%edi
  call   <count_run@plt>
  mov    %eax,%esi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    $0xff,%ebx
  je     L28
  mov    $0x2c,%edi
  call   <putchar@plt>
  jmp    L101
L20:
  mov    $0x2c,%edi
  call   <putchar@plt>
  cmp    $0xf,%ebp
  je     L28
L101:
  mov    $0x20,%edi
  call   <putchar@plt>
L110:
  add    $0x1,%ebx
  cmp    $0x100,%ebx
  je     L92
L125:
  mov    %ebx,%ebp
  and    $0xf,%ebp
  je     L109
  mov    %r13d,%edx
  mov    %r12d,%esi
  mov    %ebx,%edi
  call   <count_run@plt>
  mov    %eax,%esi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    $0xff,%ebx
  jne    L20
L28:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L110
L92:
  lea    D45(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    $0x7,%r12d
  je     L49
  mov    $0x2c,%edi
  call   <putchar@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x1,%r12d
  cmp    $0x8,%r12d
  je     L0
L79:
  lea    D66(%rip),%rdi
  call   <puts@plt>
  mov    0xc(%rsp),%ebx
  jmp    L125
L49:
  mov    $0xa,%edi
  call   <putchar@plt>
L0:
  lea    D100(%rip),%rdi
  call   <puts@plt>
L56:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D40
type: string
name: unpack_data
arguments: data_tag: D20
type: string
name: unpack_data
arguments: data_tag: D109
type: string
name: unpack_data
arguments: data_tag: D102
type: string
name: unpack_data
arguments: data_tag: D54
type: string
name: unpack_data
arguments: data_tag: D104
type: string
name: unpack_data
arguments: data_tag: D51
type: string
name: unpack_data
arguments: data_tag: D45
type: string
name: unpack_data
arguments: data_tag: D66
type: string
name: unpack_data
arguments: data_tag: D100
type: string

tool: D40: const uint8_t %s [8][256]

tool: D20:  =

tool: D109: {

tool: D102: %d

tool: D54:   

tool: D104: extern 

tool: D51: ;

tool: D45:   }

tool: D66:   {

tool: D100: };

assistant: ```c
void gen_run_length_table(bool header, int val, char *name) {
  int i, j;
  if (header)
    printf("extern ");
  printf("const uint8_t %s [8][256]", name);
  if (header) {
    printf(";\n");
    return;
  }
  printf(" =\n");
  printf("{\n");
  for (i = 0; i < 8; i++) {
    printf("  {\n");
    for (j = 0; j < 256; j++) {
      if ((j & 15) == 0)
        printf("  ");
      printf("%d", count_run(j, i, val));
      if (j != 0xff)
        printf(",");
      if ((j & 15) == 15)
        printf("\n");
      else
        printf(" ");
    }
    printf("  }");
    if (i != 7)
      printf(",");
    printf("\n");
  }
  printf("};\n");
}
```