// File: /workspace/github_cpp_makefile_star2_O1/BenLangmead[P]bowtie/ebwt_build.cpp
// Function: void driver<SString<char>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, EList<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, 128>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
static void driver(const string& infile,
                   EList<string>& infiles,
                   const string& outfile,
                   bool reverse = false)
{
	EList<FileBuf*> is;
	bool bisulfite = false;
	RefReadInParams refparams(reverse ? reverseType : REF_READ_FORWARD, nsToAs, bisulfite);
	assert_gt(infiles.size(), 0);
	if(format == CMDLINE) {
		// Adapt sequence strings to stringstreams open for input
		stringstream *ss = new stringstream();
		for(size_t i = 0; i < infiles.size(); i++) {
			(*ss) << ">" << i << endl << infiles[i] << endl;
		}
		FileBuf *fb = new FileBuf(ss);
		assert(fb != NULL);
		assert(!fb->eof());
		assert(fb->get() == '>');
		ASSERT_ONLY(fb->reset());
		assert(!fb->eof());
		is.push_back(fb);
	} else {
		// Adapt sequence files to ifstreams
		for(size_t i = 0; i < infiles.size(); i++) {
			FileBuf *fb = NULL;
			if (FileBuf::isGzippedFile(infiles[i].c_str())) {
				gzFile zFp = gzopen(infiles[i].c_str(), "rb");
				if (zFp == NULL) {
					std::cerr << "Error: could not open " << infiles[i].c_str() << std::endl;
					throw 1;
				}
				fb = new FileBuf(zFp);
			} else {
				FILE *f = fopen(infiles[i].c_str(), "rb");
				if (f == NULL) {
					cerr << "Error: could not open "<< infiles[i] << endl;
					throw 1;
				}
				fb = new FileBuf(f);
			}
			assert(fb != NULL);
			assert(!fb->eof());
			assert(fb->get() == '>');
			ASSERT_ONLY(fb->reset());
			assert(!fb->eof());
			is.push_back(fb);
		}
	}
	// Vector for the ordered list of "records" comprising the input
	// sequences.  A record represents a stretch of unambiguous
	// characters in one of the input sequences.
	EList<RefRecord> szs;
	EList<uint32_t> plens;
	std::pair<size_t, size_t> sztot;
	{
		if(verbose) cout << "Reading reference sizes" << endl;
		Timer _t(cout, "  Time reading reference sizes: ", verbose);
		if(!reverse && (writeRef || justRef)) {
			// For forward reference, dump it to .3.ebwt and .4.ebwt
			// files
			string file3 = outfile + ".3." + gEbwt_ext;
			string file4 = outfile + ".4." + gEbwt_ext;
			// Open output stream for the '.3.ebwt' file which will
			// hold the size records.
			ofstream fout3(file3.c_str(), ios::binary);
			if(!fout3.good()) {
				cerr << "Could not open index file for writing: \"" << file3 << "\"" << endl
					 << "Please make sure the directory exists and that permissions allow writing by" << endl
					 << "Bowtie." << endl;
				throw 1;
			}
			BitpairOutFileBuf bpout(file4.c_str());
			// Read in the sizes of all the unambiguous stretches of
			// the genome into a vector of RefRecords.  The input
			// streams are reset once it's done.
			writeU<int32_t>(fout3, 1, bigEndian); // endianness sentinel
			TIndexOff numSeqs = 0;
			sztot = fastaRefReadSizes(is, szs, plens, refparams, &bpout, numSeqs);
			writeU<TIndexOffU>(fout3, (TIndexOffU)szs.size(), bigEndian); // write # records
			for(size_t i = 0; i < szs.size(); i++) szs[i].write(fout3, bigEndian);
			if(sztot.first == 0) {
				cerr << "Error: No unambiguous stretches of characters in the input.  Aborting..." << endl;
				throw 1;
			}
			assert_gt(sztot.first, 0);
			assert_gt(sztot.second, 0);
			bpout.close();
			fout3.close();
#ifndef NDEBUG
			if(sanityCheck) {
				BitPairReference bpr(
					outfile, // ebwt basename
					true,    // sanity check?
					&infiles,// files to check against
					NULL,    // sequences to check against
					format == CMDLINE, // whether infiles contains strings
					true,    // load sequence?
					false,   // use memory-mapped files
					false,   // use shared memory
					false,   // sweep through memory-mapped memory
					false,   // be talkative
					false);  // be talkative
			}
#endif
		} else {
			// Read in the sizes of all the unambiguous stretches of the
			// genome into a vector of RefRecords
			TIndexOff numSeqs = 0;
			sztot = fastaRefReadSizes(is, szs, plens, refparams, NULL, numSeqs);
		}
	}
	if(justRef) return;
	assert_gt(sztot.first, 0);
	assert_gt(sztot.second, 0);
	assert_gt(szs.size(), 0);
	// Construct Ebwt from input strings and parameters
	Ebwt ebwt(TStr(),
		  packed,
		  lineRate,
		  linesPerSide,
		  offRate,      // suffix-array sampling rate
		  -1,           // ISA sampling rate
		  ftabChars,    // number of chars in initial arrow-pair calc
		  nthreads,
		  outfile,      // basename for .?.ebwt files
		  !reverse,     // fw
		  !entireSA,    // useBlockwise
		  bmax,         // block size for blockwise SA builder
		  bmaxMultSqrt, // block size as multiplier of sqrt(len)
		  bmaxDivN,     // block size as divisor of len
		  noDc? 0 : dcv,// difference-cover period
		  is,           // list of input streams
		  szs,          // list of reference sizes
		  plens,        // list of not-all-gap reference sequence lengths
		  (TIndexOffU)sztot.first,  // total size of all unambiguous ref chars
		  refparams,    // reference read-in parameters
		  seed,         // pseudo-random number generator seed
		  -1,           // override offRate
		  -1,           // override isaRate
		  verbose,      // be talkative
		  autoMem,      // pass exceptions up to the toplevel so that we can adjust memory settings automatically
		  sanityCheck,  // verify results and internal consistency
		  false);       // are we building a bt2 index?
	// Note that the Ebwt is *not* resident in memory at this time.  To
	// load it into memory, call ebwt.loadIntoMemory()
	if(verbose) {
		// Print Ebwt's vital stats
		ebwt.eh().print(cout);
	}
	if(sanityCheck) {
		// Try restoring the original string (if there were
		// multiple texts, what we'll get back is the joined,
		// padded string, not a list)
		ebwt.loadIntoMemory(
			-1,
			false,
			false);
		BTRefString s2; ebwt.restore(s2);
		ebwt.evictFromMemory();
		{
			BTRefString joinedss = Ebwt::join<BTRefString >(
				is,          // list of input streams
				szs,         // list of reference sizes
				(TIndexOffU)sztot.first, // total size of all unambiguous ref chars
				refparams,   // reference read-in parameters
				seed);       // pseudo-random number generator seed
			if(refparams.reverse == REF_READ_REVERSE) {
				joinedss.reverse();
			}
			assert_eq(joinedss.length(), s2.length());
			assert(sstr_eq(joinedss, s2));
		}
		if(verbose) {
			if(s2.length() < 1000) {
				cout << "Passed restore check: " << s2.toZBufXForm("ACGTN") << endl;
			} else {
				cout << "Passed restore check: (" << s2.length() << " chars)" << endl;
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20348, %rsp          # imm = 0x20348
movq %rsi, 0x18(%rsp)
movq %rdi, %r14
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x28(%rsp)
xorl %eax, %eax
movq %rax, 0x30(%rsp)
movq $0x80, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movl %edx, %eax
movl %edx, 0x4(%rsp)
testl %edx, %edx
je 0xb298
movl 0x32b1c(%rip), %eax     # 0x3ddb4
movb 0x32b12(%rip), %cl      # 0x3ddb0
movl %eax, 0x8(%rsp)
movb %cl, 0xc(%rsp)
movb $0x0, 0xd(%rsp)
cmpl $0x7, 0x32aee(%rip)     # 0x3dda0
jne 0xb3db
movl $0x188, %edi            # imm = 0x188
callq 0x5370
movq %rax, 0x10(%rsp)
movq %rax, %rdi
callq 0x5200
cmpq $0x0, 0x18(%r14)
je 0xb388
movq 0x10(%rsp), %r12
addq $0x10, %r12
movl $0x8, %r15d
xorl %r13d, %r13d
leaq 0x23fc6(%rip), %rbx     # 0x2f2b9
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x5400
movq %r12, %rdi
movq %r13, %rsi
callq 0x51e0
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x5340
movsbl %al, %esi
movq %rbp, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x51f0
movq 0x8(%r14), %rcx
movq -0x8(%rcx,%r15), %rsi
movq (%rcx,%r15), %rdx
movq %rax, %rdi
callq 0x5400
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x5340
movsbl %al, %esi
movq %rbp, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x51f0
incq %r13
addq $0x20, %r15
cmpq 0x18(%r14), %r13
jb 0xb2f3
movl $0x42040, %edi          # imm = 0x42040
callq 0x5370
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movl $0x40000, %ecx          # imm = 0x40000
movq %rcx, 0x28(%rax)
movq %rcx, 0x20(%rax)
movb $0x0, 0x30(%rax)
movq $0x0, 0x40038(%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 0x18(%rax)
leaq 0x330(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x12670
jmp 0xb4d2
cmpq $0x0, 0x18(%r14)
je 0xb4d2
xorl %ebp, %ebp
movl $0x40000, %ebx          # imm = 0x40000
leaq 0x330(%rsp), %r12
xorl %r15d, %r15d
movq $0x0, 0x330(%rsp)
movq 0x8(%r14), %rax
movq (%rax,%rbp), %rdi
callq 0x126f6
movq 0x8(%r14), %rcx
movq (%rcx,%rbp), %rdi
testb %al, %al
je 0xb466
leaq 0x22d9d(%rip), %rsi     # 0x2e1c1
callq 0x5540
movq %rax, %r13
testq %rax, %rax
je 0xbd4e
movl $0x42040, %edi          # imm = 0x42040
callq 0x5370
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movq %rbx, 0x28(%rax)
movq %rbx, 0x20(%rax)
movb $0x0, 0x30(%rax)
movq $0x0, 0x40038(%rax)
movq %r13, 0x8(%rax)
jmp 0xb4ac
leaq 0x22d54(%rip), %rsi     # 0x2e1c1
callq 0x53d0
testq %rax, %rax
je 0xbda8
movq %rax, %r13
movl $0x42040, %edi          # imm = 0x42040
callq 0x5370
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movq %rbx, 0x28(%rax)
movq %rbx, 0x20(%rax)
movb $0x0, 0x30(%rax)
movq $0x0, 0x40038(%rax)
movq %r13, (%rax)
movq %rax, 0x330(%rsp)
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x12670
incq %r15
addq $0x20, %rbp
cmpq 0x18(%r14), %r15
jb 0xb3f8
leaq 0x90(%rsp), %r12
movabsq $-0x100000000, %rsi     # imm = 0xFFFFFFFF00000000
movq %rsi, -0x8(%r12)
xorl %eax, %eax
movq %rax, (%r12)
movl $0x80, %ecx
movq %rcx, 0x8(%r12)
movq %rax, 0x10(%r12)
leaq 0xf0(%rsp), %rdx
movq %rsi, -0x8(%rdx)
movq %rax, (%rdx)
movq %rcx, 0x8(%rdx)
movq %rax, 0x10(%rdx)
cmpb $0x1, 0x32850(%rip)     # 0x3dd6c
jne 0xb564
movq 0x2fa7b(%rip), %rbx     # 0x3afa0
leaq 0x24745(%rip), %rsi     # 0x2fc71
movl $0x17, %edx
movq %rbx, %rdi
callq 0x5400
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5340
movsbl %al, %esi
movq 0x2fa49(%rip), %rdi     # 0x3afa0
callq 0x5040
movq %rax, %rdi
callq 0x51f0
movb 0x32802(%rip), %bl      # 0x3dd6c
xorl %edi, %edi
callq 0x5300
movq %rax, 0x68(%rsp)
movq 0x2fa23(%rip), %rax     # 0x3afa0
movq %rax, 0x70(%rsp)
leaq 0x24700(%rip), %rax     # 0x2fc89
movq %rax, 0x78(%rsp)
movb %bl, 0x80(%rsp)
cmpb $0x0, 0x4(%rsp)
je 0xb5d5
leaq 0x330(%rsp), %r9
movl $0x0, (%r9)
leaq 0x28(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xe8(%rsp), %rdx
leaq 0x8(%rsp), %rcx
xorl %r8d, %r8d
callq 0x2c2ed
movq %rax, %r13
jmp 0xb90d
cmpb $0x0, 0x327d5(%rip)     # 0x3ddb1
jne 0xb5e7
cmpb $0x1, 0x327cd(%rip)     # 0x3ddb2
jne 0xb59c
leaq 0x340(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x18(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x330(%rsp), %rdi
callq 0x10866
leaq 0x24694(%rip), %rsi     # 0x2fcaa
leaq 0x330(%rsp), %rdi
callq 0x5720
leaq 0x34826(%rip), %rbx     # 0x3fe50
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
leaq 0x330(%rsp), %rdi
callq 0x5120
leaq 0x58(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb665
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0xb66b
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x330(%rsp), %rdi
cmpq %r14, %rdi
je 0xb6a0
movq 0x340(%rsp), %rsi
incq %rsi
callq 0x5380
leaq 0x330(%rsp), %rdi
movq %r14, (%rdi)
movq 0x18(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0x10866
leaq 0x245e8(%rip), %rsi     # 0x2fcae
leaq 0x330(%rsp), %rdi
callq 0x5720
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
leaq 0x330(%rsp), %rdi
callq 0x5120
leaq 0xb8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb717
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
jmp 0xb71e
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0xb0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x330(%rsp), %rdi
cmpq %r14, %rdi
je 0xb756
movq 0x340(%rsp), %rsi
incq %rsi
callq 0x5380
movq 0x48(%rsp), %rsi
leaq 0x130(%rsp), %rdi
movl $0x4, %edx
callq 0x53b0
movq 0x130(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x150(%rsp,%rax)
jne 0xbe07
movq 0xa8(%rsp), %rsi
leaq 0x330(%rsp), %rdi
callq 0x12816
cmpl $0x0, 0x325f1(%rip)     # 0x3dd94
movl $0x1, %eax
movl $0x1000000, %ecx        # imm = 0x1000000
cmovel %eax, %ecx
leaq 0x24(%rsp), %rsi
movl %ecx, (%rsi)
leaq 0x130(%rsp), %rdi
movl $0x4, %edx
callq 0x5460
leaq 0x10c(%rsp), %r9
movl $0x0, (%r9)
leaq 0x28(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xe8(%rsp), %rdx
leaq 0x8(%rsp), %rcx
leaq 0x330(%rsp), %r8
callq 0x2c2ed
movq %rax, %r13
movl 0xa0(%rsp), %eax
cmpl $0x0, 0x32584(%rip)     # 0x3dd94
movl %eax, %ecx
bswapl %ecx
cmovel %eax, %ecx
leaq 0x24(%rsp), %rsi
movl %ecx, (%rsi)
leaq 0x130(%rsp), %rdi
movl $0x4, %edx
callq 0x5460
cmpq $0x0, 0xa0(%rsp)
je 0xb879
xorl %r14d, %r14d
leaq 0x130(%rsp), %rbx
xorl %r15d, %r15d
movq 0x90(%rsp), %rdi
addq %r14, %rdi
xorl %edx, %edx
cmpl $0x0, 0x32537(%rip)     # 0x3dd94
setne %dl
movq %rbx, %rsi
callq 0x128a8
incq %r15
addq $0xc, %r14
cmpq 0xa0(%rsp), %r15
jb 0xb849
testq %r13, %r13
je 0xbeb5
leaq 0x330(%rsp), %rdi
callq 0x1290e
leaq 0x130(%rsp), %rdi
callq 0x54e0
movq 0x2f6e5(%rip), %rax     # 0x3af88
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x138(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x130(%rsp,%rcx)
callq 0x52a0
leaq 0x228(%rsp), %rdi
callq 0x5130
movq 0xa8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb8f1
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5380
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xb90d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5380
leaq 0x68(%rsp), %rdi
callq 0xff2c
cmpb $0x0, 0x32494(%rip)     # 0x3ddb2
jne 0xbccf
movq %r13, 0x10(%rsp)
leaq 0x2f190(%rip), %rax     # 0x3aac0
movq %rax, 0x110(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x118(%rsp)
movq $0x0, 0x128(%rsp)
movzbl 0x3242a(%rip), %edx     # 0x3dd80
movl 0x32414(%rip), %ecx     # 0x3dd70
movl 0x32411(%rip), %r8d     # 0x3dd74
movl 0x3240e(%rip), %r9d     # 0x3dd78
movl 0x3240c(%rip), %eax     # 0x3dd7c
movq %rax, 0xe0(%rsp)
movl 0x4(%rsp), %eax
xorb $0x1, %al
movl %eax, 0x4(%rsp)
xorl %r11d, %r11d
cmpl $0x0, 0x32420(%rip)     # 0x3ddac
movl 0x32426(%rip), %eax     # 0x3ddb8
movq %rax, 0xd8(%rsp)
sete %sil
movl 0x323e0(%rip), %eax     # 0x3dd84
movq %rax, 0xd0(%rsp)
movl 0x323d6(%rip), %eax     # 0x3dd88
movq %rax, 0xc8(%rsp)
movl 0x323cb(%rip), %r12d    # 0x3dd8c
xorl %ebx, %ebx
cmpl $0x0, 0x323de(%rip)     # 0x3dda8
jne 0xb9d2
movl 0x323be(%rip), %ebx     # 0x3dd90
movl 0x323c4(%rip), %eax     # 0x3dd9c
movzbl 0x3238c(%rip), %r10d    # 0x3dd6c
movzbl 0x323bc(%rip), %r13d    # 0x3dda4
movzbl 0x323a8(%rip), %r15d    # 0x3dd98
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movb %sil, %r11b
movzbl 0x4(%rsp), %r14d
leaq 0x330(%rsp), %rdi
leaq 0x110(%rsp), %rsi
pushq $0x0
pushq %r15
pushq %r13
pushq %r10
pushq %rbp
pushq %rbp
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
pushq %rax
leaq 0x40(%rsp), %rax
pushq %rax
movq 0x50(%rsp), %r15
pushq %r15
leaq 0x130(%rsp), %rax
pushq %rax
leaq 0xd8(%rsp), %rax
pushq %rax
leaq 0x80(%rsp), %rax
pushq %rax
pushq %rbx
pushq %r12
pushq 0x138(%rsp)
pushq 0x148(%rsp)
pushq %r11
pushq %r14
pushq 0xa8(%rsp)
pushq 0x170(%rsp)
pushq 0x180(%rsp)
pushq %r10
callq 0x1299c
addq $0xb0, %rsp
leaq 0x110(%rsp), %rdi
callq 0xdd8e
cmpb $0x1, 0x322d9(%rip)     # 0x3dd6c
leaq 0x90(%rsp), %r12
jne 0xbab1
leaq 0x428(%rsp), %rdi
movq 0x2f4f4(%rip), %rsi     # 0x3afa0
callq 0xdfa4
cmpb $0x1, 0x322e0(%rip)     # 0x3dd98
jne 0xbcc2
subq $0x8, %rsp
leaq 0x338(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
callq 0x6b76
addq $0x10, %rsp
leaq 0x130(%rsp), %rsi
leaq 0x2efcd(%rip), %rax     # 0x3aac0
movq %rax, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsi)
movq $0x0, 0x18(%rsi)
leaq 0x330(%rsp), %rdi
callq 0x6946
leaq 0x330(%rsp), %rdi
callq 0x1380c
movl 0x32276(%rip), %r9d     # 0x3dd9c
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x88(%rsp), %rdx
leaq 0x8(%rsp), %r8
movl %r15d, %ecx
callq 0x138d4
cmpl $0x1, 0x8(%rsp)
jne 0xbb9f
movq 0x80(%rsp), %rdx
cmpq $0x2, %rdx
jb 0xbb9f
movq $-0x1, %rax
xorl %ecx, %ecx
movq 0x70(%rsp), %rsi
movb (%rsi,%rcx), %dil
addq %rsi, %rdx
movb (%rax,%rdx), %dl
movb %dl, (%rsi,%rcx)
movq 0x70(%rsp), %rdx
addq 0x80(%rsp), %rdx
movb %dil, (%rax,%rdx)
incq %rcx
movq 0x80(%rsp), %rdx
movq %rdx, %rsi
shrq %rsi
decq %rax
cmpq %rsi, %rcx
jb 0xbb63
leaq 0x68(%rsp), %rdi
callq 0xdd8e
cmpb $0x1, 0x321bc(%rip)     # 0x3dd6c
jne 0xbcb5
cmpq $0x3e7, 0x148(%rsp) # imm = 0x3E7
ja 0xbc17
movq 0x2f3d5(%rip), %rbx     # 0x3afa0
leaq 0x241a6(%rip), %rsi     # 0x2fd78
movl $0x16, %edx
movq %rbx, %rdi
callq 0x5400
leaq 0x241a9(%rip), %rsi     # 0x2fd8f
leaq 0x130(%rsp), %rdi
callq 0x13990
movq %rax, %r14
testq %rax, %rax
je 0xbc70
movq %r14, %rdi
callq 0x5150
movq 0x2f396(%rip), %rdi     # 0x3afa0
movq %r14, %rsi
movq %rax, %rdx
callq 0x5400
jmp 0xbc8e
movq 0x2f382(%rip), %rdi     # 0x3afa0
leaq 0x24170(%rip), %rsi     # 0x2fd95
movl $0x17, %edx
callq 0x5400
movq 0x148(%rsp), %rsi
movq 0x2f362(%rip), %rdi     # 0x3afa0
callq 0x51e0
movq %rax, %rbx
leaq 0x24160(%rip), %rsi     # 0x2fdad
movl $0x7, %edx
movq %rax, %rdi
callq 0x5400
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5340
jmp 0xbca2
movq 0x2f329(%rip), %rax     # 0x3afa0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %rdi
movl 0x20(%rax,%rcx), %esi
orl $0x1, %esi
callq 0x5630
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5340
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x51f0
leaq 0x130(%rsp), %rdi
callq 0xdd8e
leaq 0x330(%rsp), %rdi
callq 0x139ec
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0xbcf7
callq 0x5450
xorps %xmm0, %xmm0
leaq 0xf0(%rsp), %rax
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xbd1a
callq 0x5450
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movq $0x0, 0x10(%r12)
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xbd3c
callq 0x5450
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rax
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
addq $0x20348, %rsp          # imm = 0x20348
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2f29b(%rip), %rdi     # 0x3aff0
leaq 0x23efe(%rip), %rsi     # 0x2fc5a
movl $0x16, %edx
callq 0x5400
movq 0x8(%r14), %rax
movq (%rax,%rbp), %rsi
movq 0x2f27b(%rip), %rdi     # 0x3aff0
callq 0x5350
movq %rax, %rdi
callq 0x5170
movl $0x4, %edi
callq 0x5180
movl $0x1, (%rax)
movq 0x2f1af(%rip), %rsi     # 0x3af48
movq %rax, %rdi
xorl %edx, %edx
callq 0x5650
jmp 0xbefa
movq 0x2f241(%rip), %rdi     # 0x3aff0
leaq 0x23ea4(%rip), %rsi     # 0x2fc5a
movl $0x16, %edx
callq 0x5400
movq 0x8(%r14), %rax
movq (%rax,%rbp), %rsi
movq 0x8(%rax,%rbp), %rdx
movq 0x2f21c(%rip), %rdi     # 0x3aff0
callq 0x5400
movq %rax, %rdi
callq 0x5170
movl $0x4, %edi
callq 0x5180
movl $0x1, (%rax)
movq 0x2f150(%rip), %rsi     # 0x3af48
movq %rax, %rdi
xorl %edx, %edx
callq 0x5650
jmp 0xbefa
movq 0x2f1e2(%rip), %rdi     # 0x3aff0
leaq 0x23e9d(%rip), %rsi     # 0x2fcb2
movl $0x28, %edx
callq 0x5400
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x2f1c0(%rip), %rdi     # 0x3aff0
callq 0x5400
movq %rax, %rbx
leaq 0x23e9a(%rip), %rsi     # 0x2fcd9
movl $0x1, %edx
movq %rax, %rdi
callq 0x5400
movq %rbx, %rdi
callq 0x5170
movq %rax, %rbx
leaq 0x23e7d(%rip), %rsi     # 0x2fcdb
movl $0x4b, %edx
movq %rax, %rdi
callq 0x5400
movq %rbx, %rdi
callq 0x5170
movq %rax, %rbx
leaq 0x23eaa(%rip), %rsi     # 0x2fd27
movl $0x7, %edx
movq %rax, %rdi
callq 0x5400
movq %rbx, %rdi
callq 0x5170
movl $0x4, %edi
callq 0x5180
movl $0x1, (%rax)
movq 0x2f09f(%rip), %rsi     # 0x3af48
movq %rax, %rdi
xorl %edx, %edx
callq 0x5650
jmp 0xbefa
movq 0x2f134(%rip), %rdi     # 0x3aff0
leaq 0x23e6c(%rip), %rsi     # 0x2fd2f
movl $0x48, %edx
callq 0x5400
movq 0x2f11c(%rip), %rdi     # 0x3aff0
callq 0x5170
movl $0x4, %edi
callq 0x5180
movl $0x1, (%rax)
movq 0x2f058(%rip), %rsi     # 0x3af48
movq %rax, %rdi
xorl %edx, %edx
callq 0x5650
jmp 0xbfa6
jmp 0xbfdb
jmp 0xbfdb
movq %rax, %rbx
jmp 0xbfeb
jmp 0xbf13
movq %rax, %rbx
movq 0x330(%rsp), %rdi
cmpq %r14, %rdi
je 0xc008
movq 0x340(%rsp), %rsi
jmp 0xc000
movq %rax, %rbx
jmp 0xc008
jmp 0xbf3e
movq %rax, %rbx
movq 0x330(%rsp), %rdi
cmpq %r14, %rdi
je 0xc024
movq 0x340(%rsp), %rsi
jmp 0xc01c
jmp 0xbf97
movq %rax, %rbx
jmp 0xbfb6
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0xdd8e
jmp 0xc02e
movq %rax, %rbx
movl $0x188, %esi            # imm = 0x188
movq 0x10(%rsp), %rdi
callq 0x5380
jmp 0xc087
jmp 0xc084
movq %rax, %rbx
jmp 0xc024
jmp 0xbfdb
jmp 0xc084
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0xdd8e
leaq 0x330(%rsp), %rdi
callq 0x139ec
jmp 0xc02e
jmp 0xbfdb
movq %rax, %rbx
jmp 0xc02e
jmp 0xc084
jmp 0xc084
jmp 0xc084
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0x5520
movq 0xa8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xc008
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5380
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xc024
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5380
leaq 0x68(%rsp), %rdi
callq 0xff2c
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0xc056
callq 0x5450
xorps %xmm0, %xmm0
leaq 0xf0(%rsp), %rax
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xc087
callq 0x5450
xorps %xmm0, %xmm0
leaq 0x90(%rsp), %rax
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
jmp 0xc087
jmp 0xc084
jmp 0xc084
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xc0a9
callq 0x5450
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rax
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rbx, %rdi
callq 0x56a0