user: 请从给定的汇编指令推导出C源代码:

```asm
<search_index>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x40(%rbp),%rdx
  lea    -0x10(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x8,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  lea    -0x10(%rbp),%rax
  add    $0xc,%rax
  mov    (%rax),%eax
  shl    $0x18,%eax
  mov    %eax,%edx
  lea    -0x10(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  lea    -0x10(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  shl    $0x8,%eax
  or     %eax,%edx
  lea    -0x10(%rbp),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  mov    %eax,-0x24(%rbp)
  lea    -0x10(%rbp),%rax
  add    $0x4,%rax
  add    $0xc,%rax
  mov    (%rax),%eax
  shl    $0x18,%eax
  mov    %eax,%edx
  lea    -0x10(%rbp),%rax
  add    $0x4,%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  lea    -0x10(%rbp),%rax
  add    $0x4,%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  shl    $0x8,%eax
  or     %eax,%edx
  lea    -0x10(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  or     %edx,%eax
  mov    %eax,-0x20(%rbp)
L72:
  mov    -0x20(%rbp),%eax
  sub    -0x24(%rbp),%eax
  cmp    $0x7,%eax
  je     L77
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  sub    %edx,%eax
  add    %ecx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L91
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x1c(%rbp)
  jmp    L12
L91:
  mov    -0x1c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x1c(%rbp)
L12:
  mov    -0x1c(%rbp),%edx
  mov    %edx,%eax
  shl    $0x3,%eax
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x24(%rbp),%eax
  add    %ecx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    D1(%rip),%rax
  mov    (%rax),%edx
  mov    -0x1c(%rbp),%ecx
  mov    -0x40(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  mov    -0x40(%rbp),%rdx
  lea    -0x17(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x7,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  lea    -0x17(%rbp),%rax
  add    $0xc,%rax
  mov    (%rax),%eax
  shl    $0x18,%eax
  mov    %eax,%edx
  lea    -0x17(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  lea    -0x17(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  shl    $0x8,%eax
  or     %eax,%edx
  lea    -0x17(%rbp),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x28(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  je     L67
  mov    -0x28(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jge    L24
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  jmp    L72
L24:
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  jmp    L72
L77:
  nop
  jmp    L27
L67:
  nop
L27:
  mov    -0x28(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jle    L43
  mov    D1(%rip),%rax
  mov    (%rax),%edx
  mov    -0x24(%rbp),%ecx
  mov    -0x40(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  mov    -0x40(%rbp),%rdx
  lea    -0x17(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x7,%esi
  mov    %rax,%rdi
  call   <fread@plt>
L43:
  lea    -0x17(%rbp),%rax
  add    $0x4,%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  shl    $0x10,%eax
  mov    %eax,%edx
  lea    -0x17(%rbp),%rax
  add    $0x4,%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  shl    $0x8,%eax
  or     %eax,%edx
  lea    -0x17(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  or     %edx,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L68
  call   <__stack_chk_fail@plt>
L68:
  leave
  ret
```

assistant: ```c
uint32_t search_index(const uint32_t ip, FILE *qqwry_file) {
  uint32_t index_ip;
  uint32_t index_start;
  uint32_t index_end;
  uint32_t index_mid;
  unsigned char head[8];
  unsigned char index_bytes[7];
  fread(head, 8, 1, qqwry_file);
  index_start = (uint32_t)((((uint8_t *)(&head[0]))[3] << 24) | (((uint8_t *)(&head[0]))[2] << 16) | (((uint8_t *)(&head[0]))[1] << 8) | ((uint8_t *)(&head[0]))[0]);
  index_end = (uint32_t)((((uint8_t *)(&head[4]))[3] << 24) | (((uint8_t *)(&head[4]))[2] << 16) | (((uint8_t *)(&head[4]))[1] << 8) | ((uint8_t *)(&head[4]))[0]);
  while (1) {
    if ((index_end - index_start) == 7) {
      break;
    }
    index_mid = index_end / 7 - index_start / 7;
    if (index_mid % 2 == 0) {
      index_mid = index_mid / 2;
    } else {
      index_mid = (index_mid + 1) / 2;
    }
    index_mid = index_start + index_mid * 7;
    fseek(qqwry_file, index_mid, SEEK_SET);
    fread(index_bytes, 7, 1, qqwry_file);
    index_ip = (uint32_t)((((uint8_t *)(&index_bytes[0]))[3] << 24) | (((uint8_t *)(&index_bytes[0]))[2] << 16) | (((uint8_t *)(&index_bytes[0]))[1] << 8) | ((uint8_t *)(&index_bytes[0]))[0]);
    if (index_ip == ip) {
      break;
    } else if (index_ip < ip) {
      index_start = index_mid;
    } else {
      index_end = index_mid;
    }
  }
  if (index_ip > ip) {
    fseek(qqwry_file, index_start, SEEK_SET);
    fread(index_bytes, 7, 1, qqwry_file);
  }
  return (uint32_t)((((uint8_t *)(&index_bytes[4]))[2] << 16) | (((uint8_t *)(&index_bytes[4]))[1] << 8) | ((uint8_t *)(&index_bytes[4]))[0]);
}
```