// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/popcount_tab.c
// Function: gt_popcount_tab_rank_1
unsigned int gt_popcount_tab_rank_1(GtPopcountTab *popcount_tab,
                                    unsigned int popcount_c,
                                    GtUword i,
                                    unsigned int pos)
{
  GtUword block;
  gt_assert(pos < popcount_tab->blocksize);
  gt_assert(popcount_c <= popcount_tab->blocksize);

  if (popcount_c == 0)
    return 0;
  if (popcount_c < popcount_tab->blocksize)
    gt_assert(i <
              gt_compact_ulong_store_get(popcount_tab->offsets,
                                         (GtUword) popcount_c + 1) -
              gt_compact_ulong_store_get(popcount_tab->offsets,
                                         (GtUword) popcount_c));
  else {
    gt_assert(i == 0);
    return pos+1;
  }
  block =
    gt_compact_ulong_store_get(
                    popcount_tab->blocks,
                    gt_compact_ulong_store_get(popcount_tab->offsets,
                                               (GtUword) popcount_c) + i);
  block >>= popcount_tab->blocksize - pos - 1;
  return gt_popcount_tab_popcount(block);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movl %esi, 0x34(%rsp)
movq %rdx, 0x28(%rsp)
movl %ecx, 0x24(%rsp)
movl 0x24(%rsp), %eax
movq 0x38(%rsp), %rcx
cmpl 0x28(%rcx), %eax
jb 0x1b4d7c
movq 0x487255(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3612be(%rip), %rsi    # 0x516013
leaq 0x3ab6f3(%rip), %rdx    # 0x56044f
leaq 0x3ab70a(%rip), %rcx    # 0x56046d
leaq 0x3ab53e(%rip), %r8     # 0x5602a8
movl $0x106, %r9d            # imm = 0x106
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1b4d7e
jmp 0x1b4d80
movl 0x34(%rsp), %eax
movq 0x38(%rsp), %rcx
cmpl 0x28(%rcx), %eax
jbe 0x1b4dc6
movq 0x48720b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x361274(%rip), %rsi    # 0x516013
leaq 0x3ab547(%rip), %rdx    # 0x5602ed
leaq 0x3ab6c0(%rip), %rcx    # 0x56046d
leaq 0x3ab4f4(%rip), %r8     # 0x5602a8
movl $0x107, %r9d            # imm = 0x107
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1b4dc8
cmpl $0x0, 0x34(%rsp)
jne 0x1b4ddc
movl $0x0, 0x44(%rsp)
jmp 0x1b4f30
movl 0x34(%rsp), %eax
movq 0x38(%rsp), %rcx
cmpl 0x28(%rcx), %eax
jae 0x1b4e7c
jmp 0x1b4df0
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rdi
movl 0x34(%rsp), %eax
movl %eax, %esi
addq $0x1, %rsi
callq 0xa20c0
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rdi
movl 0x34(%rsp), %eax
movl %eax, %esi
callq 0xa20c0
movq 0x8(%rsp), %rcx
movq %rax, %rdx
movq 0x10(%rsp), %rax
subq %rdx, %rcx
cmpq %rcx, %rax
jb 0x1b4e78
movq 0x487159(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3611c2(%rip), %rsi    # 0x516013
leaq 0x3ab4cf(%rip), %rdx    # 0x560327
leaq 0x3ab60e(%rip), %rcx    # 0x56046d
leaq 0x3ab442(%rip), %r8     # 0x5602a8
movl $0x110, %r9d            # imm = 0x110
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1b4e7a
jmp 0x1b4ecd
jmp 0x1b4e7e
cmpq $0x0, 0x28(%rsp)
je 0x1b4ebe
movq 0x487113(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x36117c(%rip), %rsi    # 0x516013
leaq 0x38ccee(%rip), %rdx    # 0x541b8c
leaq 0x3ab5c8(%rip), %rcx    # 0x56046d
leaq 0x3ab3fc(%rip), %r8     # 0x5602a8
movl $0x112, %r9d            # imm = 0x112
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1b4ec0
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x1b4f30
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rdi
movl 0x34(%rsp), %eax
movl %eax, %esi
callq 0xa20c0
movq (%rsp), %rdi
movq %rax, %rsi
addq 0x28(%rsp), %rsi
callq 0xa20c0
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rax
movl 0x28(%rax), %ecx
subl 0x24(%rsp), %ecx
subl $0x1, %ecx
movq 0x18(%rsp), %rax
movl %ecx, %ecx
shrq %cl, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x1b4b20
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)