// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap/sdust.c
// Function: save_masked_regions
static inline void save_masked_regions(uint64_v *res, perf_intv_v *P, int start)
{
	int i, saved = 0;
	perf_intv_t *p;
	if (P->n == 0 || P->a[P->n - 1].start >= start) return;
	p = &P->a[P->n - 1];
	if (res->n) {
		int s = res->a[res->n - 1]>>32, f = (uint32_t)res->a[res->n - 1];
		if (p->start <= f) // if overlapping with or adjacent to the previous interval
			saved = 1, res->a[res->n - 1] = (uint64_t)s<<32 | (f > p->finish? f : p->finish);
	}
	if (!saved) kv_push(uint64_t, *res, (uint64_t)p->start<<32|p->finish);
	for (i = P->n - 1; i >= 0 && P->a[i].start < start; --i); // remove perfect intervals that have falled out of the window
	P->n = i + 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0xaa65
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x14(%rbp), %eax
jl 0xaa6a
jmp 0xac35
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0xab2f
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
cmpl -0x30(%rbp), %eax
jg 0xab2d
movl $0x1, -0x1c(%rbp)
movslq -0x2c(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x38(%rbp)
movl -0x30(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jle 0xab00
movl -0x30(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0xab0a
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rdx
movl -0x3c(%rbp), %eax
cltq
orq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xab2f
cmpl $0x0, -0x1c(%rbp)
jne 0xabd8
jmp 0xab3b
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xaba3
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xab68
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x48(%rbp)
jmp 0xab73
movl $0x2, %eax
movq %rax, -0x48(%rbp)
jmp 0xab73
movq -0x48(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2200
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movslq (%rax), %rdx
shlq $0x20, %rdx
movq -0x28(%rbp), %rax
movslq 0x4(%rax), %rax
orq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0xabd8
movq -0x10(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rax
movl %eax, -0x18(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x18(%rbp)
movb %al, -0x49(%rbp)
jl 0xac0f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x14(%rbp), %eax
setl %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0xac18
jmp 0xac25
jmp 0xac1a
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xabe6
movl -0x18(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)