// File: /workspace/github_c_makefile_star2_O1/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, %ebx
movq %rdi, %r14
leaq 0xc(%rsp), %rsi
callq 0x3408
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x4d62
movl 0xc(%rsp), %edi
leaq 0x6278(%rip), %rsi      # 0xab6a
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, %r14
movq %r12, 0x18(%rsp)
movq %r12, 0x10(%rax)
movl 0x8(%rax), %eax
andl $0x3, %eax
orl $0x10000, %eax          # imm = 0x10000
movl %eax, 0x8(%r14)
movl $0x4000, %edi           # imm = 0x4000
callq 0x2250
movq %rax, 0x18(%r14)
movq %r14, 0x68(%r15)
callq 0x41ac
movq %rax, 0x10(%rsp)
leaq 0x48(%r15), %r13
leaq 0x30(%r15), %rbp
leaq 0x18(%r15), %rax
movq %rax, 0x28(%rsp)
movl %ebx, %r12d
movq %rbp, 0x30(%rsp)
movq 0x68(%r15), %rbx
cmpl $0x0, 0x60(%r15)
jne 0x49fa
jmp 0x4983
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x49df
movl 0x8(%rbx), %edx
testb $0x3, %dl
je 0x4997
movl (%rbx), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x4(%rbx), %ecx
jge 0x49df
movl (%rbx), %eax
cmpl 0x4(%rbx), %eax
jl 0x49cf
movl $0x0, (%rbx)
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
sarl $0x2, %edx
callq 0x21f0
movl %eax, 0x4(%rbx)
movl 0x8(%rbx), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x49cb
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%rbx)
testl %eax, %eax
je 0x497c
movq 0x18(%rbx), %rax
movslq (%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%rbx)
movzbl (%rax,%rcx), %eax
movl %eax, 0x8(%rsp)
cmpl $-0x1, %eax
je 0x4b18
cmpl $0x40, %eax
je 0x49f6
cmpl $0x3e, %eax
jne 0x4983
movl %eax, 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
leaq 0x8(%rsp), %rcx
xorl %r8d, %r8d
callq 0x8b51
testq %rax, %rax
js 0x4b18
cmpl $0xa, 0x8(%rsp)
je 0x4a44
movq %rbx, %rdi
movl $0x2, %esi
movq 0x28(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x8b51
cmpq $0x0, 0x40(%r15)
jne 0x4a61
movq $0x100, 0x38(%r15)      # imm = 0x100
movl $0x100, %edi            # imm = 0x100
callq 0x2250
movq %rax, 0x40(%r15)
movl 0x8(%rbx), %edx
testb $0x3, %dl
je 0x4a75
movl (%rbx), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x4(%rbx), %ecx
jge 0x4abd
movl (%rbx), %eax
cmpl 0x4(%rbx), %eax
jl 0x4aad
movl $0x0, (%rbx)
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
sarl $0x2, %edx
callq 0x21f0
movl %eax, 0x4(%rbx)
movl 0x8(%rbx), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x4aa9
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%rbx)
testl %eax, %eax
je 0x4b11
movq 0x18(%rbx), %rax
movslq (%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%rbx)
movzbl (%rax,%rcx), %eax
movl %eax, 0x8(%rsp)
cmpl $0x2a, %eax
jg 0x4ad2
cmpl $0xa, %eax
je 0x4a61
cmpl $-0x1, %eax
jne 0x4ae1
jmp 0x4b28
cmpl $0x2b, %eax
je 0x4b28
cmpl $0x3e, %eax
je 0x4b24
cmpl $0x40, %eax
je 0x4b24
movq 0x30(%r15), %rcx
movq 0x40(%r15), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x30(%r15)
movb %al, (%rdx,%rcx)
movq %rbx, %rdi
movl $0x2, %esi
movq %rbp, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x8b51
jmp 0x4a61
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4abd
movq $-0x1, %r14
jmp 0x4c72
movl %eax, 0x60(%r15)
movq 0x30(%r15), %r14
leaq 0x1(%r14), %rax
cmpq 0x38(%r15), %rax
jb 0x4b85
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x20, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x38(%r15)
movq 0x40(%r15), %rdi
callq 0x2290
movq %rax, 0x40(%r15)
movq 0x40(%r15), %rax
movb $0x0, (%rax,%r14)
cmpl $0x2b, 0x8(%rsp)
jne 0x4c72
movq 0x38(%r15), %rsi
cmpq %rsi, 0x50(%r15)
jae 0x4bb4
movq %rsi, 0x50(%r15)
movq 0x58(%r15), %rdi
callq 0x2290
movq %rax, 0x58(%r15)
movl 0x8(%rbx), %edx
testb $0x3, %dl
je 0x4bc8
movl (%rbx), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x4(%rbx), %ecx
jge 0x4c10
movl (%rbx), %eax
cmpl 0x4(%rbx), %eax
jl 0x4c00
movl $0x0, (%rbx)
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
sarl $0x2, %edx
callq 0x21f0
movl %eax, 0x4(%rbx)
movl 0x8(%rbx), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x4bfc
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%rbx)
testl %eax, %eax
je 0x4c20
movq 0x18(%rbx), %rax
movslq (%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%rbx)
movzbl (%rax,%rcx), %eax
movl %eax, 0x8(%rsp)
cmpl $-0x1, %eax
je 0x4c6b
cmpl $0xa, %eax
jne 0x4bb4
jmp 0x4c27
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4c10
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x8b51
testq %rax, %rax
js 0x4c4e
movq (%r13), %rax
cmpq (%rbp), %rax
jb 0x4c27
movl $0x0, 0x60(%r15)
movq 0x30(%r15), %r14
cmpq 0x48(%r15), %r14
movq $-0x2, %rax
cmovneq %rax, %r14
jmp 0x4c72
movq $-0x2, %r14
testq %r14, %r14
js 0x4ce4
movabsq $0x100000000, %rax      # imm = 0x100000000
cmpq %rax, %r14
jge 0x4d57
movq 0x40(%r15), %rbx
movq %rbx, %rdi
callq 0x2110
cmpq %r12, %rax
jb 0x496b
movq 0x10(%r15), %rsi
movq %r13, %rbp
movq %r12, %r13
movq 0x10(%rsp), %r12
movq %r12, %rdi
movl %eax, %edx
callq 0x441b
movl %eax, %r14d
movq %rbx, %rdi
callq 0x23b0
movq 0x8(%r12), %rcx
movq %r13, %r12
movq %rbp, %r13
movq 0x30(%rsp), %rbp
movl %r14d, %edx
leaq (%rdx,%rdx,2), %rdx
movq %rax, 0x8(%rcx,%rdx,8)
jmp 0x496b
testq %r15, %r15
je 0x4d2f
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 0x4d27
movq 0x18(%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
callq 0x2050
movq %r15, %rdi
callq 0x2050
movq 0x18(%rsp), %rdi
callq 0x2040
movq 0x20(%rsp), %rdi
callq 0x3e07
movq 0x10(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r14, %rsi
callq 0x257f
movq %r14, %rdi
callq 0x25b1