// File: /workspace/github_cpp_makefile_star2_O2/WeiqiangZhou[P]BIRD/source/create_library_main.cpp
// Function: main
int main(int argc, char *argv[])
{
	char infile[255]="./par_file.txt";
	char outfile[255]="./model_file.bin";
	
    if (argc == 5 && strcmp(argv[1], "-i") == 0 && strcmp(argv[3], "-o") == 0)
	{
		strcpy(infile, argv[2]);
		strcpy(outfile, argv[4]);
	}
    else if (argc == 2 && strcmp(argv[1], "-h") == 0)
    {
                std::cout << "Usage: BIRD_build_library -i par_file.txt -o model_file.bin" << std::endl;
                std::cout << "-i Specify input file which contains the required parameters and files list." << std::endl;
                std::cout << "-o Specify output name of the model file to be used by BIRD." << std::endl;
                return 1;
    }
	else
	{
		std::cout << "Please input the correct parameters." << std::endl;
		std::cout << "Example: BIRD_build_library -i par_file.txt -o model_file.bin" << std::endl;
		return 1;
	}

	FILE * p_out;
	int param[8];
	int num_loci, num_gene, cluster_size, bin_size, num_var, DH_num1, DH_num2, DH_num3;
	char **filelist = new char *[18];
	for (int i = 0; i < 18; i++)
	{
		filelist[i] = new char[255];
	}

	if (ReadParam(infile, param, filelist)){ return 1; }

	num_loci = param[0];
	num_gene = param[1];
	cluster_size = param[2];
	bin_size = param[3];
	num_var = param[4];
	DH_num1 = param[5];
	DH_num2 = param[6];
	DH_num3 = param[7];

	double *uw_quantile = new double[num_gene];
	double *exon_mean = new double[num_gene];
	double *exon_sd = new double[num_gene];
	double *DNase_mean = new double[num_loci];
	double *DNase_sd = new double[num_loci];
	int *cluster_idx = new int[num_gene];

	double **coef = new double *[num_var];
	for (int j = 0; j < num_var; j++)
	{
		coef[j] = new double[num_loci]();
	}

	double **dis_matrix = new double *[3];
	for (int j = 0; j < 3; j++)
	{
		dis_matrix[j] = new double[num_loci]();
	}

	double **DH_coef1 = new double *[num_var];
	for (int j = 0; j < num_var; j++)
	{
		DH_coef1[j] = new double[DH_num1]();
	}

	double **DH_coef2 = new double *[num_var];
	for (int j = 0; j < num_var; j++)
	{
		DH_coef2[j] = new double[DH_num2]();
	}

	double **DH_coef3 = new double *[num_var];
	for (int j = 0; j < num_var; j++)
	{
		DH_coef3[j] = new double[DH_num3]();
	}

	int **pre_idx = new int *[num_var];
	for (int j = 0; j < num_var; j++)
	{
		pre_idx[j] = new int[num_loci]();
	}

	int **DH_pre_idx1 = new int *[num_var];
	for (int j = 0; j < num_var; j++)
	{
		DH_pre_idx1[j] = new int[DH_num1]();
	}

	int **DH_pre_idx2 = new int *[num_var];
	for (int j = 0; j < num_var; j++)
	{
		DH_pre_idx2[j] = new int[DH_num2]();
	}

	int **DH_pre_idx3 = new int *[num_var];
	for (int j = 0; j < num_var; j++)
	{
		DH_pre_idx3[j] = new int[DH_num3]();
	}

	int **DH_cluster = new int *[3];
	for (int j = 0; j < 3; j++)
	{
		DH_cluster[j] = new int[num_loci]();
	}

	char **select_loci = new char *[num_loci];
	for (int j = 0; j < num_loci; j++)
	{
		select_loci[j] = new char[30];
	}

	char **row_name = new char *[num_gene];
	for (int j = 0; j < num_gene; j++)
	{
		row_name[j] = new char[30];
	}

        //read in all required files
	if (ReadVector_d(filelist[0], uw_quantile)){ return 1; }
	if (ReadVector_d(filelist[1], exon_mean)){ return 1; }
	if (ReadVector_d(filelist[2], exon_sd)){ return 1; }
	if (ReadVector_i(filelist[3], cluster_idx)){ return 1; }
	if (ReadVector_d(filelist[4], DNase_mean)){ return 1; }
	if (ReadVector_d(filelist[5], DNase_sd)){ return 1; }
	if (ReadMatrix_d(filelist[6], coef)){ return 1; }
	if (ReadMatrix_i(filelist[7], pre_idx)){ return 1; }
	if (ReadName(filelist[8], select_loci)){ return 1; }
	if (ReadName(filelist[9], row_name)){ return 1; }
	if (ReadMatrix_d(filelist[10], dis_matrix)){ return 1; }
	if (ReadMatrix_i(filelist[11], DH_cluster)){ return 1; }
	if (ReadMatrix_d(filelist[12], DH_coef1)){ return 1; }
	if (ReadMatrix_d(filelist[13], DH_coef2)){ return 1; }
	if (ReadMatrix_d(filelist[14], DH_coef3)){ return 1; }
	if (ReadMatrix_i(filelist[15], DH_pre_idx1)){ return 1; }
	if (ReadMatrix_i(filelist[16], DH_pre_idx2)){ return 1; }
	if (ReadMatrix_i(filelist[17], DH_pre_idx3)){ return 1; }

        //combine all information into one binary file
	p_out = fopen(outfile, "wb");
	if (p_out != NULL)
	{
		std::cout << "Writing " << outfile << "..." << std::endl;
		fwrite(param, sizeof(int), 8, p_out);
		fwrite(uw_quantile, sizeof(double), num_gene, p_out);
		fwrite(exon_mean, sizeof(double), num_gene, p_out);
		fwrite(exon_sd, sizeof(double), num_gene, p_out);
		for (int k = 0; k < num_var; k++)
		{
			fwrite(coef[k], sizeof(double), num_loci, p_out);
		}
		fwrite(DNase_mean, sizeof(double), num_loci, p_out);
		fwrite(DNase_sd, sizeof(double), num_loci, p_out);
		for (int k = 0; k < num_var; k++)
		{
			fwrite(pre_idx[k], sizeof(int), num_loci, p_out);
		}
		fwrite(cluster_idx, sizeof(int), num_gene, p_out);
		for (int k = 0; k < num_loci; k++)
		{
			fwrite(select_loci[k], sizeof(char), 30, p_out);
		}
		for (int k = 0; k < num_gene; k++)
		{
			fwrite(row_name[k], sizeof(char), 30, p_out);
		}
		for (int k = 0; k < 3; k++)
		{
			fwrite(dis_matrix[k], sizeof(double), num_loci, p_out);
		}
		for (int k = 0; k < 3; k++)
		{
			fwrite(DH_cluster[k], sizeof(int), num_loci, p_out);
		}
		for (int k = 0; k < num_var; k++)
		{
			fwrite(DH_coef1[k], sizeof(double), DH_num1, p_out);
		}
		for (int k = 0; k < num_var; k++)
		{
			fwrite(DH_coef2[k], sizeof(double), DH_num2, p_out);
		}
		for (int k = 0; k < num_var; k++)
		{
			fwrite(DH_coef3[k], sizeof(double), DH_num3, p_out);
		}
		for (int k = 0; k < num_var; k++)
		{
			fwrite(DH_pre_idx1[k], sizeof(int), DH_num1, p_out);
		}
		for (int k = 0; k < num_var; k++)
		{
			fwrite(DH_pre_idx2[k], sizeof(int), DH_num2, p_out);
		}
		for (int k = 0; k < num_var; k++)
		{
			fwrite(DH_pre_idx3[k], sizeof(int), DH_num3, p_out);
		}
		fclose(p_out);
		std::cout << "Successfully generated library file." << std::endl;
	}
	else
	{
		std::cout << "Error! Cannot write " << outfile << std::endl;
		return 1;
	}

	

	//Release memory
	delete[] uw_quantile;
	delete[] exon_mean;
	delete[] exon_sd;
	delete[] DNase_mean;
	delete[] DNase_sd;
	delete[] cluster_idx;
	for (int j = 0; j < 3; j++)
	{
		delete[] dis_matrix[j];
		delete[] DH_cluster[j];
	}
	for (int j = 0; j < num_var; j++)
	{
		delete[] coef[j];
		delete[] pre_idx[j];
		delete[] DH_coef1[j];
		delete[] DH_coef2[j];
		delete[] DH_coef3[j];
		delete[] DH_pre_idx1[j];
		delete[] DH_pre_idx2[j];
		delete[] DH_pre_idx3[j];
	}
	delete[] coef;
	delete[] pre_idx;
	delete[] DH_coef1;
	delete[] DH_coef2;
	delete[] DH_coef3;
	delete[] DH_pre_idx1;
	delete[] DH_pre_idx2;
	delete[] DH_pre_idx3;
	delete[] dis_matrix;
	delete[] DH_cluster;

	return 0;


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2f8, %rsp            # imm = 0x2F8
movq %rsi, %r14
movl %edi, %ebx
leaq 0x2c84(%rip), %rsi      # 0x5010
leaq -0x320(%rbp), %rdi
movl $0xff, %edx
callq 0x20d0
leaq 0x2d6c(%rip), %rsi      # 0x5110
leaq -0x220(%rbp), %rdi
movl $0xff, %edx
callq 0x20d0
cmpl $0x2, %ebx
je 0x2449
cmpl $0x5, %ebx
jne 0x245e
movq 0x8(%r14), %rax
cmpb $0x2d, (%rax)
jne 0x245e
cmpb $0x69, 0x1(%rax)
jne 0x245e
cmpb $0x0, 0x2(%rax)
jne 0x245e
movq 0x18(%r14), %rax
cmpb $0x2d, (%rax)
jne 0x245e
cmpb $0x6f, 0x1(%rax)
jne 0x245e
cmpb $0x0, 0x2(%rax)
jne 0x245e
pushq $0x1
popq %rbx
movq 0x10(%r14), %rsi
leaq -0x320(%rbp), %rdi
callq 0x20f0
movq 0x20(%r14), %rsi
leaq -0x220(%rbp), %rdi
callq 0x20f0
movl $0x90, %edi
callq 0x2030
movq %rax, %r15
xorl %r14d, %r14d
cmpq $0x12, %r14
je 0x24e8
movl $0xff, %edi
callq 0x2030
movq %rax, (%r15,%r14,8)
incq %r14
jmp 0x242c
movq 0x8(%r14), %rax
cmpb $0x2d, (%rax)
jne 0x245e
cmpb $0x68, 0x1(%rax)
jne 0x245e
cmpb $0x0, 0x2(%rax)
je 0x24aa
movq 0x4b73(%rip), %rbx      # 0x6fd8
leaq 0x2e69(%rip), %rsi      # 0x52d5
movq %rbx, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x2090
leaq 0x2e77(%rip), %rsi      # 0x52fa
movq %rbx, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x2090
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x2f8, %rsp            # imm = 0x2F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4b27(%rip), %rbx      # 0x6fd8
leaq 0x2d57(%rip), %rsi      # 0x520f
movq %rbx, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x2090
leaq 0x2d7c(%rip), %rsi      # 0x524b
movq %rbx, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x2090
leaq 0x2db2(%rip), %rsi      # 0x5298
jmp 0x2483
leaq -0x320(%rbp), %rdi
leaq -0x110(%rbp), %rsi
movq %r15, %rdx
callq 0x3044
testl %eax, %eax
jne 0x2496
movq %r15, -0x38(%rbp)
movslq -0x110(%rbp), %r15
movslq -0x10c(%rbp), %rcx
movslq -0x100(%rbp), %r14
movslq -0xfc(%rbp), %rax
movq %rax, -0xa0(%rbp)
movslq -0xf8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movslq -0xf4(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq (,%rcx,8), %r13
testq %rcx, %rcx
pushq $-0x1
popq %rax
cmovsq %rax, %r13
movq %rcx, -0xe0(%rbp)
leaq (,%rcx,4), %r12
cmovsq %rax, %r12
movq %r13, %rdi
callq 0x2030
movq %rax, -0xe8(%rbp)
movq %r13, %rdi
callq 0x2030
movq %rax, -0xd8(%rbp)
movq %r13, -0x118(%rbp)
movq %r13, %rdi
callq 0x2030
movq %rax, -0xd0(%rbp)
leaq (,%r15,8), %r13
movq %r15, -0x48(%rbp)
testq %r15, %r15
pushq $-0x1
popq %r15
cmovsq %r15, %r13
movq %r13, %rdi
callq 0x2030
movq %rax, -0xc0(%rbp)
movq %r13, -0x50(%rbp)
movq %r13, %rdi
callq 0x2030
movq %rax, -0xb8(%rbp)
movq %r12, %rdi
callq 0x2030
movq %rax, -0xc8(%rbp)
leaq (,%r14,8), %rdi
testq %r14, %r14
cmovsq %r15, %rdi
movq %rdi, -0x40(%rbp)
callq 0x2030
movq %rax, %r15
xorl %r13d, %r13d
testl %r14d, %r14d
movl $0x0, %eax
cmovgl %r14d, %eax
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %r14
cmpq %r13, -0x30(%rbp)
je 0x263f
movq %r14, %rdi
callq 0x2030
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x20b0
movq %r12, (%r15,%r13,8)
incq %r13
jmp 0x2618
movq %r15, -0x98(%rbp)
pushq $0x18
popq %rdi
callq 0x2030
movq %rax, %r13
xorl %r14d, %r14d
movq -0x50(%rbp), %r15
cmpq $0x3, %r14
je 0x2680
movq %r15, %rdi
callq 0x2030
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x20b0
movq %r12, (%r13,%r14,8)
incq %r14
jmp 0x2658
movq %r13, -0x90(%rbp)
movq -0x40(%rbp), %rdi
callq 0x2030
movq %rax, -0x78(%rbp)
movq -0xa0(%rbp), %rax
leaq (,%rax,8), %r12
testl %eax, %eax
pushq $-0x1
popq %rax
cmovsq %rax, %r12
xorl %r14d, %r14d
cmpq %r14, -0x30(%rbp)
je 0x26da
movq %r12, %rdi
callq 0x2030
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x20b0
movq -0x78(%rbp), %rax
movq %r13, (%rax,%r14,8)
incq %r14
jmp 0x26af
movq -0x40(%rbp), %rdi
callq 0x2030
movq %rax, -0x70(%rbp)
movq -0xa8(%rbp), %rax
leaq (,%rax,8), %r12
testl %eax, %eax
pushq $-0x1
popq %rax
cmovsq %rax, %r12
xorl %r14d, %r14d
cmpq %r14, -0x30(%rbp)
je 0x272d
movq %r12, %rdi
callq 0x2030
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x20b0
movq -0x70(%rbp), %rax
movq %r13, (%rax,%r14,8)
incq %r14
jmp 0x2702
movq -0x40(%rbp), %rdi
callq 0x2030
movq %rax, -0x68(%rbp)
movq -0xb0(%rbp), %rax
leaq (,%rax,8), %r12
testl %eax, %eax
pushq $-0x1
popq %rax
cmovsq %rax, %r12
xorl %r14d, %r14d
cmpq %r14, -0x30(%rbp)
je 0x2780
movq %r12, %rdi
callq 0x2030
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x20b0
movq -0x68(%rbp), %rax
movq %r13, (%rax,%r14,8)
incq %r14
jmp 0x2755
movq -0x40(%rbp), %rdi
callq 0x2030
movq %rax, -0x80(%rbp)
movq -0x48(%rbp), %rax
leaq (,%rax,4), %r12
testl %eax, %eax
pushq $-0x1
popq %rax
cmovsq %rax, %r12
xorl %r14d, %r14d
cmpq %r14, -0x30(%rbp)
je 0x27d0
movq %r12, %rdi
callq 0x2030
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x20b0
movq -0x80(%rbp), %rax
movq %r13, (%rax,%r14,8)
incq %r14
jmp 0x27a5
movq -0x40(%rbp), %rdi
callq 0x2030
movq %rax, -0x60(%rbp)
movq -0xa0(%rbp), %rax
leaq (,%rax,4), %r13
testl %eax, %eax
pushq $-0x1
popq %rax
cmovsq %rax, %r13
xorl %r15d, %r15d
cmpq %r15, -0x30(%rbp)
je 0x2823
movq %r13, %rdi
callq 0x2030
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x20b0
movq -0x60(%rbp), %rax
movq %r14, (%rax,%r15,8)
incq %r15
jmp 0x27f8
movq -0x40(%rbp), %rdi
callq 0x2030
movq %rax, -0x58(%rbp)
movq -0xa8(%rbp), %rax
leaq (,%rax,4), %r13
testl %eax, %eax
pushq $-0x1
popq %rax
cmovsq %rax, %r13
xorl %r15d, %r15d
cmpq %r15, -0x30(%rbp)
je 0x2876
movq %r13, %rdi
callq 0x2030
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x20b0
movq -0x58(%rbp), %rax
movq %r14, (%rax,%r15,8)
incq %r15
jmp 0x284b
movq -0x40(%rbp), %rdi
callq 0x2030
movq %rax, -0x40(%rbp)
movq -0xb0(%rbp), %rax
leaq (,%rax,4), %r13
testl %eax, %eax
pushq $-0x1
popq %rax
cmovsq %rax, %r13
xorl %r15d, %r15d
cmpq %r15, -0x30(%rbp)
je 0x28c9
movq %r13, %rdi
callq 0x2030
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x20b0
movq -0x40(%rbp), %rax
movq %r14, (%rax,%r15,8)
incq %r15
jmp 0x289e
pushq $0x18
popq %rdi
callq 0x2030
movq %rax, %r15
xorl %r13d, %r13d
cmpq $0x3, %r13
je 0x28fe
movq %r12, %rdi
callq 0x2030
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x20b0
movq %r14, (%r15,%r13,8)
incq %r13
jmp 0x28d7
movq %r15, -0x88(%rbp)
movq -0x50(%rbp), %rdi
callq 0x2030
movq %rax, %r13
xorl %r15d, %r15d
movq -0x48(%rbp), %rax
testl %eax, %eax
movl $0x0, %r14d
cmovgl %eax, %r14d
pushq $0x1e
popq %r12
cmpq %r15, %r14
je 0x293f
movq %r12, %rdi
callq 0x2030
movq %rax, (%r13,%r15,8)
incq %r15
jmp 0x2928
movq %r13, -0xf0(%rbp)
movq -0x118(%rbp), %rdi
callq 0x2030
movq %rax, -0x50(%rbp)
xorl %r12d, %r12d
movq -0xe0(%rbp), %rax
testl %eax, %eax
movl $0x0, %r15d
cmovgl %eax, %r15d
pushq $0x1e
popq %r13
cmpq %r12, %r15
je 0x298a
movq %r13, %rdi
callq 0x2030
movq -0x50(%rbp), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
jmp 0x2970
movq -0x38(%rbp), %r12
movq (%r12), %rdi
movq -0xe8(%rbp), %rsi
callq 0x38ef
testl %eax, %eax
jne 0x2496
movq 0x8(%r12), %rdi
movq -0xd8(%rbp), %rsi
callq 0x38ef
testl %eax, %eax
jne 0x2496
movq 0x10(%r12), %rdi
movq -0xd0(%rbp), %rsi
callq 0x38ef
testl %eax, %eax
jne 0x2496
movq 0x18(%r12), %rdi
movq -0xc8(%rbp), %rsi
callq 0x39d9
testl %eax, %eax
jne 0x2496
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0xc0(%rbp), %rsi
callq 0x38ef
testl %eax, %eax
jne 0x2496
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0xb8(%rbp), %rsi
callq 0x38ef
testl %eax, %eax
jne 0x2496
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x98(%rbp), %rsi
callq 0x3abf
testl %eax, %eax
jne 0x2496
movq -0x38(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x80(%rbp), %rsi
callq 0x3cae
testl %eax, %eax
jne 0x2496
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0xf0(%rbp), %rsi
callq 0x3e9b
testl %eax, %eax
jne 0x2496
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x50(%rbp), %rsi
callq 0x3e9b
testl %eax, %eax
jne 0x2496
movq -0x38(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x90(%rbp), %rsi
callq 0x3abf
testl %eax, %eax
jne 0x2496
movq -0x38(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x88(%rbp), %rsi
callq 0x3cae
testl %eax, %eax
jne 0x2496
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rdi
movq -0x78(%rbp), %rsi
callq 0x3abf
testl %eax, %eax
jne 0x2496
movq -0x38(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x70(%rbp), %rsi
callq 0x3abf
testl %eax, %eax
jne 0x2496
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rdi
movq -0x68(%rbp), %rsi
callq 0x3abf
testl %eax, %eax
jne 0x2496
movq -0x38(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x60(%rbp), %rsi
callq 0x3cae
testl %eax, %eax
jne 0x2496
movq -0x38(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x58(%rbp), %rsi
callq 0x3cae
testl %eax, %eax
jne 0x2496
movq -0x38(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x3cae
testl %eax, %eax
jne 0x2496
leaq 0x27ca(%rip), %rsi      # 0x5338
leaq -0x220(%rbp), %rdi
callq 0x2130
testq %rax, %rax
je 0x3015
movq %rax, %r13
movq 0x444b(%rip), %rdi      # 0x6fd8
leaq 0x27a7(%rip), %rsi      # 0x533b
callq 0x2100
leaq -0x220(%rbp), %rsi
movq %rax, %rdi
callq 0x2100
leaq 0x2795(%rip), %rsi      # 0x5344
movq %rax, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x2090
leaq -0x110(%rbp), %rdi
pushq $0x4
popq %rsi
pushq $0x8
popq %rbx
movq %rbx, %rdx
movq %r13, %rcx
callq 0x21f0
movq -0xe8(%rbp), %rdi
movq %rbx, %rsi
movq -0xe0(%rbp), %r12
movq %r12, %rdx
movq %r13, %rcx
callq 0x21f0
movq -0xd8(%rbp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x21f0
movq -0xd0(%rbp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x21f0
xorl %r12d, %r12d
cmpq %r12, -0x30(%rbp)
je 0x2c45
movq -0x98(%rbp), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
movq -0x48(%rbp), %rdx
movq %r13, %rcx
callq 0x21f0
incq %r12
jmp 0x2c20
pushq $0x8
popq %rbx
movq -0xc0(%rbp), %rdi
movq %rbx, %rsi
movq -0x48(%rbp), %r12
movq %r12, %rdx
movq %r13, %rcx
callq 0x21f0
movq -0xb8(%rbp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x21f0
xorl %r12d, %r12d
pushq $0x4
popq %rbx
cmpq %r12, -0x30(%rbp)
je 0x2c9e
movq -0x80(%rbp), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
movq -0x48(%rbp), %rdx
movq %r13, %rcx
callq 0x21f0
incq %r12
jmp 0x2c7c
pushq $0x4
popq %rsi
movq -0xc8(%rbp), %rdi
movq -0xe0(%rbp), %rdx
movq %r13, %rcx
callq 0x21f0
xorl %r12d, %r12d
pushq $0x1e
popq %rbx
cmpq %r12, %r14
je 0x2ce0
movq -0xf0(%rbp), %rax
movq (%rax,%r12,8), %rdi
pushq $0x1
popq %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x21f0
incq %r12
jmp 0x2cbd
xorl %r12d, %r12d
pushq $0x1
popq %rbx
pushq $0x1e
popq %r14
cmpq %r12, %r15
je 0x2d0a
movq -0x50(%rbp), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x21f0
incq %r12
jmp 0x2cea
xorl %r14d, %r14d
pushq $0x8
popq %rbx
cmpq $0x3, %r14
je 0x2d35
movq -0x90(%rbp), %rax
movq (%rax,%r14,8), %rdi
movq %rbx, %rsi
movq -0x48(%rbp), %rdx
movq %r13, %rcx
callq 0x21f0
incq %r14
jmp 0x2d10
xorl %r14d, %r14d
pushq $0x4
popq %rbx
cmpq $0x3, %r14
je 0x2d60
movq -0x88(%rbp), %rax
movq (%rax,%r14,8), %rdi
movq %rbx, %rsi
movq -0x48(%rbp), %rdx
movq %r13, %rcx
callq 0x21f0
incq %r14
jmp 0x2d3b
xorl %r14d, %r14d
pushq $0x8
popq %rbx
cmpq %r14, -0x30(%rbp)
je 0x2d8b
movq -0x78(%rbp), %rax
movq (%rax,%r14,8), %rdi
movq %rbx, %rsi
movq -0xa0(%rbp), %rdx
movq %r13, %rcx
callq 0x21f0
incq %r14
jmp 0x2d66
xorl %r14d, %r14d
pushq $0x8
popq %rbx
cmpq %r14, -0x30(%rbp)
je 0x2db6
movq -0x70(%rbp), %rax
movq (%rax,%r14,8), %rdi
movq %rbx, %rsi
movq -0xa8(%rbp), %rdx
movq %r13, %rcx
callq 0x21f0
incq %r14
jmp 0x2d91
xorl %r14d, %r14d
pushq $0x8
popq %rbx
cmpq %r14, -0x30(%rbp)
je 0x2de1
movq -0x68(%rbp), %rax
movq (%rax,%r14,8), %rdi
movq %rbx, %rsi
movq -0xb0(%rbp), %rdx
movq %r13, %rcx
callq 0x21f0
incq %r14
jmp 0x2dbc
xorl %r14d, %r14d
pushq $0x4
popq %rbx
cmpq %r14, -0x30(%rbp)
je 0x2e0c
movq -0x60(%rbp), %rax
movq (%rax,%r14,8), %rdi
movq %rbx, %rsi
movq -0xa0(%rbp), %rdx
movq %r13, %rcx
callq 0x21f0
incq %r14
jmp 0x2de7
xorl %r14d, %r14d
pushq $0x4
popq %rbx
cmpq %r14, -0x30(%rbp)
je 0x2e37
movq -0x58(%rbp), %rax
movq (%rax,%r14,8), %rdi
movq %rbx, %rsi
movq -0xa8(%rbp), %rdx
movq %r13, %rcx
callq 0x21f0
incq %r14
jmp 0x2e12
xorl %r14d, %r14d
pushq $0x4
popq %rbx
cmpq %r14, -0x30(%rbp)
je 0x2e62
movq -0x40(%rbp), %rax
movq (%rax,%r14,8), %rdi
movq %rbx, %rsi
movq -0xb0(%rbp), %rdx
movq %r13, %rcx
callq 0x21f0
incq %r14
jmp 0x2e3d
movq %r13, %rdi
callq 0x2110
movq 0x4167(%rip), %rdi      # 0x6fd8
leaq 0x24d0(%rip), %rsi      # 0x5348
callq 0x2100
movq %rax, %rdi
callq 0x2090
movq -0xe8(%rbp), %rdi
callq 0x2150
movq -0xd8(%rbp), %rdi
callq 0x2150
movq -0xd0(%rbp), %rdi
callq 0x2150
movq -0xc0(%rbp), %rdi
callq 0x2150
movq -0xb8(%rbp), %rdi
callq 0x2150
movq -0xc8(%rbp), %rdi
callq 0x2150
xorl %ebx, %ebx
cmpq $0x3, %rbx
je 0x2f04
movq -0x90(%rbp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x2eea
callq 0x2150
movq -0x88(%rbp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x2eff
callq 0x2150
incq %rbx
jmp 0x2ecf
xorl %ebx, %ebx
cmpq %rbx, -0x30(%rbp)
je 0x2fab
movq -0x98(%rbp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x2f25
callq 0x2150
movq -0x80(%rbp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x2f37
callq 0x2150
movq -0x78(%rbp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x2f49
callq 0x2150
movq -0x70(%rbp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x2f5b
callq 0x2150
movq -0x68(%rbp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x2f6d
callq 0x2150
movq -0x60(%rbp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x2f7f
callq 0x2150
movq -0x58(%rbp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x2f91
callq 0x2150
movq -0x40(%rbp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x2fa3
callq 0x2150
incq %rbx
jmp 0x2f06
movq -0x98(%rbp), %rdi
callq 0x2150
movq -0x80(%rbp), %rdi
callq 0x2150
movq -0x78(%rbp), %rdi
callq 0x2150
movq -0x70(%rbp), %rdi
callq 0x2150
movq -0x68(%rbp), %rdi
callq 0x2150
movq -0x60(%rbp), %rdi
callq 0x2150
movq -0x58(%rbp), %rdi
callq 0x2150
movq -0x40(%rbp), %rdi
callq 0x2150
movq -0x90(%rbp), %rdi
callq 0x2150
movq -0x88(%rbp), %rdi
callq 0x2150
xorl %ebx, %ebx
jmp 0x2496
movq 0x3fbc(%rip), %rdi      # 0x6fd8
leaq 0x234a(%rip), %rsi      # 0x536d
callq 0x2100
leaq -0x220(%rbp), %rsi
movq %rax, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x2090
jmp 0x2496