// File: /workspace/github_c_makefile_star2_O1/jflatow[P]jfdb/src/trie.c
// Function: make_jump_table
static inline JFT_Offset make_jump_table(JFT_Buffer *buf,
                                         JFT_Offset parentPos,
                                         const JFT_Stem *stem,
                                         JFT_TypeInfo rangeId) {
  // just create an offset for each symbol in the range
  int rangeSize = JumpTableRanges[rangeId].max - JumpTableRanges[rangeId].min + 1;
  JFT_Offset size = JFT_jump_size(stem->size, rangeSize);
  if (!JFT_buffer_ample(buf, size))
    return 0;

  JFT_Offset parentOffset = offset_parent(buf, parentPos, stem);
  write_node(buf, JumpTable, stem, rangeId, parentOffset);

  for (int i = 0; i < rangeSize; i++)
    JFT_buffer_equal(buf, JFT_Offset, 0);

  return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r12
movl %ecx, %eax
shlq $0x4, %rax
leaq 0x12d7(%rip), %r13      # 0x73e0
movl 0x8(%rax,%r13), %r14d
subl (%rax,%r13), %r14d
movq %rdi, %rbx
leal 0x1(%r14), %ecx
movzwl 0x8(%rdx), %eax
movq %rcx, 0x10(%rsp)
leaq (%rax,%rcx,8), %rsi
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
callq *0x20(%rdi)
movl %eax, %ecx
xorl %eax, %eax
testq %rbx, %rbx
je 0x635b
testl %ecx, %ecx
jne 0x635b
movq 0x18(%rbx), %rax
leaq (%rax,%r12), %rsi
movq (%r15), %rdx
testq %rdx, %rdx
jne 0x615e
movq 0x10(%r15), %rcx
movzbl (%rcx), %edx
movq 0x10(%rbx), %rcx
movq (%rsi), %r8
movq %r8, %rdi
shrq $0x3e, %rdi
leaq 0x125d(%rip), %r9       # 0x73d0
movslq (%r9,%rdi,4), %rdi
addq %r9, %rdi
jmpq *%rdi
xorl %edi, %edi
cmpq $-0x2, %rdx
je 0x6244
movq %r8, %r9
shrq $0x28, %r9
movzbl %r9b, %r10d
shll $0x4, %r10d
movq (%r10,%r13), %r9
cmpq %rdx, %r9
ja 0x6244
cmpq %rdx, 0x8(%r10,%r13)
jb 0x6244
shrq $0x30, %r8
andl $0xfff, %r8d            # imm = 0xFFF
addq %r8, %rsi
leaq (%rsi,%rdx,8), %rdi
shlq $0x3, %r9
subq %r9, %rdi
addq $0x8, %rdi
jmp 0x6244
cmpq $-0x2, %rdx
jne 0x61d8
xorl %edi, %edi
jmp 0x6244
movq %r8, %rdi
shrq $0x28, %rdi
shrq $0x30, %r8
andl $0xfff, %r8d            # imm = 0xFFF
leaq (%rsi,%r8), %r9
movzbl %dil, %r10d
leaq (%r10,%r9), %rdi
addq $0x8, %rdi
testq %r10, %r10
setne %r9b
je 0x6234
addq %rsi, %r8
addq $0x8, %r8
xorl %r11d, %r11d
leaq (%r11,%r10), %rsi
shrq %rsi
movzbl (%r8,%rsi), %r13d
cmpq %r13, %rdx
jbe 0x6224
leaq 0x1(%rsi), %r11
jmp 0x6229
movq %rsi, %r10
jae 0x6236
cmpq %r10, %r11
setb %r9b
jb 0x620d
jmp 0x6236
xorl %esi, %esi
leaq (%rdi,%rsi,8), %rdx
xorl %edi, %edi
testb $0x1, %r9b
cmovneq %rdx, %rdi
subq %r12, %rcx
testq %rdi, %rdi
je 0x624f
movq %rcx, (%rdi)
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
movabsq $0xffffffffff, %rdx     # imm = 0xFFFFFFFFFF
movq (%r15), %rdi
movzwl 0x8(%r15), %r12d
testq %rdi, %rdi
je 0x62d7
testl %edi, %edi
movabsq $-0x6000000000000000, %rdi # imm = 0xA000000000000000
cmoveq %rsi, %rdi
andl $0xfff, %r12d           # imm = 0xFFF
shlq $0x30, %r12
movzbl %bpl, %esi
shlq $0x28, %rsi
orq %r12, %rsi
orq %rdi, %rsi
andq %rdx, %rcx
orq %rsi, %rcx
movq 0x10(%rbx), %rdx
movq %rcx, (%rax,%rdx)
movq 0x10(%rbx), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x10(%rbx)
movb (%r15), %dl
movb %dl, 0x8(%rax,%rcx)
movq 0x10(%rbx), %rdi
incq %rdi
movq %rdi, 0x10(%rbx)
movq 0x10(%r15), %rsi
movzwl 0x8(%r15), %r12d
decq %r12
addq 0x18(%rbx), %rdi
jmp 0x6318
movl %r12d, %edi
andl $0xfff, %edi            # imm = 0xFFF
shlq $0x30, %rdi
movzbl %bpl, %r8d
shlq $0x28, %r8
orq %rdi, %r8
andq %rdx, %rcx
orq %r8, %rcx
orq %rsi, %rcx
movq 0x10(%rbx), %rdx
movq %rcx, (%rax,%rdx)
movq 0x10(%rbx), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x10(%rbx)
movq 0x10(%r15), %rsi
leaq (%rax,%rcx), %rdi
addq $0x8, %rdi
movq %r12, %rdx
callq 0x1140
addq %r12, 0x10(%rbx)
cmpl $0x7ffffffe, %r14d      # imm = 0x7FFFFFFE
ja 0x6356
movq 0x18(%rbx), %rax
movq 0x10(%rsp), %rdx
cmpl $0x2, %edx
movl $0x1, %ecx
cmovgel %edx, %ecx
movq 0x10(%rbx), %rdx
movq $0x0, (%rax,%rdx)
addq $0x8, 0x10(%rbx)
decl %ecx
jne 0x6341
movq 0x8(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq