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

```asm
<hexfile_build_tables>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  sub    $0x148,%rsp
  mov    %rsi,0x8(%rsp)
  lea    D65(%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     L80
  lea    D34(%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    %rbp,%rdi
  call   <memset@plt>
  mov    0x8(%rsp),%rdi
  mov    $0x8,%edx
  mov    $0xff,%esi
  call   <memset@plt>
  nopl   0x0(%rax)
L122:
  mov    0x10(%rsp),%rdx
  lea    D44(%rip),%rsi
  mov    %r14,%rdi
  call   <fscanf@plt>
  cmp    $0x1,%eax
  jne    L132
  lea    0x37(%rsp),%r15
  mov    $0x2,%edx
  movb   $0x0,0x25(%rsp)
  lea    D28(%rip),%rsi
  mov    %r15,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L98
  mov    $0x2,%edx
  lea    D90(%rip),%rsi
  mov    %r15,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L10
  mov    $0x2,%edx
  lea    D62(%rip),%rsi
  mov    %r15,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L122
  lea    0x26(%rsp),%rdx
  lea    0x33(%rsp),%rdi
  lea    D17(%rip),%rsi
  call   <sscanf@plt>
  lea    0x28(%rsp),%rdx
  lea    0x39(%rsp),%rdi
  xor    %eax,%eax
  lea    D21(%rip),%rsi
  call   <sscanf@plt>
  mov    0x28(%rsp),%rsi
  xor    %eax,%eax
  lea    D93(%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    L122
  nopw   0x0(%rax,%rax,1)
L98:
  lea    D43(%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    D17(%rip),%rsi
  call   <sscanf@plt>
  cmpb   $0x0,0x25(%rsp)
  je     L122
  lea    0x39(%rsp),%r12
  mov    %r14,0x18(%rsp)
  xor    %r15d,%r15d
  mov    %r13d,%r14d
  mov    %rbp,%r13
  mov    %r12,%rbp
  jmp    L74
  nopl   0x0(%rax)
L19:
  mov    %rbp,%rdi
  movslq %r12d,%rdx
  mov    %rbx,%rsi
  add    0x8(%rsp),%rdx
  xor    %eax,%eax
  add    $0x1,%r15d
  add    $0x2,%rbp
  call   <sscanf@plt>
  movzbl 0x25(%rsp),%eax
  cmp    %r15d,%eax
  jle    L8
L74:
  movzwl 0x26(%rsp),%edx
  add    0x28(%rsp),%edx
  lea    (%rdx,%r15,1),%r12d
  test   %r12d,%r12d
  lea    0x7ff(%r12),%eax
  cmovns %r12d,%eax
  sar    $0xb,%eax
  cltq
  add    %r13,%rax
  cmpb   $0x0,(%rax)
  jne    L19
  movb   $0x1,(%rax)
  add    $0x1,%r14d
  lea    D2(%rip),%rdi
  xor    %eax,%eax
  mov    %r14d,%esi
  call   <printf@plt>
  jmp    L19
  nopw   0x0(%rax,%rax,1)
L8:
  mov    %r13,%rbp
  mov    %r14d,%r13d
  mov    0x18(%rsp),%r14
  jmp    L122
L10:
  lea    D7(%rip),%rdi
  call   <puts@plt>
L132:
  mov    %r14,%rdi
  call   <fclose@plt>
L90:
  mov    0x138(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L114
  add    $0x148,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L80:
  mov    %r13,%rsi
  lea    D81(%rip),%rdi
  xor    %eax,%eax
  mov    $0xffffffff,%r13d
  call   <printf@plt>
  jmp    L90
L114:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D65
type_infered: string
name: disassemble_data
arguments: data_tag: D34
type_infered: string
name: disassemble_data
arguments: data_tag: D44
type_infered: string
name: disassemble_data
arguments: data_tag: D28
type_infered: string
name: disassemble_data
arguments: data_tag: D90
type_infered: string
name: disassemble_data
arguments: data_tag: D62
type_infered: string
name: disassemble_data
arguments: data_tag: D17
type_infered: string
name: disassemble_data
arguments: data_tag: D21
type_infered: string
name: disassemble_data
arguments: data_tag: D93
type_infered: string
name: disassemble_data
arguments: data_tag: D43
type_infered: string
name: disassemble_data
arguments: data_tag: D2
type_infered: string
name: disassemble_data
arguments: data_tag: D7
type_infered: string
name: disassemble_data
arguments: data_tag: D81
type_infered: string

tool: D65: r

tool: D34: .ihex file ok.

tool: D44: %s

tool: D28: 00

tool: D90: 01

tool: D62: 04

tool: D17: %4hx

tool: D21: %4lx

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


tool: D43: %2hhx

tool: D2: Writing %d pages.

tool: D7: 
File read complete.

tool: D81: 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);
}
```