// File: /workspace/github_c_makefile_star2_O2/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 0x2f94
testq %rax, %rax
je 0x45d1
movq %rax, 0x20(%rsp)
movl 0xc(%rsp), %edi
leaq 0x57a8(%rip), %rsi      # 0x9a7c
callq 0x20f0
movq %rax, %r12
pushq $0x1
popq %r14
pushq $0x70
popq %rsi
movq %r14, %rdi
callq 0x21d0
movq %rax, %r15
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
movq %r12, 0x18(%rsp)
movq %r12, 0x10(%rax)
movl $0x10000, 0x8(%rax)     # imm = 0x10000
movl $0x4000, %edi           # imm = 0x4000
callq 0x2250
movq %rax, 0x18(%r14)
movq %r14, 0x68(%r15)
callq 0x3c64
movq %rax, 0x10(%rsp)
leaq 0x48(%r15), %r13
leaq 0x30(%r15), %rbp
leaq 0x18(%r15), %rax
movq %rax, 0x28(%rsp)
movl %ebx, %eax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
testl %eax, %eax
jne 0x4369
movq %r14, %rdi
callq 0x7929
cmpl $-0x1, %eax
je 0x4536
cmpl $0x40, %eax
je 0x4361
cmpl $0x3e, %eax
jne 0x4346
movl %eax, 0x8(%rsp)
movl %eax, 0x60(%r15)
andq $0x0, 0x48(%r15)
andq $0x0, 0x30(%r15)
andq $0x0, 0x18(%r15)
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
leaq 0x8(%rsp), %rcx
callq 0x799c
testq %rax, %rax
js 0x453b
cmpl $0xa, 0x8(%rsp)
pushq $0x2
popq %rbx
je 0x43ae
movq %r14, %rdi
movl %ebx, %esi
movq 0x28(%rsp), %rdx
xorl %ecx, %ecx
callq 0x799c
cmpq $0x0, 0x40(%r15)
jne 0x43cb
movq $0x100, 0x38(%r15)      # imm = 0x100
movl $0x100, %edi            # imm = 0x100
callq 0x2250
movq %rax, 0x40(%r15)
movq %r14, %rdi
callq 0x7929
movl %eax, 0x8(%rsp)
cmpl $0xa, %eax
je 0x43cb
cmpl $-0x1, %eax
je 0x441c
cmpl $0x2b, %eax
je 0x441c
cmpl $0x3e, %eax
je 0x4418
cmpl $0x40, %eax
je 0x4418
movq 0x30(%r15), %rcx
movq 0x40(%r15), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x30(%r15)
movb %al, (%rdx,%rcx)
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
xorl %ecx, %ecx
pushq $0x1
popq %r8
callq 0x79a1
jmp 0x43cb
movl %eax, 0x60(%r15)
movq 0x30(%r15), %r12
movq 0x38(%r15), %rbx
leaq 0x1(%r12), %rcx
movq 0x40(%r15), %rax
cmpq %rbx, %rcx
jb 0x4483
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, %rbx
shrq $0x20, %rbx
orq %rdx, %rbx
incq %rbx
movq %rbx, 0x38(%r15)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2290
movq %rax, 0x40(%r15)
movb $0x0, (%rax,%r12)
cmpl $0x2b, 0x8(%rsp)
jne 0x44f1
cmpq %rbx, 0x50(%r15)
jae 0x44a9
movq %rbx, 0x50(%r15)
movq 0x58(%r15), %rdi
movq %rbx, %rsi
callq 0x2290
movq %rax, 0x58(%r15)
pushq $0x2
popq %rbx
movq %r14, %rdi
callq 0x7929
movl %eax, 0x8(%rsp)
cmpl $-0x1, %eax
je 0x4536
cmpl $0xa, %eax
jne 0x44ac
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
xorl %ecx, %ecx
pushq $0x1
popq %r8
callq 0x79a1
movq (%rbp), %r12
movq (%r13), %rcx
testq %rax, %rax
js 0x44e7
cmpq %r12, %rcx
jb 0x44c2
andl $0x0, 0x60(%r15)
cmpq %rcx, %r12
jne 0x453b
testq %r12, %r12
js 0x453b
movq %r12, %rax
shrq $0x20, %rax
jne 0x45a9
movq 0x40(%r15), %rbx
movq %rbx, %rdi
callq 0x2110
cmpq 0x30(%rsp), %rax
jb 0x4529
movq 0x10(%r15), %rsi
movq 0x10(%rsp), %rdi
movq %rbx, %rdx
movl %eax, %ecx
callq 0x4121
movq 0x68(%r15), %r14
movl 0x60(%r15), %eax
jmp 0x4342
testq %r15, %r15
je 0x4581
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 0x4579
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 0x38e9
movq 0x10(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8a40(%rip), %rax      # 0xcff0
movq (%rax), %rdi
movq 0x10(%r15), %rcx
leaq 0x4db6(%rip), %rsi      # 0x9374
leaq 0x4d9c(%rip), %rdx      # 0x9361
movq %r12, %r8
xorl %eax, %eax
callq 0x2200
jmp 0x45f3
movq 0x8a18(%rip), %rax      # 0xcff0
movq (%rax), %rdi
leaq 0x4d56(%rip), %rsi      # 0x9338
leaq 0x4d78(%rip), %rdx      # 0x9361
movq %r14, %rcx
xorl %eax, %eax
callq 0x2200
pushq $0x1
popq %rdi
callq 0x2360