// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/samtools-0.1.18/bam_index.c
// Function: reg2bins
static inline int reg2bins(uint32_t beg, uint32_t end, uint16_t list[BAM_MAX_BIN])
{
	int i = 0, k;
	if (beg >= end) return 0;
	if (end >= 1u<<29) end = 1u<<29;
	--end;
	list[i++] = 0;
	for (k =    1 + (beg>>26); k <=    1 + (end>>26); ++k) list[i++] = k;
	for (k =    9 + (beg>>23); k <=    9 + (end>>23); ++k) list[i++] = k;
	for (k =   73 + (beg>>20); k <=   73 + (end>>20); ++k) list[i++] = k;
	for (k =  585 + (beg>>17); k <=  585 + (end>>17); ++k) list[i++] = k;
	for (k = 4681 + (beg>>14); k <= 4681 + (end>>14); ++k) list[i++] = k;
	return i;
}

// Assembly:
movl %edi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq %rdx, -0x18(%rsp)
movl $0x0, -0x1c(%rsp)
movl -0x8(%rsp), %eax
cmpl -0xc(%rsp), %eax
jb 0x473a5c
movl $0x0, -0x4(%rsp)
jmp 0x473c27
cmpl $0x20000000, -0xc(%rsp) # imm = 0x20000000
jb 0x473a6e
movl $0x20000000, -0xc(%rsp) # imm = 0x20000000
movl -0xc(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rsp)
movq -0x18(%rsp), %rax
movl -0x1c(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rsp)
movslq %ecx, %rcx
movw $0x0, (%rax,%rcx,2)
movl -0x8(%rsp), %eax
shrl $0x1a, %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
movl -0xc(%rsp), %ecx
shrl $0x1a, %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
ja 0x473ae1
movl -0x20(%rsp), %eax
movw %ax, %dx
movq -0x18(%rsp), %rax
movl -0x1c(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rsp)
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0x473aa2
movl -0x8(%rsp), %eax
shrl $0x17, %eax
addl $0x9, %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
movl -0xc(%rsp), %ecx
shrl $0x17, %ecx
addl $0x9, %ecx
cmpl %ecx, %eax
ja 0x473b2e
movl -0x20(%rsp), %eax
movw %ax, %dx
movq -0x18(%rsp), %rax
movl -0x1c(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rsp)
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0x473aef
movl -0x8(%rsp), %eax
shrl $0x14, %eax
addl $0x49, %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
movl -0xc(%rsp), %ecx
shrl $0x14, %ecx
addl $0x49, %ecx
cmpl %ecx, %eax
ja 0x473b7b
movl -0x20(%rsp), %eax
movw %ax, %dx
movq -0x18(%rsp), %rax
movl -0x1c(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rsp)
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0x473b3c
movl -0x8(%rsp), %eax
shrl $0x11, %eax
addl $0x249, %eax            # imm = 0x249
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
movl -0xc(%rsp), %ecx
shrl $0x11, %ecx
addl $0x249, %ecx            # imm = 0x249
cmpl %ecx, %eax
ja 0x473bcd
movl -0x20(%rsp), %eax
movw %ax, %dx
movq -0x18(%rsp), %rax
movl -0x1c(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rsp)
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0x473b8b
movl -0x8(%rsp), %eax
shrl $0xe, %eax
addl $0x1249, %eax           # imm = 0x1249
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
movl -0xc(%rsp), %ecx
shrl $0xe, %ecx
addl $0x1249, %ecx           # imm = 0x1249
cmpl %ecx, %eax
ja 0x473c1f
movl -0x20(%rsp), %eax
movw %ax, %dx
movq -0x18(%rsp), %rax
movl -0x1c(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rsp)
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0x473bdd
movl -0x1c(%rsp), %eax
movl %eax, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopl (%rax)