user: 这段汇编代码用C语言表示是什么样的？

```asm
<hexfile_build_tables>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  push   %rbx
  sub    $0x148,%rsp
  mov    %rsi,0x8(%rsp)
  lea    D99(%rip),%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x138(%rsp)
  xor    %eax,%eax
  xor    %eax,%eax
  movq   $0x0,0x28(%rsp)
  mov    %ax,0x26(%rsp)
  call   <fopen@plt>
  test   %rax,%rax
  je     L131
  lea    D75(%rip),%rdi
  mov    %rax,%r14
  xor    %r13d,%r13d
  call   <puts@plt>
  lea    0x30(%rsp),%rax
  mov    $0x100,%esi
  mov    %rax,%rdi
  mov    %rax,0x10(%rsp)
  call   <bzero@plt>
  mov    $0x40,%edx
  xor    %esi,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  mov    0x8(%rsp),%rdi
  mov    $0x8,%edx
  mov    $0xff,%esi
  call   <memset@plt>
  nopl   0x0(%rax)
L79:
  mov    0x10(%rsp),%rdx
  lea    D107(%rip),%rsi
  mov    %r14,%rdi
  call   <fscanf@plt>
  cmp    $0x1,%eax
  jne    L11
  lea    0x37(%rsp),%r15
  mov    $0x2,%edx
  movb   $0x0,0x25(%rsp)
  lea    D82(%rip),%rsi
  mov    %r15,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L20
  mov    $0x2,%edx
  lea    D98(%rip),%rsi
  mov    %r15,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L25
  mov    $0x2,%edx
  lea    D20(%rip),%rsi
  mov    %r15,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L79
  lea    0x26(%rsp),%rdx
  lea    0x33(%rsp),%rdi
  lea    D10(%rip),%rsi
  call   <sscanf@plt>
  lea    0x28(%rsp),%rdx
  lea    0x39(%rsp),%rdi
  xor    %eax,%eax
  lea    D53(%rip),%rsi
  call   <sscanf@plt>
  mov    0x28(%rsp),%rsi
  xor    %eax,%eax
  lea    D39(%rip),%rdi
  shl    $0xf,%rsi
  call   <printf@plt>
  mov    0x28(%rsp),%rax
  cmp    $0x1,%rax
  adc    $0xffffffffffffffff,%rax
  shl    $0xf,%rax
  mov    %rax,0x28(%rsp)
  jmp    L79
  nopw   0x0(%rax,%rax,1)
L20:
  lea    D122(%rip),%rbx
  lea    0x25(%rsp),%rdx
  lea    0x31(%rsp),%rdi
  mov    %rbx,%rsi
  call   <sscanf@plt>
  xor    %eax,%eax
  lea    0x26(%rsp),%rdx
  lea    0x33(%rsp),%rdi
  lea    D10(%rip),%rsi
  call   <sscanf@plt>
  cmpb   $0x0,0x25(%rsp)
  je     L79
  xor    %r15d,%r15d
  lea    0x39(%rsp),%rbp
  mov    %r14,0x18(%rsp)
  mov    %r15d,%r14d
  mov    %rbp,%r15
  jmp    L26
  nopl   0x0(%rax)
L105:
  mov    %r15,%rdi
  movslq %ebp,%rdx
  mov    %rbx,%rsi
  add    0x8(%rsp),%rdx
  xor    %eax,%eax
  add    $0x1,%r14d
  add    $0x2,%r15
  call   <sscanf@plt>
  movzbl 0x25(%rsp),%eax
  cmp    %r14d,%eax
  jle    L27
L26:
  movzwl 0x26(%rsp),%ebp
  add    0x28(%rsp),%ebp
  add    %r14d,%ebp
  lea    0x7ff(%rbp),%eax
  cmovns %ebp,%eax
  sar    $0xb,%eax
  cltq
  add    %r12,%rax
  cmpb   $0x0,(%rax)
  jne    L105
  movb   $0x1,(%rax)
  add    $0x1,%r13d
  lea    D79(%rip),%rdi
  xor    %eax,%eax
  mov    %r13d,%esi
  call   <printf@plt>
  jmp    L105
  nopl   0x0(%rax,%rax,1)
L27:
  mov    0x18(%rsp),%r14
  jmp    L79
  nopw   0x0(%rax,%rax,1)
L25:
  lea    D65(%rip),%rdi
  call   <puts@plt>
L11:
  mov    %r14,%rdi
  call   <fclose@plt>
L16:
  mov    0x138(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L68
  add    $0x148,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L131:
  mov    %r13,%rsi
  lea    D3(%rip),%rdi
  xor    %eax,%eax
  mov    $0xffffffff,%r13d
  call   <printf@plt>
  jmp    L16
L68:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D99
datatype: string
name: unpack_data
arguments: label: D75
datatype: string
name: unpack_data
arguments: label: D107
datatype: string
name: unpack_data
arguments: label: D82
datatype: string
name: unpack_data
arguments: label: D98
datatype: string
name: unpack_data
arguments: label: D20
datatype: string
name: unpack_data
arguments: label: D10
datatype: string
name: unpack_data
arguments: label: D53
datatype: string
name: unpack_data
arguments: label: D39
datatype: string
name: unpack_data
arguments: label: D122
datatype: string
name: unpack_data
arguments: label: D79
datatype: string
name: unpack_data
arguments: label: D65
datatype: string
name: unpack_data
arguments: label: D3
datatype: string

tool: D99: r

tool: D75: .ihex file ok.

tool: D107: %s

tool: D82: 00

tool: D98: 01

tool: D20: 04

tool: D10: %4hx

tool: D53: %4lx

tool: D39: 
Extended page address: 0x%8.8lX


tool: D122: %2hhx

tool: D79: Writing %d pages.

tool: D65: 
File read complete.

tool: D3: Failed to open .ihex file %s


assistant: ```c
int hexfile_build_tables(char *ihexfile, unsigned char *page_buffer, unsigned char *page_table) {
  unsigned char buffer[256];
  int length;
  int i;
  int pages;
  unsigned long ext_addr = 0;
  unsigned short int addr = 0;
  FILE *ihex_fp;
  if ((ihex_fp = (FILE *)fopen(ihexfile, "r")) == NULL) {
    printf("Failed to open .ihex file %s\n", ihexfile);
    return (-1);
  } else {
    printf(".ihex file ok.\n");
  }
  bzero(buffer, sizeof(buffer));
  memset(page_table, 0, 64);
  memset(page_buffer, 0xFF, sizeof(page_buffer));
  pages = 0;
  while ((fscanf(ihex_fp, "%s", buffer) == 1)) {
    unsigned char data_len = 0;
    if (memcmp(&buffer[7], "00", 2) == 0) {
      i = 0;
      sscanf((char *)&buffer[1], "%2hhx", &data_len);
      sscanf((char *)&(buffer[3]), "%4hx", &addr);
      while (i < data_len) {
        uint32_t absolute_address = ext_addr + addr + i;
        if (page_table[absolute_address / 2048] == 0) {
          page_table[absolute_address / 2048] = 1;
          printf("Writing %d pages.\r", ++pages);
        }
        sscanf((char *)&buffer[2 * i + 9], "%2hhx", &page_buffer[absolute_address]);
        i++;
      }
    } else if (memcmp(&buffer[7], "01", 2) == 0) {
      printf("\nFile read complete.\n");
      break;
    } else if (memcmp(&buffer[7], "04", 2) == 0) {
      sscanf((char *)&(buffer[3]), "%4hx", &addr);
      sscanf((char *)&(buffer[9]), "%4lx", &ext_addr);
      printf("\nExtended page address: 0x%8.8lX\n", ext_addr * 0x8000);
      if (ext_addr)
        ext_addr--;
      ext_addr *= 0x8000;
    }
  }
  fclose(ihex_fp);
  return (pages);
}
```