// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap2/index.c
// Function: mm_idx_bed_junc
int mm_idx_bed_junc(const mm_idx_t *mi, int32_t ctg, int32_t st, int32_t en, uint8_t *s)
{
	int32_t i, left, right;
	mm_idx_intv_t *r;
	memset(s, 0, en - st);
	if (mi->I == 0 || ctg < 0 || ctg >= mi->n_seq) return -1;
	r = &mi->I[ctg];
	left = 0, right = r->n;
	while (right > left) {
		int32_t mid = left + ((right - left) >> 1);
		if (r->a[mid].st >= st) right = mid;
		else left = mid + 1;
	}
	for (i = left; i < r->n; ++i) {
		if (st <= r->a[i].st && en >= r->a[i].en && r->a[i].strand != 0) {
			if (r->a[i].strand > 0) {
				s[r->a[i].st - st] |= 1, s[r->a[i].en - 1 - st] |= 2;
			} else {
				s[r->a[i].st - st] |= 8, s[r->a[i].en - 1 - st] |= 4;
			}
		}
	}
	return left;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movl -0x1c(%rbp), %eax
subl -0x18(%rbp), %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0x21b0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0xc0da
cmpl $0x0, -0x14(%rbp)
jl 0xc0da
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jb 0xc0e6
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xc2aa
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x40(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x30(%rbp), %eax
jle 0xc152
movl -0x30(%rbp), %eax
movl -0x34(%rbp), %ecx
subl -0x30(%rbp), %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x44(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x18(%rbp), %eax
jl 0xc147
movl -0x44(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0xc150
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xc10d
movl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl (%rcx), %eax
jge 0xc2a4
movl -0x18(%rbp), %eax
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x2c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jg 0xc294
movl -0x1c(%rbp), %eax
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x2c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
jl 0xc294
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
sarl $0x1e, %eax
cmpl $0x0, %eax
je 0xc294
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
sarl $0x1e, %eax
cmpl $0x0, %eax
jle 0xc23c
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x2c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
subl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
orl $0x1, %edx
movb %dl, (%rax,%rcx)
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x2c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
subl $0x1, %ecx
subl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
orl $0x2, %edx
movb %dl, (%rax,%rcx)
jmp 0xc292
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x2c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
subl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
orl $0x8, %edx
movb %dl, (%rax,%rcx)
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x2c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
subl $0x1, %ecx
subl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
orl $0x4, %edx
movb %dl, (%rax,%rcx)
jmp 0xc294
jmp 0xc296
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xc158
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)