// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/poly.c
// Function: polylearn
Polynomptr polylearn(char* trainfname, char* testfname, int maxdegree, double* trainerror, double* testerror, int regression)
{
	/*!Last Changed 22.01.2005 rewritten*/
	/*!Last Changed 02.02.2004 added safemalloc*/
 char varname[MAXLENGTH];
 char varvalue[MAXLENGTH], pst[READLINELENGTH];
	FILE* errorfile;
 Polynomptr p;
	double** traindata, **testdata, bestgeneralization = +LONG_MAX, error, generalizationerror, calcsigma;
	double*** trainfolds, ***testfolds, loglikelihood;
	char fname[20], **fnames, line[READLINELENGTH];
	int traincount, testcount, i, bestdegree = -1, d, j, k, *trainortest;
 int foldcount, foldtraincount, dummy1, dummy2, *ordering;
	traindata = readpolydata(trainfname, &traincount);
	testdata = readpolydata(testfname, &testcount);
	if (get_parameter_l("modelselectionmethod") != 0)
	 {
   for (i = 0; i <= maxdegree; i++)
			 {
				 if (regression)
					 {
  	  	 p = polyfit(traindata, traincount, i);
							error = calculate_mse(traindata, traincount, p);
					 }
					else
					 {
						 p = polyfitcls(traindata, traincount, i);
							error = calculate_poly_clserror(traindata, traincount, p);
							loglikelihood = calculate_poly_loglikelihood(traindata, traincount, p);
					 }
		  	d = i + 1;
			  switch (get_parameter_l("modelselectionmethod"))
					 {
			  		case MODEL_SELECTION_AIC:if (regression)
															                   if (get_parameter_f("sigma") <= 0.0)
																                   {
								                            generalizationerror = aic_squared_error(error, d, traincount);
															  	                  calcsigma = (error * traincount) / (traincount - d);
	                                   sprintf(varname,"aout1[%d]", d);
			                                 set_precision(pst, NULL, NULL);
	                                   sprintf(varvalue, pst, calcsigma);
	                                   set_variable(varname, varvalue);
																                   }
																                  else
																	                   generalizationerror = aic_squared_error_with_sigma(error, d, traincount, get_parameter_f("sigma"));
								                        else
															                   generalizationerror = aic_loglikelihood(loglikelihood, d);
														                  break;
			  		case MODEL_SELECTION_BIC:if (regression)
															                   if (get_parameter_f("sigma") <= 0.0)
																                   {
														  	                   generalizationerror = bic_squared_error(error, d, traincount);
														  		                  calcsigma = (error * traincount) / (traincount - d);
	                                   sprintf(varname,"aout1[%d]", d);
			                                 set_precision(pst, NULL, NULL);
	                                   sprintf(varvalue, pst, calcsigma);
	                                   set_variable(varname, varvalue);
																                   }
																                  else
																	                   generalizationerror = bic_squared_error_with_sigma(error, d, traincount, get_parameter_f("sigma"));
								                        else
															                   generalizationerror = bic_loglikelihood(loglikelihood, d, traincount);
								                        break;
			  		case MODEL_SELECTION_SRM:if (regression) 
															                   generalizationerror = srm_regression(error, d, traincount, 1.0, 1.0);
								                        else
															                   generalizationerror = srm_classification(error, d, traincount, 1.0, 1.0);
														                  break;
				  	case MODEL_SELECTION_MDL:if (regression)
  								                        generalizationerror = mdl(error, d, 1.0 / traincount, 6);
								                        else
															                   generalizationerror = mdl(error, d, 0.01, 6);
														                  break;
					 }
					if (generalizationerror < bestgeneralization)
					 {
						 bestdegree = i;
       bestgeneralization = generalizationerror;
					 }
			  free_polynom(p);
			 }
	 }
	else
	 {
		 if (traincount < 50) /*Leave one out*/
			 {
				 foldcount = traincount;
					foldtraincount = traincount - 1;
				 trainfolds = (double***) safemalloc_3d(sizeof(double**), sizeof(double*), sizeof(double), traincount, traincount - 1, 2, "polylearn", 37);
					testfolds = (double***) safemalloc_3d(sizeof(double**), sizeof(double*), sizeof(double), traincount, 1, 2, "polylearn", 38);
					for (i = 0; i < traincount; i++)
					 { /*Prepare fold i*/
							k = 0;
							for (j = 0; j < traincount; j++)
								 if (i != j)
									 {
										 trainfolds[i][k][0] = traindata[j][0];
										 trainfolds[i][k][1] = traindata[j][1];
											k++;
									 }
									else
									 {
										 testfolds[i][0][0] = traindata[j][0];
										 testfolds[i][0][1] = traindata[j][1];
									 }       
					 }
			 }
			else /*5x2 Cross validation*/
			 {
				 foldcount = 10;
					foldtraincount = traincount / 2;
				 trainfolds = (double***) safemalloc_3d(sizeof(double**), sizeof(double*), sizeof(double), 10, traincount / 2, 2, "polylearn", 63);
					testfolds = (double***) safemalloc_3d(sizeof(double**), sizeof(double*), sizeof(double), 10, traincount / 2, 2, "polylearn", 64);
					for (i = 0; i < 5; i++)
					 {
       trainortest = random_array(traincount);
							k = 0;
       for (j = 0; j < traincount; j++)
								 if (trainortest[j] % 2 == 0)
									 {
										 trainfolds[2 * i][k][0] = traindata[j][0];
										 trainfolds[2 * i][k][1] = traindata[j][1];
											testfolds[2 * i + 1][k][0] = traindata[j][0];
											testfolds[2 * i + 1][k][1] = traindata[j][1];
											k++;
									 }
									else
									 {
										 trainfolds[2 * i + 1][j - k][0] = traindata[j][0];
										 trainfolds[2 * i + 1][j - k][1] = traindata[j][1];
											testfolds[2 * i][j - k][0] = traindata[j][0];
											testfolds[2 * i][j - k][1] = traindata[j][1];										 
									 }
					  safe_free(trainortest);
					 }
			 }
			fnames = safemalloc((maxdegree + 1) * sizeof(char *), "polylearn", 138); 
   for (i = 0; i <= maxdegree; i++)
			 { 
				 sprintf(fname, "%s/error%d.txt", get_parameter_s("tempdirectory"), i);
					fnames[i] = strcopy(fnames[i], fname);
				 errorfile = fopen(fname, "w");
					if (!errorfile)
						 return NULL;
				 for (j = 0; j < foldcount; j++)
					 {
						 if (regression)
							 {
  						 p = polyfit(trainfolds[j], foldtraincount, i);
							  error = calculate_mse(testfolds[j], traincount - foldtraincount, p);
							 }
							else
							 {
								 p = polyfitcls(trainfolds[j], foldtraincount, i);
									error = calculate_poly_clserror(testfolds[j], traincount - foldtraincount, p);
							 }
			    set_precision(pst, NULL, "\n");
							fprintf(errorfile, pst, error);
							free_polynom(p);
					 }
					fclose(errorfile);
 			}
			free_3d((void***)trainfolds, foldcount, foldtraincount);
			free_3d((void***)testfolds, foldcount, traincount - foldtraincount);
			sprintf(line, "-");
			ordering = multiple_comparison(fnames, maxdegree + 1, get_parameter_l("testtype"), line, &dummy1, &dummy2, get_parameter_l("correctiontype"));
			bestdegree = ordering[0] - 1;
			safe_free(ordering);
   free_2d((void**)fnames, maxdegree + 1);
	 }
	if (regression)
	 {
  	p = polyfit(traindata, traincount, bestdegree);
	  *trainerror = calculate_mse(traindata, traincount, p);
	  *testerror = calculate_mse(testdata, testcount, p);
	 }
 else
	 {
		 p = polyfitcls(traindata, traincount, bestdegree);
			*trainerror = calculate_poly_clserror(traindata, traincount, p);
			*testerror = calculate_poly_clserror(testdata, testcount, p);
	 }
	free_2d((void**)traindata, traincount);
	free_2d((void**)testdata, testcount);
 return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e85f0, %rsp         # imm = 0x1E85F0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movsd 0x5feb6(%rip), %xmm0    # 0xe2fb0
movsd %xmm0, -0x16e3c8(%rbp)
movl $0xffffffff, -0x1e8550(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rdi
leaq -0x1e8544(%rbp), %rsi
callq 0x80b50
movq %rax, -0x16e3b8(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x1e8548(%rbp), %rsi
callq 0x80b50
movq %rax, -0x16e3c0(%rbp)
leaq 0x5f39a(%rip), %rdi     # 0xe24db
callq 0x792b0
cmpl $0x0, %eax
je 0x83631
movl $0x0, -0x1e854c(%rbp)
movl -0x1e854c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jg 0x8362c
cmpl $0x0, -0x34(%rbp)
je 0x831b0
movq -0x16e3b8(%rbp), %rdi
movl -0x1e8544(%rbp), %esi
movl -0x1e854c(%rbp), %edx
callq 0x82990
movq %rax, -0x16e3b0(%rbp)
movq -0x16e3b8(%rbp), %rdi
movl -0x1e8544(%rbp), %esi
movq -0x16e3b0(%rbp), %rdx
callq 0x82780
movsd %xmm0, -0x16e3d0(%rbp)
jmp 0x83211
movq -0x16e3b8(%rbp), %rdi
movl -0x1e8544(%rbp), %esi
movl -0x1e854c(%rbp), %edx
callq 0x82ca0
movq %rax, -0x16e3b0(%rbp)
movq -0x16e3b8(%rbp), %rdi
movl -0x1e8544(%rbp), %esi
movq -0x16e3b0(%rbp), %rdx
callq 0x82580
movsd %xmm0, -0x16e3d0(%rbp)
movq -0x16e3b8(%rbp), %rdi
movl -0x1e8544(%rbp), %esi
movq -0x16e3b0(%rbp), %rdx
callq 0x82680
movsd %xmm0, -0x16e3f8(%rbp)
movl -0x1e854c(%rbp), %eax
incl %eax
movl %eax, -0x1e8554(%rbp)
leaq 0x5f2b5(%rip), %rdi     # 0xe24db
callq 0x792b0
decl %eax
movl %eax, %ecx
movq %rcx, -0x1e8588(%rbp)
subl $0x3, %eax
ja 0x835da
movq -0x1e8588(%rbp), %rax
leaq 0x6458b(%rip), %rcx     # 0xe77d8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, -0x34(%rbp)
je 0x8338f
leaq 0x5f2da(%rip), %rdi     # 0xe2541
callq 0x79040
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jb 0x8332f
movsd -0x16e3d0(%rbp), %xmm0
cvtsi2sdl -0x1e8554(%rbp), %xmm1
movl -0x1e8544(%rbp), %edi
callq 0x663e0
movsd %xmm0, -0x16e3d8(%rbp)
movsd -0x16e3d0(%rbp), %xmm0
cvtsi2sdl -0x1e8544(%rbp), %xmm1
mulsd %xmm1, %xmm0
movl -0x1e8544(%rbp), %eax
subl -0x1e8554(%rbp), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x16e3e0(%rbp)
leaq -0x7a160(%rbp), %rdi
movl -0x1e8554(%rbp), %edx
leaq 0x62e90(%rip), %rsi     # 0xe6173
movb $0x0, %al
callq 0x4170
leaq -0x16e3a0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x53310
leaq -0xf4280(%rbp), %rdi
leaq -0x16e3a0(%rbp), %rsi
movsd -0x16e3e0(%rbp), %xmm0
movb $0x1, %al
callq 0x4170
leaq -0x7a160(%rbp), %rdi
leaq -0xf4280(%rbp), %rsi
callq 0x493b0
jmp 0x8338d
movsd -0x16e3d0(%rbp), %xmm0
movsd %xmm0, -0x1e8590(%rbp)
cvtsi2sdl -0x1e8554(%rbp), %xmm0
movsd %xmm0, -0x1e85a0(%rbp)
movl -0x1e8544(%rbp), %eax
movl %eax, -0x1e8594(%rbp)
leaq 0x5f1df(%rip), %rdi     # 0xe2541
callq 0x79040
movsd -0x1e85a0(%rbp), %xmm1
movl -0x1e8594(%rbp), %edi
movaps %xmm0, %xmm2
movsd -0x1e8590(%rbp), %xmm0
callq 0x67890
movsd %xmm0, -0x16e3d8(%rbp)
jmp 0x833ac
movsd -0x16e3f8(%rbp), %xmm0
cvtsi2sdl -0x1e8554(%rbp), %xmm1
callq 0x66430
movsd %xmm0, -0x16e3d8(%rbp)
jmp 0x835da
cmpl $0x0, -0x34(%rbp)
je 0x834ea
leaq 0x5f17f(%rip), %rdi     # 0xe2541
callq 0x79040
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jb 0x8348a
movsd -0x16e3d0(%rbp), %xmm0
cvtsi2sdl -0x1e8554(%rbp), %xmm1
movl -0x1e8544(%rbp), %edi
callq 0x66950
movsd %xmm0, -0x16e3d8(%rbp)
movsd -0x16e3d0(%rbp), %xmm0
cvtsi2sdl -0x1e8544(%rbp), %xmm1
mulsd %xmm1, %xmm0
movl -0x1e8544(%rbp), %eax
subl -0x1e8554(%rbp), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x16e3e0(%rbp)
leaq -0x7a160(%rbp), %rdi
movl -0x1e8554(%rbp), %edx
leaq 0x62d35(%rip), %rsi     # 0xe6173
movb $0x0, %al
callq 0x4170
leaq -0x16e3a0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x53310
leaq -0xf4280(%rbp), %rdi
leaq -0x16e3a0(%rbp), %rsi
movsd -0x16e3e0(%rbp), %xmm0
movb $0x1, %al
callq 0x4170
leaq -0x7a160(%rbp), %rdi
leaq -0xf4280(%rbp), %rsi
callq 0x493b0
jmp 0x834e8
movsd -0x16e3d0(%rbp), %xmm0
movsd %xmm0, -0x1e85a8(%rbp)
cvtsi2sdl -0x1e8554(%rbp), %xmm0
movsd %xmm0, -0x1e85b8(%rbp)
movl -0x1e8544(%rbp), %eax
movl %eax, -0x1e85ac(%rbp)
leaq 0x5f084(%rip), %rdi     # 0xe2541
callq 0x79040
movsd -0x1e85b8(%rbp), %xmm1
movl -0x1e85ac(%rbp), %edi
movaps %xmm0, %xmm2
movsd -0x1e85a8(%rbp), %xmm0
callq 0x678e0
movsd %xmm0, -0x16e3d8(%rbp)
jmp 0x8350d
movsd -0x16e3f8(%rbp), %xmm0
cvtsi2sdl -0x1e8554(%rbp), %xmm1
movl -0x1e8544(%rbp), %edi
callq 0x669d0
movsd %xmm0, -0x16e3d8(%rbp)
jmp 0x835da
cmpl $0x0, -0x34(%rbp)
je 0x83546
movsd -0x16e3d0(%rbp), %xmm0
movl -0x1e8554(%rbp), %edi
movl -0x1e8544(%rbp), %esi
movsd 0x5eae4(%rip), %xmm2    # 0xe2018
movaps %xmm2, %xmm1
callq 0x67ad0
movsd %xmm0, -0x16e3d8(%rbp)
jmp 0x83572
movsd -0x16e3d0(%rbp), %xmm0
movl -0x1e8554(%rbp), %edi
movl -0x1e8544(%rbp), %esi
movsd 0x5eab6(%rip), %xmm2    # 0xe2018
movaps %xmm2, %xmm1
callq 0x67a20
movsd %xmm0, -0x16e3d8(%rbp)
jmp 0x835da
cmpl $0x0, -0x34(%rbp)
je 0x835b0
movsd -0x16e3d0(%rbp), %xmm0
movl -0x1e8554(%rbp), %edi
cvtsi2sdl -0x1e8544(%rbp), %xmm2
movsd 0x5ea80(%rip), %xmm1    # 0xe2018
divsd %xmm2, %xmm1
movl $0x6, %esi
callq 0x67b80
movsd %xmm0, -0x16e3d8(%rbp)
jmp 0x835d8
movsd -0x16e3d0(%rbp), %xmm0
movl -0x1e8554(%rbp), %edi
movsd 0x5ea5a(%rip), %xmm1    # 0xe2020
movl $0x6, %esi
callq 0x67b80
movsd %xmm0, -0x16e3d8(%rbp)
jmp 0x835da
movsd -0x16e3d8(%rbp), %xmm1
movsd -0x16e3c8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x8360c
movl -0x1e854c(%rbp), %eax
movl %eax, -0x1e8550(%rbp)
movsd -0x16e3d8(%rbp), %xmm0
movsd %xmm0, -0x16e3c8(%rbp)
movq -0x16e3b0(%rbp), %rdi
callq 0x815c0
movl -0x1e854c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e854c(%rbp)
jmp 0x83159
jmp 0x83ed1
cmpl $0x32, -0x1e8544(%rbp)
jge 0x8383c
movl -0x1e8544(%rbp), %eax
movl %eax, -0x1e856c(%rbp)
movl -0x1e8544(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x1e8570(%rbp)
movl -0x1e8544(%rbp), %ecx
movl -0x1e8544(%rbp), %r8d
subl $0x1, %r8d
movl $0x8, %edx
movl $0x2, %r9d
leaq 0x6420d(%rip), %rax     # 0xe7889
movq %rdx, %rdi
movq %rdx, %rsi
movq %rax, (%rsp)
movl $0x25, 0x8(%rsp)
callq 0x531b0
movq %rax, -0x16e3e8(%rbp)
movl -0x1e8544(%rbp), %ecx
movl $0x8, %edx
movl $0x1, %r8d
movl $0x2, %r9d
leaq 0x641d1(%rip), %rax     # 0xe7889
movq %rdx, %rdi
movq %rdx, %rsi
movq %rax, (%rsp)
movl $0x26, 0x8(%rsp)
callq 0x531b0
movq %rax, -0x16e3f0(%rbp)
movl $0x0, -0x1e854c(%rbp)
movl -0x1e854c(%rbp), %eax
cmpl -0x1e8544(%rbp), %eax
jge 0x83837
movl $0x0, -0x1e855c(%rbp)
movl $0x0, -0x1e8558(%rbp)
movl -0x1e8558(%rbp), %eax
cmpl -0x1e8544(%rbp), %eax
jge 0x83821
movl -0x1e854c(%rbp), %eax
cmpl -0x1e8558(%rbp), %eax
je 0x837ab
movq -0x16e3b8(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
movq -0x16e3e8(%rbp), %rax
movslq -0x1e854c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1e855c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax)
movq -0x16e3b8(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd 0x8(%rax), %xmm0
movq -0x16e3e8(%rbp), %rax
movslq -0x1e854c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1e855c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, 0x8(%rax)
movl -0x1e855c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e855c(%rbp)
jmp 0x8380b
movq -0x16e3b8(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
movq -0x16e3f0(%rbp), %rax
movslq -0x1e854c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movsd %xmm0, (%rax)
movq -0x16e3b8(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd 0x8(%rax), %xmm0
movq -0x16e3f0(%rbp), %rax
movslq -0x1e854c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movsd %xmm0, 0x8(%rax)
jmp 0x8380d
movl -0x1e8558(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8558(%rbp)
jmp 0x83706
jmp 0x83823
movl -0x1e854c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e854c(%rbp)
jmp 0x836e0
jmp 0x83baf
movl $0xa, -0x1e856c(%rbp)
movl -0x1e8544(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x1e8570(%rbp)
movl -0x1e8544(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %r8d
movl $0x8, %edx
movl $0xa, %ecx
movl $0x2, %r9d
leaq 0x64007(%rip), %rax     # 0xe7889
movq %rdx, %rdi
movq %rdx, %rsi
movq %rax, (%rsp)
movl $0x3f, 0x8(%rsp)
callq 0x531b0
movq %rax, -0x16e3e8(%rbp)
movl -0x1e8544(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %r8d
movl $0x8, %edx
movl $0xa, %ecx
movl $0x2, %r9d
leaq 0x63fc1(%rip), %rax     # 0xe7889
movq %rdx, %rdi
movq %rdx, %rsi
movq %rax, (%rsp)
movl $0x40, 0x8(%rsp)
callq 0x531b0
movq %rax, -0x16e3f0(%rbp)
movl $0x0, -0x1e854c(%rbp)
cmpl $0x5, -0x1e854c(%rbp)
jge 0x83bad
movl -0x1e8544(%rbp), %edi
callq 0x54600
movq %rax, -0x1e8568(%rbp)
movl $0x0, -0x1e855c(%rbp)
movl $0x0, -0x1e8558(%rbp)
movl -0x1e8558(%rbp), %eax
cmpl -0x1e8544(%rbp), %eax
jge 0x83b8d
movq -0x1e8568(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x83a61
movq -0x16e3b8(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
movq -0x16e3e8(%rbp), %rax
movl -0x1e854c(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1e855c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax)
movq -0x16e3b8(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd 0x8(%rax), %xmm0
movq -0x16e3e8(%rbp), %rax
movl -0x1e854c(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1e855c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, 0x8(%rax)
movq -0x16e3b8(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
movq -0x16e3f0(%rbp), %rax
movl -0x1e854c(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1e855c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax)
movq -0x16e3b8(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd 0x8(%rax), %xmm0
movq -0x16e3f0(%rbp), %rax
movl -0x1e854c(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1e855c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, 0x8(%rax)
movl -0x1e855c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e855c(%rbp)
jmp 0x83b77
movq -0x16e3b8(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
movq -0x16e3e8(%rbp), %rax
movl -0x1e854c(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl -0x1e8558(%rbp), %ecx
subl -0x1e855c(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax)
movq -0x16e3b8(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd 0x8(%rax), %xmm0
movq -0x16e3e8(%rbp), %rax
movl -0x1e854c(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl -0x1e8558(%rbp), %ecx
subl -0x1e855c(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, 0x8(%rax)
movq -0x16e3b8(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
movq -0x16e3f0(%rbp), %rax
movl -0x1e854c(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl -0x1e8558(%rbp), %ecx
subl -0x1e855c(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax)
movq -0x16e3b8(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd 0x8(%rax), %xmm0
movq -0x16e3f0(%rbp), %rax
movl -0x1e854c(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl -0x1e8558(%rbp), %ecx
subl -0x1e855c(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, 0x8(%rax)
jmp 0x83b79
movl -0x1e8558(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8558(%rbp)
jmp 0x83923
movq -0x1e8568(%rbp), %rdi
callq 0x52e80
movl -0x1e854c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e854c(%rbp)
jmp 0x838f0
jmp 0x83baf
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
leaq 0x63cc6(%rip), %rsi     # 0xe7889
movl $0x8a, %edx
callq 0x52d70
movq %rax, -0x16e418(%rbp)
movl $0x0, -0x1e854c(%rbp)
movl -0x1e854c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jg 0x83dd9
leaq -0x16e410(%rbp), %rax
movq %rax, -0x1e85c0(%rbp)
leaq 0x6337a(%rip), %rdi     # 0xe6f7c
callq 0x79190
movq -0x1e85c0(%rbp), %rdi
movq %rax, %rdx
movl -0x1e854c(%rbp), %ecx
leaq 0x63c75(%rip), %rsi     # 0xe7893
movb $0x0, %al
callq 0x4170
movq -0x16e418(%rbp), %rax
movslq -0x1e854c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x16e410(%rbp), %rsi
callq 0x54ba0
movq %rax, %rdx
movq -0x16e418(%rbp), %rax
movslq -0x1e854c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
leaq -0x16e410(%rbp), %rdi
leaq 0x64558(%rip), %rsi     # 0xe81be
callq 0x40c0
movq %rax, -0x16e3a8(%rbp)
cmpq $0x0, -0x16e3a8(%rbp)
jne 0x83c89
movq $0x0, -0x8(%rbp)
jmp 0x83fca
movl $0x0, -0x1e8558(%rbp)
movl -0x1e8558(%rbp), %eax
cmpl -0x1e856c(%rbp), %eax
jge 0x83db9
cmpl $0x0, -0x34(%rbp)
je 0x83d09
movq -0x16e3e8(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl -0x1e8570(%rbp), %esi
movl -0x1e854c(%rbp), %edx
callq 0x82990
movq %rax, -0x16e3b0(%rbp)
movq -0x16e3f0(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl -0x1e8544(%rbp), %esi
subl -0x1e8570(%rbp), %esi
movq -0x16e3b0(%rbp), %rdx
callq 0x82780
movsd %xmm0, -0x16e3d0(%rbp)
jmp 0x83d65
movq -0x16e3e8(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl -0x1e8570(%rbp), %esi
movl -0x1e854c(%rbp), %edx
callq 0x82ca0
movq %rax, -0x16e3b0(%rbp)
movq -0x16e3f0(%rbp), %rax
movslq -0x1e8558(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl -0x1e8544(%rbp), %esi
subl -0x1e8570(%rbp), %esi
movq -0x16e3b0(%rbp), %rdx
callq 0x82580
movsd %xmm0, -0x16e3d0(%rbp)
leaq -0x16e3a0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x61fc4(%rip), %rdx     # 0xe5d3b
callq 0x53310
movq -0x16e3a8(%rbp), %rdi
leaq -0x16e3a0(%rbp), %rsi
movsd -0x16e3d0(%rbp), %xmm0
movb $0x1, %al
callq 0x4280
movq -0x16e3b0(%rbp), %rdi
callq 0x815c0
movl -0x1e8558(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8558(%rbp)
jmp 0x83c93
movq -0x16e3a8(%rbp), %rdi
callq 0x4250
movl -0x1e854c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e854c(%rbp)
jmp 0x83bde
movq -0x16e3e8(%rbp), %rdi
movl -0x1e856c(%rbp), %esi
movl -0x1e8570(%rbp), %edx
callq 0x52ea0
movq -0x16e3f0(%rbp), %rdi
movl -0x1e856c(%rbp), %esi
movl -0x1e8544(%rbp), %edx
subl -0x1e8570(%rbp), %edx
callq 0x52ea0
leaq -0x1e8540(%rbp), %rdi
leaq 0x61d65(%rip), %rsi     # 0xe5b82
movb $0x0, %al
callq 0x4170
movq -0x16e418(%rbp), %rax
movq %rax, -0x1e85d8(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e85d0(%rbp)
leaq 0x6317c(%rip), %rdi     # 0xe6fc1
callq 0x792b0
movl %eax, -0x1e85cc(%rbp)
leaq -0x1e8540(%rbp), %rax
movq %rax, -0x1e85c8(%rbp)
leaq 0x5e848(%rip), %rdi     # 0xe26ad
callq 0x792b0
movq -0x1e85d8(%rbp), %rdi
movl -0x1e85d0(%rbp), %esi
movl -0x1e85cc(%rbp), %edx
movq -0x1e85c8(%rbp), %rcx
leaq -0x1e8574(%rbp), %r8
leaq -0x1e8578(%rbp), %r9
movl %eax, (%rsp)
callq 0xc3c40
movq %rax, -0x1e8580(%rbp)
movq -0x1e8580(%rbp), %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x1e8550(%rbp)
movq -0x1e8580(%rbp), %rdi
callq 0x52e80
movq -0x16e418(%rbp), %rdi
movl -0x1c(%rbp), %esi
addl $0x1, %esi
callq 0x52e20
cmpl $0x0, -0x34(%rbp)
je 0x83f3a
movq -0x16e3b8(%rbp), %rdi
movl -0x1e8544(%rbp), %esi
movl -0x1e8550(%rbp), %edx
callq 0x82990
movq %rax, -0x16e3b0(%rbp)
movq -0x16e3b8(%rbp), %rdi
movl -0x1e8544(%rbp), %esi
movq -0x16e3b0(%rbp), %rdx
callq 0x82780
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x16e3c0(%rbp), %rdi
movl -0x1e8548(%rbp), %esi
movq -0x16e3b0(%rbp), %rdx
callq 0x82780
movq -0x30(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x83f9b
movq -0x16e3b8(%rbp), %rdi
movl -0x1e8544(%rbp), %esi
movl -0x1e8550(%rbp), %edx
callq 0x82ca0
movq %rax, -0x16e3b0(%rbp)
movq -0x16e3b8(%rbp), %rdi
movl -0x1e8544(%rbp), %esi
movq -0x16e3b0(%rbp), %rdx
callq 0x82580
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x16e3c0(%rbp), %rdi
movl -0x1e8548(%rbp), %esi
movq -0x16e3b0(%rbp), %rdx
callq 0x82580
movq -0x30(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x16e3b8(%rbp), %rdi
movl -0x1e8544(%rbp), %esi
callq 0x52e20
movq -0x16e3c0(%rbp), %rdi
movl -0x1e8548(%rbp), %esi
callq 0x52e20
movq -0x16e3b0(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x1e85f0, %rsp         # imm = 0x1E85F0
popq %rbp
retq
nopw (%rax,%rax)