// File: /workspace/github_c_makefile_star2_O0/DReichLab[P]adna/hts.c
// Function: reg2bins
static inline int reg2bins(int64_t beg, int64_t end, hts_itr_t *itr, int min_shift, int n_lvls, cand_bins_t *bins)
{
	int l, t, s = min_shift + (n_lvls<<1) + n_lvls;
	if (beg >= end) return 0;
	if (end >= 1LL<<s) end = 1LL<<s;
	for (--end, l = 0, t = 0; l <= n_lvls; s -= 3, t += 1<<((l<<1)+l), ++l) {
		int b, e, n, i;
		b = t + (beg>>s); e = t + (end>>s); n = e - b + 1;
		if (bins->n + n > bins->m) {
			bins->m = bins->n + n;
			kroundup32(bins->m);
			bins->a = (int*)realloc(bins->a, sizeof(int) * bins->m);
		}
		for (i = b; i <= e; ++i) bins->a[bins->n++] = i;
	}
	return bins->n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
shll %ecx
addl %ecx, %eax
addl -0x28(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jl 0xb215
movl $0x0, -0x4(%rbp)
jmp 0xb3d2
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
cmpq %rcx, %rax
jl 0xb23d
movl -0x3c(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x28(%rbp), %eax
jg 0xb3c9
movslq -0x38(%rbp), %rax
movq -0x10(%rbp), %rdx
movl -0x3c(%rbp), %ecx
sarq %cl, %rdx
movq %rdx, %rcx
addq %rcx, %rax
movl %eax, -0x40(%rbp)
movslq -0x38(%rbp), %rax
movq -0x18(%rbp), %rdx
movl -0x3c(%rbp), %ecx
sarq %cl, %rdx
movq %rdx, %rcx
addq %rcx, %rax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
subl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movl (%rax), %eax
addl -0x48(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jle 0xb364
movq -0x30(%rbp), %rax
movl (%rax), %ecx
addl -0x48(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
sarl %ecx
movq -0x30(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
sarl $0x2, %ecx
movq -0x30(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
sarl $0x4, %ecx
movq -0x30(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
sarl $0x8, %ecx
movq -0x30(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
sarl $0x10, %ecx
movq -0x30(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x30(%rbp), %rax
movslq 0x4(%rax), %rsi
shlq $0x2, %rsi
callq 0x22f0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x40(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jg 0xb39b
movl -0x4c(%rbp), %edx
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x30(%rbp), %rsi
movl (%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, (%rsi)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xb36a
jmp 0xb39d
movl -0x3c(%rbp), %eax
subl $0x3, %eax
movl %eax, -0x3c(%rbp)
movl -0x34(%rbp), %ecx
shll %ecx
addl -0x34(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xb257
movq -0x30(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)