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

```asm
<ini_parse>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x178,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x168(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  movq   $0x0,0x30(%rsp)
  movq   $0x0,0x38(%rsp)
  movq   $0x0,0x40(%rsp)
  movq   $0x0,0x48(%rsp)
  movw   $0x0,0x50(%rsp)
  movq   $0x0,0x60(%rsp)
  movq   $0x0,0x68(%rsp)
  movq   $0x0,0x70(%rsp)
  movq   $0x0,0x78(%rsp)
  movq   $0x0,0x80(%rsp)
  movq   $0x0,0x88(%rsp)
  movw   $0x0,0x90(%rsp)
  lea    D5(%rip),%rsi
  call   <fopen@plt>
  test   %rax,%rax
  je     L81
  mov    %rax,%r13
  mov    $0x0,%r14d
  mov    $0x0,%ebp
  lea    0xa0(%rsp),%r12
  jmp    L142
L53:
  movzbl (%rbx),%eax
  cmp    $0x5b,%al
  je     L97
  test   %al,%al
  je     L142
  cmp    $0x3b,%al
  jne    L85
L142:
  mov    %r13,%rdx
  mov    $0xc8,%esi
  mov    %r12,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L45
  add    $0x1,%ebp
  mov    %r12,%rdi
  call   <rstrip@plt>
  mov    %rax,%rdi
  call   <lskip@plt>
  mov    %rax,%rbx
  cmpb   $0x0,0x60(%rsp)
  je     L53
  cmpb   $0x0,(%rax)
  je     L53
  cmp    %r12,%rax
  jbe    L53
  lea    0x60(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  mov    %rax,%rcx
  mov    0x10(%rsp),%rdi
  mov    0x8(%rsp),%rax
  call   *%rax
  or     %r14d,%eax
  cmove  %ebp,%r14d
  jmp    L142
L97:
  add    $0x1,%rbx
  mov    $0x5d,%esi
  mov    %rbx,%rdi
  call   <find_char_or_comment@plt>
  cmpb   $0x5d,(%rax)
  je     L151
  test   %r14d,%r14d
  cmove  %ebp,%r14d
  jmp    L142
L151:
  movb   $0x0,(%rax)
  lea    0x20(%rsp),%rdi
  mov    $0x32,%edx
  mov    %rbx,%rsi
  call   <strncpy0@plt>
  movb   $0x0,0x60(%rsp)
  jmp    L142
L85:
  mov    $0x3d,%esi
  mov    %rbx,%rdi
  call   <find_char_or_comment@plt>
  mov    %rax,%r15
  cmpb   $0x3d,(%rax)
  je     L32
  test   %r14d,%r14d
  cmove  %ebp,%r14d
  jmp    L142
L32:
  movb   $0x0,(%rax)
  mov    %rbx,%rdi
  call   <rstrip@plt>
  mov    %rax,0x18(%rsp)
  lea    0x1(%r15),%rdi
  call   <lskip@plt>
  mov    %rax,%rbx
  mov    $0x3b,%esi
  mov    %rax,%rdi
  call   <find_char_or_comment@plt>
  cmpb   $0x3b,(%rax)
  je     L62
L1:
  mov    %rbx,%rdi
  call   <rstrip@plt>
  lea    0x60(%rsp),%rdi
  mov    $0x32,%edx
  mov    0x18(%rsp),%r15
  mov    %r15,%rsi
  call   <strncpy0@plt>
  lea    0x20(%rsp),%rsi
  mov    %rbx,%rcx
  mov    %r15,%rdx
  mov    0x10(%rsp),%rdi
  mov    0x8(%rsp),%rax
  call   *%rax
  or     %r14d,%eax
  cmove  %ebp,%r14d
  jmp    L142
L62:
  movb   $0x0,(%rax)
  jmp    L1
L45:
  mov    %r13,%rdi
  call   <fclose@plt>
L99:
  mov    0x168(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L154
  mov    %r14d,%eax
  add    $0x178,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L81:
  mov    $0xffffffff,%r14d
  jmp    L99
L154:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D5
type_infered: string

tool: D5: r

assistant: ```c
int ini_parse(const char *filename, int (*handler)(void *, const char *, const char *, const char *), void *user) {
  char line[200];
  char section[50] = "";
  char prev_name[50] = "";
  FILE *file;
  char *start;
  char *end;
  char *name;
  char *value;
  int lineno = 0;
  int error = 0;
  file = fopen(filename, "r");
  if (!file)
    return -1;
  while (fgets(line, sizeof(line), file) != NULL) {
    lineno++;
    start = lskip(rstrip(line));
    if (*prev_name && *start && start > line) {
      if (!handler(user, section, prev_name, start) && !error)
        error = lineno;
    } else if (*start == '[') {
      end = find_char_or_comment(start + 1, ']');
      if (*end == ']') {
        *end = '\0';
        strncpy0(section, start + 1, sizeof(section));
        *prev_name = '\0';
      } else if (!error) {
        error = lineno;
      }
    } else if (*start && *start != ';') {
      end = find_char_or_comment(start, '=');
      if (*end == '=') {
        *end = '\0';
        name = rstrip(start);
        value = lskip(end + 1);
        end = find_char_or_comment(value, ';');
        if (*end == ';')
          *end = '\0';
        rstrip(value);
        strncpy0(prev_name, name, sizeof(prev_name));
        if (!handler(user, section, name, value) && !error)
          error = lineno;
      } else if (!error) {
        error = lineno;
      }
    }
  }
  fclose(file);
  return error;
}
```