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

```asm
<qqwry_get_location_by_long>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %rcx,%rcx
  je     L82
  mov    %rdi,%rbp
  mov    %rsi,%r13
  mov    %edx,%ebx
  mov    %rcx,%r12
  mov    D25(%rip),%r15
  mov    (%r15),%edx
  mov    $0x0,%esi
  mov    %rcx,%rdi
  call   <fseek@plt>
  mov    %r12,%rsi
  mov    %ebx,%edi
  call   <search_index@plt>
  mov    %eax,%r14d
  lea    0x4(%rax),%esi
  mov    (%r15),%edx
  mov    %r12,%rdi
  call   <fseek@plt>
  mov    %r12,%rdi
  call   <fgetc@plt>
  mov    %eax,%ebx
  cmp    $0x1,%al
  je     L97
L116:
  cmp    $0x2,%bl
  je     L92
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %bl,0x0(%rbp,%rax,1)
  jmp    L79
L97:
  lea    0x5(%rsp),%rdi
  mov    %r12,%rcx
  mov    $0x1,%edx
  mov    $0x3,%esi
  call   <fread@plt>
  mov    0xd(%rsp),%r14d
  shl    $0x10,%r14d
  mov    0x9(%rsp),%eax
  shl    $0x8,%eax
  or     %eax,%r14d
  or     0x5(%rsp),%r14d
  mov    D25(%rip),%rax
  mov    (%rax),%edx
  mov    %r14d,%esi
  mov    %r12,%rdi
  call   <fseek@plt>
  mov    %r12,%rdi
  call   <fgetc@plt>
  mov    %eax,%ebx
  sub    $0x4,%r14d
  jmp    L116
L92:
  add    $0x8,%r14d
  lea    0x5(%rsp),%rdi
  mov    %r12,%rcx
  mov    $0x1,%edx
  mov    $0x3,%esi
  call   <fread@plt>
  mov    0xd(%rsp),%esi
  shl    $0x10,%esi
  mov    0x9(%rsp),%eax
  shl    $0x8,%eax
  or     %eax,%esi
  or     0x5(%rsp),%esi
  mov    D25(%rip),%rax
  mov    (%rax),%edx
  mov    %r12,%rdi
  call   <fseek@plt>
  jmp    L16
L41:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %bl,0x0(%rbp,%rax,1)
L16:
  mov    %r12,%rdi
  call   <fgetc@plt>
  mov    %eax,%ebx
  test   %al,%al
  jne    L41
  mov    %r14d,%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <readOrJumpRead@plt>
  jmp    L87
L4:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %bl,0x0(%rbp,%rax,1)
L79:
  mov    %r12,%rdi
  call   <fgetc@plt>
  mov    %eax,%ebx
  test   %al,%al
  jne    L4
  mov    $0x0,%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <readOrJumpRead@plt>
L87:
  mov    %rbp,%rdi
  call   <is_cz88@plt>
  test   %rax,%rax
  je     L62
  movb   $0x0,0x0(%rbp)
L62:
  mov    %r13,%rdi
  call   <is_cz88@plt>
  mov    %rax,%rdx
  mov    $0x1,%eax
  test   %rdx,%rdx
  je     L82
  movb   $0x0,0x0(%r13)
L82:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L35
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L35:
  call   <__stack_chk_fail@plt>
```

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;
}
```