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

```asm
<load_contacts>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x18(%rbp)
  lea    D43(%rip),%rax
  mov    %rax,%rsi
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L87
  mov    $0x0,%eax
  jmp    L49
L87:
  lea    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  lea    D29(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  mov    -0x18(%rbp),%eax
  cmp    $0x9,%eax
  jle    L63
  movl   $0xa,-0x18(%rbp)
L63:
  movl   $0x0,-0x14(%rbp)
  jmp    L81
L17:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%rax
  lea    D58(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  addl   $0x1,-0x14(%rbp)
L81:
  mov    -0x18(%rbp),%eax
  cmp    %eax,-0x14(%rbp)
  jl     L17
  movl   $0x0,-0x14(%rbp)
  jmp    L29
L12:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    0x0(,%rax,4),%rdx
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%rax
  lea    D58(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  addl   $0x1,-0x14(%rbp)
L29:
  mov    -0x18(%rbp),%eax
  cmp    %eax,-0x14(%rbp)
  jl     L12
  movl   $0x0,-0x14(%rbp)
  jmp    L82
L90:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  add    %rax,%rax
  mov    %rax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%rax
  lea    D58(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  addl   $0x1,-0x14(%rbp)
L82:
  mov    -0x18(%rbp),%eax
  cmp    %eax,-0x14(%rbp)
  jl     L90
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x18(%rbp),%eax
L49:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L38
  call   <__stack_chk_fail@plt>
L38:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D43
type_guessed: string
name: read_data
arguments: data_label: D28
type_guessed: string
name: read_data
arguments: data_label: D29
type_guessed: string
name: read_data
arguments: data_label: D58
type_guessed: string

tool: D43: r

tool: D28: contacts.dat

tool: D29: %d

tool: D58: %s

assistant: ```c
int load_contacts(char names[10][20], char addresses[10][200], char phoneNumbers[10][10]) {
  int numItems = 0;
  FILE *infile = fopen("contacts.dat", "r");
  if (infile == NULL) {
    return 0;
  }
  fscanf(infile, "%d", &numItems);
  if (numItems >= 10) {
    numItems = 10;
  }
  int i;
  for (i = 0; i < numItems; i++) {
    fscanf(infile, "%s", names[i]);
  }
  for (i = 0; i < numItems; i++) {
    fscanf(infile, "%s", addresses[i]);
  }
  for (i = 0; i < numItems; i++) {
    fscanf(infile, "%s", phoneNumbers[i]);
  }
  fclose(infile);
  return numItems;
}
```