// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/wtree_encseq.c
// Function: gt_wtree_encseq_rank
static GtUword gt_wtree_encseq_rank(GtWtree *wtree,
                                    GtUword pos,
                                    GtWtreeSymbol symbol)
{
  unsigned int alpha_start = 0,
               alpha_end;
  GtUword node_start = 0,
          node_size;
  GtWtreeEncseq *we;
  gt_assert(wtree != NULL);

  we = gt_wtree_encseq_cast(wtree);
  gt_assert(pos < wtree->members->length);

  alpha_end = we->alpha_size - 1;
  node_size = wtree->members->length;

  return gt_wtree_encseq_rank_rec(we, pos, symbol, node_start, node_size,
                                  alpha_start, alpha_end);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, 0x20(%rsp)
testq %rdi, %rdi
je 0x12c8ac
movq %rsi, %rbx
movq %rdi, %r14
callq 0x12c432
movq %rax, %rdi
movq %r14, %rsi
callq 0x12c0db
movq 0x8(%r14), %rcx
movq (%rcx), %r15
cmpq %rbx, %r15
jbe 0x12c8da
movl 0x58(%rax), %r12d
decl %r12d
movq $0x0, 0x28(%rsp)
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
xorl %r13d, %r13d
leal (%r12,%r13), %r14d
shrl %r14d
leaq 0x21066f(%rip), %rdi    # 0x33cd4b
movl %r13d, %esi
movl %r14d, %edx
movl %r12d, %ecx
movq 0x20(%rsp), %r8
xorl %eax, %eax
callq 0x92a82
leaq 0x1f9506(%rip), %rdi    # 0x325bfe
movq %rbx, %rsi
xorl %eax, %eax
callq 0x92a82
cmpq %r15, %rbx
jae 0x12c874
cmpl %r12d, %r13d
jae 0x12c847
movq %r13, 0x30(%rsp)
movq %r15, %r13
movq %r12, 0x40(%rsp)
cmpl 0x20(%rsp), %r14d
setb 0xf(%rsp)
testq %rbp, %rbp
movq %rbp, 0x18(%rsp)
je 0x12c74e
movq 0x10(%rsp), %r15
movq 0x38(%r15), %rdi
decq %rbp
movq %rbp, %rsi
callq 0xbf6f8
movq %rax, %r12
jmp 0x12c759
pushq $-0x1
popq %rbp
xorl %r12d, %r12d
movq 0x10(%rsp), %r15
movq 0x38(%r15), %rdi
addq %rbp, %r13
movq %r13, 0x38(%rsp)
movq %r13, %rsi
callq 0xbf6f8
movq %rax, %r13
subq %r12, %r13
cmpl 0x20(%rsp), %r14d
jae 0x12c79b
movq 0x18(%rsp), %r15
testq %r15, %r15
je 0x12c7be
movq 0x10(%rsp), %r12
movq 0x38(%r12), %rdi
movq %rbp, %rsi
callq 0xbf619
movq %rax, %rbp
jmp 0x12c7c5
movq 0x38(%r15), %rdi
addq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0xbf6f8
movq %rax, %rbx
subq %r12, %rbx
movq 0x8(%r15), %rax
movq (%rax), %r15
movl %r14d, %r12d
jmp 0x12c80b
xorl %ebp, %ebp
movq 0x10(%rsp), %r12
movq 0x38(%r12), %rdi
addq %r15, %rbx
movq %rbx, %rsi
callq 0xbf619
movq %rax, %rbx
subq %rbp, %rbx
incl %r14d
movq 0x38(%r12), %rdi
movq 0x38(%rsp), %rsi
callq 0xbf619
movq %r13, %r15
subq %rbp, %rax
movq 0x8(%r12), %rcx
addq (%rcx), %r15
movq %rax, %r13
movl %r14d, %eax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %r12
xorl %esi, %esi
movb 0xf(%rsp), %al
movb %al, %sil
leaq 0x210566(%rip), %rdi    # 0x33cd81
movq %r13, %rdx
xorl %eax, %eax
callq 0x92a82
testq %r13, %r13
je 0x12c860
testq %rbx, %rbx
je 0x12c860
movq 0x18(%rsp), %rbp
addq %r15, %rbp
decq %rbx
movq %r13, %r15
movq 0x30(%rsp), %r13
jmp 0x12c6ce
incq %rbx
leaq 0x210547(%rip), %rdi    # 0x33cd98
movq %rbx, %rsi
xorl %eax, %eax
callq 0x92a82
movq %rbx, 0x28(%rsp)
movq 0x28(%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30b6ed(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b878e(%rip), %rsi    # 0x2e5013
leaq 0x21047f(%rip), %rdx    # 0x33cd0b
leaq 0x2104d5(%rip), %rcx    # 0x33cd68
leaq 0x210421(%rip), %r8     # 0x33ccbb
movl $0x97, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x30b6b5(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b8756(%rip), %rsi    # 0x2e5013
leaq 0x210367(%rip), %rdx    # 0x33cc2b
leaq 0x21046b(%rip), %rcx    # 0x33cd36
leaq 0x2103e9(%rip), %r8     # 0x33ccbb
movl $0xcd, %r9d
jmp 0x12c8a0
movq 0x30b687(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b8728(%rip), %rsi    # 0x2e5013
leaq 0x2103fc(%rip), %rdx    # 0x33ccee
leaq 0x21043d(%rip), %rcx    # 0x33cd36
leaq 0x2103bb(%rip), %r8     # 0x33ccbb
movl $0xd0, %r9d
jmp 0x12c8a0