// File: /workspace/github_c_makefile_star2_O1/jflatow[P]jfdb/src/trie.c
// Function: JFT_cursor_find
JFT_Symbol JFT_cursor_find(JFT_Cursor *cursor, const JFT_Stem *stem) {
  if (stem->pre && stem->size)
    if (JFT_cursor_init(cursor, In, JFT_child(cursor->node, stem->pre, 0)) == JFT_SYMBOL_NIL)
      return cursor->symbol;
  JFT_KeySize size = stem->pre && stem->size ? stem->size - 1 : stem->size;
  for (JFT_KeySize i = 0; i < size; i++) {
    if (cursor->symbol == JFT_SYMBOL_NIL)
      return cursor->symbol;
    if (++cursor->point >= cursor->stem.size)
      switch (JFT_node_type(cursor->node)) {
        case Leaf:
          return cursor->symbol = JFT_SYMBOL_ANY;
        default:
          JFT_cursor_init(cursor, In, JFT_child(cursor->node, stem->data[i], 0));
      }
    if ((cursor->symbol = JFT_cursor_symbol_at_point(cursor)) != stem->data[i])
      return cursor->symbol = JFT_SYMBOL_NIL;
  }
  return cursor->symbol;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
testq %rax, %rax
je 0x4049
cmpw $0x0, 0x8(%r14)
je 0x4049
movq 0x8(%rbx), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
shrq $0x3e, %rsi
leaq 0x345b(%rip), %rdi      # 0x73a0
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
xorl %esi, %esi
cmpq $-0x2, %rax
je 0x4028
movq %rcx, %rdi
shrq $0x28, %rdi
movzbl %dil, %r8d
shll $0x4, %r8d
leaq 0x3470(%rip), %r9       # 0x73e0
movq (%r8,%r9), %rdi
cmpq %rax, %rdi
ja 0x4028
cmpq %rax, 0x8(%r8,%r9)
jb 0x4028
shrq $0x30, %rcx
andl $0xfff, %ecx            # imm = 0xFFF
addq %rdx, %rcx
leaq (%rcx,%rax,8), %rax
shlq $0x3, %rdi
subq %rdi, %rax
addq $0x8, %rax
jmp 0x4021
cmpq $-0x2, %rax
jne 0x3fb0
xorl %eax, %eax
jmp 0x401c
movq %rcx, %rsi
shrq $0x28, %rsi
shrq $0x30, %rcx
andl $0xfff, %ecx            # imm = 0xFFF
leaq (%rdx,%rcx), %rdi
movzbl %sil, %r8d
leaq (%r8,%rdi), %rsi
addq $0x8, %rsi
testq %r8, %r8
setne %dil
je 0x400c
leaq (%rdx,%rcx), %r9
addq $0x8, %r9
xorl %r10d, %r10d
leaq (%r10,%r8), %rcx
shrq %rcx
movzbl (%r9,%rcx), %r11d
cmpq %r11, %rax
jbe 0x3ffc
leaq 0x1(%rcx), %r10
jmp 0x4001
movq %rcx, %r8
jae 0x400e
cmpq %r8, %r10
setb %dil
jb 0x3fe5
jmp 0x400e
xorl %ecx, %ecx
leaq (%rsi,%rcx,8), %rcx
xorl %eax, %eax
testb $0x1, %dil
cmovneq %rcx, %rax
testq %rax, %rax
je 0x4026
movq (%rax), %rsi
jmp 0x4028
xorl %esi, %esi
addq %rsi, %rdx
testq %rsi, %rsi
cmoveq %rsi, %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x39a0
cmpq $-0x2, %rax
je 0x4216
cmpq $0x0, (%r14)
je 0x405f
movzwl 0x8(%r14), %r15d
testw %r15w, %r15w
je 0x405f
decl %r15d
jmp 0x4064
movzwl 0x8(%r14), %r15d
testw %r15w, %r15w
setne %bpl
je 0x41fa
xorl %r12d, %r12d
leaq 0x3364(%rip), %r9       # 0x73e0
movq %r14, (%rsp)
cmpq $-0x2, 0x30(%rbx)
je 0x41f1
movq 0x28(%rbx), %rax
incq %rax
movq %rax, 0x28(%rbx)
movzwl 0x18(%rbx), %ecx
movzwl %r12w, %r13d
cmpq %rcx, %rax
jl 0x41a9
movq 0x8(%rbx), %rdx
movq (%rdx), %rax
movq %rax, %rdi
shrq $0x3e, %rdi
cmpq $0x3, %rdi
je 0x4205
movq 0x10(%r14), %rcx
movzbl (%rcx,%r13), %ecx
movq %rax, %rsi
shrq $0x28, %rsi
cmpq $0x2, %rdi
je 0x4127
cmpl $0x1, %edi
jne 0x4127
shrq $0x30, %rax
andl $0xfff, %eax            # imm = 0xFFF
movzbl %sil, %esi
testq %rsi, %rsi
setne %dil
je 0x4165
leaq (%rdx,%rax), %r9
addq $0x8, %r9
movq %rsi, %r11
xorl %r10d, %r10d
leaq (%r10,%r11), %r8
shrq %r8
movb (%r9,%r8), %r14b
cmpb %cl, %r14b
jae 0x4114
leaq 0x1(%r8), %r10
jmp 0x411c
movq %r8, %r11
cmpb %cl, %r14b
jbe 0x4168
cmpq %r11, %r10
setb %dil
jb 0x40fe
jmp 0x4168
movzbl %sil, %r8d
shll $0x4, %r8d
movq (%r8,%r9), %rsi
cmpq %rcx, %rsi
ja 0x4161
movl $0x0, %edi
cmpq %rcx, 0x8(%r8,%r9)
jb 0x418b
shrq $0x30, %rax
andl $0xfff, %eax            # imm = 0xFFF
addq %rdx, %rax
leaq (%rax,%rcx,8), %rax
shlq $0x3, %rsi
subq %rsi, %rax
addq $0x8, %rax
jmp 0x4180
xorl %edi, %edi
jmp 0x418b
xorl %r8d, %r8d
testb $0x1, %dil
je 0x4185
addq %rdx, %rax
addq %rsi, %rax
addq $0x8, %rax
leaq (%rax,%r8,8), %rax
movq (%rsp), %r14
movq (%rax), %rdi
jmp 0x418b
xorl %edi, %edi
movq (%rsp), %r14
addq %rdi, %rdx
testq %rdi, %rdi
cmoveq %rdi, %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x39a0
leaq 0x3237(%rip), %r9       # 0x73e0
movq 0x10(%rbx), %rcx
movq 0x28(%rbx), %rax
testq %rcx, %rcx
je 0x41c7
testq %rax, %rax
je 0x41ce
movq 0x20(%rbx), %rcx
addq %rcx, %rax
decq %rax
jmp 0x41cb
addq 0x20(%rbx), %rax
movzbl (%rax), %ecx
movq %rcx, 0x30(%rbx)
movq 0x10(%r14), %rax
movzbl (%rax,%r13), %eax
cmpq %rax, %rcx
jne 0x41fc
incl %r12d
cmpw %r15w, %r12w
setb %bpl
jne 0x4080
movq $-0x2, %rax
jmp 0x4210
jmp 0x4210
movq $-0x2, %rax
jmp 0x420c
movq $-0x1, %rax
movq %rax, 0x30(%rbx)
testb $0x1, %bpl
jne 0x421a
movq 0x30(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq