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     L53
  mov    D1(%rip),%r15
  mov    %edx,%r14d
  mov    %rcx,%r12
  mov    %rdi,%rbp
  mov    %rsi,%r13
  mov    %rcx,%rdi
  xor    %esi,%esi
  mov    (%r15),%edx
  call   <fseek@plt>
  mov    %r14d,%edi
  mov    %r12,%rsi
  call   <search_index@plt>
  mov    (%r15),%edx
  mov    %r12,%rdi
  lea    0x4(%rax),%esi
  mov    %eax,%r14d
  call   <fseek@plt>
  mov    %r12,%rdi
  call   <fgetc@plt>
  mov    %eax,%ebx
  cmp    $0x1,%al
  je     L90
L113:
  cmp    $0x2,%bl
  je     L45
  nopw   0x0(%rax,%rax,1)
L62:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %bl,0x0(%rbp,%rax,1)
  call   <fgetc@plt>
  mov    %eax,%ebx
  test   %al,%al
  jne    L62
  xor    %edx,%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <readOrJumpRead@plt>
L29:
  mov    %rbp,%rdi
  call   <is_cz88@plt>
  test   %rax,%rax
  je     L36
  movb   $0x0,0x0(%rbp)
L36:
  mov    %r13,%rdi
  call   <is_cz88@plt>
  mov    %rax,%r8
  mov    $0x1,%eax
  test   %r8,%r8
  jne    L95
L53:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L49
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L95:
  movb   $0x0,0x0(%r13)
  jmp    L53
  nopw   0x0(%rax,%rax,1)
L45:
  lea    0x5(%rsp),%rdi
  mov    %r12,%rcx
  mov    $0x1,%edx
  mov    $0x3,%esi
  call   <fread@plt>
  mov    0xd(%rsp),%esi
  mov    0x9(%rsp),%eax
  mov    %r12,%rdi
  mov    (%r15),%edx
  add    $0x8,%r14d
  shl    $0x10,%esi
  shl    $0x8,%eax
  or     %eax,%esi
  or     0x5(%rsp),%esi
  call   <fseek@plt>
  jmp    L112
  nopl   0x0(%rax)
L35:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %bl,0x0(%rbp,%rax,1)
L112:
  mov    %r12,%rdi
  call   <fgetc@plt>
  mov    %eax,%ebx
  test   %al,%al
  jne    L35
  mov    %r14d,%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <readOrJumpRead@plt>
  jmp    L29
  nopl   (%rax)
L90:
  mov    %r12,%rcx
  lea    0x5(%rsp),%rdi
  mov    $0x1,%edx
  mov    $0x3,%esi
  call   <fread@plt>
  mov    0xd(%rsp),%r14d
  mov    (%r15),%edx
  mov    %r12,%rdi
  mov    0x9(%rsp),%eax
  shl    $0x10,%r14d
  shl    $0x8,%eax
  or     %eax,%r14d
  or     0x5(%rsp),%r14d
  mov    %r14d,%esi
  sub    $0x4,%r14d
  call   <fseek@plt>
  mov    %r12,%rdi
  call   <fgetc@plt>
  mov    %eax,%ebx
  jmp    L113
L49:
  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;
}
```