user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<build_table_color>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L25
L93:
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0xa,%rax
  mov    %rax,%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x8,%rax
  mov    %rax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x5,%rax
  mov    %rax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L151
L238:
  movl   $0x0,-0x24(%rbp)
  jmp    L146
L134:
  cmpl   $0x0,-0x24(%rbp)
  jne    L114
  movl   $0x1,-0x20(%rbp)
  jmp    L185
L114:
  cmpl   $0x0,-0x24(%rbp)
  jle    L60
  cmpl   $0x2,-0x24(%rbp)
  jg     L60
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  shr    $0xf,%eax
  and    $0x7,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L185
L60:
  cmpl   $0x2,-0x24(%rbp)
  jle    L116
  cmpl   $0x5,-0x24(%rbp)
  jg     L116
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  shr    $0xc,%eax
  and    $0x7,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L185
L116:
  cmpl   $0x5,-0x24(%rbp)
  jle    L9
  cmpl   $0x9,-0x24(%rbp)
  jg     L9
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  shr    $0x9,%eax
  and    $0x7,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L185
L9:
  cmpl   $0x9,-0x24(%rbp)
  jle    L209
  cmpl   $0xc,-0x24(%rbp)
  jg     L209
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  shr    $0x6,%eax
  and    $0x7,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L185
L209:
  cmpl   $0xc,-0x24(%rbp)
  jle    L103
  cmpl   $0xe,-0x24(%rbp)
  jg     L103
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  shr    $0x3,%eax
  and    $0x7,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L185
L103:
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  and    $0x7,%eax
  mov    %eax,-0x20(%rbp)
L185:
  cmpl   $0x0,-0x24(%rbp)
  jne    L43
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x8,(%rax)
  jmp    L80
L43:
  mov    -0x28(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%eax
  mov    %eax,%esi
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  sub    %esi,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
L80:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  mov    -0x20(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x20(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  add    $0x40,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x10(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  add    %edx,%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x20(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  add    $0xffffff80,%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  add    $0x20,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x30(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  shl    $0x2,%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x40(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    $0xffffff80,%edx
  sub    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  sub    $0x40,%eax
  mov    %eax,%ecx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x50(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    $0x0,%eax
  sub    %ecx,%eax
  add    %eax,%eax
  mov    %al,(%rdx)
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edx
  shl    $0x2,%eax
  sub    %eax,%edx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x60(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  add    $0xffffff80,%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  sub    $0x20,%eax
  mov    %eax,%ecx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x70(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    $0x0,%eax
  sub    %ecx,%eax
  shl    $0x2,%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x24(%rbp)
L146:
  cmpl   $0xf,-0x24(%rbp)
  jle    L134
  addl   $0x1,-0x28(%rbp)
  addq   $0x4,-0x8(%rbp)
  subq   $0xffffffffffffff80,-0x18(%rbp)
L151:
  cmpl   $0x7,-0x28(%rbp)
  jle    L238
  addl   $0x1,-0x2c(%rbp)
L25:
  cmpl   $0xf,-0x2c(%rbp)
  jle    L93
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void build_table_color(const unsigned int romtable[16][8], unsigned char p0004[16][1024], unsigned char p8004[16][256]) {
  int compression_mode, j, k, bit, pw;
  unsigned char *p0, *p8;
  const unsigned int *r;
  for (compression_mode = 0; compression_mode < 16; compression_mode++) {
    p0 = p0004[compression_mode];
    p8 = p8004[compression_mode];
    r = romtable[compression_mode];
    for (j = 0; j < 8; j++, r++, p0 += 128) {
      for (k = 0; k < 16; k++) {
        if (k == 0)
          bit = 1;
        else if (k >= 1 && k < 3)
          bit = (r[0] >> 15) & 7;
        else if (k >= 3 && k < 6)
          bit = (r[0] >> 12) & 7;
        else if (k >= 6 && k < 10)
          bit = (r[0] >> 9) & 7;
        else if (k >= 10 && k < 13)
          bit = (r[0] >> 6) & 7;
        else if (k >= 13 && k < 15)
          bit = (r[0] >> 3) & 7;
        else
          bit = (r[0]) & 7;
        if (k == 0)
          *p8++ = 8;
        else
          *p8++ = j - bit;
        *p8++ = bit;
        pw = 1 << bit;
        p0[k + 0x00] = (1 * pw) + 0x80;
        p0[k + 0x10] = (2 * pw) + 0x80;
        p0[k + 0x20] = (3 * pw) + 0x80;
        p0[k + 0x30] = (4 * pw) + 0x80;
        p0[k + 0x40] = (-1 * pw) + 0x80;
        p0[k + 0x50] = (-2 * pw) + 0x80;
        p0[k + 0x60] = (-3 * pw) + 0x80;
        p0[k + 0x70] = (-4 * pw) + 0x80;
      }
    }
  }
}
```