user: 请将以下的汇编代码转换成C语言代码：

```asm
<search_index>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%r14d
  mov    %rsi,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rdi
  mov    %rsi,%rcx
  mov    $0x1,%edx
  mov    $0x8,%esi
  call   <fread@plt>
  mov    0x1c(%rsp),%edx
  mov    0x18(%rsp),%eax
  mov    0x14(%rsp),%ecx
  mov    %edx,%ebp
  shl    $0x18,%ebp
  mov    %eax,%esi
  shl    $0x10,%esi
  or     %esi,%ebp
  or     0x10(%rsp),%ebp
  mov    %ecx,%esi
  shl    $0x8,%esi
  or     %esi,%ebp
  mov    0x20(%rsp),%r12d
  shl    $0x18,%r12d
  shl    $0x10,%edx
  or     %edx,%r12d
  or     %ecx,%r12d
  shl    $0x8,%eax
  or     %eax,%r12d
  mov    %r12d,%eax
  sub    %ebp,%eax
  cmp    $0x7,%eax
  jne    L8
L57:
  cmp    %r14d,%ebx
  jle    L5
  mov    D6(%rip),%rax
  mov    (%rax),%edx
  mov    %ebp,%esi
  mov    %r15,%rdi
  call   <fseek@plt>
  lea    0x9(%rsp),%rdi
  mov    %r15,%rcx
  mov    $0x1,%edx
  mov    $0x7,%esi
  call   <fread@plt>
L5:
  mov    0x15(%rsp),%eax
  shl    $0x10,%eax
  mov    0x11(%rsp),%edx
  shl    $0x8,%edx
  or     %edx,%eax
  or     0xd(%rsp),%eax
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L64
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L53:
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
L13:
  lea    0x0(%rbp,%rax,8),%r13d
  sub    %eax,%r13d
  mov    D6(%rip),%rax
  mov    (%rax),%edx
  mov    %r13d,%esi
  mov    %r15,%rdi
  call   <fseek@plt>
  lea    0x9(%rsp),%rdi
  mov    %r15,%rcx
  mov    $0x1,%edx
  mov    $0x7,%esi
  call   <fread@plt>
  mov    0x15(%rsp),%ebx
  shl    $0x18,%ebx
  mov    0x11(%rsp),%eax
  shl    $0x10,%eax
  or     %eax,%ebx
  or     0x9(%rsp),%ebx
  mov    0xd(%rsp),%eax
  shl    $0x8,%eax
  or     %eax,%ebx
  cmp    %r14d,%ebx
  je     L5
  cmovge %r13d,%r12d
  cmovl  %r13d,%ebp
  mov    %r12d,%eax
  sub    %ebp,%eax
  cmp    $0x7,%eax
  je     L57
L8:
  movslq %r12d,%rax
  imul   $0xffffffff92492493,%rax,%rax
  shr    $0x20,%rax
  add    %r12d,%eax
  sar    $0x2,%eax
  mov    %r12d,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  movslq %ebp,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %ebp,%edx
  sar    $0x2,%edx
  mov    %ebp,%ecx
  sar    $0x1f,%ecx
  sub    %edx,%ecx
  add    %ecx,%eax
  test   $0x1,%al
  jne    L53
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  jmp    L13
L64:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
uint32_t search_index(const uint32_t ip, FILE *qqwry_file) {
  uint32_t index_ip;
  unsigned char head[8];
  unsigned char index_bytes[7];
  fread(head, 8, 1, qqwry_file);
  uint32_t index_start, index_end, index_mid;
  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]);
}
```