// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/sdict.c
// Function: make_sdict_from_fa
sdict_t *make_sdict_from_fa(const char *f, uint32_t min_len)
{
    int fd;
    int64_t l;
    gzFile fp;
    kseq_t *ks;
    void *ko = 0;

    ko = kopen(f, &fd);
    if (ko == 0) {
        fprintf(stderr, "[E::%s] cannot open file %s for reading\n", __func__, f);
        exit(EXIT_FAILURE);
    }
    fp = gzdopen(fd, "r");
    ks = kseq_init(fp);
    
    sdict_t *d;
    d = sd_init();
    while ((l = kseq_read(ks)) >= 0) {
        if (l > UINT32_MAX) {
            fprintf(stderr, "[E::%s] >4G sequence chunks are not supported: %s [%ld]\n", __func__, ks->name.s, l);
            exit(EXIT_FAILURE);
        }
        if (strlen(ks->seq.s) >= min_len)
            sd_put1(d, ks->name.s, ks->seq.s, strlen(ks->seq.s));
    }

    kseq_destroy(ks);
    gzclose(fp);
    kclose(ko);

    return d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
callq 0x3498
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x4ddf
movl 0x4(%rsp), %edi
leaq 0x61e6(%rip), %rsi      # 0xab6c
callq 0x20f0
movq %rax, %r12
movl $0x1, %edi
movl $0x70, %esi
callq 0x21d0
movq %rax, %r15
movl $0x1, %edi
movl $0x20, %esi
callq 0x21d0
movq %rax, %rbx
movq %r12, 0x20(%rsp)
movq %r12, 0x10(%rax)
movl $0x10000, 0x8(%rax)     # imm = 0x10000
movl $0x4000, %edi           # imm = 0x4000
callq 0x2250
movq %rax, 0x18(%rbx)
movq %rbx, 0x68(%r15)
callq 0x423c
movq %rax, 0x10(%rsp)
leaq 0x48(%r15), %r13
leaq 0x30(%r15), %rbp
leaq 0x18(%r15), %rax
movq %rax, 0x18(%rsp)
movl %r14d, %eax
movq %rax, 0x30(%rsp)
leaq 0x10(%r15), %rax
movq %rax, 0x8(%rsp)
xorl %eax, %eax
testl %eax, %eax
jne 0x4a76
movl 0x8(%rbx), %edx
movl (%rbx), %ecx
movl 0x4(%rbx), %eax
testb $0x3, %dl
je 0x4a1b
cmpl %eax, %ecx
jge 0x4d5f
movq 0x18(%rbx), %rsi
cmpl %eax, %ecx
jl 0x4a5a
movl $0x0, (%rbx)
movq 0x10(%rbx), %rdi
sarl $0x2, %edx
callq 0x21f0
movl %eax, 0x4(%rbx)
movl 0x8(%rbx), %edx
movl %edx, %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
jge 0x4a4c
andl $-0x4, %edx
incl %edx
movl %edx, 0x8(%rbx)
testl %eax, %eax
je 0x4d5f
movl (%rbx), %ecx
movq 0x18(%rbx), %rsi
movslq %ecx, %rdi
incl %ecx
movl %ecx, (%rbx)
movzbl (%rsi,%rdi), %esi
movl %esi, (%rsp)
cmpl $0x40, %esi
je 0x4a72
cmpl $0x3e, %esi
jne 0x4a0e
movl %esi, 0x60(%r15)
xorl %eax, %eax
movq %rax, 0x48(%r15)
movq %rax, 0x30(%r15)
movq %rax, 0x18(%r15)
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rsp, %rcx
xorl %r8d, %r8d
callq 0x8c9a
testq %rax, %rax
js 0x4d64
cmpl $0xa, (%rsp)
je 0x4abd
movq %rbx, %rdi
movl $0x2, %esi
movq 0x18(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x8c9a
cmpq $0x0, 0x40(%r15)
jne 0x4ada
movq $0x100, 0x38(%r15)      # imm = 0x100
movl $0x100, %edi            # imm = 0x100
callq 0x2250
movq %rax, 0x40(%r15)
movl 0x8(%rbx), %edx
testb $0x3, %dl
sete %sil
movl (%rbx), %ecx
movl 0x4(%rbx), %eax
cmpl %eax, %ecx
setl %dil
orb %dil, %sil
testb $0x1, %sil
je 0x4bbd
movq 0x18(%rbx), %rsi
testb $0x1, %dil
jne 0x4b3d
movl $0x0, (%rbx)
movq 0x10(%rbx), %rdi
sarl $0x2, %edx
callq 0x21f0
movl %eax, 0x4(%rbx)
movl 0x8(%rbx), %edx
movl %edx, %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
jge 0x4b2f
andl $-0x4, %edx
incl %edx
movl %edx, 0x8(%rbx)
testl %eax, %eax
je 0x4bbd
movl (%rbx), %ecx
movq 0x18(%rbx), %rsi
movslq %ecx, %rdi
incl %ecx
movl %ecx, (%rbx)
movb (%rsi,%rdi), %sil
movzbl %sil, %edi
movl %edi, (%rsp)
cmpl $0x2a, %edi
jg 0x4b5b
cmpl $0xa, %edi
je 0x4ba6
jmp 0x4b72
cmpl $0x2b, %edi
je 0x4bc4
cmpl $0x3e, %edi
je 0x4d56
cmpl $0x40, %edi
je 0x4d56
movq 0x30(%r15), %rax
movq 0x40(%r15), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x30(%r15)
movb %sil, (%rcx,%rax)
movq %rbx, %rdi
movl $0x2, %esi
movq %rbp, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x8c9a
movl 0x8(%rbx), %edx
movl (%rbx), %ecx
movl 0x4(%rbx), %eax
cmpl %eax, %ecx
setl %dil
testb $0x3, %dl
je 0x4afc
cmpl %eax, %ecx
jl 0x4afc
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
movq 0x30(%r15), %r14
movq 0x38(%r15), %r12
leaq 0x1(%r14), %rcx
movq 0x40(%r15), %rax
cmpq %r12, %rcx
jb 0x4c2a
movq %rcx, %rdx
shrq %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x2, %rcx
orq %rdx, %rcx
movq %rcx, %rdx
shrq $0x4, %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x8, %rcx
orq %rdx, %rcx
movq %rcx, %rdx
shrq $0x10, %rdx
orq %rcx, %rdx
movq %rdx, %r12
shrq $0x20, %r12
orq %rdx, %r12
incq %r12
movq %r12, 0x38(%r15)
movq %rax, %rdi
movq %r12, %rsi
callq 0x2290
movq %rax, 0x40(%r15)
movb $0x0, (%rax,%r14)
cmpl $0x2b, (%rsp)
jne 0x4cf1
cmpq %r12, 0x50(%r15)
jae 0x4c53
movq %r12, 0x50(%r15)
movq 0x58(%r15), %rdi
movq %r12, %rsi
callq 0x2290
movq %rax, 0x58(%r15)
movl 0x8(%rbx), %edx
movl (%rbx), %ecx
movl 0x4(%rbx), %eax
testb $0x3, %dl
je 0x4c68
cmpl %eax, %ecx
jge 0x4d5f
movq 0x18(%rbx), %rsi
cmpl %eax, %ecx
jl 0x4ca7
movl $0x0, (%rbx)
movq 0x10(%rbx), %rdi
sarl $0x2, %edx
callq 0x21f0
movl %eax, 0x4(%rbx)
movl 0x8(%rbx), %edx
movl %edx, %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
jge 0x4c99
andl $-0x4, %edx
incl %edx
movl %edx, 0x8(%rbx)
testl %eax, %eax
je 0x4d5f
movl (%rbx), %ecx
movq 0x18(%rbx), %rsi
movslq %ecx, %rdi
incl %ecx
movl %ecx, (%rbx)
movzbl (%rsi,%rdi), %esi
movl %esi, (%rsp)
cmpl $0xa, %esi
jne 0x4c5b
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x8c9a
movq (%rbp), %r14
movq (%r13), %rcx
testq %rax, %rax
js 0x4ce4
cmpq %r14, %rcx
jb 0x4cba
movl $0x0, 0x60(%r15)
cmpq %rcx, %r14
jne 0x4d64
testq %r14, %r14
js 0x4d64
movq %r14, %rax
shrq $0x20, %rax
jne 0x4dd2
movq 0x40(%r15), %rbx
movq %rbx, %rdi
callq 0x2110
cmpq 0x30(%rsp), %rax
jb 0x4d49
movq 0x8(%rsp), %rcx
movq (%rcx), %rsi
movq 0x10(%rsp), %r12
movq %r12, %rdi
movl %eax, %edx
callq 0x449a
movl %eax, %r14d
movq %rbx, %rdi
callq 0x23b0
movq 0x8(%r12), %rcx
movl %r14d, %edx
leaq (%rdx,%rdx,2), %rdx
movq %rax, 0x8(%rcx,%rdx,8)
movq 0x68(%r15), %rbx
movl 0x60(%r15), %eax
jmp 0x4a02
movl %edi, 0x60(%r15)
jmp 0x4bc4
testq %r15, %r15
je 0x4daa
movq 0x10(%r15), %rdi
callq 0x2050
movq 0x28(%r15), %rdi
callq 0x2050
movq 0x40(%r15), %rdi
callq 0x2050
movq 0x58(%r15), %rdi
callq 0x2050
movq 0x68(%r15), %rbx
testq %rbx, %rbx
je 0x4da2
movq 0x18(%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
callq 0x2050
movq %r15, %rdi
callq 0x2050
movq 0x20(%rsp), %rdi
callq 0x2040
movq 0x28(%rsp), %rdi
callq 0x3e8a
movq 0x10(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x257f
movq %rbx, %rdi
callq 0x25b0