user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<qqwry_get_location_by_long>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpq   $0x0,-0x40(%rbp)
  jne    L58
  mov    $0x0,%eax
  jmp    L116
L58:
  mov    D6(%rip),%rax
  mov    (%rax),%edx
  mov    -0x40(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  mov    -0x40(%rbp),%rdx
  mov    -0x34(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <search_index@plt>
  mov    %eax,-0x14(%rbp)
  mov    D6(%rip),%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  lea    0x4(%rax),%ecx
  mov    -0x40(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  mov    %al,-0x15(%rbp)
  cmpb   $0x1,-0x15(%rbp)
  jne    L97
  mov    -0x40(%rbp),%rdx
  lea    -0xb(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  lea    -0xb(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  shl    $0x10,%eax
  mov    %eax,%edx
  lea    -0xb(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  shl    $0x8,%eax
  or     %eax,%edx
  lea    -0xb(%rbp),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  mov    %eax,-0x14(%rbp)
  mov    D6(%rip),%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%ecx
  mov    -0x40(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  mov    %al,-0x15(%rbp)
  subl   $0x4,-0x14(%rbp)
L97:
  cmpb   $0x2,-0x15(%rbp)
  jne    L111
  mov    -0x14(%rbp),%eax
  add    $0x8,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x40(%rbp),%rdx
  lea    -0xb(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  lea    -0xb(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  shl    $0x10,%eax
  mov    %eax,%edx
  lea    -0xb(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  shl    $0x8,%eax
  or     %eax,%edx
  lea    -0xb(%rbp),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  mov    %eax,-0x14(%rbp)
  mov    D6(%rip),%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%ecx
  mov    -0x40(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  jmp    L71
L105:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x28(%rbp),%rdx
  add    %rax,%rdx
  movzbl -0x15(%rbp),%eax
  mov    %al,(%rdx)
L71:
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  mov    %al,-0x15(%rbp)
  cmpb   $0x0,-0x15(%rbp)
  jne    L105
  mov    -0x10(%rbp),%edx
  mov    -0x40(%rbp),%rcx
  mov    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <readOrJumpRead@plt>
  jmp    L108
L111:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x28(%rbp),%rdx
  add    %rax,%rdx
  movzbl -0x15(%rbp),%eax
  mov    %al,(%rdx)
  jmp    L17
L92:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x28(%rbp),%rdx
  add    %rax,%rdx
  movzbl -0x15(%rbp),%eax
  mov    %al,(%rdx)
L17:
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  mov    %al,-0x15(%rbp)
  cmpb   $0x0,-0x15(%rbp)
  jne    L92
  mov    -0x40(%rbp),%rcx
  mov    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <readOrJumpRead@plt>
L108:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <is_cz88@plt>
  test   %rax,%rax
  je     L110
  mov    -0x28(%rbp),%rax
  movb   $0x0,(%rax)
L110:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <is_cz88@plt>
  test   %rax,%rax
  je     L35
  mov    -0x30(%rbp),%rax
  movb   $0x0,(%rax)
L35:
  mov    $0x1,%eax
L116:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L15
  call   <__stack_chk_fail@plt>
L15:
  leave
  ret
```

assistant: ```c
int qqwry_get_location_by_long(char *addr1, char *addr2, const uint32_t ip, FILE *qqwry_file) {
  unsigned char data_index_bytes[3];
  uint32_t data_index;
  uint32_t addr2_offset;
  unsigned char c;
  if (!qqwry_file) {
    return 0;
  }
  fseek(qqwry_file, 0, SEEK_SET);
  data_index = search_index(ip, qqwry_file);
  fseek(qqwry_file, data_index + 4, SEEK_SET);
  c = fgetc(qqwry_file);
  if (c == 0x01) {
    fread(data_index_bytes, 3, 1, qqwry_file);
    data_index = ((((uint8_t *)(&data_index_bytes[0]))[2] << 16) | (((uint8_t *)(&data_index_bytes[0]))[1] << 8) | ((uint8_t *)(&data_index_bytes[0]))[0]);
    fseek(qqwry_file, data_index, SEEK_SET);
    c = fgetc(qqwry_file);
    data_index -= 4;
  }
  if (c == 0x02) {
    addr2_offset = data_index + 8;
    fread(data_index_bytes, 3, 1, qqwry_file);
    data_index = ((((uint8_t *)(&data_index_bytes[0]))[2] << 16) | (((uint8_t *)(&data_index_bytes[0]))[1] << 8) | ((uint8_t *)(&data_index_bytes[0]))[0]);
    fseek(qqwry_file, data_index, SEEK_SET);
    while (c = fgetc(qqwry_file)) {
      addr1[strlen(addr1)] = c;
    }
    readOrJumpRead(addr2, qqwry_file, addr2_offset);
  } else {
    addr1[strlen(addr1)] = c;
    while (c = fgetc(qqwry_file)) {
      addr1[strlen(addr1)] = c;
    }
    readOrJumpRead(addr2, qqwry_file, 0);
  }
  if (is_cz88(addr1)) {
    addr1[0] = '\0';
  }
  if (is_cz88(addr2)) {
    addr2[0] = '\0';
  }
  return 1;
}
```