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

```asm
<seek_config_path>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0xc38,%rsp
  mov    %rdi,-0xc38(%rbp)
  mov    %rsi,-0xc40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    -0xc40(%rbp),%rcx
  lea    -0x820(%rbp),%rax
  mov    $0x800,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  lea    -0x820(%rbp),%rax
  mov    $0x800,%esi
  mov    %rax,%rdi
  call   <trim_leading@plt>
  movl   $0x0,-0xc2c(%rbp)
  jmp    L174
L74:
  mov    -0xc2c(%rbp),%eax
  cltq
  movzbl -0x820(%rbp,%rax,1),%eax
  test   %al,%al
  je     L235
  mov    -0xc2c(%rbp),%eax
  cltq
  movzbl -0x820(%rbp,%rax,1),%eax
  cmp    $0x3e,%al
  je     L235
  mov    -0xc2c(%rbp),%eax
  cltq
  movzbl -0x820(%rbp,%rax,1),%eax
  cmp    $0x20,%al
  je     L235
  addl   $0x1,-0xc2c(%rbp)
L174:
  mov    -0xc2c(%rbp),%eax
  cmp    $0x1fe,%eax
  jbe    L74
L235:
  mov    -0xc2c(%rbp),%edx
  lea    -0x820(%rbp),%rcx
  lea    -0xc20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0xc2c(%rbp),%eax
  cltq
  movb   $0x0,-0xc20(%rbp,%rax,1)
  nop
L237:
  mov    -0xc38(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  test   %eax,%eax
  jne    L237
  mov    -0xc38(%rbp),%rax
  mov    %rax,%rdi
  call   <read_compressed_int@plt>
  mov    %eax,-0xc28(%rbp)
  movl   $0x0,-0xc2c(%rbp)
  jmp    L159
L135:
  mov    -0xc38(%rbp),%rax
  mov    %rax,%rdi
  call   <ftell@plt>
  mov    %eax,-0xc30(%rbp)
  mov    -0xc38(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  mov    %eax,-0xc24(%rbp)
  cmpl   $0x0,-0xc24(%rbp)
  jne    L229
  mov    -0xc38(%rbp),%rdx
  lea    -0xa20(%rbp),%rax
  mov    $0x200,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L128
  mov    $0x1,%eax
  jmp    L272
L128:
  mov    D54(%rip),%rax
  mov    (%rax),%ebx
  lea    -0xa20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0xc30(%rbp),%edx
  add    %edx,%eax
  lea    0x2(%rax),%ecx
  mov    -0xc38(%rbp),%rax
  mov    %ebx,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  mov    -0xc38(%rbp),%rdx
  lea    -0xc30(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  lea    -0xc20(%rbp),%rdx
  lea    -0xa20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stricmp@plt>
  test   %rax,%rax
  jne    L47
  mov    D54(%rip),%rax
  mov    (%rax),%edx
  mov    -0xc30(%rbp),%ecx
  mov    -0xc38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  lea    -0x820(%rbp),%rax
  mov    $0x3e,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L202
  mov    $0x0,%eax
  jmp    L272
L202:
  mov    -0xc40(%rbp),%rax
  mov    $0x3e,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  lea    0x8(%rax),%rdx
  lea    -0x820(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x820(%rbp),%rdx
  mov    -0xc38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <seek_config_path>
  jmp    L272
L229:
  cmpl   $0x1,-0xc24(%rbp)
  jne    L18
  mov    -0xc38(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  mov    %eax,-0xc24(%rbp)
  mov    -0xc38(%rbp),%rdx
  lea    -0xa20(%rbp),%rax
  mov    $0x200,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L13
  mov    $0x1,%eax
  jmp    L272
L13:
  lea    -0xc20(%rbp),%rdx
  lea    -0xa20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stricmp@plt>
  test   %rax,%rax
  jne    L69
  mov    D54(%rip),%rax
  mov    (%rax),%edx
  mov    -0xc30(%rbp),%ecx
  mov    -0xc38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  mov    $0x0,%eax
  jmp    L272
L69:
  mov    D54(%rip),%rax
  mov    (%rax),%ebx
  lea    -0xa20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0xc30(%rbp),%edx
  add    %edx,%eax
  lea    0x3(%rax),%ecx
  mov    -0xc38(%rbp),%rax
  mov    %ebx,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  cmpl   $0x0,-0xc24(%rbp)
  jne    L146
  nop
L150:
  mov    -0xc38(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  test   %eax,%eax
  jne    L150
  jmp    L181
L146:
  mov    D23(%rip),%rax
  mov    (%rax),%edx
  mov    -0xc38(%rbp),%rax
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  jmp    L181
L18:
  cmpl   $0x2,-0xc24(%rbp)
  jne    L301
  mov    -0xc38(%rbp),%rdx
  lea    -0xa20(%rbp),%rax
  mov    $0x200,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L188
  mov    $0x1,%eax
  jmp    L272
L188:
  lea    -0xc20(%rbp),%rdx
  lea    -0xa20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stricmp@plt>
  test   %rax,%rax
  jne    L60
  mov    D54(%rip),%rax
  mov    (%rax),%edx
  mov    -0xc30(%rbp),%ecx
  mov    -0xc38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  mov    $0x0,%eax
  jmp    L272
L60:
  mov    D54(%rip),%rax
  mov    (%rax),%ebx
  lea    -0xa20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0xc30(%rbp),%edx
  add    %edx,%eax
  lea    0x2(%rax),%ecx
  mov    -0xc38(%rbp),%rax
  mov    %ebx,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  mov    -0xc38(%rbp),%rax
  mov    %rax,%rdi
  call   <skip_array@plt>
  jmp    L181
L301:
  nop
L300:
  mov    -0xc38(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  test   %eax,%eax
  jne    L300
  jmp    L181
L47:
  nop
L181:
  addl   $0x1,-0xc2c(%rbp)
L159:
  mov    -0xc2c(%rbp),%eax
  cmp    -0xc28(%rbp),%eax
  jl     L135
  mov    $0xffffffff,%eax
L272:
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L132
  call   <__stack_chk_fail@plt>
L132:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int seek_config_path(FILE *f, char *config_path) {
  int i;
  uint8_t type;
  uint32_t num_entries;
  uint32_t fp;
  char path[2048];
  char target[512];
  char buffer[512];
  strncpy(path, config_path, sizeof(path));
  trim_leading(path, sizeof(path));
  for (i = 0; i < sizeof(target) - 1; i++) {
    if (path[i] == 0 || path[i] == '>' || path[i] == ' ')
      break;
  }
  strncpy(target, path, i);
  target[i] = 0;
  while (fgetc(f) != 0)
    ;
  num_entries = read_compressed_int(f);
  for (i = 0; i < num_entries; i++) {
    fp = ftell(f);
    type = fgetc(f);
    if (type == 0) {
      if (fgets(buffer, sizeof(buffer), f) == NULL)
        return 1;
      fseek(f, fp + strlen(buffer) + 2, SEEK_SET);
      fread(&fp, 4, 1, f);
      if (stricmp(buffer, target))
        continue;
      fseek(f, fp, SEEK_SET);
      if (strchr(path, '>') == NULL)
        return 0;
      strcpy(path, strchr(config_path, '>') + 2);
      return seek_config_path(f, path);
    } else if (type == 1) {
      type = fgetc(f);
      if (fgets(buffer, sizeof(buffer), f) == NULL)
        return 1;
      if (stricmp(buffer, target) == 0) {
        fseek(f, fp, SEEK_SET);
        return 0;
      }
      fseek(f, fp + strlen(buffer) + 3, SEEK_SET);
      if (type == 0)
        while (fgetc(f) != 0)
          ;
      else
        fseek(f, 4, SEEK_CUR);
    } else if (type == 2) {
      if (fgets(buffer, sizeof(buffer), f) == NULL)
        return 1;
      if (stricmp(buffer, target) == 0) {
        fseek(f, fp, SEEK_SET);
        return 0;
      }
      fseek(f, fp + strlen(buffer) + 2, SEEK_SET);
      skip_array(f);
    } else {
      while (fgetc(f) != 0)
        ;
    }
  }
  return -1;
}
```