user: Please show me the C implementation that matches the assembly code listed below:

```asm
<nb_ind_ancestrymap>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x258,%rsp
  mov    %rdi,-0x258(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  movq   $0x0,-0x240(%rbp)
  movl   $0x3e8,-0x244(%rbp)
  movl   $0x0,-0x24c(%rbp)
  movl   $0x0,-0x248(%rbp)
  mov    -0x244(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x238(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L26:
  cmp    %rdx,%rsp
  je     L45
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L26
L45:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L5
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L5:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x230(%rbp)
  movq   $0x0,-0x220(%rbp)
  movq   $0x0,-0x218(%rbp)
  lea    -0x210(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0x3e,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
  mov    -0x258(%rbp),%rax
  mov    %rax,%rdi
  call   <fopen_read@plt>
  mov    %rax,-0x240(%rbp)
  mov    -0x240(%rbp),%rdx
  mov    -0x244(%rbp),%ecx
  mov    -0x230(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  mov    %rax,-0x228(%rbp)
  mov    -0x230(%rbp),%rax
  lea    D2(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strtok@plt>
  mov    %rax,-0x228(%rbp)
  mov    -0x228(%rbp),%rdx
  lea    -0x220(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L33
L42:
  mov    -0x240(%rbp),%rdx
  mov    -0x244(%rbp),%ecx
  mov    -0x230(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  mov    %rax,-0x228(%rbp)
  mov    -0x230(%rbp),%rax
  lea    D2(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strtok@plt>
  mov    %rax,-0x228(%rbp)
  mov    -0x228(%rbp),%rdx
  lea    -0x220(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  setne  %al
  movzbl %al,%eax
  mov    %eax,-0x248(%rbp)
  addl   $0x1,-0x24c(%rbp)
L33:
  mov    -0x240(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %eax,%eax
  jne    L2
  cmpl   $0x0,-0x248(%rbp)
  je     L42
L2:
  mov    -0x240(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x24c(%rbp),%eax
  mov    %rbx,%rsp
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D2
datatype: string

tool: D2:  	


assistant: ```c
int nb_ind_ancestrymap(char *input_file) {
  FILE *File = NULL;
  int max_char_per_line = 1000;
  int nb = 0, diff = 0;
  char szbuff[max_char_per_line];
  char *token;
  char tmp[512] = "";
  File = fopen_read(input_file);
  token = fgets(szbuff, max_char_per_line, File);
  token = strtok(szbuff, " \t\n");
  strcpy(tmp, token);
  while (!feof(File) && !diff) {
    token = fgets(szbuff, max_char_per_line, File);
    token = strtok(szbuff, " \t\n");
    diff = strcmp(tmp, token) != 0;
    nb++;
  }
  fclose(File);
  return nb;
}
```