user: What would the C source look like for the assembly code provided here?

```asm
<lpm4_dxr_search>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    -0x14(%rbp),%eax
  sar    $0x10,%eax
  mov    %eax,-0x8(%rbp)
  andl   $0xffff,-0x14(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jg     L35
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L9
L35:
  mov    -0xc(%rbp),%eax
  sub    -0x10(%rbp),%eax
  cmp    $0x1f,%eax
  jg     L7
  jmp    L130
L126:
  subl   $0x1,-0xc(%rbp)
L130:
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jge    L96
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jle    L126
L96:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L9
L114:
  mov    -0xc(%rbp),%eax
  sub    -0x10(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jle    L136
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  jmp    L120
L136:
  mov    -0x4(%rbp),%eax
  mov    %eax,-0xc(%rbp)
L120:
  mov    -0xc(%rbp),%eax
  sub    -0x10(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jle    L140
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  jmp    L73
L140:
  mov    -0x4(%rbp),%eax
  mov    %eax,-0xc(%rbp)
L73:
  mov    -0xc(%rbp),%eax
  sub    -0x10(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jle    L104
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  jmp    L63
L104:
  mov    -0x4(%rbp),%eax
  mov    %eax,-0xc(%rbp)
L63:
  mov    -0xc(%rbp),%eax
  sub    -0x10(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jle    L89
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  jmp    L7
L89:
  mov    -0x4(%rbp),%eax
  mov    %eax,-0xc(%rbp)
L7:
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jl     L114
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
L9:
  pop    %rbp
  ret
```

assistant: ```c
uint16_t lpm4_dxr_search(uint32_t ip, uint16_t *ints, uint16_t *keys, uint32_t *bottoms, uint32_t *tops) {
  uint32_t base = ip >> 16;
  ip = ip & 0xffff;
  int bottom = bottoms[base];
  int top = tops[base];
  int mid = 0;
  if (top <= bottom) {
    return keys[top];
  } else if (top - bottom < 32) {
    while (bottom < top && ip <= ints[top - 1]) {
      top = top - 1;
    }
    return keys[top];
  } else {
    while (bottom < top) {
      mid = bottom + (top - bottom) / 2;
      if (ints[mid] < ip) {
        bottom = mid + 1;
      } else {
        top = mid;
      }
      mid = bottom + (top - bottom) / 2;
      if (ints[mid] < ip) {
        bottom = mid + 1;
      } else {
        top = mid;
      }
      mid = bottom + (top - bottom) / 2;
      if (ints[mid] < ip) {
        bottom = mid + 1;
      } else {
        top = mid;
      }
      mid = bottom + (top - bottom) / 2;
      if (ints[mid] < ip) {
        bottom = mid + 1;
      } else {
        top = mid;
      }
    }
    return keys[top];
  }
}
```