// File: /workspace/github_cpp_makefile_star2_O3/CominLab[P]QCluster/qcluster.cc
// Function: main
int main(int argc, char **argv)
{
	int num_clusters = 5;  // target number of clusters
	char dist_type = 'e'; // default to L2
	int K = 2;  // k-mer size
	bool normalize_matrix_flag = false; // make columns univariant ("whiten");
		// off by default
	int normalize = 2; // normalize each row. Deafult: method 2
	bool redistribute = true; //Redistribute missing quality by default
	int e_method = 1;
	int p_method = 1;
	double pseudocount = PC; // pseudocount for k-mers
	bool rc_flag = false; // append reverse complement to each sequence;
		// off by default
	unsigned int random_seed = time(NULL); // initial seed
	int num_trials = 0; // later we check if it was specified using "-t" arg
		// and set the correct default if it was not; note that the default 
		// depends on whether consensus clustering is performed
	int verbose_level = 0;
	bool write_flag = false; // write sequences by cluster; off by default
	int default_max_iterations = 1000;

	int opt;
	while((opt = getopt(argc, argv, "c:d:e:k:m:N:nP:p:q:rRsS:t:vwh")) != -1 ){
		switch(opt){
            case 'c':
                num_clusters = atoi(optarg);
                break;
			case 'd':
                dist_type = *optarg;
                break;
			case 'e':
				e_method = atoi(optarg);
				break;
            case 'k':
                K = atoi(optarg);
                break;
			case 'm':
				max_iterations = atoi(optarg);
				//If max_iterations < 2 the default value will be restored
				if (max_iterations<2) max_iterations = default_max_iterations;
				break;
			case 'N':
				normalize = atoi(optarg);
				break;
            case 'n':
                normalize_matrix_flag = true;
                break;
			case 'P':
				p_method = atoi(optarg);
				if (p_method<1 || p_method>3) p_method = 2;
				break;				
			case 'p':
				pseudocount = atof(optarg);
				break;
			case 'R':
				//Do not redistribute quality
				redistribute = false;
				break;
            case 'r':
                rc_flag = true;
                break;
			case 'S':
				random_seed = atoi(optarg);
				break;
            case 't':
                num_trials = atoi(optarg);
                break;
            case 'v':
                ++verbose_level;
                break;
            case 'w':
                write_flag = true;
                break;
            case 'h':
				print_usage(argv[0]);
				return EXIT_SUCCESS;
            case '?':
                print_usage(argv[0]);
                return EXIT_FAILURE;
            default:
                // You won't actually get here
                break;
        }
	}

	if (dist_type != 'a'){
		p_method = 0;//No calculation of expected freq and expected quality
		e_method = 0;
	}

	// if "-t" argument was absent, use the appropriate default
	if (!num_trials) {
		num_trials = 1;
	}

	if(argc != optind + 1){
		cout<<"Missing/extra input file name"<<endl;
		print_usage(argv[0]);
		return EXIT_FAILURE;
	}
	char* fastq_file_name = *(argv + optind );

	// initialize random number generator
	srand(random_seed);

	// initialize constants
	int L = 1; // length of the freq. vector L = NUM_NT**K
	for(int k=0; k<K; ++k){
		L *= NUM_NT;
	}

	// count sequences
	int N = CountReads(fastq_file_name);  // number of sequences
	if (verbose_level>0){
		cerr<<"Found "<<N<<" sequences\n";
	}

	// read sequences and build count matrix
	RecordGenerator rec_gen(fastq_file_name);
	double **freq = new double*[N];
	freq[0] = new double[N * L];
	double **quality = new double*[N];
	for (int i=0; i<N; i++) quality[i] = new double[L];
	
	double **freq_1  = new double*[N];
	freq_1[0] = new double[N * NUM_NT];
	double **quality_1 = new double*[N];
	for (int i=0; i<N; i++) quality_1[i] = new double[NUM_NT];
	
	//Vector for calculus of E(Pxi)2
	double *avg_quality_1 = new double[NUM_NT];
	for(int i=0; i<NUM_NT; i++) avg_quality_1[i] = 0;
	
	//Vector for calculus of E(Pxi)3
	double **avg_quality = new double*[L];
	for (int i=0; i<L; i++) {
		avg_quality[i] = new double[NUM_NT];
		for (int j=0; j<NUM_NT; j++) avg_quality[i][j] = 0;
	}
	
	//For each read we count the number of kmers
	for(int i=0; i<N; ++i){
		SeqRecord rec = rec_gen.next();
		string seq = rc_flag ? rec.seq() + rec.rc().seq() : rec.seq();
		freq[i] = freq[0] + i*L;

		//Calculate frequencies of individual bases
		freq_1[i] = freq_1[0] + i*NUM_NT;
		fill_overlap_count_vector(seq, rec.qual(), 1, freq_1[i], 
								  quality_1[i], false, pseudocount, 
								  avg_quality_1, NULL, NULL, false);
		
		//Calculate frequencies of kmers
		fill_overlap_count_vector(seq, rec.qual(), K, freq[i], quality[i],
								normalize, pseudocount, NULL, avg_quality, 
								freq_1[i], redistribute);
	}
	
	if (verbose_level>0){
		cerr<<"Read counts calculated\n";
	}

	
	//Compute the expected quality of each kmer
	double *expected_qual = NULL;
	if (e_method != 0) {
		expected_qual = new double[L];
		calculate_quality_expected_value(e_method, N, K, L, freq, quality,
						freq_1, avg_quality_1, avg_quality, expected_qual);
	}
	
	//Expected frequancy of each kmer
	double *expected_freq = NULL;
	//Instantiate the vector only if p_method is global (P1G or P2G)
	if (p_method==2 || p_method==3) expected_freq = new double[L];
	
	//P1G Average frequency of every word over the entire dataset
	if (p_method==2)
		expected_frequency_p1global(N, K, L, expected_freq, freq);
	
	//P2G Markovian model based on average frequency of single bases
	if (p_method==3)
		expected_frequency_p2global(N, K, L, expected_freq, freq_1);
	

	
	
	// whiten if requested; in this case reset the distance to euclidean L2
	if (normalize_matrix_flag){
		dist_type = 'e';
		normalize_freq_matrix(freq, quality, N, L);
	}
	if (verbose_level > 0){
		cerr<<"Word frequencies calculated\n";
	}


	// hard EM clustering
	int* assignment = new int[N];
	double* Z = new double[num_clusters * N];
		if (verbose_level > 0) {
			cerr<<"Running regular EM clustering "<<num_trials<<" times "
			"to chose the best partitioning"<<endl;
		}
		num_clusters = hard_em(num_clusters, N, L, freq, quality, expected_qual, 
			quality_1, expected_freq, NUM_NT, freq_1, assignment, Z, num_trials, 
			dist_type, verbose_level);
		
	if (verbose_level > 0){
		cerr<<"Clustering done\n";
	}

	// release memory previously allocated for frequency data
	delete[] freq[0];
	delete[] freq;
	delete[] freq_1[0];
	delete[] freq_1;
	
	for(int i=0; i<N; i++) {
		delete[] quality[i];
		delete[] quality_1[i];
	}
	for(int i=0; i<L; i++)
		delete[] avg_quality[i];
	delete[] quality;
	delete[] quality_1;
	delete[] avg_quality_1;
	delete[] avg_quality;
	if (p_method==2 || p_method==3) delete [] expected_freq;
	if (e_method != 0) delete[] expected_qual;

	// reassign cluster names so that they are sorted 
	// in the descending order of the number of members
	int* num_members = new int[num_clusters];
	int* ix = new int[num_clusters];
	int* rix = new int[num_clusters];
	for (int i=0; i<num_clusters; ++i){
		*(num_members + i) = 0;
		*(ix + i) = i;
	}
	for (int i=0; i<N; ++i){
		num_members[assignment[i]]++;
	}
	for (int i=0; i<num_clusters; ++i){
		int max_pos = i;
		for (int j=i+1; j<num_clusters; ++j){
			if (num_members[ix[j]] > num_members[ix[max_pos]]) {
				max_pos = j;
			}
		}
		int tmp = ix[i];
		ix[i] = ix[max_pos];
		ix[max_pos] = tmp;
	}
	for (int i=0; i<num_clusters; ++i){
		rix[ix[i]] = i;
	}
	for (int i=0; i<N; ++i) {
		*(assignment + i) = *(rix + *(assignment + i));
	}
	delete[] num_members;
	//delete[] ix and rix later

	cout.setf(ios_base::fixed);
	cout.precision(4);

	// output assignment to stdout
	RecordGenerator rec_gen_2(fastq_file_name);
	for(int n=0; n<N; ++n){
		cout<<rec_gen_2.next().id()<<"\t"<<*(assignment+n);
		cout<<endl;
	}
	delete[] ix;
	delete[] rix;

	// write sequences to individual files if requested
	if (write_flag) {
		vector<SeqRecord> rec_vec;
		FastqRead(fastq_file_name, rec_vec);
		int N = rec_vec.size();
		char fname[256];
		for (int i=0; i<num_clusters; ++i){
			sprintf(fname, "part_%i.fastq", i+1);
			ofstream ofs(fname);
			for (int j=0; j<N; ++j) {
				if (*(assignment + j) == i) {
					ofs<<"@"<<rec_vec[j].desc()<<endl;
					ofs<<rec_vec[j].seq()<<endl;
					ofs<<"+"<<endl;
					ofs<<rec_vec[j].qual()<<endl;
				}
			}
		}
	}

	// free allocated memory
	delete[] Z;
	delete[] assignment;
	return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x9b8, %rsp            # imm = 0x9B8
movq %rsi, %r14
movl %edi, %ebp
movq $0x0, 0xf8(%rsp)
xorl %edi, %edi
callq 0x21c0
movq %rax, 0x28(%rsp)
movl $0x5, 0x8c(%rsp)
movb $0x65, 0xf(%rsp)
movb $0x1, %al
movl %eax, 0x4c(%rsp)
movl $0x1, %eax
movq %rax, 0x80(%rsp)
movq 0x595b(%rip), %xmm0     # 0x8008
movq %xmm0, 0x38(%rsp)
leaq 0x6361(%rip), %rbx      # 0x8a1b
leaq 0x598f(%rip), %r12      # 0x8050
movq 0x98e8(%rip), %r15      # 0xbfb0
leaq 0x5999(%rip), %r13      # 0x8068
movl $0x0, %eax
movq %rax, 0x30(%rsp)
movl $0x0, %eax
movq %rax, 0xc8(%rsp)
movq $0x0, 0xd0(%rsp)
movl $0x1, 0x24(%rsp)
movl $0x2, 0x10(%rsp)
movq $0x0, 0xc0(%rsp)
movl $0x2, 0x70(%rsp)
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2070
cmpl $0x62, %eax
jle 0x274b
addl $-0x63, %eax
cmpl $0x14, %eax
ja 0x2716
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movq (%r15), %rdi
callq 0x22c0
movl %eax, 0x8c(%rsp)
jmp 0x2716
leal -0x4e(%rax), %ecx
cmpl $0x5, %ecx
ja 0x2861
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movq (%r15), %rdi
callq 0x22c0
movl %eax, 0x10(%rsp)
jmp 0x2716
movl $0x0, 0x4c(%rsp)
jmp 0x2716
movq (%r15), %rdi
callq 0x22c0
movq %rax, 0x28(%rsp)
jmp 0x2716
movq (%r15), %rdi
callq 0x22c0
leal -0x4(%rax), %ecx
cmpl $-0x3, %ecx
movl $0x2, %ecx
cmovbl %ecx, %eax
movq %rax, 0x80(%rsp)
jmp 0x2716
movb $0x1, %al
movq %rax, 0xf8(%rsp)
jmp 0x2716
movq (%r15), %rdi
callq 0x22c0
movl %eax, 0x70(%rsp)
jmp 0x2716
movq 0x30(%rsp), %rax
incl %eax
movq %rax, 0x30(%rsp)
jmp 0x2716
movq (%r15), %rdi
callq 0x22c0
movl %eax, 0x24(%rsp)
jmp 0x2716
movq (%r15), %rdi
callq 0x22c0
cmpl $0x2, %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cmovll %ecx, %eax
leaq 0x99da(%rip), %rcx      # 0xc1e0
movl %eax, (%rcx)
jmp 0x2716
movq (%r15), %rax
movb (%rax), %al
movb %al, 0xf(%rsp)
jmp 0x2716
movb $0x1, %al
movq %rax, 0xd0(%rsp)
jmp 0x2716
movb $0x1, %al
movq %rax, 0xc0(%rsp)
jmp 0x2716
movq (%r15), %rdi
callq 0x2260
movq %xmm0, 0x38(%rsp)
jmp 0x2716
movq (%r15), %rdi
callq 0x22c0
movq %rax, 0xc8(%rsp)
jmp 0x2716
cmpl $-0x1, %eax
je 0x2881
cmpl $0x3f, %eax
jne 0x2716
jmp 0x3091
movq (%r14), %rdi
callq 0x258c
jmp 0x3a31
xorl %eax, %eax
cmpb $0x61, 0xf(%rsp)
movq 0x80(%rsp), %r15
cmovnel %eax, %r15d
movl 0x24(%rsp), %ecx
cmovnel %eax, %ecx
movl %ecx, 0x24(%rsp)
movq 0xc8(%rsp), %rdx
cmpl $0x1, %edx
adcl $0x0, %edx
movq 0x971c(%rip), %rax      # 0xbfd0
movslq (%rax), %rax
leal 0x1(%rax), %ecx
cmpl %ebp, %ecx
jne 0x304f
movq %rdx, 0xc8(%rsp)
movq (%r14,%rax,8), %r14
movq 0x28(%rsp), %rdi
callq 0x21d0
movl 0x70(%rsp), %eax
movl $0x1, %ebp
testl %eax, %eax
jle 0x28ec
shll $0x2, %ebp
decl %eax
jne 0x28e5
leaq 0x1f0(%rsp), %rdi
leaq 0x768(%rsp), %rdx
movq %r14, %rsi
callq 0x3d4a
leaq 0x1f0(%rsp), %rdi
callq 0x72ff
movq %rax, 0x18(%rsp)
leaq 0x200(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2937
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x2200
cmpl $0x0, 0x30(%rsp)
jle 0x297a
movq 0x96ab(%rip), %rbx      # 0xbff0
leaq 0x610b(%rip), %rsi      # 0x8a57
movl $0x6, %edx
movq %rbx, %rdi
callq 0x2240
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0x2310
leaq 0x60f1(%rip), %rsi      # 0x8a5e
movl $0xb, %edx
movq %rax, %rdi
callq 0x2240
leaq 0x1d0(%rsp), %rdi
leaq 0x518(%rsp), %rdx
movq %r14, %rsi
callq 0x3d4a
leaq 0x768(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x6b16
movl %ebp, 0x14(%rsp)
movq %r15, 0x80(%rsp)
movq %r14, 0xe8(%rsp)
leaq 0x1e0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29dc
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x18(%rsp), %r15
movslq %r15d, %r12
leaq (,%r12,8), %rbx
testl %r15d, %r15d
movq $-0x1, %r14
cmovsq %r14, %rbx
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x40(%rsp)
movl %r15d, %eax
imull 0x14(%rsp), %eax
cltq
leaq (,%rax,8), %rdi
testl %eax, %eax
cmovsq %r14, %rdi
callq 0x2030
movq %r12, 0x180(%rsp)
movq 0x40(%rsp), %rcx
movq %rax, (%rcx)
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x78(%rsp)
movl 0x14(%rsp), %r13d
movq 0x18(%rsp), %rax
movl %eax, %r12d
testl %eax, %eax
jle 0x2a76
leaq (,%r13,8), %r14
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x2030
movq 0x78(%rsp), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq %r15, %r12
jne 0x2a5d
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x28(%rsp)
movq 0x18(%rsp), %rcx
leal (,%rcx,4), %eax
cltq
shlq $0x3, %rax
testl %ecx, %ecx
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x2030
movq 0x28(%rsp), %rcx
movq %rax, (%rcx)
movq %rbx, %rdi
callq 0x2030
movq %rax, 0xb8(%rsp)
cmpl $0x0, 0x18(%rsp)
jle 0x2ae6
xorl %ebx, %ebx
movl $0x20, %edi
callq 0x2030
movq 0xb8(%rsp), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
cmpq %rbx, %r12
jne 0x2ac8
movl $0x20, %edi
callq 0x2030
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rax)
movq %rax, 0xe0(%rsp)
movdqu %xmm0, (%rax)
movq %r13, %rdi
shlq $0x3, %rdi
movq %rdi, 0xd8(%rsp)
callq 0x2030
movq %rax, %r15
movl 0x14(%rsp), %eax
cmpl $0x1, %eax
adcl $0x0, %eax
movq %rax, 0xf0(%rsp)
xorl %ebx, %ebx
movl $0x20, %edi
callq 0x2030
movq %rax, (%r15,%rbx,8)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rax)
movdqu %xmm0, (%rax)
incq %rbx
cmpq %rbx, 0xf0(%rsp)
jne 0x2b30
movq %r12, 0xb0(%rsp)
cmpl $0x0, 0x18(%rsp)
jle 0x2fe1
movq 0xb0(%rsp), %rax
shlq $0x5, %rax
movq %rax, 0x188(%rsp)
xorl %r12d, %r12d
leaq 0x518(%rsp), %r14
leaq 0x140(%rsp), %rbp
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %r14, %rdi
leaq 0x768(%rsp), %rsi
callq 0x6c02
testb $0x1, 0xd0(%rsp)
je 0x2c83
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x558(%rsp), %rsi
movq 0x560(%rsp), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0x3dd0
leaq 0x318(%rsp), %rdi
leaq 0x518(%rsp), %rsi
callq 0x68c0
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x358(%rsp), %rsi
movq 0x360(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0x3dd0
movq 0x50(%rsp), %rcx
movl $0xf, %edi
leaq 0x60(%rsp), %rax
cmpq %rax, %rcx
je 0x2c3a
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %r8
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0x2c77
movl $0xf, %edi
leaq 0xa0(%rsp), %r9
cmpq %r9, %rsi
je 0x2c72
movq 0xa0(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x2cb8
leaq 0x50(%rsp), %rdi
callq 0x20d0
jmp 0x2cc9
leaq 0x220(%rsp), %rax
movq %rax, 0x210(%rsp)
movq 0x558(%rsp), %rsi
movq 0x560(%rsp), %rdx
addq %rsi, %rdx
leaq 0x210(%rsp), %rdi
callq 0x3dd0
jmp 0x2d70
leaq 0x90(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2230
leaq 0x220(%rsp), %rsi
movq %rsi, 0x210(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x2cfa
movq %rdx, 0x210(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x220(%rsp)
jmp 0x2d02
movdqu (%rcx), %xmm0
movdqu %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x218(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x2d47
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x318(%rsp), %rdi
callq 0x6626
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x2d70
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x40(%rsp), %rcx
movq (%rcx), %rax
addq %r13, %rax
movq %rax, (%rcx,%r12,4)
movq 0x28(%rsp), %rcx
movq (%rcx), %rax
addq %rbx, %rax
movq %rax, (%rcx,%r12,4)
leaq 0x110(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x210(%rsp), %rsi
movq 0x218(%rsp), %rdx
addq %rsi, %rdx
leaq 0x100(%rsp), %rdi
callq 0x3dd0
movq %rbp, %r14
movq %r15, %rbp
leaq 0x170(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0x578(%rsp), %rsi
movq 0x580(%rsp), %rdx
addq %rsi, %rdx
leaq 0x160(%rsp), %r15
movq %r15, %rdi
callq 0x3dd0
movq 0x28(%rsp), %rax
movq (%rax,%r12,4), %rcx
movq 0xb8(%rsp), %rax
movq (%rax,%r12,4), %r8
subq $0x20, %rsp
pxor %xmm0, %xmm0
movdqu %xmm0, 0x8(%rsp)
movq 0x100(%rsp), %rax
movq %rax, (%rsp)
movl $0x0, 0x18(%rsp)
leaq 0x120(%rsp), %rdi
movq %r15, %rsi
movl $0x1, %edx
xorl %r9d, %r9d
movq 0x58(%rsp), %xmm0
callq 0x57b6
addq $0x20, %rsp
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
movq %rbp, %r15
je 0x2e78
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
movq %r14, %rbp
je 0x2ea0
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x150(%rsp), %rax
movq %rax, 0x140(%rsp)
movq 0x210(%rsp), %rsi
movq 0x218(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x3dd0
leaq 0x130(%rsp), %rax
movq %rax, 0x120(%rsp)
movq 0x578(%rsp), %rsi
movq 0x580(%rsp), %rdx
addq %rsi, %rdx
leaq 0x120(%rsp), %r14
movq %r14, %rdi
callq 0x3dd0
movq 0x40(%rsp), %rax
movq (%rax,%r12,4), %rcx
movq 0x78(%rsp), %rax
movq (%rax,%r12,4), %r8
movzbl 0x4c(%rsp), %eax
andl $0x1, %eax
movq %rbp, %rdi
movq %r14, %rsi
movl 0x70(%rsp), %edx
movl 0x10(%rsp), %r9d
movq 0x38(%rsp), %xmm0
pushq %rax
movq 0x30(%rsp), %rax
pushq (%rax,%r12,4)
pushq %r15
pushq $0x0
callq 0x57b6
addq $0x20, %rsp
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x2f69
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x2f8e
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x2fb3
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x518(%rsp), %r14
movq %r14, %rdi
callq 0x6626
addq $0x20, %rbx
addq 0xd8(%rsp), %r13
addq $0x2, %r12
cmpq %rbx, 0x188(%rsp)
jne 0x2b97
cmpl $0x0, 0x30(%rsp)
jle 0x3000
movq 0x9001(%rip), %rdi      # 0xbff0
leaq 0x5a74(%rip), %rsi      # 0x8a6a
movl $0x17, %edx
callq 0x2240
cmpl $0x0, 0x24(%rsp)
je 0x30a3
movq 0xd8(%rsp), %rdi
callq 0x2030
movl 0x14(%rsp), %ecx
movq %rax, %r14
movl 0x24(%rsp), %edi
movq 0x18(%rsp), %rsi
movl 0x70(%rsp), %edx
movq 0x40(%rsp), %r8
movq 0x78(%rsp), %r9
pushq %rax
pushq %r15
pushq 0xf0(%rsp)
pushq 0x40(%rsp)
callq 0x5dce
addq $0x20, %rsp
jmp 0x30a6
movq 0x8f72(%rip), %rbx      # 0xbfc8
leaq 0x59dc(%rip), %rsi      # 0x8a39
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq (%r14), %rdi
callq 0x258c
movl $0x1, %eax
jmp 0x3a33
xorl %r14d, %r14d
movq 0x80(%rsp), %rax
movl %eax, %r12d
andl $-0x2, %r12d
cmpl $0x2, %r12d
je 0x30bf
xorl %ebp, %ebp
jmp 0x30cf
movq 0xd8(%rsp), %rdi
callq 0x2030
movq %rax, %rbp
movq 0x80(%rsp), %rax
cmpl $0x3, %eax
je 0x30fd
cmpl $0x2, %eax
jne 0x3117
movq 0x18(%rsp), %rdi
movl 0x70(%rsp), %esi
movl 0x14(%rsp), %edx
movq %rbp, %rcx
movq 0x40(%rsp), %r8
callq 0x6229
jmp 0x3117
movq 0x18(%rsp), %rdi
movl 0x70(%rsp), %esi
movl 0x14(%rsp), %edx
movq %rbp, %rcx
movq 0x28(%rsp), %r8
callq 0x6162
testb $0x1, 0xc0(%rsp)
je 0x313e
movb $0x65, 0xf(%rsp)
movq 0x40(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x18(%rsp), %rdx
movl 0x14(%rsp), %ecx
callq 0x62a2
cmpl $0x0, 0x30(%rsp)
jle 0x315d
movq 0x8ea4(%rip), %rdi      # 0xbff0
leaq 0x592f(%rip), %rsi      # 0x8a82
movl $0x1c, %edx
callq 0x2240
movq 0x180(%rsp), %rdi
shlq $0x2, %rdi
movq 0x18(%rsp), %r13
testl %r13d, %r13d
movq $-0x1, %rbx
cmovsq %rbx, %rdi
callq 0x2030
movq %rax, 0x38(%rsp)
movl %r13d, %eax
imull 0x8c(%rsp), %eax
cltq
leaq (,%rax,8), %rdi
testl %eax, %eax
cmovsq %rbx, %rdi
callq 0x2030
movq %rax, 0xc0(%rsp)
cmpl $0x0, 0x30(%rsp)
jle 0x3220
movq 0x8e34(%rip), %rdi      # 0xbff0
leaq 0x58dc(%rip), %rsi      # 0x8a9f
movl $0x1e, %edx
callq 0x2240
movq 0x8e1c(%rip), %rdi      # 0xbff0
movq 0xc8(%rsp), %rsi
callq 0x2310
movq %rax, %r13
leaq 0x58d3(%rip), %rsi      # 0x8abe
movl $0x25, %edx
movq %rax, %rdi
callq 0x2240
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
subq $0x8, %rsp
movsbl 0x17(%rsp), %eax
movl 0x94(%rsp), %edi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %edx
movq 0x48(%rsp), %rcx
movq 0x80(%rsp), %r8
movq %r14, %r9
pushq 0x38(%rsp)
pushq %rax
pushq 0xe0(%rsp)
pushq 0xe0(%rsp)
pushq 0x60(%rsp)
pushq 0x58(%rsp)
pushq $0x4
pushq %rbp
pushq 0x100(%rsp)
callq 0x4081
addq $0x50, %rsp
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x30(%rsp)
jle 0x329a
movq 0x8d67(%rip), %rdi      # 0xbff0
leaq 0x5854(%rip), %rsi      # 0x8ae4
movl $0x10, %edx
callq 0x2240
movq 0x40(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x32ac
callq 0x2270
movq 0x40(%rsp), %rdi
callq 0x2270
movq 0x28(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
movq 0x18(%rsp), %rbx
je 0x32cd
callq 0x2270
movq 0x28(%rsp), %rdi
callq 0x2270
testl %ebx, %ebx
jle 0x3313
xorl %ebx, %ebx
movq 0x78(%rsp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x32f0
callq 0x2270
movq 0xb8(%rsp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x3306
callq 0x2270
incq %rbx
cmpq %rbx, 0xb0(%rsp)
jne 0x32dd
xorl %ebx, %ebx
movq (%r15,%rbx,8), %rdi
testq %rdi, %rdi
je 0x3323
callq 0x2270
incq %rbx
cmpq %rbx, 0xf0(%rsp)
jne 0x3315
movq 0x78(%rsp), %rdi
callq 0x2270
movq 0xb8(%rsp), %rdi
callq 0x2270
movq 0xe0(%rsp), %rdi
callq 0x2270
movq %r15, %rdi
callq 0x2270
cmpl $0x2, %r12d
jne 0x336f
testq %rbp, %rbp
je 0x336f
movq %rbp, %rdi
callq 0x2270
cmpl $0x0, 0x24(%rsp)
je 0x3383
testq %r14, %r14
je 0x3383
movq %r14, %rdi
callq 0x2270
movl 0x10(%rsp), %eax
movl %eax, %ebx
leaq (,%rbx,4), %r13
testl %eax, %eax
movq $-0x1, %r15
cmovnsq %r13, %r15
movq %r15, %rdi
callq 0x2030
movq %rax, %r12
movq %r15, %rdi
callq 0x2030
movq %rax, %r14
movq %r15, %rdi
callq 0x2030
movq %rax, %r15
cmpl $0x0, 0x10(%rsp)
jle 0x3465
xorl %ebp, %ebp
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x2130
leal 0x1(%rbx), %eax
andl $-0x2, %eax
leaq -0x1(%rbx), %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0x4c1b(%rip), %xmm1     # 0x8010
movdqa 0x4c23(%rip), %xmm2     # 0x8020
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x4c23(%rip), %xmm4     # 0x8030
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %ecx
notl %ecx
testb $0x1, %cl
je 0x3442
movl %ebp, (%r14,%rbp,4)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %ecx
testb $0x1, %cl
je 0x3458
leal 0x1(%rbp), %ecx
movl %ecx, 0x4(%r14,%rbp,4)
addq $0x2, %rbp
paddq %xmm4, %xmm1
cmpq %rbp, %rax
jne 0x340d
movq 0x18(%rsp), %r13
testl %r13d, %r13d
movq 0xb0(%rsp), %rdx
movq 0x38(%rsp), %rbp
jle 0x348f
xorl %eax, %eax
movslq (%rbp,%rax,4), %rcx
incl (%r12,%rcx,4)
incq %rax
cmpq %rax, %rdx
jne 0x347e
cmpl $0x0, 0x10(%rsp)
jle 0x3508
movl $0x1, %eax
xorl %ecx, %ecx
leaq 0x1(%rcx), %rdx
movl %ecx, %edi
movq %rax, %rsi
cmpq %rbx, %rdx
jae 0x34d1
movslq (%r14,%rsi,4), %r8
movl (%r12,%r8,4), %r9d
movslq %edi, %r8
movslq (%r14,%r8,4), %r10
movl %esi, %r8d
cmpl (%r12,%r10,4), %r9d
jg 0x34c6
movl %edi, %r8d
incq %rsi
movl %r8d, %edi
cmpq %rsi, %rbx
jne 0x34ab
movl (%r14,%rcx,4), %esi
movslq %edi, %rdi
movl (%r14,%rdi,4), %r8d
movl %r8d, (%r14,%rcx,4)
movl %esi, (%r14,%rdi,4)
incq %rax
movq %rdx, %rcx
cmpq %rbx, %rdx
jne 0x349d
cmpl $0x0, 0x10(%rsp)
jle 0x3508
xorl %eax, %eax
movslq (%r14,%rax,4), %rcx
movl %eax, (%r15,%rcx,4)
incq %rax
cmpq %rax, %rbx
jne 0x34f8
testl %r13d, %r13d
movq 0xb0(%rsp), %rdx
jle 0x352c
xorl %eax, %eax
movslq (%rbp,%rax,4), %rcx
movl (%r15,%rcx,4), %ecx
movl %ecx, (%rbp,%rax,4)
incq %rax
cmpq %rax, %rdx
jne 0x3517
movq %r12, %rdi
callq 0x2270
movq 0x8a8d(%rip), %r12      # 0xbfc8
movq (%r12), %rax
movq -0x18(%rax), %rcx
orl $0x4, 0x18(%r12,%rcx)
movq -0x18(%rax), %rax
movq $0x4, 0x8(%r12,%rax)
leaq 0x1b0(%rsp), %rdi
leaq 0x318(%rsp), %rdx
movq 0xe8(%rsp), %rsi
callq 0x3d4a
leaq 0x518(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x6b16
leaq 0x1c0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35a9
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x2200
testl %r13d, %r13d
jle 0x36a6
xorl %ebx, %ebx
leaq 0x318(%rsp), %r13
movq %r13, %rdi
leaq 0x518(%rsp), %rsi
callq 0x6c02
leaq 0x220(%rsp), %rax
movq %rax, 0x210(%rsp)
movq 0x318(%rsp), %rsi
movq 0x320(%rsp), %rdx
addq %rsi, %rdx
leaq 0x210(%rsp), %rdi
callq 0x3dd0
movq 0x210(%rsp), %rsi
movq 0x218(%rsp), %rdx
movq %r12, %rdi
callq 0x2240
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0x54cf(%rip), %rsi      # 0x8af5
callq 0x2240
movq 0x38(%rsp), %rax
movl (%rax,%rbx,4), %esi
movq %rbp, %rdi
callq 0x2310
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x3660
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x2200
movq %r13, %rdi
callq 0x6626
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21e0
movq 0x38(%rsp), %rbp
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
incq %rbx
cmpq %rbx, 0xb0(%rsp)
jne 0x35bc
movq %r14, %rdi
callq 0x2270
movq %r15, %rdi
callq 0x2270
testb $0x1, 0xf8(%rsp)
je 0x3a02
pxor %xmm0, %xmm0
movdqa %xmm0, 0x90(%rsp)
movq $0x0, 0xa0(%rsp)
leaq 0x190(%rsp), %rdi
leaq 0x318(%rsp), %r14
movq 0xe8(%rsp), %rsi
movq %r14, %rdx
callq 0x3d4a
leaq 0x190(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x71be
leaq 0x1a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3733
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x2200
cmpl $0x0, 0x10(%rsp)
jle 0x39f0
movq 0x98(%rsp), %rcx
subq 0x90(%rsp), %rcx
shrq $0x7, %rcx
leaq 0x60(%rsp), %rbp
movq 0x8862(%rip), %rax      # 0xbfc0
movq (%rax), %rdx
movq %rdx, 0xd0(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x80(%rsp)
movq %rcx, 0x70(%rsp)
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq %rcx, 0x30(%rsp)
xorl %ebx, %ebx
leal 0x1(%rbx), %edx
leaq 0x210(%rsp), %r15
movq %r15, %rdi
leaq 0x535b(%rip), %rsi      # 0x8af7
movl %edx, 0x4c(%rsp)
xorl %eax, %eax
callq 0x2060
movq %r14, %rdi
movq %r15, %rsi
movl $0x10, %edx
callq 0x2220
cmpl $0x0, 0x70(%rsp)
jle 0x39a2
xorl %r13d, %r13d
xorl %r15d, %r15d
movq 0x38(%rsp), %rax
cmpl %ebx, (%rax,%r15,4)
jne 0x3990
movl $0x1, %edx
movq %r14, %rdi
leaq 0x531f(%rip), %rsi      # 0x8b05
callq 0x2240
movq 0x90(%rsp), %rax
movq %rbp, 0x50(%rsp)
movq 0x20(%rax,%r13), %rsi
movq 0x28(%rax,%r13), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0x3dd0
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %r14, %rdi
callq 0x2240
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq 0x50(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3862
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x90(%rsp), %rax
movq %rbp, 0x50(%rsp)
movq 0x40(%rax,%r13), %rsi
movq 0x48(%rax,%r13), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0x3dd0
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %r14, %rdi
callq 0x2240
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq 0x50(%rsp), %rdi
cmpq %rbp, %rdi
je 0x38d9
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2200
movl $0x1, %edx
movq %r14, %rdi
leaq 0x521f(%rip), %rsi      # 0x8b07
callq 0x2240
movq 0x318(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq 0x90(%rsp), %rax
movq %rbp, 0x50(%rsp)
movq 0x60(%rax,%r13), %rsi
movq 0x68(%rax,%r13), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0x3dd0
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %r14, %rdi
callq 0x2240
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2140
movq 0x50(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3990
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2200
incq %r15
subq $-0x80, %r13
cmpq %r15, 0x30(%rsp)
jne 0x37c8
movq 0xd0(%rsp), %rax
movq %rax, 0x318(%rsp)
movq -0x18(%rax), %rax
movq 0x80(%rsp), %rcx
movq %rcx, 0x318(%rsp,%rax)
leaq 0x320(%rsp), %rdi
callq 0x21a0
leaq 0x410(%rsp), %rdi
callq 0x20e0
movl 0x4c(%rsp), %eax
movl %eax, %ebx
cmpl 0x10(%rsp), %eax
jne 0x3787
leaq 0x90(%rsp), %rdi
callq 0x3d88
movq 0x38(%rsp), %rbp
movq 0xc0(%rsp), %rdi
callq 0x2270
movq %rbp, %rdi
callq 0x2270
leaq 0x518(%rsp), %rdi
callq 0x6bb8
leaq 0x768(%rsp), %rdi
callq 0x6bb8
xorl %eax, %eax
addq $0x9b8, %rsp            # imm = 0x9B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x1a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3d1b
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x3d1b
jmp 0x3b43
movq %rax, %rbx
leaq 0x1c0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3d35
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x3d35
jmp 0x3c67
jmp 0x3c67
jmp 0x3c67
jmp 0x3c67
jmp 0x3c67
jmp 0x3c67
jmp 0x3c67
jmp 0x3c67
movq %rax, %rbx
leaq 0x1e0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3d42
movq 0x1e0(%rsp), %rsi
jmp 0x3b10
jmp 0x3b1d
movq %rax, %rbx
leaq 0x200(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3d42
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x3d42
movq %rax, %rbx
jmp 0x3d42
jmp 0x3c67
jmp 0x3c67
jmp 0x3c67
jmp 0x3c67
jmp 0x3c67
jmp 0x3c67
movq %rax, %rbx
jmp 0x3d1b
jmp 0x3b52
movq %rax, %rbx
jmp 0x3b87
movq %rax, %rbx
jmp 0x3c97
movq %rax, %rbx
jmp 0x3b94
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x3b87
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x318(%rsp), %rdi
callq 0x6626
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x3c97
movq 0x60(%rsp), %rsi
jmp 0x3c8f
jmp 0x3ca9
movq %rax, %rbx
jmp 0x3cd6
jmp 0x3c67
movq %rax, %rbx
jmp 0x3bf0
movq %rax, %rbx
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x3bf0
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x3c72
movq 0x110(%rsp), %rsi
jmp 0x3c59
movq %rax, %rbx
jmp 0x3c3c
movq %rax, %rbx
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x3c3c
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x3c72
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x3c72
jmp 0x3c67
jmp 0x3c67
movq %rax, %rbx
jmp 0x3d35
movq %rax, %rbx
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x3c97
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x518(%rsp), %rdi
callq 0x6626
jmp 0x3d35
movq %rax, %rbx
jmp 0x3d28
movq %rax, %rbx
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x3cd6
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x318(%rsp), %rdi
callq 0x6626
jmp 0x3d28
jmp 0x3d0b
jmp 0x3d0b
jmp 0x3d0b
jmp 0x3cef
jmp 0x3cef
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3d0e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x3d0e
movq %rax, %rbx
leaq 0x318(%rsp), %rdi
callq 0x2290
leaq 0x90(%rsp), %rdi
callq 0x3d88
leaq 0x518(%rsp), %rdi
callq 0x6bb8
leaq 0x768(%rsp), %rdi
callq 0x6bb8
movq %rbx, %rdi
callq 0x2330