// File: /workspace/github_c_makefile_star2_O0/aokad[P]sequeeze/seqtk.c
// Function: stk_reg_read
reghash_t *stk_reg_read(const char *fn)
{
	reghash_t *h = kh_init(reg);
	gzFile fp;
	kstream_t *ks;
	int dret;
	kstring_t *str;
	// read the list
	fp = strcmp(fn, "-")? gzopen(fn, "r") : gzdopen(fileno(stdin), "r");
	if (fp == 0) return 0;
	ks = ks_init(fp);
	str = calloc(1, sizeof(kstring_t));
	while (ks_getuntil(ks, 0, str, &dret) >= 0) {
		int beg = -1, end = -1;
		reglist_t *p;
		khint_t k = kh_get(reg, h, str->s);
		if (k == kh_end(h)) {
			int ret;
			char *s = strdup(str->s);
			k = kh_put(reg, h, s, &ret);
			memset(&kh_val(h, k), 0, sizeof(reglist_t));
		}
		p = &kh_val(h, k);
		if (dret != '\n') {
			if (ks_getuntil(ks, 0, str, &dret) > 0 && isdigit(str->s[0])) {
				beg = atoi(str->s);
				if (dret != '\n') {
					if (ks_getuntil(ks, 0, str, &dret) > 0 && isdigit(str->s[0])) {
						end = atoi(str->s);
						if (end < 0) end = -1;
					}
				}
			}
		}
		// skip the rest of the line
		if (dret != '\n') while ((dret = ks_getc(ks)) > 0 && dret != '\n');
		if (end < 0 && beg > 0) end = beg, beg = beg - 1; // if there is only one column
		if (beg < 0) beg = 0, end = INT_MAX;
		if (p->n == p->m) {
			p->m = p->m? p->m<<1 : 4;
			p->a = realloc(p->a, p->m * 8);
		}
		p->a[p->n++] = (uint64_t)beg<<32 | end;
	}
	ks_destroy(ks);
	gzclose(fp);
	free(str->s); free(str);
	return h;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
callq 0xb1c0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xc0d6(%rip), %rsi      # 0xe496
callq 0x2170
cmpl $0x0, %eax
je 0x23e0
movq -0x10(%rbp), %rdi
leaq 0xaeab(%rip), %rsi      # 0xd280
callq 0x2220
movq %rax, -0x60(%rbp)
jmp 0x2401
movq 0xebe1(%rip), %rax      # 0x10fc8
movq (%rax), %rdi
callq 0x21b0
movl %eax, %edi
leaq 0xae88(%rip), %rsi      # 0xd280
callq 0x20b0
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x241d
movq $0x0, -0x8(%rbp)
jmp 0x26c6
movq -0x20(%rbp), %rdi
callq 0x26d0
movq %rax, -0x28(%rbp)
movl $0x1, %edi
movl $0x18, %esi
callq 0x2160
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rdx
xorl %esi, %esi
leaq -0x2c(%rbp), %rcx
callq 0x2720
cmpl $0x0, %eax
jl 0x2696
movl $0xffffffff, -0x3c(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x40(%rbp) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x2760
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x24c9
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2270
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x28c0
movl %eax, -0x4c(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
movl -0x4c(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2120
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x4c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
cmpl $0xa, -0x2c(%rbp)
je 0x25a0
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rdx
xorl %esi, %esi
leaq -0x2c(%rbp), %rcx
callq 0x2720
cmpl $0x0, %eax
jle 0x259e
callq 0x2280
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x259e
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2250
movl %eax, -0x3c(%rbp)
cmpl $0xa, -0x2c(%rbp)
je 0x259c
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rdx
xorl %esi, %esi
leaq -0x2c(%rbp), %rcx
callq 0x2720
cmpl $0x0, %eax
jle 0x259a
callq 0x2280
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x259a
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2250
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jge 0x2598
movl $0xffffffff, -0x40(%rbp) # imm = 0xFFFFFFFF
jmp 0x259a
jmp 0x259c
jmp 0x259e
jmp 0x25a0
cmpl $0xa, -0x2c(%rbp)
je 0x25d7
jmp 0x25a8
movq -0x28(%rbp), %rdi
callq 0x2bf0
movl %eax, %ecx
movl %ecx, -0x2c(%rbp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x61(%rbp)
jle 0x25ca
cmpl $0xa, -0x2c(%rbp)
setne %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x25d3
jmp 0x25d5
jmp 0x25a8
jmp 0x25d7
cmpl $0x0, -0x40(%rbp)
jge 0x25f2
cmpl $0x0, -0x3c(%rbp)
jle 0x25f2
movl -0x3c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x2606
movl $0x0, -0x3c(%rbp)
movl $0x7fffffff, -0x40(%rbp) # imm = 0x7FFFFFFF
movq -0x48(%rbp), %rax
movl (%rax), %eax
movq -0x48(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x2666
movq -0x48(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x262d
movq -0x48(%rbp), %rax
movl 0x4(%rax), %eax
shll %eax
movl %eax, -0x68(%rbp)
jmp 0x2637
movl $0x4, %eax
movl %eax, -0x68(%rbp)
jmp 0x2637
movl -0x68(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x48(%rbp), %rax
movl 0x4(%rax), %eax
shll $0x3, %eax
movslq %eax, %rsi
callq 0x2200
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x8(%rax)
movslq -0x3c(%rbp), %rdx
shlq $0x20, %rdx
movslq -0x40(%rbp), %rax
orq %rax, %rdx
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x48(%rbp), %rsi
movl (%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, (%rsi)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x243d
movq -0x28(%rbp), %rdi
callq 0x2ce0
movq -0x20(%rbp), %rdi
callq 0x2030
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2040
movq -0x38(%rbp), %rdi
callq 0x2040
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq