// File: /workspace/github_cpp_makefile_star2_O2/myudelson[P]hmm-scalable/trainhmmst.cpp
// Function: parse_arguments_step2(int, char**, _IO_FILE*)
void parse_arguments_step2(int argc, char **argv, FILE *fid_console) {
	// parse command line options, starting from 1 (0 is path to executable)
	// go in pairs, looking at whether first in pair starts with '-', if not, stop parsing arguments
    
    // at this time we do know nO (the number of observations)
	int i;
    int n, expected_n;
    char *ch;
	for(i=1;i<argc;i++)
	{
		if(argv[i][0] != '-') break; // end of options stop parsing
		if(++i>=argc)
			exit_with_help();
		switch(argv[i-1][1])
		{
			case '0': // init_params
				int len;
				len = (int)strlen( argv[i] );
				// count delimiters
				n = 1; // start with 1
				for(int j=0;j<len;j++) {
					n += (argv[i][j]==',')?1:0;
                    if( (argv[i][j] >= 'a' && argv[i][j] <= 'z') || (argv[i][j] >= 'A' && argv[i][j] <= 'Z') ) {
                        strcpy(task.initfile, argv[i]);
                        break;
                    }
                }
                // init parameters
                if(task.init_param_values!=NULL) free(task.init_param_values);
                task.init_param_values = Calloc(NUMBER, (size_t)n);
                task.init_param_values_n = (NPAR)n;
                // read params and write to params
                task.init_param_values[0] = atof( strtok(argv[i],",\t\n\r") );
                for(int j=1; j<n; j++) {
                    task.init_param_values[j] = atof( strtok(NULL,",\t\n\r") );
                }
				break;
			case 'l': // lower boundaries
				len = (int)strlen( argv[i] );
				// count delimiters
				n = 1; // start with 1
				for(int j=0;j<len;j++)
					n += (NPAR)((argv[i][j]==',')?1:0);
				// init params
				if(task.param_values_lb!=NULL) free(task.param_values_lb);
				task.param_values_lb = Calloc(NUMBER, (size_t)n);
				// read params and write to params
				task.param_values_lb[0] = atof( strtok(argv[i],",\t\n\r") );
                for(int j=1; j<n; j++) {
					task.param_values_lb[j] = atof( strtok(NULL,",\t\n\r") );
//                    if(task.param_lo[j] >0) {
//                        int a = 0;
//                    }
                }
                // check if the number of lower boundaries corresponds
                expected_n = task.nS +
                    ((task.sliced==1 && (task.structure==STRUCTURE_SKAslc || task.structure==STRUCTURE_SKABslc) )?task.nZ:1)*task.nS*task.nS +
                    ((task.sliced==1 && task.structure==STRUCTURE_SKABslc )?task.nZ:1)*task.nS*task.nO;
                if( n != expected_n ) {
//                    fprintf(stderr,"Structure=%d, nS=%d, nO=%d, nZ=%d, The expected n=%d specified=%d\n",task.structure,task.nS,task.nO,task.nZ,expected_n,n);
                    fprintf(stderr,"The expected number of lower parameter boundaries is %d and it is %d\n",expected_n,n);
                    exit_with_help();
                }
                task.lb_specd = true;
				break;
			case 'u': // upper boundaries
				len = (int)strlen( argv[i] );
				// count delimiters
				n = 1; // start with 1
				for(int j=0;j<len;j++)
					n += (argv[i][j]==',')?1:0;
				// init params
				if(task.param_values_ub!=NULL) free(task.param_values_ub);
				task.param_values_ub = Calloc(NUMBER, (size_t)n);
				// read params and write to params
				task.param_values_ub[0] = atof( strtok(argv[i],",\t\n\r") );
                for(int j=1; j<n; j++) {
					task.param_values_ub[j] = atof( strtok(NULL,",\t\n\r") );
//                    if(task.param_hi[j] < 1) {
//                        int a = 0;
//                    }
                }
                // check if the number of upper boundaries corresponds
                expected_n = task.nS +
                    ((task.sliced==1 && (task.structure==STRUCTURE_SKAslc || task.structure==STRUCTURE_SKABslc) )?task.nZ:1)*task.nS*task.nS +
                    ((task.sliced==1 && task.structure==STRUCTURE_SKABslc )?task.nZ:1)*task.nS*task.nO;
                if( n != expected_n ) {
                    fprintf(stderr,"The expected number of upper parameter boundaries is %d and it is %d\n",expected_n,n);
                    exit_with_help();
                }
                task.ub_specd = true;
				break;
			case 'B': // block fitting
                // first
				task.block_fitting[0] = (NPAR)atoi( strtok(argv[i],",\t\n\r") );
                if(task.block_fitting[0]!=0 && task.block_fitting[0]!=1) {
                    fprintf(stderr,"Values of blocking the fitting flags shuld only be 0 or 1.\n");
                    if(task.duplicate_console==1) fprintf(fid_console,"Values of blocking the fitting flags shuld only be 0 or 1.\n");
                    exit_with_help();
                }
                // second
                ch = strtok(NULL,",\t\n\r"); // could be NULL (default GD solver)
                if(ch != NULL) {
                    task.block_fitting[1] = (NPAR)atoi(ch);
                    if(task.block_fitting[1]!=0 && task.block_fitting[1]!=1) {
                        fprintf(stderr,"Values of blocking the fitting flags shuld only be 0 or 1.\n");
                        if(task.duplicate_console==1) fprintf(fid_console,"Values of blocking the fitting flags shuld only be 0 or 1.\n");
                        exit_with_help();
                    }
                }
                else {
                    fprintf(stderr,"There should be 3 blockig the fitting flags specified.\n");
                    if(task.duplicate_console==1) fprintf(fid_console,"There should be 3 blockig the fitting flags specified.\n");
                    exit_with_help();
                }
                // third
                ch = strtok(NULL,",\t\n\r"); // could be NULL (default GD solver)
                if(ch != NULL) {
                    task.block_fitting[2] = (NPAR)atoi(ch);
                    if(task.block_fitting[2]!=0 && task.block_fitting[2]!=1) {
                        fprintf(stderr,"Values of blocking the fitting flags shuld only be 0 or 1.\n");
                        if(task.duplicate_console==1) fprintf(fid_console,"Values of blocking the fitting flags shuld only be 0 or 1.\n");
                        exit_with_help();
                    }
                }
                else {
                    fprintf(stderr,"There should be 3 blockig the fitting flags specified.\n");
                    if(task.duplicate_console==1) fprintf(fid_console,"There should be 3 blockig the fitting flags specified.\n");
                    exit_with_help();
                }
				break;
			case 'c': {
                    // this version with per-parameter center of gravity in Pi, A, and B
                    NPAR nS = task.nS;
                    NPAR nO = task.nO;
                    int nPerSlice = 1 + nS + nS*nS + nS*nO; // parameters per slice
                    int nCenters = nS + nS*nS + nS*nO; // centers per slice
                    StripedArray<NUMBER> * tmp_array = new StripedArray<NUMBER>();
                    ch = strtok(argv[i],",\t\n\r");
                    while( ch != NULL ) {
                        tmp_array->add( atof(ch) );
                        ch = strtok(NULL,",\t\n\r");
                    }
                    if( (tmp_array->getSize() % nPerSlice) != 0 ) {
                        fprintf(stderr,"The number of regularization parameters should be a multiple of %d and it is %d\n",nPerSlice,tmp_array->getSize());
                        exit_with_help();
                    }
                    task.Cslices = (NPAR) ( tmp_array->getSize() / nPerSlice );
                    task.Cw = Calloc(NUMBER, (size_t)task.Cslices);
                    task.Ccenters = Calloc(NUMBER, (size_t)(task.Cslices * nCenters) );
                    int c1 = 0/*counter for weights*/, c2 = 0/*counter for centers*/, i = 0/*counter for tmp_array*/;
                    for(int l=0; l<(int)tmp_array->getSize() / nPerSlice; l++) {
                        task.Cw[c1++] = tmp_array->get((NDAT)i++);
                        for(int j=0; j<nCenters; j++)
                            task.Ccenters[c2++] = tmp_array->get((NDAT)i++);
                    }
                    delete tmp_array;
                }
                break;
            case 'k':
                // ELO parameters specified as a comma-delimited list of values, first is an integer, the rest are real
                len = (int)strlen( argv[i] );
                // count delimiters
                n = 1; // start with 1
                for(int j=0;j<len;j++)
                    n += (NPAR)((argv[i][j]==',')?1:0);
                if( n < 3 ) {
                    fprintf(stderr,"To use Elo, one needs at lest three parameters; %d were specified\n",n);
                    exit_with_help();
                }
                // init params
                task.elo_param_values_n = (NPAR)(n-2); // first parameter is Elo type
                if(task.elo_param_values!=NULL) free(task.elo_param_values);
                task.elo_param_values = Calloc(NUMBER, (size_t)(n-2));
                // read params and write to params
                task.elo_type = (NPAR)atoi( strtok(argv[i],",\t\n\r") );
                task.elo_scope = (NCAT)atof( strtok(NULL,",\t\n\r") );
                for(int j=2; j<n; j++) {
                    task.elo_param_values[j-2] = atof( strtok(NULL,",\t\n\r") );
                }
                break;
                
        } // end switch
    }// end for
    
    // post parse actions
    
    // post-argument checks
    if( task.cv_target_obs>(task.nO-1)) {
        fprintf(stderr,"target observation to be cross-validated against cannot be '%d'\n",task.cv_target_obs+1);
        if(task.duplicate_console==1) fprintf(fid_console,"target observation to be cross-validated against cannot be '%d'\n",task.cv_target_obs+1);
        exit_with_help();
    }
    if(task.metrics_target_obs>(task.nO-1)) {
        fprintf(stderr,"target observation to compute metrics against cannot be '%d'\n",task.metrics_target_obs+1);
        if(task.duplicate_console==1) fprintf(fid_console,"target observation to compute metrics against cannot be '%d'\n",task.metrics_target_obs+1);
        exit_with_help();
    }
    
    if( !( (task.elo_param_values_n==0 && task.elo_type==0 && task.structure != STRUCTURE_ELO) || // not an Elo
           (task.elo_param_values_n==1 && task.elo_type==1 && task.structure == STRUCTURE_ELO) || // Simple Elo
           (task.elo_param_values_n==1 && task.elo_type==2 && task.structure == STRUCTURE_ELO) || // relation Uncertainty \frac{1}{1+b*n} Elo
           (task.elo_param_values_n==1 && task.elo_type==3 && task.structure == STRUCTURE_ELO) || // relation Uncertainty \frac{1}{1+b*e^{0.01*n}} Elo
           (task.elo_param_values_n==1 && task.elo_type==4 && task.structure == STRUCTURE_ELO)    // linear trend from 1 to 0 in b steps
          ) ) {
        fprintf(stderr,"Elo type specified (%d) does not match the number of Elo parameters (%d)\n",task.elo_type,task.elo_param_values_n);
        exit_with_help();
    }
    
    if( task.structure == STRUCTURE_ELO && task.nS != 2) {
        fprintf(stderr,"Elo solvers only work with number of states equal to 2, while %d were specified!",task.nS);
        exit_with_help();
    }
    
    // upper and lower bounds
    if( (task.sliced==1) && (task.structure == STRUCTURE_SKABslc || task.structure == STRUCTURE_SKAslc) &&
       !(task.lb_specd && task.ub_specd)) {
        fprintf(stderr,"Error! when parameter slicing is enabled, lower and upper boundaries for all parameters have to be set explicitly.\n");
        exit_with_help();
    }
    if(!task.lb_specd && (task.nS!=2 || task.nO!=2) ) { // if not specified, and it's not 2-state 2-obs case, set to 0
        if(task.param_values_lb!=NULL) free(task.param_values_lb);
        task.param_values_lb = Calloc(NUMBER, (size_t)( task.nS*(1+task.nS+task.nO) ) );
    }
 
    if(!task.ub_specd && (task.nS!=2 || task.nO!=2) ) {  // if not specified, and it's not 2-state 2-obs case, set to 1
        if(task.param_values_ub!=NULL) free(task.param_values_ub);  // if not specified, set to 1
        task.param_values_ub = Calloc(NUMBER, (size_t)( task.nS*(1+task.nS+task.nO) ) );
        for(int j=0; j<( task.nS*(1+task.nS+task.nO) ); j++)
            task.param_values_ub[j] = (NUMBER)1.0;
    }

    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, %r12
movl %edi, %r13d
movslq %edi, %rbp
pushq $0x1
popq %r14
leaq 0xdbf9(%rip), %r15      # 0x12285
movq %rbp, 0x18(%rsp)
movq %rsi, 0x30(%rsp)
movl %edi, 0x20(%rsp)
cmpq %rbp, %r14
jge 0x4d10
movq (%r12,%r14,8), %rax
cmpb $0x2d, (%rax)
jne 0x4d10
leal 0x1(%r14), %ecx
cmpl %r13d, %ecx
jge 0x4fdc
movzbl 0x1(%rax), %eax
cmpl $0x75, %eax
movq %r14, 0x28(%rsp)
je 0x4b5e
cmpl $0x42, %eax
je 0x4ae4
cmpl $0x63, %eax
je 0x47ca
cmpl $0x6b, %eax
je 0x4a06
cmpl $0x6c, %eax
je 0x4922
cmpl $0x30, %eax
jne 0x4d02
movq 0x28(%rsp), %r14
movq 0x8(%r12,%r14,8), %rbx
movq %rbx, %rdi
callq 0x30e0
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
xorl %ecx, %ecx
pushq $0x1
popq %rbp
cmpq %rcx, %rax
je 0x474d
movb (%rbx,%rcx), %dl
xorl %esi, %esi
cmpb $0x2c, %dl
sete %sil
addl %esi, %ebp
andb $-0x21, %dl
addb $-0x41, %dl
incq %rcx
cmpb $0x19, %dl
ja 0x471d
leaq 0x15baf(%rip), %rdi     # 0x1a2f4
movq %rbx, %rsi
callq 0x31c0
movq 0x15b24(%rip), %rdi     # 0x1a278
callq 0x3260
movslq %ebp, %rbx
movq %rbx, %rdi
pushq $0x8
popq %rsi
callq 0x3110
movq %rax, 0x15b0a(%rip)     # 0x1a278
movb %bl, 0x15b0c(%rip)      # 0x1a280
movq 0x8(%r12,%r14,8), %rdi
movq %r15, %rsi
callq 0x3360
movq %rax, %rdi
callq 0x3290
movq 0x15ae8(%rip), %rax     # 0x1a278
movsd %xmm0, (%rax)
pushq $0x1
popq %r14
movq 0x18(%rsp), %rbp
cmpq %rbx, %r14
jge 0x4d02
xorl %edi, %edi
movq %r15, %rsi
callq 0x3360
movq %rax, %rdi
callq 0x3290
movq 0x15ab9(%rip), %rax     # 0x1a278
movsd %xmm0, (%rax,%r14,8)
incq %r14
jmp 0x479d
movq %r14, %rbp
movsbl 0x163a3(%rip), %r14d    # 0x1ab78
movsbl 0x1639d(%rip), %ebx     # 0x1ab79
leal 0x1(%r14), %eax
imull %r14d, %eax
movq %rax, 0x10(%rsp)
incl %eax
movl %eax, 0x4(%rsp)
pushq $0x18
popq %rdi
callq 0x31f0
movq %rax, %r13
movabsq $0x4e2000000000, %rax   # imm = 0x4E2000000000
movq %rax, (%r13)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%r13)
movq 0x8(%r12,%rbp,8), %rdi
movq %r15, %rsi
callq 0x3360
testq %rax, %rax
je 0x4838
movq %rax, %rdi
callq 0x3290
movq %r13, %rdi
callq 0x62d2
xorl %edi, %edi
jmp 0x4817
imull %r14d, %ebx
movl 0x4(%rsp), %r12d
addl %ebx, %r12d
movl (%r13), %r15d
movl %r15d, %eax
cltd
movl %r12d, 0x4(%rsp)
idivl %r12d
testl %edx, %edx
jne 0x500c
movl %eax, %ebp
movq 0x10(%rsp), %r14
addl %ebx, %r14d
movb %bpl, 0x15a5d(%rip)     # 0x1a2ca
movsbq %bpl, %rdi
pushq $0x8
popq %rbx
movq %rbx, %rsi
callq 0x3110
movq %rax, 0x15a4d(%rip)     # 0x1a2d0
movsbl %bpl, %eax
imull %r14d, %eax
movslq %eax, %rdi
movq %rbx, %rsi
callq 0x3110
xorl %r12d, %r12d
testl %r14d, %r14d
cmovlel %r12d, %r14d
movq %rax, 0x15a31(%rip)     # 0x1a2d8
movq %r14, 0x10(%rsp)
movl %r14d, %ecx
xorl %ebx, %ebx
xorl %ebp, %ebp
movl %r15d, %eax
cltd
idivl 0x4(%rsp)
cmpl %r12d, %eax
jle 0x4c42
movl %ecx, 0x24(%rsp)
movslq %ecx, %r15
movq %r13, %rdi
movl %ebp, %esi
callq 0x634e
movq 0x159f4(%rip), %rax     # 0x1a2d0
movsd %xmm0, (%rax,%r12,8)
movslq %ebx, %r14
movq 0x10(%rsp), %rax
leal (%rax,%r14), %ebx
incl %ebp
cmpq %r14, %r15
je 0x4911
movq %r13, %rdi
movl %ebp, %esi
callq 0x634e
movq 0x159d2(%rip), %rax     # 0x1a2d8
movsd %xmm0, (%rax,%r14,8)
incq %r14
jmp 0x48ee
incq %r12
movl (%r13), %r15d
movl 0x24(%rsp), %ecx
addl 0x10(%rsp), %ecx
jmp 0x48b3
movq 0x8(%r12,%r14,8), %r15
movq %r15, %rdi
callq 0x30e0
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
xorl %ecx, %ecx
pushq $0x1
popq %rbx
cmpq %rcx, %rax
je 0x4954
xorl %edx, %edx
cmpb $0x2c, (%r15,%rcx)
sete %dl
addl %edx, %ebx
incq %rcx
jmp 0x493e
movq 0x1592d(%rip), %rdi     # 0x1a288
callq 0x3260
movl %ebx, %r15d
movq %r15, %rdi
pushq $0x8
popq %rsi
callq 0x3110
movq %rax, 0x15913(%rip)     # 0x1a288
movq 0x8(%r12,%r14,8), %rdi
leaq 0xd904(%rip), %rsi      # 0x12285
callq 0x3360
movq %rax, %rdi
callq 0x3290
movq 0x158f3(%rip), %rax     # 0x1a288
movsd %xmm0, (%rax)
pushq $0x1
popq %r14
cmpq %r15, %r14
jae 0x49ca
xorl %edi, %edi
leaq 0xd8da(%rip), %rsi      # 0x12285
callq 0x3360
movq %rax, %rdi
callq 0x3290
movq 0x158c9(%rip), %rax     # 0x1a288
movsd %xmm0, (%rax,%r14,8)
incq %r14
jmp 0x499d
movsbl 0x161a7(%rip), %eax     # 0x1ab78
movb 0x158e4(%rip), %cl      # 0x1a2bb
movb 0x158e9(%rip), %dl      # 0x1a2c6
cmpb $0x1, %cl
jne 0x4c70
leal -0xb(%rdx), %esi
cmpb $0x2, %sil
movl 0x16195(%rip), %edi     # 0x1ab88
movl %edi, %esi
pushq $0x1
popq %r8
cmovael %r8d, %esi
movsbl %sil, %esi
jmp 0x4c7e
movq 0x8(%r12,%r14,8), %r15
movq %r15, %rdi
callq 0x30e0
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
xorl %ecx, %ecx
pushq $0x1
popq %rdx
movl %edx, %ebx
cmpq %rcx, %rax
je 0x4a3a
xorl %edx, %edx
cmpb $0x2c, (%r15,%rcx)
sete %dl
addl %edx, %ebx
incq %rcx
jmp 0x4a24
cmpl $0x3, %ebx
jb 0x4fe1
leal -0x2(%rbx), %ebp
movb %bpl, 0x1585b(%rip)     # 0x1a2a8
movq 0x1584c(%rip), %rdi     # 0x1a2a0
callq 0x3260
movslq %ebp, %rdi
pushq $0x8
popq %rsi
callq 0x3110
movq %rax, 0x15835(%rip)     # 0x1a2a0
movq 0x8(%r12,%r14,8), %rdi
leaq 0xd80e(%rip), %r15      # 0x12285
movq %r15, %rsi
callq 0x3360
movq %rax, %rdi
callq 0x3350
movb %al, 0x1580b(%rip)      # 0x1a298
xorl %edi, %edi
movq %r15, %rsi
callq 0x3360
movq %rax, %rdi
callq 0x3290
cvttsd2si %xmm0, %eax
movl %eax, 0x157f3(%rip)     # 0x1a29c
movl %ebx, %ebx
addq $-0x2, %rbx
xorl %r14d, %r14d
movq 0x18(%rsp), %rbp
cmpq %r14, %rbx
je 0x4d02
xorl %edi, %edi
movq %r15, %rsi
callq 0x3360
movq %rax, %rdi
callq 0x3290
movq 0x157c7(%rip), %rax     # 0x1a2a0
movsd %xmm0, (%rax,%r14,8)
incq %r14
jmp 0x4ab7
movq 0x8(%r12,%r14,8), %rdi
movq %r15, %rsi
callq 0x3360
movq %rax, %rdi
callq 0x3350
movb %al, 0x16102(%rip)      # 0x1ac01
testb $-0x2, %al
jne 0x4f70
xorl %edi, %edi
movq %r15, %rsi
callq 0x3360
testq %rax, %rax
je 0x4fa0
movq %rax, %rdi
callq 0x3350
movb %al, 0x160da(%rip)      # 0x1ac02
testb $-0x2, %al
jne 0x4f70
xorl %edi, %edi
movq %r15, %rsi
callq 0x3360
testq %rax, %rax
je 0x4fa0
movq %rax, %rdi
callq 0x3350
movb %al, 0x160b2(%rip)      # 0x1ac03
testb $-0x2, %al
je 0x4d02
jmp 0x4f70
movq 0x8(%r12,%r14,8), %r15
movq %r15, %rdi
callq 0x30e0
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
xorl %ecx, %ecx
pushq $0x1
popq %rbx
cmpq %rcx, %rax
je 0x4b90
xorl %edx, %edx
cmpb $0x2c, (%r15,%rcx)
sete %dl
addl %edx, %ebx
incq %rcx
jmp 0x4b7a
movq 0x156f9(%rip), %rdi     # 0x1a290
callq 0x3260
movl %ebx, %r15d
movq %r15, %rdi
pushq $0x8
popq %rsi
callq 0x3110
movq %rax, 0x156df(%rip)     # 0x1a290
movq 0x8(%r12,%r14,8), %rdi
leaq 0xd6c8(%rip), %rsi      # 0x12285
callq 0x3360
movq %rax, %rdi
callq 0x3290
movq 0x156bf(%rip), %rax     # 0x1a290
movsd %xmm0, (%rax)
pushq $0x1
popq %r14
cmpq %r15, %r14
jae 0x4c06
xorl %edi, %edi
leaq 0xd69e(%rip), %rsi      # 0x12285
callq 0x3360
movq %rax, %rdi
callq 0x3290
movq 0x15695(%rip), %rax     # 0x1a290
movsd %xmm0, (%rax,%r14,8)
incq %r14
jmp 0x4bd9
movsbl 0x15f6b(%rip), %eax     # 0x1ab78
movb 0x156a8(%rip), %cl      # 0x1a2bb
movb 0x156ad(%rip), %dl      # 0x1a2c6
cmpb $0x1, %cl
jne 0x4cba
leal -0xb(%rdx), %esi
cmpb $0x2, %sil
movl 0x15f59(%rip), %edi     # 0x1ab88
movl %edi, %esi
pushq $0x1
popq %r8
cmovael %r8d, %esi
movsbl %sil, %esi
jmp 0x4cc8
movq %r13, %rdi
callq 0x6390
movq %r13, %rdi
pushq $0x18
popq %rsi
callq 0x3200
movq 0x30(%rsp), %r12
movl 0x20(%rsp), %r13d
movq 0x18(%rsp), %rbp
leaq 0xd61a(%rip), %r15      # 0x12285
jmp 0x4d02
movb 0x15f11(%rip), %dil     # 0x1ab88
pushq $0x1
popq %r8
movl %r8d, %esi
leaq 0xd600(%rip), %r15      # 0x12285
xorb $0x1, %cl
imull %eax, %esi
xorb $0xb, %dl
orb %cl, %dl
movsbl %dil, %ecx
cmovnel %r8d, %ecx
movsbl 0x15eda(%rip), %edx     # 0x1ab79
imull %ecx, %edx
addl %esi, %edx
incl %edx
imull %eax, %edx
cmpl %edx, %ebx
jne 0x5026
movb $0x1, 0x15ee2(%rip)     # 0x1ab9a
jmp 0x4d02
movb 0x15ec7(%rip), %dil     # 0x1ab88
pushq $0x1
popq %r8
movl %r8d, %esi
leaq 0xd5b6(%rip), %r15      # 0x12285
xorb $0x1, %cl
imull %eax, %esi
xorb $0xb, %dl
orb %cl, %dl
movsbl %dil, %ecx
cmovnel %r8d, %ecx
movsbl 0x15e90(%rip), %edx     # 0x1ab79
imull %ecx, %edx
addl %esi, %edx
incl %edx
imull %eax, %edx
cmpl %edx, %ebx
jne 0x4ff9
movb $0x1, 0x15e99(%rip)     # 0x1ab9b
movq 0x28(%rsp), %r14
addq $0x2, %r14
jmp 0x469a
movsbl 0x159df(%rip), %edx     # 0x1a6f6
movb 0x15e5c(%rip), %bl      # 0x1ab79
cmpb %dl, %bl
jle 0x4eef
movsbl 0x155b8(%rip), %edx     # 0x1a2e4
cmpb %dl, %bl
jle 0x4f28
movsbl 0x1556d(%rip), %ecx     # 0x1a2a8
movb 0x15556(%rip), %sil     # 0x1a298
movl %ecx, %eax
orb %sil, %al
sete %dl
movb 0x15576(%rip), %al      # 0x1a2c6
cmpb $0xe, %al
setne %dil
testb %dil, %dl
jne 0x4dc1
movsbl %sil, %edx
movl %ecx, %edi
xorb $0x1, %dil
movl %edx, %r8d
xorb $0x1, %r8b
orb %dil, %r8b
movl %eax, %edi
xorb $0xe, %dil
orb %dil, %r8b
je 0x4dc1
movl %ecx, %r8d
xorb $0x1, %r8b
movl %edx, %r9d
xorb $0x2, %r9b
orb %r8b, %r9b
orb %dil, %r9b
je 0x4dc1
movl %ecx, %r8d
xorb $0x1, %r8b
movl %edx, %r9d
xorb $0x3, %r9b
orb %r8b, %r9b
orb %dil, %r9b
je 0x4dc1
cmpb $0x1, %cl
jne 0x505f
cmpb $0x4, %sil
jne 0x505f
cmpb $0xe, %al
jne 0x505f
cmpb $0xe, %al
sete %cl
movb 0x15dab(%rip), %r14b    # 0x1ab78
cmpb $0x2, %r14b
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x5045
cmpb $0x1, 0x154d5(%rip)     # 0x1a2bb
jne 0x4e23
addb $-0xb, %al
movb 0x15daa(%rip), %cl      # 0x1ab9a
cmpb $0x1, %al
ja 0x4e29
testb $0x1, %cl
je 0x4e02
cmpb $0x0, 0x15d9b(%rip)     # 0x1ab9b
jne 0x4e29
movq 0x151cf(%rip), %rax     # 0x19fd8
movq (%rax), %rcx
leaq 0xdd7a(%rip), %rdi      # 0x12b8d
pushq $0x73
popq %rsi
pushq $0x1
popq %rdx
callq 0x3430
callq 0x6219
movb 0x15d71(%rip), %cl      # 0x1ab9a
testb $0x1, %cl
jne 0x4e76
xorb $0x2, %r14b
xorb $0x2, %bl
orb %r14b, %bl
movb $0x2, %bl
movb $0x2, %r14b
je 0x4e76
movq 0x15442(%rip), %rdi     # 0x1a288
callq 0x3260
movsbl 0x15d25(%rip), %r14d    # 0x1ab78
movsbl 0x15d1f(%rip), %ebx     # 0x1ab79
leal (%r14,%rbx), %eax
incl %eax
imull %r14d, %eax
movslq %eax, %rdi
pushq $0x8
popq %rsi
callq 0x3110
movq %rax, 0x15412(%rip)     # 0x1a288
cmpb $0x0, 0x15d1e(%rip)     # 0x1ab9b
jne 0x4ee0
xorb $0x2, %r14b
xorb $0x2, %bl
orb %r14b, %bl
je 0x4ee0
movq 0x153fe(%rip), %rdi     # 0x1a290
callq 0x3260
movsbl 0x15cda(%rip), %eax     # 0x1ab78
movsbl 0x15cd4(%rip), %ecx     # 0x1ab79
addl %eax, %ecx
incl %ecx
imull %eax, %ecx
movslq %ecx, %rbx
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x3110
movq %rax, 0x153cf(%rip)     # 0x1a290
xorl %ecx, %ecx
testl %ebx, %ebx
cmovlel %ecx, %ebx
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
cmpq %rcx, %rbx
je 0x4ee0
movq %rdx, (%rax,%rcx,8)
incq %rcx
jmp 0x4ed2
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x150e2(%rip), %rax     # 0x19fd8
movq (%rax), %rdi
incl %edx
leaq 0xd736(%rip), %rsi      # 0x12638
xorl %eax, %eax
callq 0x3300
cmpb $0x1, 0x153ac(%rip)     # 0x1a2bc
jne 0x4fdc
movsbl 0x157d9(%rip), %edx     # 0x1a6f6
incl %edx
leaq 0xd712(%rip), %rsi      # 0x12638
jmp 0x4f5f
movq 0x150a9(%rip), %rax     # 0x19fd8
movq (%rax), %rdi
incl %edx
leaq 0xd606(%rip), %rsi      # 0x12541
xorl %eax, %eax
callq 0x3300
cmpb $0x1, 0x15373(%rip)     # 0x1a2bc
jne 0x4fdc
movsbl 0x1538e(%rip), %edx     # 0x1a2e4
incl %edx
leaq 0xd5e2(%rip), %rsi      # 0x12541
movq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0x3300
callq 0x6219
movq 0x15061(%rip), %rax     # 0x19fd8
movq (%rax), %rcx
leaq 0xda69(%rip), %rdi      # 0x129ea
pushq $0x3b
popq %rsi
pushq $0x1
popq %rdx
callq 0x3430
cmpb $0x1, 0x15329(%rip)     # 0x1a2bc
jne 0x4fdc
leaq 0xda4e(%rip), %rdi      # 0x129ea
pushq $0x3b
jmp 0x4fce
movq 0x15031(%rip), %rax     # 0x19fd8
movq (%rax), %rcx
leaq 0xda75(%rip), %rdi      # 0x12a26
pushq $0x37
popq %rsi
pushq $0x1
popq %rdx
callq 0x3430
cmpb $0x1, 0x152f9(%rip)     # 0x1a2bc
jne 0x4fdc
leaq 0xda5a(%rip), %rdi      # 0x12a26
pushq $0x37
popq %rsi
pushq $0x1
popq %rdx
movq 0x8(%rsp), %rcx
callq 0x3430
callq 0x6219
movq 0x14ff0(%rip), %rax     # 0x19fd8
movq (%rax), %rdi
leaq 0xdabd(%rip), %rsi      # 0x12aaf
movl %ebx, %edx
jmp 0x4f64
movq 0x14fd8(%rip), %rax     # 0x19fd8
movq (%rax), %rdi
leaq 0xd99a(%rip), %rsi      # 0x129a4
jmp 0x5037
movq 0x14fc5(%rip), %rax     # 0x19fd8
movq (%rax), %rdi
leaq 0xda41(%rip), %rsi      # 0x12a5e
movl 0x4(%rsp), %edx
movl %r15d, %ecx
jmp 0x5039
movq 0x14fab(%rip), %rax     # 0x19fd8
movq (%rax), %rdi
leaq 0xd927(%rip), %rsi      # 0x1295e
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3300
callq 0x6219
movsbl %r14b, %edx
movq 0x14f88(%rip), %rax     # 0x19fd8
movq (%rax), %rdi
leaq 0xdae2(%rip), %rsi      # 0x12b3c
jmp 0x4f64
movq 0x14f72(%rip), %rax     # 0x19fd8
movq (%rax), %rdi
leaq 0xda82(%rip), %rsi      # 0x12af2
jmp 0x5039