user: 下面的汇编指令对应的C源代码是什么：

```asm
<pack_nametable>:
  endbr64
  push   %r15
  xor    %eax,%eax
  mov    %esi,%r15d
  push   %r14
  push   %r13
  mov    %r9,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x58,%rsp
  mov    %esi,0x48(%rsp)
  mov    %edx,0x14(%rsp)
  mov    %r8d,0x4c(%rsp)
  mov    %rdi,0x8(%rsp)
  call   <assert@plt>
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <assert@plt>
  mov    0x90(%rsp),%rdi
  xor    %eax,%eax
  call   <assert@plt>
  movq   $0x0,0x0(%r13)
  test   %r15d,%r15d
  jle    L437
  mov    0x14(%rsp),%r10d
  xor    %eax,%eax
  mov    0x8(%rsp),%r14
  mov    %ebx,0x40(%rsp)
  xor    %r12d,%r12d
  xor    %ebx,%ebx
  mov    %eax,%r11d
  mov    %r10d,0x44(%rsp)
  nopw   0x0(%rax,%rax,1)
L52:
  mov    0x40(%rsp),%r15d
  test   %r10d,%r10d
  jle    L87
  xor    %ecx,%ecx
  xor    %ebp,%ebp
L221:
  movslq %r12d,%rax
  movzbl (%r14,%rax,1),%edx
  cmp    $0x1,%ecx
  jne    L114
L47:
  xor    %r9d,%r9d
  test   %dl,%dl
  jne    L378
  add    $0x1,%ebp
  add    $0x1,%r12d
  add    $0x1,%r15d
  cmp    %ebp,%r10d
  jle    L129
  movslq %r12d,%rax
  movzbl (%r14,%rax,1),%edx
L399:
  test   %dl,%dl
  jne    L378
  add    $0x1,%ebp
  add    $0x1,%r12d
  add    $0x1,%r15d
  mov    $0x1,%ecx
  cmp    %ebp,%r10d
  jg     L221
  nopw   0x0(%rax,%rax,1)
L129:
  mov    0x44(%rsp),%esi
  cmp    %esi,0x48(%rsp)
  jle    L326
L87:
  add    %r10d,0x44(%rsp)
  addl   $0x20,0x40(%rsp)
  jmp    L52
  nopw   0x0(%rax,%rax,1)
L433:
  xor    %r9d,%r9d
L378:
  lea    0x2(%rbx),%r8d
  mov    0x0(%r13),%rdi
  cmp    %r11d,%r8d
  jge    L321
L220:
  movslq %ebx,%rax
  mov    %r15d,%ecx
  mov    %ch,(%rdi,%rax,1)
  lea    0x1(%rbx),%eax
  mov    0x0(%r13),%rsi
  cltq
  mov    %r15b,(%rsi,%rax,1)
  test   %r9d,%r9d
  je     L271
  add    $0x4,%ebp
  add    $0x4,%r12d
  cmp    %ebp,%r10d
  jle    L558
  movslq %r12d,%rcx
  movzbl (%r14,%rcx,1),%eax
  lea    0x1(%r14,%rcx,1),%rsi
  mov    $0x4,%ecx
L329:
  cmp    %al,%dl
  je     L380
L93:
  lea    0x4(%rbx),%r9d
  mov    0x0(%r13),%rdi
  cmp    %r11d,%r9d
  jge    L177
L379:
  mov    %ecx,%eax
  movslq %r8d,%r8
  add    $0x3,%ebx
  add    %ecx,%r15d
  or     $0x40,%eax
  movslq %ebx,%rbx
  mov    %al,(%rdi,%r8,1)
  mov    0x0(%r13),%rax
  mov    %dl,(%rax,%rbx,1)
  cmp    %ebp,%r10d
  jle    L106
  movslq %r12d,%rax
  mov    %r9d,%ebx
  movzbl (%r14,%rax,1),%edx
L114:
  lea    0x1(%r15),%edi
  lea    0x1(%rbp),%ecx
  lea    0x1(%r12),%esi
L40:
  lea    0x2(%rcx),%r8d
  lea    -0x1(%rsi),%r12d
  lea    -0x1(%rcx),%ebp
  lea    -0x1(%rdi),%r15d
  cmp    %r8d,%r10d
  jle    L521
  cmp    %dl,0x1(%r14,%rax,1)
  je     L74
L521:
  test   %dl,%dl
  jne    L433
L405:
  mov    %esi,%r12d
  cmp    %ecx,%r10d
  jle    L129
  movslq %esi,%rax
  add    $0x1,%edi
  add    $0x1,%ecx
  add    $0x1,%esi
  movzbl (%r14,%rax,1),%edx
  jmp    L40
L380:
  add    $0x1,%ecx
  add    $0x1,%r12d
  add    $0x1,%ebp
  cmp    $0x3f,%ecx
  je     L93
  cmp    %ebp,%r10d
  jle    L230
  movzbl (%rsi),%eax
  add    $0x1,%rsi
  jmp    L329
  nopl   0x0(%rax,%rax,1)
L271:
  lea    0x4(%rbx),%ecx
  mov    0x0(%r13),%rdi
  cmp    %r11d,%ecx
  jge    L469
L290:
  movslq %r8d,%rax
  add    $0x3,%ebx
  add    $0x1,%ebp
  add    $0x1,%r12d
  movb   $0x0,(%rdi,%rax,1)
  movslq %ebx,%rbx
  mov    %rax,0x18(%rsp)
  mov    0x0(%r13),%rax
  mov    %dl,(%rax,%rbx,1)
  cmp    %ebp,%r10d
  jle    L555
  movslq %r12d,%r8
  movslq %ecx,%rax
  mov    $0x1,%ecx
  mov    %r15d,0x14(%rsp)
  movzbl (%r14,%r8,1),%r9d
  mov    %rax,0x8(%rsp)
  mov    %rax,%rbx
  mov    %r8,%r12
  lea    0x3(%rbp),%eax
  mov    %ecx,%r15d
  mov    %r14,%rdx
  mov    %r13,%rcx
  mov    %r8,%rsi
  mov    %r9d,%r13d
  mov    %r12d,%r14d
  cmp    %r10d,%eax
  jge    L343
  cmp    %r13b,0x1(%rdx,%rsi,1)
  je     L510
  nopw   0x0(%rax,%rax,1)
L343:
  add    $0x1,%ebx
  mov    (%rcx),%rdi
  cmp    %r11d,%ebx
  jge    L107
L287:
  mov    0x8(%rsp),%rax
  add    %r12,%rdi
  add    $0x1,%r15d
  add    $0x1,%ebp
  sub    %r8,%rax
  mov    %r13b,(%rdi,%rax,1)
  lea    0x1(%r14),%edi
  cmp    $0x3f,%r15d
  je     L94
  add    $0x1,%r12
  cmp    %ebp,%r10d
  jle    L339
  lea    0x3(%rbp),%eax
  movzbl (%rdx,%r12,1),%r13d
  mov    %r12,%rsi
  mov    %r12d,%r14d
  cmp    %r10d,%eax
  jge    L343
  cmp    %r13b,0x1(%rdx,%rsi,1)
  jne    L343
L510:
  cmp    %r13b,0x2(%rdx,%rsi,1)
  jne    L343
  cmp    %r13b,0x3(%rdx,%rsi,1)
  jne    L343
  mov    %rcx,%r13
  mov    0x18(%rsp),%rsi
  mov    %r15d,%ecx
  mov    0x14(%rsp),%r15d
  mov    0x0(%r13),%rax
  mov    %rdx,%r14
  add    %ecx,%r15d
  mov    %cl,(%rax,%rsi,1)
  cmp    %ebp,%r10d
  jle    L129
  movslq %r12d,%rax
  mov    $0x1,%r9d
  movzbl (%rdx,%rax,1),%edx
  jmp    L399
  nopl   0x0(%rax)
L94:
  mov    0x14(%rsp),%r15d
  mov    (%rcx),%rax
  mov    %edi,%r12d
  mov    %rdx,%r14
  mov    0x18(%rsp),%rsi
  mov    %rcx,%r13
  add    $0x3f,%r15d
  movb   $0x3f,(%rax,%rsi,1)
  cmp    %ebp,%r10d
  jle    L129
  movslq %edi,%rax
  movzbl (%rdx,%rax,1),%edx
  jmp    L47
  nopl   0x0(%rax,%rax,1)
L321:
  add    $0x40,%r11d
  mov    %dl,0x20(%rsp)
  movslq %r11d,%rsi
  mov    %r8d,0x30(%rsp)
  mov    %r10d,0x18(%rsp)
  mov    %r9d,0x14(%rsp)
  mov    %r11d,0x8(%rsp)
  call   <realloc@plt>
  movzbl 0x20(%rsp),%edx
  mov    0x30(%rsp),%r8d
  mov    %rax,0x0(%r13)
  mov    0x18(%rsp),%r10d
  mov    %rax,%rdi
  mov    0x14(%rsp),%r9d
  mov    0x8(%rsp),%r11d
  jmp    L220
  nopl   0x0(%rax)
L107:
  add    $0x40,%r11d
  mov    %rcx,0x38(%rsp)
  movslq %r11d,%rsi
  mov    %r10d,0x34(%rsp)
  mov    %rdx,0x28(%rsp)
  mov    %r8,0x20(%rsp)
  mov    %r11d,0x30(%rsp)
  call   <realloc@plt>
  mov    0x38(%rsp),%rcx
  mov    0x34(%rsp),%r10d
  mov    0x28(%rsp),%rdx
  mov    0x20(%rsp),%r8
  mov    %rax,%rdi
  mov    %rax,(%rcx)
  mov    0x30(%rsp),%r11d
  jmp    L287
  nopl   0x0(%rax)
L74:
  cmp    %dl,0x2(%r14,%rax,1)
  jne    L521
  movzbl 0x3(%r14,%rax,1),%eax
  test   %dl,%dl
  je     L405
  xor    %r9d,%r9d
  cmp    %dl,%al
  sete   %r9b
  jmp    L378
  nop
L469:
  add    $0x40,%r11d
  mov    %ecx,0x20(%rsp)
  movslq %r11d,%rsi
  mov    %dl,0x30(%rsp)
  mov    %r8d,0x18(%rsp)
  mov    %r10d,0x14(%rsp)
  mov    %r11d,0x8(%rsp)
  call   <realloc@plt>
  mov    0x20(%rsp),%ecx
  movzbl 0x30(%rsp),%edx
  mov    %rax,0x0(%r13)
  mov    0x18(%rsp),%r8d
  mov    %rax,%rdi
  mov    0x14(%rsp),%r10d
  mov    0x8(%rsp),%r11d
  jmp    L290
  nopw   0x0(%rax,%rax,1)
L177:
  add    $0x40,%r11d
  mov    %dl,0x28(%rsp)
  movslq %r11d,%rsi
  mov    %ecx,0x20(%rsp)
  mov    %r8d,0x30(%rsp)
  mov    %r9d,0x18(%rsp)
  mov    %r10d,0x14(%rsp)
  mov    %r11d,0x8(%rsp)
  call   <realloc@plt>
  movzbl 0x28(%rsp),%edx
  mov    0x20(%rsp),%ecx
  mov    %rax,0x0(%r13)
  mov    0x30(%rsp),%r8d
  mov    %rax,%rdi
  mov    0x18(%rsp),%r9d
  mov    0x14(%rsp),%r10d
  mov    0x8(%rsp),%r11d
  jmp    L379
L339:
  mov    %rcx,%r13
  mov    %edi,%r12d
  mov    %rdx,%r14
  mov    %r15d,%ecx
L138:
  mov    0x18(%rsp),%rsi
  mov    0x0(%r13),%rax
  mov    %cl,(%rax,%rsi,1)
  mov    0x44(%rsp),%esi
  cmp    %esi,0x48(%rsp)
  jg     L87
L326:
  mov    0x4c(%rsp),%edx
  mov    %r11d,%esi
  test   %edx,%edx
  jne    L25
L32:
  mov    0x90(%rsp),%rax
  mov    %ebx,(%rax)
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L230:
  mov    %ecx,%ebp
  or     $0x40,%ebp
L64:
  lea    0x4(%rbx),%r15d
  mov    0x0(%r13),%rdi
  cmp    %r11d,%r15d
  jge    L28
L390:
  movslq %r8d,%r8
  lea    0x3(%rbx),%eax
  mov    %r15d,%ebx
  mov    %bpl,(%rdi,%r8,1)
  mov    0x0(%r13),%rcx
  cltq
  mov    %dl,(%rcx,%rax,1)
  jmp    L129
L28:
  add    $0x40,%r11d
  mov    %r10d,0x30(%rsp)
  movslq %r11d,%rsi
  mov    %dl,0x18(%rsp)
  mov    %r8d,0x14(%rsp)
  mov    %r11d,0x8(%rsp)
  call   <realloc@plt>
  mov    0x30(%rsp),%r10d
  movzbl 0x18(%rsp),%edx
  mov    %rax,0x0(%r13)
  mov    0x14(%rsp),%r8d
  mov    %rax,%rdi
  mov    0x8(%rsp),%r11d
  jmp    L390
L558:
  mov    $0x44,%ebp
  jmp    L64
L555:
  mov    %ecx,%ebx
  mov    $0x1,%ecx
  jmp    L138
L106:
  mov    %r9d,%ebx
  jmp    L129
L25:
  lea    0x1(%rbx),%ebp
  add    $0x1,%esi
  mov    0x0(%r13),%rdi
  movslq %ebx,%rbx
  movslq %esi,%rsi
  cmp    %r11d,%ebp
  jge    L152
L413:
  movb   $0x0,(%rdi,%rbx,1)
  mov    %ebp,%ebx
  jmp    L32
L437:
  mov    0x4c(%rsp),%eax
  xor    %ebx,%ebx
  test   %eax,%eax
  je     L32
  xor    %ebx,%ebx
  xor    %edi,%edi
  mov    $0x1,%esi
  mov    $0x1,%ebp
L152:
  call   <realloc@plt>
  mov    %rax,0x0(%r13)
  mov    %rax,%rdi
  jmp    L413
```

assistant: ```c
void pack_nametable(const unsigned char *nametable, int nametable_sz, int width, int vram_address, int zero_terminate, unsigned char **out, int *out_sz) {
  int out_pos = 0;
  int buf_sz = 0;
  int y = 0;
  int in_pos = 0;
  assert(nametable);
  assert(out);
  assert(out_sz);
  *out = 0;
  while (y * width < nametable_sz) {
    unsigned char rlech;
    int count;
    int count_pos;
    int x = 0;
    int state = 0;
    int start_rle = 0;
    int addr = vram_address + (y * 32);
    while (x < width) {
      const unsigned char ch = nametable[in_pos];
      switch (state) {
      case 0:
        start_rle = (x + 4 <= width) && (nametable[in_pos + 1] == ch) && (nametable[in_pos + 2] == ch) && (nametable[in_pos + 3] == ch);
      case 1:
        if (ch == 0) {
          start_rle = 0;
          ++in_pos;
          ++x;
          ++addr;
          break;
        }
        if (out_pos + 2 >= buf_sz) {
          buf_sz += 64;
          *out = (unsigned char *)realloc(*out, buf_sz);
        }
        (*out)[out_pos++] = (unsigned char)(addr >> 8);
        (*out)[out_pos++] = (unsigned char)(addr & 255);
        if (start_rle) {
          count = 4;
          rlech = ch;
          in_pos += 4;
          x += 4;
          state = 2;
        } else {
          count_pos = out_pos;
          if (out_pos + 2 >= buf_sz) {
            buf_sz += 64;
            *out = (unsigned char *)realloc(*out, buf_sz);
          }
          (*out)[out_pos++] = 0;
          count = 1;
          (*out)[out_pos++] = ch;
          ++in_pos;
          ++x;
          state = 3;
        }
        break;
      case 2:
        if (ch == rlech) {
          ++count;
          ++in_pos;
          ++x;
        }
        if ((ch != rlech) || (count == 0x3F)) {
          if (out_pos + 2 >= buf_sz) {
            buf_sz += 64;
            *out = (unsigned char *)realloc(*out, buf_sz);
          }
          (*out)[out_pos++] = (unsigned char)(0x40 | count);
          (*out)[out_pos++] = rlech;
          addr += count;
          state = 0;
        }
        break;
      case 3:
        start_rle = ((x + 4 <= width) && (nametable[in_pos + 1] == ch) && (nametable[in_pos + 2] == ch) && (nametable[in_pos + 3] == ch));
        if (start_rle) {
          (*out)[count_pos] = count;
          addr += count;
          state = 1;
        } else {
          if (out_pos + 1 >= buf_sz) {
            buf_sz += 64;
            *out = (unsigned char *)realloc(*out, buf_sz);
          }
          (*out)[out_pos++] = ch;
          ++in_pos;
          ++x;
          ++count;
          if (count == 0x3F) {
            (*out)[count_pos] = count;
            addr += count;
            state = 1;
          }
        }
        break;
      }
    }
    switch (state) {
    case 0:
    case 1:
      break;
    case 2:
      if (out_pos + 2 >= buf_sz) {
        buf_sz += 64;
        *out = (unsigned char *)realloc(*out, buf_sz);
      }
      (*out)[out_pos++] = (unsigned char)(0x40 | count);
      (*out)[out_pos++] = rlech;
      break;
    case 3:
      (*out)[count_pos] = count;
      break;
    }
    ++y;
  }
  if (zero_terminate) {
    if (out_pos + 1 >= buf_sz) {
      buf_sz += 1;
      *out = (unsigned char *)realloc(*out, buf_sz);
    }
    (*out)[out_pos++] = 0;
  }
  *out_sz = out_pos;
}
```