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

```asm
<gen_run_length_table>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %edi,%edi
  jne    L49
  lea    D13(%rip),%rdi
  mov    %esi,%r13d
  xor    %eax,%eax
  mov    %rdx,%rsi
  call   <printf@plt>
  lea    D66(%rip),%rdi
  xor    %r12d,%r12d
  lea    D41(%rip),%r14
  call   <puts@plt>
  lea    D107(%rip),%rdi
  lea    D23(%rip),%r15
  call   <puts@plt>
L99:
  lea    D18(%rip),%rdi
  xor    %ebx,%ebx
  call   <puts@plt>
  jmp    L25
  nopw   0x0(%rax,%rax,1)
L61:
  mov    %r12d,%esi
  mov    %ebx,%edi
  mov    %r13d,%edx
  call   <count_run@plt>
  mov    %r14,%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  cmp    $0xff,%ebx
  je     L13
  mov    $0x2c,%edi
  call   <putchar@plt>
  cmp    $0xf,%ebp
  je     L13
L15:
  mov    $0x20,%edi
  add    $0x1,%ebx
  call   <putchar@plt>
  cmp    $0x100,%ebx
  je     L47
L25:
  mov    %ebx,%ebp
  and    $0xf,%ebp
  jne    L61
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r12d,%esi
  mov    %ebx,%edi
  mov    %r13d,%edx
  call   <count_run@plt>
  mov    %r14,%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  cmp    $0xff,%ebx
  je     L13
  mov    $0x2c,%edi
  call   <putchar@plt>
  jmp    L15
  nopl   0x0(%rax,%rax,1)
L13:
  mov    $0xa,%edi
  add    $0x1,%ebx
  call   <putchar@plt>
  cmp    $0x100,%ebx
  jne    L25
L47:
  xor    %eax,%eax
  lea    D109(%rip),%rdi
  call   <printf@plt>
  cmp    $0x7,%r12d
  je     L38
  mov    $0x2c,%edi
  add    $0x1,%r12d
  call   <putchar@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L99
L38:
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D24(%rip),%rdi
L34:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <puts@plt>
L49:
  lea    D47(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D13(%rip),%rdi
  mov    %rbp,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D75(%rip),%rdi
  jmp    L34
```

tool_calls: name: retrieve_data
arguments: data_label: D13
type: string
name: retrieve_data
arguments: data_label: D66
type: string
name: retrieve_data
arguments: data_label: D41
type: string
name: retrieve_data
arguments: data_label: D107
type: string
name: retrieve_data
arguments: data_label: D23
type: string
name: retrieve_data
arguments: data_label: D18
type: string
name: retrieve_data
arguments: data_label: D109
type: string
name: retrieve_data
arguments: data_label: D24
type: string
name: retrieve_data
arguments: data_label: D47
type: string
name: retrieve_data
arguments: data_label: D75
type: string

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

tool: D66:  =

tool: D41: %d

tool: D107: {

tool: D23:   

tool: D18:   {

tool: D109:   }

tool: D24: };

tool: D47: extern 

tool: D75: ;

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