// File: c2-d2[P]disty/src/main.cpp
// Function: void load_sequences<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
void load_sequences(const string &fasta_fn, T &names, T &seqs) {
    gzFile fp;
    kseq_t *seq;
    int l;
    fp = gzopen(fasta_fn.c_str(), "r");
    assert (fp != nullptr);
    seq = kseq_init(fp);

    int len=0; // length of sequences (for checking)

    while ((l = kseq_read(seq)) >= 0) {
        names.push_back(seq->name.s);
        string s(seq->seq.s);
        for (auto & c: s) {
            c = toupper(c);
        }
        if(len!=0){
            assert(len==static_cast<int>(s.size()));
        }
        else{
            len=(int)s.size();
        }

        for(char &a: s){
            assert ((int)a<128);
        }

        seqs.push_back(s);
    }
    kseq_destroy(seq);
    gzclose(fp);

    assert(seqs.size()>0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x20a0
movq %rax, %rdi
leaq 0x4487(%rip), %rsi      # 0x8661
callq 0x22f0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x41ec
jmp 0x420b
leaq 0x4585(%rip), %rdi      # 0x8778
leaq 0x43d4(%rip), %rsi      # 0x85ce
movl $0xef, %edx
leaq 0x4580(%rip), %rcx      # 0x8786
callq 0x2110
movq -0x20(%rbp), %rdi
callq 0x3550
movq %rax, -0x28(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x3590
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
jl 0x44f7
movq -0x10(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xe0(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x2380
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0x4030
jmp 0x4277
movq -0xe8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x5c00
jmp 0x4289
leaq -0x50(%rbp), %rdi
callq 0x23e8
leaq -0x51(%rbp), %rdi
callq 0x2230
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0xf8(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x2380
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rdx
leaq -0x88(%rbp), %rdi
callq 0x4030
jmp 0x42d9
leaq -0x89(%rbp), %rdi
callq 0x2230
leaq -0x88(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
callq 0x21a0
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
callq 0x20f0
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x5c30
testb $0x1, %al
jne 0x4335
jmp 0x43be
leaq -0xa0(%rbp), %rdi
callq 0x5c70
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movsbl (%rax), %edi
callq 0x23a0
movb %al, %cl
movq -0xb0(%rbp), %rax
movb %cl, (%rax)
leaq -0xa0(%rbp), %rdi
callq 0x5c90
jmp 0x4319
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x4393
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x23e8
leaq -0x51(%rbp), %rdi
callq 0x2230
jmp 0x4542
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x89(%rbp), %rdi
callq 0x2230
jmp 0x4542
cmpl $0x0, -0x30(%rbp)
je 0x4409
movl -0x30(%rbp), %eax
movl %eax, -0xfc(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x2140
movq %rax, %rcx
movl -0xfc(%rbp), %eax
cmpl %ecx, %eax
jne 0x43e8
jmp 0x4407
leaq 0x43f0(%rip), %rdi      # 0x87df
leaq 0x41d8(%rip), %rsi      # 0x85ce
movl $0xfb, %edx
leaq 0x4384(%rip), %rcx      # 0x8786
callq 0x2110
jmp 0x4418
leaq -0x88(%rbp), %rdi
callq 0x2140
movl %eax, -0x30(%rbp)
leaq -0x88(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x21a0
movq %rax, -0xc0(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x20f0
movq %rax, -0xc8(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x5c30
testb $0x1, %al
jne 0x4465
jmp 0x44ba
leaq -0xc0(%rbp), %rdi
callq 0x5c70
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x80, %eax
jge 0x448b
jmp 0x44aa
leaq 0x436d(%rip), %rdi      # 0x87ff
leaq 0x4135(%rip), %rsi      # 0x85ce
movl $0x102, %edx            # imm = 0x102
leaq 0x42e1(%rip), %rcx      # 0x8786
callq 0x2110
jmp 0x44ac
leaq -0xc0(%rbp), %rdi
callq 0x5c90
jmp 0x444c
movq -0x18(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x5cb0
jmp 0x44cc
leaq -0x88(%rbp), %rdi
callq 0x23e8
jmp 0x421f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x23e8
jmp 0x4542
movq -0x28(%rbp), %rdi
callq 0x3980
movq -0x20(%rbp), %rdi
callq 0x2350
movq -0x18(%rbp), %rdi
callq 0x4550
cmpq $0x0, %rax
jbe 0x451a
jmp 0x4539
leaq 0x42e9(%rip), %rdi      # 0x880a
leaq 0x40a6(%rip), %rsi      # 0x85ce
movl $0x10a, %edx            # imm = 0x10A
leaq 0x4252(%rip), %rcx      # 0x8786
callq 0x2110
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x2370
nopl (%rax,%rax)