// File: /workspace/github_cpp_makefile_star2_O1/schneebergerlab[P]DrLink/separate_chr_v2.cpp
// Function: separate_chr_v2(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
bool separate_chr_v2(string filename, map<string, string>* visitedChr, string* tmpflag)
{
    /* this function separates 
    
       xxx_molecule_table_trashme.txt.gz from DrLink molecule or 
       phased_variants.vcf.gz            from longranger
       
       into chr-sepecific sub-files for later processing.
       
       Input:
       
       filename  - name of input gzipped file.
       moleORvcf - if "moleTable", the file is treated as molecule table file; if "vcf", vcf file.
       
       return variable:
       
       visitedChr- map<chr, chrfilename>
    */
    // files need to be gzipped
    if(filename.size() < 4)
    {
        cout << "   Error: unexpted file name " << filename << ". Must be in form of xxx.gz ." << endl;
        return false;
    }
    if(filename.substr(filename.size()-3).compare(".gz") != 0)
    {
        cout << "   Error: only file xxx.gz for molecule table or vcf accepted. " << endl;
        return false;
    }
    //
    map<string, ogzstream*> allofp; // map<filename, filehandle>
    //
    string tmpfileflag= *tmpflag;
    // read and write
    igzstream  fp;
    fp.open(filename.c_str());
    if(!fp.good())
    {
        cout << "   Error: cannot open file " << filename << "; exited. " << endl;
        return false;
    }
    while(fp.good())
    {
        string line("");
        getline(fp, line);
        if(line.size()==0 || line[0]=='#') continue;
        
        //vector<string> lineinfo = split_string(line, '\t');
        
        string chrinfo(""); // == lineinfo[0]
        size_t tabfirst = line.find("\t");
        chrinfo = line.substr(0, tabfirst);
        
        // find chr
        size_t ipos = chrinfo.find("#");     // if found - molecule table; if not - vcf file
        bool   vcf  = false;
        if(ipos == std::string::npos)
        {
            ipos = chrinfo.size();
            vcf  = true;
        }
        string chr;
        if(line.substr(0, 3).compare("Chr")==0 || 
           line.substr(0, 3).compare("chr")==0 || 
           line.substr(0, 3).compare("CHR")==0)
        {
            chr = chrinfo.substr(3, ipos-3); 
        }
        else
        {
            chr = chrinfo.substr(0, ipos); 
        }
        // if has not been not visited, open new file for current chr if not exist
        if(allofp.find(chr)==allofp.end())
        {
            string chrfilename("");
            if(vcf == true)
            {
                int t=0;
                chrfilename = tmpfileflag + "_subfile_chr_" + chr + "_longranger_variants.vcf.gz";
                igzstream iitfp;
                iitfp.open(chrfilename.c_str(), ios::in);
                while(t<10000 && iitfp.good())
                {
                    iitfp.close();
                    tmpfileflag.clear();
                    gen_random(&tmpfileflag, 6);
                    chrfilename = tmpfileflag + "_subfile_chr_" + chr + "_longranger_variants.vcf.gz";
                    iitfp.open(chrfilename.c_str(), ios::in);
                    if(iitfp.good())
                    cout << "   Warning: tmp file " << chrfilename << " exists! Trying another!" << endl;
                }
            }
            else
            {
                int t=0;
                chrfilename = tmpfileflag + "_subfile_chr_" + chr + "_DrLink_molecules.txt.gz";
                igzstream iitfp;
                iitfp.open(chrfilename.c_str(), ios::in);
                while(t<10000 && iitfp.good())
                {
                    iitfp.close();
                    tmpfileflag.clear();
                    gen_random(&tmpfileflag, 6);
                    chrfilename = tmpfileflag + "_subfile_chr_" + chr + "_DrLink_molecules.txt.gz";
                    iitfp.open(chrfilename.c_str(), ios::in);
                    if(iitfp.good())
                    cout << "   Warning: tmp file " << chrfilename << " exists! Trying another!" << endl;
                }                
            }
            ogzstream* f = new ogzstream(chrfilename.c_str(), ios::out);   
            allofp.insert(std::pair<string, ogzstream*>(chr, f) );
            cout << "   Info: new subfile " << chrfilename << " created and opened." << endl;
            // output
            if(line.substr(0, 3).compare("Chr")==0 || 
               line.substr(0, 3).compare("chr")==0 || 
               line.substr(0, 3).compare("CHR")==0)
            {
                *f << line.substr(3) << endl;
            }
            else
            {
                *f << line << endl;
            }
            // collect chr and filename
            (*visitedChr).insert(std::pair<string, string>(chr, chrfilename));
        }
        else //if differ from last Chr, output to existing file for current chr if exists
        {
            ogzstream* f       = allofp[chr];
            // output 
            if(line.substr(0, 3).compare("Chr")==0 || 
               line.substr(0, 3).compare("chr")==0 || 
               line.substr(0, 3).compare("CHR")==0)
            {
                *f << line.substr(3) << endl;
            }
            else
            {
                *f << line << endl;
            }
        }
    }
    //
    fp.close();
    //
    map<string, ogzstream*>::iterator fitr;
    map<string, ogzstream*>::iterator fitr_end;
    fitr     = allofp.begin();
    fitr_end = allofp.end();
    while(fitr != fitr_end)
    {
        ogzstream* f = (*fitr).second;
        (*f).close();
        fitr ++;
    }
    //
    (*tmpflag) = tmpfileflag;
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x758, %rsp            # imm = 0x758
movq %rdx, %r12
movq %rdi, %r14
movq 0x8(%rdi), %rdx
cmpq $0x3, %rdx
ja 0x35107
movq 0x16ef8(%rip), %rbx     # 0x4bfc8
leaq 0x9cee(%rip), %rsi      # 0x3edc5
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x43a0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x43a0
movq %rax, %rbx
leaq 0x9ce6(%rip), %rsi      # 0x3ede3
movl $0x1d, %edx
movq %rax, %rdi
jmp 0x35173
movq %rsi, %r13
addq $-0x3, %rdx
leaq 0x4b8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x4360
leaq 0x5308(%rip), %rsi      # 0x3a437
movq %r15, %rdi
callq 0x4100
movl %eax, %ebx
movq (%r15), %rdi
leaq 0x4c8(%rsp), %rax
cmpq %rax, %rdi
je 0x35159
movq 0x4c8(%rsp), %rsi
incq %rsi
callq 0x4340
testl %ebx, %ebx
je 0x351b5
movq 0x16e64(%rip), %rbx     # 0x4bfc8
leaq 0x9c96(%rip), %rsi      # 0x3ee01
movl $0x3f, %edx
movq %rbx, %rdi
callq 0x43a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x758, %rsp            # imm = 0x758
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x190(%rsp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0xd8(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0xda32
leaq 0x4b8(%rsp), %rdi
callq 0xcc30
movq (%r14), %rsi
leaq 0x4b8(%rsp), %rdi
movl $0x8, %edx
callq 0x39386
movq 0x4b8(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x4d8(%rsp,%rax)
sete %bl
je 0x352a3
movq 0x16d8c(%rip), %rdi     # 0x4bfc8
leaq 0x592b(%rip), %rsi      # 0x3ab6e
movl $0x1b, %edx
callq 0x43a0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x16d6d(%rip), %rdi     # 0x4bfc8
callq 0x43a0
movq %rax, %r14
leaq 0x9bd7(%rip), %rsi      # 0x3ee41
movl $0xa, %edx
movq %rax, %rdi
callq 0x43a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
jmp 0x36462
movl %ebx, 0xec(%rsp)
movq %r13, 0x120(%rsp)
movq %r12, 0x118(%rsp)
movq 0x4b8(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x4d8(%rsp,%rax)
jne 0x36400
leaq 0x58(%rsp), %rbx
leaq 0x1c8(%rsp), %r13
leaq 0x1b8(%rsp), %rax
addq $0x198, %rax            # imm = 0x198
movq %rax, 0xf0(%rsp)
leaq 0x48(%rsp), %r15
movq %rbx, 0x48(%rsp)
movq %r15, %rdi
leaq 0x9817(%rip), %rdx      # 0x3eb22
movq %rdx, %rsi
callq 0x5384
movq 0x640(%rsp), %rax
movq -0x18(%rax), %rdi
leaq 0x640(%rsp), %r14
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x45c0
cmpq $0x0, 0x50(%rsp)
je 0x363cf
movq 0x48(%rsp), %rax
cmpb $0x23, (%rax)
je 0x363cf
leaq 0x108(%rsp), %rax
movq %rax, 0xf8(%rsp)
leaq 0xf8(%rsp), %r14
movq %r14, %rdi
leaq 0x97a4(%rip), %rdx      # 0x3eb22
movq %rdx, %rsi
callq 0x5384
movl $0x1, %ecx
movq %r15, %rdi
leaq 0x978c(%rip), %rsi      # 0x3eb21
xorl %edx, %edx
callq 0x4590
leaq 0x1b8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x4360
movq %r14, %rdi
movq %r12, %rsi
callq 0x43e0
movq 0x1b8(%rsp), %rdi
cmpq %r13, %rdi
je 0x353dc
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4340
movl $0x1, %ecx
movq %r14, %rdi
leaq 0x9c07(%rip), %rsi      # 0x3eff2
xorl %edx, %edx
callq 0x4590
movq %rax, %r13
movq %rax, %rbp
cmpq $-0x1, %rax
jne 0x35406
movq 0x100(%rsp), %rbp
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq $0x0, 0x90(%rsp)
movb $0x0, 0x98(%rsp)
movl $0x3, %ecx
leaq 0x1b8(%rsp), %r15
movq %r15, %rdi
leaq 0x48(%rsp), %rsi
xorl %edx, %edx
callq 0x4360
movq %r15, %rdi
leaq 0x99fc(%rip), %rsi      # 0x3ee4c
callq 0x4100
movl %eax, %r12d
movb $0x1, %r15b
testl %eax, %eax
je 0x354c3
movl $0x3, %ecx
leaq 0x168(%rsp), %r14
movq %r14, %rdi
leaq 0x48(%rsp), %rsi
xorl %edx, %edx
callq 0x4360
movq %r14, %rdi
leaq 0x99cb(%rip), %rsi      # 0x3ee50
callq 0x4100
testl %eax, %eax
je 0x354c3
movl $0x3, %ecx
leaq 0x498(%rsp), %r14
movq %r14, %rdi
leaq 0x48(%rsp), %rsi
xorl %edx, %edx
callq 0x4360
movq %r14, %rdi
leaq 0x99a0(%rip), %rsi      # 0x3ee54
callq 0x4100
testl %eax, %eax
sete %r15b
movb $0x1, %al
jmp 0x354c5
xorl %eax, %eax
testb %al, %al
je 0x354ee
movq 0x498(%rsp), %rdi
leaq 0x4a8(%rsp), %rax
cmpq %rax, %rdi
je 0x354ee
movq 0x4a8(%rsp), %rsi
incq %rsi
callq 0x4340
testl %r12d, %r12d
leaq 0x58(%rsp), %rbx
je 0x3551d
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
je 0x3551d
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1b8(%rsp), %rdi
leaq 0x1c8(%rsp), %rax
cmpq %rax, %rdi
je 0x35542
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4340
testb %r15b, %r15b
je 0x35575
addq $-0x3, %rbp
movl $0x3, %edx
leaq 0x1b8(%rsp), %r12
movq %r12, %rdi
leaq 0xf8(%rsp), %rsi
movq %rbp, %rcx
callq 0x4360
leaq 0x1c8(%rsp), %r15
jmp 0x3559a
leaq 0x1b8(%rsp), %r12
movq %r12, %rdi
leaq 0xf8(%rsp), %rsi
xorl %edx, %edx
movq %rbp, %rcx
callq 0x4360
leaq 0x1c8(%rsp), %r15
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
callq 0x43e0
movq 0x1b8(%rsp), %rdi
cmpq %r15, %rdi
je 0x355c7
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x188(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x3688a
leaq 0x190(%rsp), %rcx
cmpq %rcx, %rax
je 0x357ae
leaq 0x188(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x30fb0
movq (%rax), %rbp
movl $0x3, %ecx
leaq 0x1b8(%rsp), %r14
movq %r14, %rdi
leaq 0x48(%rsp), %rsi
xorl %edx, %edx
callq 0x4360
movq %r14, %rdi
leaq 0x9821(%rip), %rsi      # 0x3ee4c
callq 0x4100
movl %eax, %r14d
movb $0x1, %r15b
testl %eax, %eax
je 0x3569e
movl $0x3, %ecx
leaq 0x128(%rsp), %r12
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
xorl %edx, %edx
callq 0x4360
movq %r12, %rdi
leaq 0x97f0(%rip), %rsi      # 0x3ee50
callq 0x4100
testl %eax, %eax
je 0x3569e
movl $0x3, %ecx
leaq 0x458(%rsp), %r15
movq %r15, %rdi
leaq 0x48(%rsp), %rsi
xorl %edx, %edx
callq 0x4360
movq %r15, %rdi
leaq 0x97c5(%rip), %rsi      # 0x3ee54
callq 0x4100
testl %eax, %eax
sete %r15b
movb $0x1, %al
jmp 0x356a0
xorl %eax, %eax
testb %al, %al
je 0x356c9
movq 0x458(%rsp), %rdi
leaq 0x468(%rsp), %rax
cmpq %rax, %rdi
je 0x356c9
movq 0x468(%rsp), %rsi
incq %rsi
callq 0x4340
testl %r14d, %r14d
je 0x356f3
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x356f3
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1b8(%rsp), %rdi
leaq 0x1c8(%rsp), %rax
cmpq %rax, %rdi
je 0x35718
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4340
testb %r15b, %r15b
je 0x35856
movl $0x3, %edx
leaq 0x1b8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movq $-0x1, %rcx
callq 0x4360
leaq 0x1c8(%rsp), %r13
addq $0x188, %rbp            # imm = 0x188
movq 0x1b8(%rsp), %rsi
movq 0x1c0(%rsp), %rdx
movq %rbp, %rdi
callq 0x43a0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
movq 0x1b8(%rsp), %rdi
cmpq %r13, %rdi
je 0x36380
movq 0x1c8(%rsp), %rsi
jmp 0x36378
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x935e(%rip), %rdx      # 0x3eb22
movq %rdx, %rsi
callq 0x5384
cmpq $-0x1, %r13
leaq 0x18(%rsp), %rax
leaq 0x8(%rsp), %r14
je 0x358a6
movq %rax, 0x8(%rsp)
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xda32
movq %r14, %rdi
leaq 0x78b3(%rip), %rsi      # 0x3d0bd
callq 0x45e0
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq %r14, %rdi
callq 0x4120
leaq 0x38(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3591c
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x35922
addq $0x188, %rbp            # imm = 0x188
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %rbp, %rdi
callq 0x43a0
leaq 0x1c8(%rsp), %r13
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
jmp 0x36380
movq %rax, 0x8(%rsp)
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xda32
movq %r14, %rdi
leaq 0x77ed(%rip), %rsi      # 0x3d0bd
callq 0x45e0
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq %r14, %rdi
callq 0x4120
leaq 0x38(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x35c73
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x35c79
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x28(%rsp), %rdi
leaq 0x7806(%rip), %rsi      # 0x3d14c
callq 0x45e0
movq %r15, 0x1b8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x35977
movq %rdx, 0x1b8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1c8(%rsp)
jmp 0x3597e
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x1c0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x68(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0x43e0
movq 0x1b8(%rsp), %rdi
cmpq %r15, %rdi
je 0x359c8
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x359e4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x35a00
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x1b8(%rsp), %r14
movq %r14, %rdi
callq 0xcc30
movq 0x68(%rsp), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x39386
movq 0x1b8(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x1d8(%rsp,%rax)
jne 0x35fca
leaq 0x1b8(%rsp), %rdi
callq 0x3962e
movq $0x0, 0xd0(%rsp)
movq 0xc8(%rsp), %rax
movb $0x0, (%rax)
leaq 0xc8(%rsp), %rdi
movl $0x6, %esi
callq 0x36824
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %r14
movq %r14, %rdi
callq 0xda32
movq %r14, %rdi
leaq 0x760e(%rip), %rsi      # 0x3d0bd
callq 0x45e0
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq %r14, %rdi
callq 0x4120
leaq 0x18(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x8(%rsp), %rdi
je 0x35af9
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x35aff
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x762e(%rip), %rsi      # 0x3d14c
callq 0x45e0
leaq 0x38(%rsp), %r14
movq %r14, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x35b4b
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x35b52
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x43e0
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x35b90
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x35bac
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x35bd1
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x68(%rsp), %rsi
leaq 0x1b8(%rsp), %rdi
movl $0x8, %edx
callq 0x39386
movq 0x1b8(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x1d8(%rsp,%rax)
jne 0x35a22
movl $0x15, %edx
movq 0x163ba(%rip), %rdi     # 0x4bfc8
leaq 0x9243(%rip), %rsi      # 0x3ee58
callq 0x43a0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0x1639d(%rip), %rdi     # 0x4bfc8
callq 0x43a0
movq %rax, %r14
movl $0x18, %edx
movq %rax, %rdi
leaq 0x922c(%rip), %rsi      # 0x3ee6e
callq 0x43a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
jmp 0x35a22
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x28(%rsp), %rdi
leaq 0x742e(%rip), %rsi      # 0x3d0cb
callq 0x45e0
movq %r15, 0x1b8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x35cce
movq %rdx, 0x1b8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1c8(%rsp)
jmp 0x35cd5
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x1c0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x68(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0x43e0
movq 0x1b8(%rsp), %rdi
cmpq %r15, %rdi
je 0x35d1f
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x35d3b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x35d57
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x1b8(%rsp), %r14
movq %r14, %rdi
callq 0xcc30
movq 0x68(%rsp), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x39386
movq 0x1b8(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x1d8(%rsp,%rax)
jne 0x35fca
leaq 0x1b8(%rsp), %rdi
callq 0x3962e
movq $0x0, 0xd0(%rsp)
movq 0xc8(%rsp), %rax
movb $0x0, (%rax)
leaq 0xc8(%rsp), %rdi
movl $0x6, %esi
callq 0x36824
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %r14
movq %r14, %rdi
callq 0xda32
movq %r14, %rdi
leaq 0x72b7(%rip), %rsi      # 0x3d0bd
callq 0x45e0
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq %r14, %rdi
callq 0x4120
leaq 0x18(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x8(%rsp), %rdi
je 0x35e50
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x35e56
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x7256(%rip), %rsi      # 0x3d0cb
callq 0x45e0
leaq 0x38(%rsp), %r14
movq %r14, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x35ea2
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x35ea9
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x43e0
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x35ee7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x35f03
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x35f28
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x68(%rsp), %rsi
leaq 0x1b8(%rsp), %rdi
movl $0x8, %edx
callq 0x39386
movq 0x1b8(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x1d8(%rsp,%rax)
jne 0x35d79
movl $0x15, %edx
movq 0x16063(%rip), %rdi     # 0x4bfc8
leaq 0x8eec(%rip), %rsi      # 0x3ee58
callq 0x43a0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0x16046(%rip), %rdi     # 0x4bfc8
callq 0x43a0
movq %rax, %r14
movl $0x18, %edx
movq %rax, %rdi
leaq 0x8ed5(%rip), %rsi      # 0x3ee6e
callq 0x43a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
jmp 0x35d79
leaq 0x15c6f(%rip), %rax     # 0x4bc40
movq %rax, 0x340(%rsp)
leaq 0x15c88(%rip), %rax     # 0x4bc68
movq %rax, 0x350(%rsp)
movq $0x0, 0x348(%rsp)
leaq 0x1b8(%rsp), %rdi
leaq 0x15ba5(%rip), %rsi     # 0x4bba8
callq 0x39330
movq 0xf0(%rsp), %rdi
callq 0x4140
movl $0x298, %edi            # imm = 0x298
callq 0x4330
movq %rax, %rbp
movq 0x68(%rsp), %rsi
movq %rax, %rdi
movl $0x10, %edx
callq 0x30c08
movq %r15, 0x1b8(%rsp)
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
addq %rsi, %rdx
leaq 0x1b8(%rsp), %r14
movq %r14, %rdi
callq 0xda32
movq %rbp, 0x1d8(%rsp)
leaq 0x188(%rsp), %rdi
movq %r14, %rsi
callq 0x31772
movq 0x1b8(%rsp), %rdi
cmpq %r15, %rdi
je 0x36094
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4340
movl $0x15, %edx
movq 0x15f28(%rip), %rdi     # 0x4bfc8
leaq 0x8de0(%rip), %rsi      # 0x3ee87
callq 0x43a0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0x15f0b(%rip), %rdi     # 0x4bfc8
callq 0x43a0
movq %rax, %r14
movl $0x14, %edx
movq %rax, %rdi
leaq 0x8dc9(%rip), %rsi      # 0x3ee9d
callq 0x43a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
movl $0x3, %ecx
leaq 0x1b8(%rsp), %r14
movq %r14, %rdi
leaq 0x48(%rsp), %rsi
xorl %edx, %edx
callq 0x4360
movq %r14, %rdi
leaq 0x8d26(%rip), %rsi      # 0x3ee4c
callq 0x4100
movl %eax, %r14d
movb $0x1, %r15b
testl %eax, %eax
je 0x36199
movl $0x3, %ecx
leaq 0x148(%rsp), %r12
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
xorl %edx, %edx
callq 0x4360
movq %r12, %rdi
leaq 0x8cf5(%rip), %rsi      # 0x3ee50
callq 0x4100
testl %eax, %eax
je 0x36199
movl $0x3, %ecx
leaq 0x478(%rsp), %r15
movq %r15, %rdi
leaq 0x48(%rsp), %rsi
xorl %edx, %edx
callq 0x4360
movq %r15, %rdi
leaq 0x8cca(%rip), %rsi      # 0x3ee54
callq 0x4100
testl %eax, %eax
sete %r15b
movb $0x1, %al
jmp 0x3619b
xorl %eax, %eax
testb %al, %al
je 0x361c4
movq 0x478(%rsp), %rdi
leaq 0x488(%rsp), %rax
cmpq %rax, %rdi
je 0x361c4
movq 0x488(%rsp), %rsi
incq %rsi
callq 0x4340
testl %r14d, %r14d
je 0x361ee
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x361ee
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1b8(%rsp), %rdi
leaq 0x1c8(%rsp), %rax
cmpq %rax, %rdi
je 0x36213
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4340
testb %r15b, %r15b
je 0x362aa
movl $0x3, %edx
leaq 0x1b8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movq $-0x1, %rcx
callq 0x4360
leaq 0x1c8(%rsp), %r13
addq $0x188, %rbp            # imm = 0x188
movq 0x1b8(%rsp), %rsi
movq 0x1c0(%rsp), %rdx
movq %rbp, %rdi
callq 0x43a0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
movq 0x1b8(%rsp), %rdi
cmpq %r13, %rdi
je 0x362f5
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x362f5
addq $0x188, %rbp            # imm = 0x188
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %rbp, %rdi
callq 0x43a0
leaq 0x1c8(%rsp), %r13
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
leaq 0x1b8(%rsp), %r14
movq %r14, %rdi
leaq 0x88(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0xeee8
movq 0x120(%rsp), %rdi
movq %r14, %rsi
callq 0xf00c
movq 0x1d8(%rsp), %rdi
leaq 0x1e8(%rsp), %rax
cmpq %rax, %rdi
je 0x36347
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1b8(%rsp), %rdi
cmpq %r13, %rdi
je 0x36364
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x36380
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x363a5
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
leaq 0x48(%rsp), %r15
je 0x363cf
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x48(%rsp), %rdi
cmpq %rbx, %rdi
je 0x363e6
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x4b8(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x4d8(%rsp,%rax)
je 0x352fc
leaq 0x4b8(%rsp), %rdi
leaq 0xd8(%rsp), %r15
callq 0x3962e
movq 0x118(%rsp), %r12
movl 0xec(%rsp), %ebx
movq 0x1a0(%rsp), %r14
leaq 0x190(%rsp), %r13
cmpq %r13, %r14
je 0x36452
movq 0x40(%r14), %rdi
callq 0x3962e
movq %r14, %rdi
callq 0x4230
movq %rax, %r14
cmpq %r13, %rax
jne 0x36439
leaq 0xc8(%rsp), %rsi
movq %r12, %rdi
callq 0x41c0
leaq 0x157d7(%rip), %rax     # 0x4bc40
leaq 0x650(%rsp), %r14
movq %rax, -0x10(%r14)
leaq 0x157ec(%rip), %rax     # 0x4bc68
movq %rax, (%r14)
movq $0x0, -0x8(%r14)
leaq 0x1571a(%rip), %rsi     # 0x4bba8
leaq 0x4b8(%rsp), %rdi
callq 0x39330
movq %r14, %rdi
callq 0x4140
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0x364c0
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x188(%rsp), %rdi
callq 0x316fa
jmp 0x351a1
jmp 0x3674b
jmp 0x36735
jmp 0x36547
jmp 0x3656a
jmp 0x3656a
jmp 0x36735
movq %rax, %r14
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x3651f
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x3651f
jmp 0x36735
movq %rax, %r14
movq 0x1b8(%rsp), %rdi
leaq 0x1c8(%rsp), %rax
cmpq %rax, %rdi
jne 0x3668d
jmp 0x3675b
jmp 0x3674b
jmp 0x36735
movq %rax, %r14
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3656d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x3656d
jmp 0x3656a
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3675b
movq 0x18(%rsp), %rsi
jmp 0x36695
jmp 0x36735
movq %rax, %r14
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x3664f
movq 0x138(%rsp), %rsi
jmp 0x36633
jmp 0x3673c
jmp 0x366dc
movq %rax, %r14
leaq 0x1b8(%rsp), %rdi
callq 0xef4c
jmp 0x3675b
jmp 0x36735
jmp 0x36735
jmp 0x366dc
movq %rax, %r14
movq 0x1b8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x3668d
jmp 0x3675b
jmp 0x36735
movq %rax, %r14
movl $0x298, %esi            # imm = 0x298
movq %rbp, %rdi
jmp 0x36698
jmp 0x3664c
movq %rax, %r14
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
je 0x3664f
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x3664f
jmp 0x366dc
jmp 0x366dc
jmp 0x366dc
movq %rax, %r14
movq 0x1b8(%rsp), %rdi
leaq 0x1c8(%rsp), %rax
cmpq %rax, %rdi
jne 0x366c7
jmp 0x36777
movq %rax, %r14
jmp 0x367ea
movq %rax, %r14
jmp 0x3680f
movq %rax, %r14
movq 0x1b8(%rsp), %rdi
cmpq %r13, %rdi
je 0x3675b
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x3675b
jmp 0x36744
jmp 0x366dc
jmp 0x366dc
movq %rax, %r14
jmp 0x3679c
movq %rax, %r14
movq 0x1b8(%rsp), %rdi
cmpq %r13, %rdi
je 0x36777
movq 0x1c8(%rsp), %rsi
jmp 0x3676f
jmp 0x366e6
jmp 0x36709
jmp 0x36709
jmp 0x3674b
movq %rax, %r14
jmp 0x36777
jmp 0x3674b
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3670c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x3670c
jmp 0x36709
movq %rax, %r14
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x3674e
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x3674e
jmp 0x3673c
movq %rax, %r14
jmp 0x3675b
jmp 0x3673c
movq %rax, %r14
jmp 0x367dd
movq %rax, %r14
jmp 0x367c1
jmp 0x3674b
movq %rax, %r14
leaq 0x1b8(%rsp), %rdi
callq 0xcecc
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x36777
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x3679c
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x367c1
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x367dd
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x4b8(%rsp), %rdi
callq 0xcecc
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x3680f
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x188(%rsp), %rdi
callq 0x316fa
movq %r14, %rdi
callq 0x45a0