// File: /workspace/github_cpp_makefile_star2_O3/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 $0x698, %rsp            # imm = 0x698
movq %rdx, %r15
movq %rdi, %rbx
movq 0x8(%rdi), %rdx
cmpq $0x3, %rdx
ja 0x34ecb
movq 0x17134(%rip), %r14     # 0x4bfc8
leaq 0x9f12(%rip), %rsi      # 0x3edad
movl $0x1d, %edx
movq %r14, %rdi
callq 0x43a0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x43a0
movq %rax, %rbx
leaq 0x9f0a(%rip), %rsi      # 0x3edcb
movl $0x1d, %edx
movq %rax, %rdi
jmp 0x34f37
movq %rsi, %r12
addq $-0x3, %rdx
leaq 0x3f8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq $-0x1, %rcx
callq 0x4360
leaq 0x5544(%rip), %rsi      # 0x3a437
movq %r14, %rdi
callq 0x4100
movl %eax, %ebp
movq (%r14), %rdi
leaq 0x408(%rsp), %rax
cmpq %rax, %rdi
je 0x34f1d
movq 0x408(%rsp), %rsi
incq %rsi
callq 0x4340
testl %ebp, %ebp
je 0x34f79
movq 0x170a0(%rip), %rbx     # 0x4bfc8
leaq 0x9eba(%rip), %rsi      # 0x3ede9
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 %ebp, %ebp
movl %ebp, %eax
addq $0x698, %rsp            # imm = 0x698
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x130(%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 0xb8(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0xd940
leaq 0x3f8(%rsp), %rdi
callq 0xcb3a
movq (%rbx), %rsi
leaq 0x3f8(%rsp), %rdi
movl $0x8, %edx
callq 0x39022
movq 0x3f8(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x418(%rsp,%rax)
sete %bpl
je 0x35066
movq 0x16fc9(%rip), %rdi     # 0x4bfc8
leaq 0x5b68(%rip), %rsi      # 0x3ab6e
movl $0x1b, %edx
callq 0x43a0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x16faa(%rip), %rdi     # 0x4bfc8
callq 0x43a0
movq %rax, %rbx
leaq 0x9dfc(%rip), %rsi      # 0x3ee29
movl $0xa, %edx
movq %rax, %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
jmp 0x36117
movq %r12, 0x120(%rsp)
movq %r15, 0x118(%rsp)
movl %ebp, 0xec(%rsp)
leaq 0xd8(%rsp), %rbx
leaq 0x158(%rsp), %r13
leaq 0x198(%r13), %rax
movq %rax, 0x110(%rsp)
leaq 0x9a67(%rip), %rbp      # 0x3eb0a
leaq 0xc8(%rsp), %r15
movq %rbx, 0xc8(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
movq %rbp, %rdx
callq 0x5384
movq 0x580(%rsp), %rax
movq -0x18(%rax), %rdi
leaq 0x580(%rsp), %r14
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x45c0
cmpq $0x0, 0xd0(%rsp)
movq 0xc8(%rsp), %rdi
je 0x36086
cmpb $0x23, (%rdi)
je 0x36086
leaq 0x100(%rsp), %rax
movq %rax, 0xf0(%rsp)
leaq 0xf0(%rsp), %rdi
movq %rbp, %rsi
movq %rbp, %rdx
callq 0x5384
movl $0x1, %ecx
movq %r15, %rdi
leaq 0x99c7(%rip), %rsi      # 0x3eb09
xorl %edx, %edx
callq 0x4590
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x4360
leaq 0xf0(%rsp), %rdi
movq %r13, %rsi
callq 0x43e0
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x3518e
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x4340
movl $0x1, %ecx
leaq 0xf0(%rsp), %rdi
leaq 0x9e30(%rip), %rsi      # 0x3efd2
xorl %edx, %edx
callq 0x4590
movq %rax, %r12
movq %rax, %r14
cmpq $-0x1, %rax
jne 0x351bd
movq 0xf8(%rsp), %r14
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq $0x0, 0x70(%rsp)
movb $0x0, 0x78(%rsp)
movl $0x3, %ecx
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4360
movq %r13, %rdi
leaq 0x9c43(%rip), %rsi      # 0x3ee34
callq 0x4100
testl %eax, %eax
je 0x3526d
movl $0x3, %ecx
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4360
movq %rbx, %rdi
leaq 0x9c1d(%rip), %rsi      # 0x3ee38
callq 0x4100
testl %eax, %eax
je 0x35271
movl $0x3, %ecx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4360
movq %rbx, %rdi
leaq 0x9bf7(%rip), %rsi      # 0x3ee3c
callq 0x4100
testl %eax, %eax
sete %bl
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x35273
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x35273
movb $0x1, %bl
jmp 0x3528f
movb $0x1, %bl
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3528f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x352b4
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x4340
testb %bl, %bl
je 0x352d6
addq $-0x3, %r14
movl $0x3, %edx
movq %r13, %rdi
leaq 0xf0(%rsp), %rsi
movq %r14, %rcx
callq 0x4360
jmp 0x352eb
movq %r13, %rdi
leaq 0xf0(%rsp), %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x4360
leaq 0x68(%rsp), %rdi
movq %r13, %rsi
callq 0x43e0
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x3531d
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x128(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x364d0
leaq 0x130(%rsp), %rcx
cmpq %rcx, %rax
je 0x353fc
leaq 0x128(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x30d5e
movq (%rax), %r14
movl $0x3, %ecx
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4360
movq %r13, %rdi
leaq 0x9ac3(%rip), %rsi      # 0x3ee34
callq 0x4100
testl %eax, %eax
je 0x354a6
movl $0x3, %ecx
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4360
movq %rbx, %rdi
leaq 0x9a99(%rip), %rsi      # 0x3ee38
callq 0x4100
testl %eax, %eax
je 0x354aa
movl $0x3, %ecx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4360
movq %rbx, %rdi
leaq 0x9a6f(%rip), %rsi      # 0x3ee3c
callq 0x4100
testl %eax, %eax
sete %bl
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x354ac
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x354ac
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x48(%rsp), %rdi
movq %rbp, %rsi
movq %rbp, %rdx
callq 0x5384
cmpq $-0x1, %r12
leaq 0x38(%rsp), %rax
leaq 0x28(%rsp), %rbx
je 0x355d9
movq %rax, 0x28(%rsp)
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0xd940
movq 0x16b77(%rip), %r12     # 0x4bfc8
movq %rbx, %rdi
leaq 0x7c62(%rip), %rsi      # 0x3d0bd
callq 0x45e0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %rbx, %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 0x35655
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x3565b
movb $0x1, %bl
jmp 0x354c8
movb $0x1, %bl
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x354c8
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x354ed
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x4340
testb %bl, %bl
je 0x35583
movl $0x3, %edx
movq %r13, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
leaq 0xd8(%rsp), %rbx
callq 0x4360
addq $0x188, %r14            # imm = 0x188
movq 0x158(%rsp), %rsi
movq 0x160(%rsp), %rdx
movq %r14, %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 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x3603d
movq 0x168(%rsp), %rsi
jmp 0x36035
addq $0x188, %r14            # imm = 0x188
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
movq %r14, %rdi
leaq 0xd8(%rsp), %rbx
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
jmp 0x3603d
movq %rax, 0x28(%rsp)
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0xd940
movq 0x169c8(%rip), %r12     # 0x4bfc8
movq %rbx, %rdi
leaq 0x7ab3(%rip), %rsi      # 0x3d0bd
callq 0x45e0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %rbx, %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 0x35988
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x3598e
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 0x7ad2(%rip), %rsi      # 0x3d14c
callq 0x45e0
leaq 0x168(%rsp), %rbx
movq %rbx, 0x158(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x356b3
movq %rdx, 0x158(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x168(%rsp)
jmp 0x356b9
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x160(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x48(%rsp), %rdi
movq %r13, %rsi
callq 0x43e0
movq 0x158(%rsp), %rdi
cmpq %rbx, %rdi
je 0x356fe
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3571a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x35736
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4340
movq %r13, %rdi
callq 0xcb3a
movq 0x48(%rsp), %rsi
movq %r13, %rdi
movl $0x8, %edx
callq 0x39022
movq 0x158(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x178(%rsp,%rax)
jne 0x35cb7
movq %r13, %rdi
callq 0x392ca
movq $0x0, 0xb0(%rsp)
movq 0xa8(%rsp), %rax
movb $0x0, (%rax)
leaq 0xa8(%rsp), %rdi
movl $0x6, %esi
callq 0x36469
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rbx
movq %rbx, %rdi
callq 0xd940
movq %rbx, %rdi
leaq 0x78e5(%rip), %rsi      # 0x3d0bd
callq 0x45e0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %rbx, %rdi
callq 0x4120
leaq 0x38(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x28(%rsp), %rdi
je 0x3581c
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x35822
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 0x790b(%rip), %rsi      # 0x3d14c
callq 0x45e0
leaq 0x18(%rsp), %rbx
movq %rbx, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3586e
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x35874
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x43e0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x358b2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x358ce
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x358f3
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x48(%rsp), %rsi
movq %r13, %rdi
movl $0x8, %edx
callq 0x39022
movq 0x158(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x178(%rsp,%rax)
jne 0x35cb7
movl $0x15, %edx
movq %r12, %rdi
leaq 0x9512(%rip), %rsi      # 0x3ee40
callq 0x43a0
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r12, %rdi
callq 0x43a0
movq %rax, %r14
movl $0x18, %edx
movq %rax, %rdi
leaq 0x94ff(%rip), %rsi      # 0x3ee56
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 0x35750
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 0x771e(%rip), %rsi      # 0x3d0cb
callq 0x45e0
leaq 0x168(%rsp), %rbx
movq %rbx, 0x158(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x359e6
movq %rdx, 0x158(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x168(%rsp)
jmp 0x359ec
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x160(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x48(%rsp), %rdi
movq %r13, %rsi
callq 0x43e0
movq 0x158(%rsp), %rdi
cmpq %rbx, %rdi
je 0x35a31
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x35a4d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x35a69
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4340
movq %r13, %rdi
callq 0xcb3a
movq 0x48(%rsp), %rsi
movq %r13, %rdi
movl $0x8, %edx
callq 0x39022
movq 0x158(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x178(%rsp,%rax)
jne 0x35cb7
movq %r13, %rdi
callq 0x392ca
movq $0x0, 0xb0(%rsp)
movq 0xa8(%rsp), %rax
movb $0x0, (%rax)
leaq 0xa8(%rsp), %rdi
movl $0x6, %esi
callq 0x36469
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rbx
movq %rbx, %rdi
callq 0xd940
movq %rbx, %rdi
leaq 0x75b2(%rip), %rsi      # 0x3d0bd
callq 0x45e0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %rbx, %rdi
callq 0x4120
leaq 0x38(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x28(%rsp), %rdi
je 0x35b4f
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x35b55
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 0x7557(%rip), %rsi      # 0x3d0cb
callq 0x45e0
leaq 0x18(%rsp), %rbx
movq %rbx, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x35ba1
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x35ba7
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x43e0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x35be5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x35c01
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x35c26
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x48(%rsp), %rsi
movq %r13, %rdi
movl $0x8, %edx
callq 0x39022
movq 0x158(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x178(%rsp,%rax)
jne 0x35cb7
movl $0x15, %edx
movq %r12, %rdi
leaq 0x91e3(%rip), %rsi      # 0x3ee40
callq 0x43a0
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r12, %rdi
callq 0x43a0
movq %rax, %r14
movl $0x18, %edx
movq %rax, %rdi
leaq 0x91d0(%rip), %rsi      # 0x3ee56
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 0x35a83
leaq 0x15f82(%rip), %rax     # 0x4bc40
movq %rax, 0x2e0(%rsp)
leaq 0x15f9b(%rip), %rax     # 0x4bc68
movq %rax, 0x2f0(%rsp)
movq $0x0, 0x2e8(%rsp)
movq %r13, %rdi
leaq 0x15ebd(%rip), %rsi     # 0x4bba8
callq 0x38fcc
movq 0x110(%rsp), %rdi
callq 0x4140
movl $0x298, %edi            # imm = 0x298
callq 0x4330
movq %rax, %r14
movq 0x48(%rsp), %rsi
movq %rax, %rdi
movl $0x10, %edx
callq 0x309b2
leaq 0x168(%rsp), %rax
movq %rax, 0x158(%rsp)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xd940
movq 0x16280(%rip), %rbx     # 0x4bfc8
movq %r14, 0x178(%rsp)
leaq 0x128(%rsp), %rdi
movq %r13, %rsi
callq 0x31520
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x35d85
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x4340
movl $0x15, %edx
movq %rbx, %rdi
leaq 0x90db(%rip), %rsi      # 0x3ee6f
callq 0x43a0
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x1621e(%rip), %rdi     # 0x4bfc8
callq 0x43a0
movq %rax, %r12
movl $0x14, %edx
movq %rax, %rdi
leaq 0x90c4(%rip), %rsi      # 0x3ee85
callq 0x43a0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r12, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
movl $0x3, %ecx
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4360
movq %r13, %rdi
leaq 0x902a(%rip), %rsi      # 0x3ee34
callq 0x4100
testl %eax, %eax
je 0x35e86
movl $0x3, %ecx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4360
movq %rbx, %rdi
leaq 0x9004(%rip), %rsi      # 0x3ee38
callq 0x4100
testl %eax, %eax
je 0x35e8a
movl $0x3, %ecx
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4360
movq %rbx, %rdi
leaq 0x8fde(%rip), %rsi      # 0x3ee3c
callq 0x4100
testl %eax, %eax
sete %bl
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x35e8c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x35e8c
movb $0x1, %bl
jmp 0x35ea8
movb $0x1, %bl
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x35ea8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x35ecd
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x4340
testb %bl, %bl
je 0x35f64
movl $0x3, %edx
movq %r13, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
leaq 0xd8(%rsp), %rbx
callq 0x4360
addq $0x188, %r14            # imm = 0x188
movq 0x158(%rsp), %rsi
movq 0x160(%rsp), %rdx
movq %r14, %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 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x35fb5
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x35fb5
addq $0x188, %r14            # imm = 0x188
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
movq %r14, %rdi
leaq 0xd8(%rsp), %rbx
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 %r13, %rdi
leaq 0x68(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0xee04
movq 0x120(%rsp), %rdi
movq %r13, %rsi
callq 0xef28
movq 0x178(%rsp), %rdi
leaq 0x188(%rsp), %rax
cmpq %rax, %rdi
je 0x35ffc
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x36021
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3603d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x36059
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x3607e
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xc8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3609b
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x3f8(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x418(%rsp,%rax)
je 0x350ab
leaq 0x3f8(%rsp), %rdi
leaq 0xb8(%rsp), %r14
callq 0x392ca
movl 0xec(%rsp), %ebp
movq 0x118(%rsp), %r15
leaq 0x130(%rsp), %r12
movq 0x140(%rsp), %rbx
cmpq %r12, %rbx
je 0x36107
movq 0x40(%rbx), %rdi
callq 0x392ca
movq %rbx, %rdi
callq 0x4230
movq %rax, %rbx
cmpq %r12, %rax
jne 0x360ee
leaq 0xa8(%rsp), %rsi
movq %r15, %rdi
callq 0x41c0
leaq 0x15b22(%rip), %rax     # 0x4bc40
leaq 0x590(%rsp), %rbx
movq %rax, -0x10(%rbx)
leaq 0x15b37(%rip), %rax     # 0x4bc68
movq %rax, (%rbx)
movq $0x0, -0x8(%rbx)
leaq 0x15a65(%rip), %rsi     # 0x4bba8
leaq 0x3f8(%rsp), %rdi
callq 0x38fcc
movq %rbx, %rdi
callq 0x4140
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
je 0x36175
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x128(%rsp), %rdi
callq 0x314a8
jmp 0x34f65
jmp 0x3637c
jmp 0x36390
jmp 0x36384
jmp 0x361dd
jmp 0x36200
jmp 0x36200
jmp 0x36384
movq %rax, %r15
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x362ae
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x362ae
jmp 0x36384
jmp 0x362ab
jmp 0x36390
jmp 0x36384
movq %rax, %r15
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x36203
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x36203
jmp 0x36200
movq %rax, %r15
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x363a0
movq 0x38(%rsp), %rsi
jmp 0x362cf
jmp 0x36384
jmp 0x36279
movq %rax, %r15
jmp 0x3642f
movq %rax, %r15
jmp 0x36454
jmp 0x36375
jmp 0x36375
jmp 0x36384
jmp 0x362ab
jmp 0x36384
movq %rax, %r15
movl $0x298, %esi            # imm = 0x298
movq %r14, %rdi
jmp 0x362d2
movq %rax, %r15
leaq 0x158(%rsp), %rdi
callq 0xee68
jmp 0x363a0
jmp 0x36384
jmp 0x362fb
movq %rax, %r15
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x362fe
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x362fe
jmp 0x36375
jmp 0x36375
jmp 0x36375
jmp 0x362fb
movq %rax, %r15
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x363a0
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x363a0
jmp 0x3634b
jmp 0x36390
jmp 0x36326
jmp 0x3634b
jmp 0x36375
movq %rax, %r15
jmp 0x363d8
jmp 0x36389
jmp 0x36375
movq %rax, %r15
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x363bc
movq 0x168(%rsp), %rsi
jmp 0x363b4
jmp 0x3637c
movq %rax, %r15
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3634e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x3634e
jmp 0x36390
jmp 0x3634b
movq %rax, %r15
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x36393
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x36393
movq %rax, %r15
jmp 0x363bc
jmp 0x3637c
movq %rax, %r15
jmp 0x36422
movq %rax, %r15
jmp 0x363a0
movq %rax, %r15
jmp 0x363fd
jmp 0x36390
movq %rax, %r15
leaq 0x158(%rsp), %rdi
callq 0xcdd6
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x363bc
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x363d8
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x363fd
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x36422
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x3f8(%rsp), %rdi
callq 0xcdd6
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x36454
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x128(%rsp), %rdi
callq 0x314a8
movq %r15, %rdi
callq 0x45a0