// File: /workspace/github_cpp_makefile_star2_O2/WeiqiangZhou[P]BIRD/source/create_library_function.cpp
// Function: ReadParam(char*, int*, char**)
int ReadParam(char *infile, int *parameter, char **filename)
{
	FILE * p_in;
	char par_name[255];
	int temp_int;
	char temp_char[255];
	p_in = fopen(infile, "r");
	if (p_in != NULL)
	{
		std::cout << "Reading " << infile << "..." << std::endl;
		while (!feof(p_in) && fscanf(p_in, "%s", par_name) == 1)
		{
			if (strcmp(par_name, "NumLoci") == 0)
			{
				fscanf(p_in, "%d", &temp_int);
				parameter[0] = temp_int;
				std::cout << "NumLoci=" << temp_int << std::endl;
			}
			else if (strcmp(par_name, "NumGene") == 0)
			{
				fscanf(p_in, "%d", &temp_int);
				parameter[1] = temp_int;
				std::cout << "NumGene=" << temp_int << std::endl;
			}
			else if (strcmp(par_name, "NumCluster") == 0)
			{
				fscanf(p_in, "%d", &temp_int);
				parameter[2] = temp_int;
				std::cout << "NumCluster=" << temp_int << std::endl;
			}
			else if (strcmp(par_name, "NumBin") == 0)
			{
				fscanf(p_in, "%d", &temp_int);
				parameter[3] = temp_int;
				std::cout << "NumBin=" << temp_int << std::endl;
			}
			else if (strcmp(par_name, "NumVar") == 0)
			{
				fscanf(p_in, "%d", &temp_int);
				parameter[4] = temp_int;
				std::cout << "NumVar=" << temp_int << std::endl;
			}
			else if (strcmp(par_name, "DHCluterNum1") == 0)
			{
				fscanf(p_in, "%d", &temp_int);
				parameter[5] = temp_int;
				std::cout << "DHCluterNum1=" << temp_int << std::endl;
			}
			else if (strcmp(par_name, "DHCluterNum2") == 0)
			{
				fscanf(p_in, "%d", &temp_int);
				parameter[6] = temp_int;
				std::cout << "DHCluterNum2=" << temp_int << std::endl;
			}
			else if (strcmp(par_name, "DHCluterNum3") == 0)
			{
				fscanf(p_in, "%d", &temp_int);
				parameter[7] = temp_int;
				std::cout << "DHCluterNum3=" << temp_int << std::endl;
			}
			else if (strcmp(par_name, "GeneQuantile") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[0], temp_char);
			}
			else if (strcmp(par_name, "GeneMean") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[1], temp_char);
			}
			else if (strcmp(par_name, "GeneSD") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[2], temp_char);
			}
			else if (strcmp(par_name, "ClusterIndex") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[3], temp_char);
			}
			else if (strcmp(par_name, "DNaseMean") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[4], temp_char);
			}
			else if (strcmp(par_name, "DNaseSD") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[5], temp_char);
			}
			else if (strcmp(par_name, "RegressionCoef") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[6], temp_char);
			}
			else if (strcmp(par_name, "RegressionPredictor") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[7], temp_char);
			}
			else if (strcmp(par_name, "GenomicLoci") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[8], temp_char);
			}
			else if (strcmp(par_name, "GeneName") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[9], temp_char);
			}
			else if (strcmp(par_name, "DistanceMatrix") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[10], temp_char);
			}
			else if (strcmp(par_name, "DHCluster") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[11], temp_char);
			}
			else if (strcmp(par_name, "DHClusterCoef1") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[12], temp_char);
			}
			else if (strcmp(par_name, "DHClusterCoef2") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[13], temp_char);
			}
			else if (strcmp(par_name, "DHClusterCoef3") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[14], temp_char);
			}
			else if (strcmp(par_name, "DHClusterPredictor1") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[15], temp_char);
			}
			else if (strcmp(par_name, "DHClusterPredictor2") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[16], temp_char);
			}
			else if (strcmp(par_name, "DHClusterPredictor3") == 0)
			{
				fscanf(p_in, "%s", temp_char);
				strcpy(filename[17], temp_char);
			}
			else
			{
				break;
			}
		}

	}
	else
	{
		std::cout << "Error! File "<<infile<< " not found!" << std::endl;
		return 1;
	}

	std::cout << "Sucessfully read in parameter file." << std::endl;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x2366(%rip), %rsi      # 0x53ce
callq 0x2130
testq %rax, %rax
je 0x38a5
movq %rax, %r15
movq %r14, -0x40(%rbp)
movq %r12, -0x38(%rbp)
movq 0x3f50(%rip), %rdi      # 0x6fd8
leaq 0x22f3(%rip), %rsi      # 0x5382
callq 0x2100
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2100
leaq 0x229e(%rip), %rsi      # 0x5344
movq %rax, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x2090
leaq 0x22ce(%rip), %r13      # 0x538b
leaq -0x140(%rbp), %r12
pushq $0x7
popq %rbx
movq %r15, %rdi
callq 0x2170
testl %eax, %eax
jne 0x3886
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x21d0
cmpl $0x1, %eax
jne 0x3886
movq %r12, %r14
movq -0x140(%rbp), %r12
movabsq $0x656e65476d754e, %rax # imm = 0x656E65476D754E
cmpq %rax, %r12
je 0x3146
movabsq $0x69636f4c6d754e, %rax # imm = 0x69636F4C6D754E
cmpq %rax, %r12
jne 0x3193
movq %r15, %rdi
leaq 0x226c(%rip), %rsi      # 0x538e
leaq -0x2c(%rbp), %rdx
xorl %eax, %eax
callq 0x21d0
movl -0x2c(%rbp), %eax
movq -0x40(%rbp), %rcx
movl %eax, (%rcx)
movq 0x3e9b(%rip), %rdi      # 0x6fd8
leaq 0x224d(%rip), %rsi      # 0x5391
jmp 0x3173
movq %r15, %rdi
leaq 0x223e(%rip), %rsi      # 0x538e
leaq -0x2c(%rbp), %rdx
xorl %eax, %eax
callq 0x21d0
movl -0x2c(%rbp), %eax
movq -0x40(%rbp), %rcx
movl %eax, 0x4(%rcx)
movq 0x3e6c(%rip), %rdi      # 0x6fd8
leaq 0x2227(%rip), %rsi      # 0x539a
callq 0x2100
movl -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2090
movq %r14, %r12
jmp 0x30c7
movq %r14, %rdi
leaq 0x2206(%rip), %rsi      # 0x53a3
pushq $0xb
popq %rdx
callq 0x2120
testl %eax, %eax
je 0x3325
leaq -0x140(%rbp), %rdi
leaq 0x21ff(%rip), %rsi      # 0x53ba
movq %rbx, %r13
movq %rbx, %rdx
callq 0x2120
testl %eax, %eax
je 0x3376
leaq -0x140(%rbp), %rdi
leaq 0x21ed(%rip), %rsi      # 0x53c9
movq %r13, %rdx
callq 0x2120
testl %eax, %eax
je 0x33c0
leaq -0x140(%rbp), %rdi
leaq 0x21de(%rip), %rsi      # 0x53d8
pushq $0xd
popq %rdx
callq 0x2120
testl %eax, %eax
leaq 0x2180(%rip), %r13      # 0x538b
je 0x3418
leaq -0x140(%rbp), %rdi
leaq 0x21d4(%rip), %rsi      # 0x53f3
pushq $0xd
popq %rdx
callq 0x2120
testl %eax, %eax
movq -0x40(%rbp), %r13
je 0x344a
leaq -0x140(%rbp), %rdi
leaq 0x21cd(%rip), %rsi      # 0x540e
pushq $0xd
popq %rdx
callq 0x2120
testl %eax, %eax
je 0x3476
leaq -0x140(%rbp), %rdi
leaq 0x21ca(%rip), %rsi      # 0x5429
pushq $0xd
popq %rdx
callq 0x2120
testl %eax, %eax
leaq 0x211b(%rip), %r13      # 0x538b
je 0x34ce
leaq -0x140(%rbp), %rdi
leaq 0x21b2(%rip), %rsi      # 0x5436
pushq $0x9
popq %rdx
callq 0x2120
testl %eax, %eax
je 0x34ee
leaq -0x140(%rbp), %rdi
leaq 0x219d(%rip), %rsi      # 0x543f
movq %rbx, %rdx
callq 0x2120
testl %eax, %eax
je 0x350f
leaq -0x140(%rbp), %rdi
leaq 0x2186(%rip), %rsi      # 0x5446
pushq $0xd
popq %rdx
callq 0x2120
testl %eax, %eax
je 0x3530
leaq -0x140(%rbp), %rdi
leaq 0x2175(%rip), %rsi      # 0x5453
pushq $0xa
popq %rdx
callq 0x2120
testl %eax, %eax
je 0x3563
movabsq $0x44536573614e44, %rax # imm = 0x44536573614E44
cmpq %rax, %r12
jne 0x3592
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r12
movq %r12, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rdi
jmp 0x3582
movq %r15, %rdi
leaq 0x205f(%rip), %rsi      # 0x538e
leaq -0x2c(%rbp), %rdx
xorl %eax, %eax
callq 0x21d0
movl -0x2c(%rbp), %eax
movq -0x40(%rbp), %rcx
movl %eax, 0x8(%rcx)
movq 0x3c8d(%rip), %rdi      # 0x6fd8
leaq 0x205c(%rip), %rsi      # 0x53ae
callq 0x2100
movl -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2090
leaq -0x140(%rbp), %r12
jmp 0x30c7
movq %r15, %rdi
leaq 0x200e(%rip), %rsi      # 0x538e
leaq -0x2c(%rbp), %rdx
xorl %eax, %eax
callq 0x21d0
movl -0x2c(%rbp), %eax
movq -0x40(%rbp), %rcx
movl %eax, 0xc(%rcx)
movq 0x3c3c(%rip), %rdi      # 0x6fd8
leaq 0x201e(%rip), %rsi      # 0x53c1
callq 0x2100
movl -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2090
movq %r13, %rbx
jmp 0x3405
movq %r15, %rdi
leaq 0x1fc4(%rip), %rsi      # 0x538e
leaq -0x2c(%rbp), %rdx
xorl %eax, %eax
callq 0x21d0
movl -0x2c(%rbp), %eax
movq -0x40(%rbp), %rcx
movl %eax, 0x10(%rcx)
movq 0x3bf2(%rip), %rdi      # 0x6fd8
leaq 0x1fe3(%rip), %rsi      # 0x53d0
callq 0x2100
movl -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2090
leaq 0x1f7f(%rip), %r13      # 0x538b
leaq -0x140(%rbp), %r12
jmp 0x30c7
movq %r15, %rdi
leaq 0x1f6c(%rip), %rsi      # 0x538e
leaq -0x2c(%rbp), %rdx
xorl %eax, %eax
callq 0x21d0
movl -0x2c(%rbp), %eax
movq -0x40(%rbp), %rcx
movl %eax, 0x14(%rcx)
movq 0x3b9a(%rip), %rdi      # 0x6fd8
leaq 0x1fa0(%rip), %rsi      # 0x53e5
jmp 0x3352
movq %r15, %rdi
leaq 0x1f3a(%rip), %rsi      # 0x538e
leaq -0x2c(%rbp), %rdx
xorl %eax, %eax
callq 0x21d0
movl -0x2c(%rbp), %eax
movl %eax, 0x18(%r13)
movq 0x3b6b(%rip), %rdi      # 0x6fd8
leaq 0x1f8c(%rip), %rsi      # 0x5400
jmp 0x34a3
movq %r15, %rdi
leaq 0x1f0e(%rip), %rsi      # 0x538e
leaq -0x2c(%rbp), %rdx
xorl %eax, %eax
callq 0x21d0
movl -0x2c(%rbp), %eax
movq -0x40(%rbp), %rcx
movl %eax, 0x1c(%rcx)
movq 0x3b3c(%rip), %rdi      # 0x6fd8
leaq 0x1f78(%rip), %rsi      # 0x541b
callq 0x2100
movl -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2090
leaq -0x140(%rbp), %r12
leaq 0x1ec2(%rip), %r13      # 0x538b
jmp 0x30c7
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq (%rax), %rdi
jmp 0x354f
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
jmp 0x354f
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
jmp 0x354f
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rdi
movq %r14, %rsi
callq 0x20f0
leaq -0x140(%rbp), %r12
jmp 0x30c7
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r12
movq %r12, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdi
movq %r12, %rsi
callq 0x20f0
movq %r14, %r12
jmp 0x30c7
movq %r14, %r12
movq %r14, %rdi
leaq 0x1ebe(%rip), %rsi      # 0x545d
pushq $0xf
popq %r14
movq %r14, %rdx
callq 0x2120
testl %eax, %eax
je 0x36f8
movq %r12, %rdi
leaq 0x1eaf(%rip), %rsi      # 0x546c
pushq $0x14
popq %rdx
callq 0x2120
testl %eax, %eax
je 0x371c
movq %r12, %rdi
leaq 0x1ea9(%rip), %rsi      # 0x5480
pushq $0xc
popq %rdx
callq 0x2120
testl %eax, %eax
je 0x3740
movq %r12, %rdi
leaq 0x1e9b(%rip), %rsi      # 0x548c
pushq $0x9
popq %rdx
callq 0x2120
testl %eax, %eax
je 0x3764
movq %r12, %rdi
leaq 0x1e8a(%rip), %rsi      # 0x5495
movq %r14, %rdx
callq 0x2120
testl %eax, %eax
je 0x3788
movq %r12, %rdi
leaq 0x1e7f(%rip), %rsi      # 0x54a4
pushq $0xa
popq %rdx
callq 0x2120
testl %eax, %eax
je 0x37ac
movq %r12, %rdi
leaq 0x1e6f(%rip), %rsi      # 0x54ae
movq %r14, %rdx
callq 0x2120
testl %eax, %eax
je 0x37d0
movq %r12, %rdi
leaq 0x1e64(%rip), %rsi      # 0x54bd
movq %r14, %rdx
callq 0x2120
testl %eax, %eax
je 0x37f4
movq %r12, %rdi
leaq 0x1e59(%rip), %rsi      # 0x54cc
movq %r14, %rdx
callq 0x2120
testl %eax, %eax
je 0x3815
movq %r12, %rdi
leaq 0x1e4e(%rip), %rsi      # 0x54db
pushq $0x14
popq %rdx
callq 0x2120
testl %eax, %eax
je 0x3836
movq %r12, %rdi
leaq 0x1e48(%rip), %rsi      # 0x54ef
pushq $0x14
popq %rdx
callq 0x2120
testl %eax, %eax
je 0x3857
movq %r12, %rdi
leaq 0x1e42(%rip), %rsi      # 0x5503
pushq $0x14
popq %rdx
callq 0x2120
testl %eax, %eax
jne 0x3886
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x88(%rax), %rdi
jmp 0x3879
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rdi
jmp 0x3879
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x38(%rax), %rdi
jmp 0x3879
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rdi
jmp 0x3879
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rdi
jmp 0x3879
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x50(%rax), %rdi
jmp 0x3879
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x58(%rax), %rdi
jmp 0x3879
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rdi
jmp 0x3879
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x68(%rax), %rdi
jmp 0x3879
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rdi
jmp 0x3879
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x78(%rax), %rdi
jmp 0x3879
movq %r15, %rdi
movq %r13, %rsi
leaq -0x240(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq -0x38(%rbp), %rax
movq 0x80(%rax), %rdi
movq %r14, %rsi
callq 0x20f0
jmp 0x30c7
movq 0x374b(%rip), %rdi      # 0x6fd8
leaq 0x1c9c(%rip), %rsi      # 0x5530
callq 0x2100
movq %rax, %rdi
callq 0x2090
xorl %eax, %eax
jmp 0x38dd
movq 0x372c(%rip), %rdi      # 0x6fd8
leaq 0x1c64(%rip), %rsi      # 0x5517
callq 0x2100
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2100
leaq 0x1c5a(%rip), %rsi      # 0x5524
movq %rax, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x2090
pushq $0x1
popq %rax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq