// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: skiplist_get
struct kv *
skiplist_get(struct skiplist * const list, const struct kv * const key, struct kv * const out)
{
  u64 i = list->height - 1;
  struct skipnode * left = &(list->n0);
  struct skipnode * right = NULL;
  while (i) {
    while (left->next[i]) {
      right = left->next[i];
      struct kv * const curr = __u64_to_ptr(right->e.ptr);
      debug_assert(curr);
      const int cmp = list->comp(key, curr);
      if (cmp == 0) {
        if (list->mm.hf) list->mm.hf(curr, list->mm.hp);
        struct kv * const ret = kv_dup2(curr, out);
        return ret;
      } else if (cmp < 0) {
        break;
      } else {
        left = right;
      }
    }
    i--;
  }
  const u64 pkey = kvmap_pkey(key->hash);
  if (left) left = left->next[0];
  while (left && (left != right)) {
    struct kv * const curr = __u64_to_ptr(left->e.ptr);
    if (kvmap_pkey(curr->hash) == pkey) {
      if (kv_keymatch(curr, key)) {
        if (list->mm.hf) list->mm.hf(curr, list->mm.hp);
        struct kv * const ret = kv_dup2(curr, out);
        return ret;
      }
    }
    left = left->next[0];
  }
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x258(%rax), %rax
subq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq $0x260, %rax            # imm = 0x260
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x11e08
jmp 0x11d3a
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq $0x0, 0x8(%rax,%rcx,8)
je 0x11df7
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rdi
shrq $0x10, %rdi
callq 0xf220
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
setne %al
movzbl %al, %edi
andl $0x1, %edi
callq 0x7640
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq *%rax
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x11de0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x11dc2
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rsi
callq *%rax
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xdfb0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x11ee3
cmpl $0x0, -0x44(%rbp)
jge 0x11de8
jmp 0x11df7
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x11df2
jmp 0x11d3a
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x11d2d
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x10c00
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x11e2b
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x11e2d
xorl %eax, %eax
cmpq $0x0, -0x30(%rbp)
movb %al, -0x69(%rbp)
je 0x11e47
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
setne %al
movb %al, -0x69(%rbp)
movb -0x69(%rbp), %al
testb $0x1, %al
jne 0x11e53
jmp 0x11edb
movq -0x30(%rbp), %rax
movq (%rax), %rdi
shrq $0x10, %rdi
callq 0xf220
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq (%rax), %rdi
callq 0x10c00
cmpq -0x58(%rbp), %rax
jne 0x11eca
movq -0x60(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xe110
testb $0x1, %al
jne 0x11e8c
jmp 0x11ec8
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x11ead
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rsi
callq *%rax
movq -0x60(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xdfb0
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x11ee3
jmp 0x11eca
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x11e2d
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)