// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/trainhmm.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(param.initfile, argv[i]);
                        break;
                    }
                }
                // init parameters
                if(param.init_params!=NULL) free(param.init_params);
                param.init_params = Calloc(NUMBER, (size_t)n);
                param.init_params_n = (NPAR)n;
                // read params and write to params
                param.init_params[0] = atof( strtok(argv[i],",\t\n\r") );
                for(int j=1; j<n; j++) {
                    param.init_params[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(param.param_lo!=NULL) free(param.param_lo);
				param.param_lo = Calloc(NUMBER, (size_t)n);
				// read params and write to params
				param.param_lo[0] = atof( strtok(argv[i],",\t\n\r") );
                for(int j=1; j<n; j++) {
					param.param_lo[j] = atof( strtok(NULL,",\t\n\r") );
//                    if(param.param_lo[j] >0) {
//                        int a = 0;
//                    }
                }
                // check if the number of lower boundaries corresponds
                expected_n = param.nS +
                    ((param.sliced==1 && (param.structure==STRUCTURE_SKAslc || param.structure==STRUCTURE_SKABslc) )?param.nZ:1)*param.nS*param.nS +
                    ((param.sliced==1 && param.structure==STRUCTURE_SKABslc )?param.nZ:1)*param.nS*param.nO;
                if( n != expected_n ) {
//                    fprintf(stderr,"Structure=%d, nS=%d, nO=%d, nZ=%d, The expected n=%d specified=%d\n",param.structure,param.nS,param.nO,param.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();
                }
                param.lo_lims_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(param.param_hi!=NULL) free(param.param_hi);
				param.param_hi = Calloc(NUMBER, (size_t)n);
				// read params and write to params
				param.param_hi[0] = atof( strtok(argv[i],",\t\n\r") );
                for(int j=1; j<n; j++) {
					param.param_hi[j] = atof( strtok(NULL,",\t\n\r") );
//                    if(param.param_hi[j] < 1) {
//                        int a = 0;
//                    }
                }
                // check if the number of upper boundaries corresponds
                expected_n = param.nS +
                    ((param.sliced==1 && (param.structure==STRUCTURE_SKAslc || param.structure==STRUCTURE_SKABslc) )?param.nZ:1)*param.nS*param.nS +
                    ((param.sliced==1 && param.structure==STRUCTURE_SKABslc )?param.nZ:1)*param.nS*param.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();
                }
                param.hi_lims_specd = true;
				break;
			case 'B': // block fitting
                // first
				param.block_fitting[0] = (NPAR)atoi( strtok(argv[i],",\t\n\r") );
                if(param.block_fitting[0]!=0 && param.block_fitting[0]!=1) {
                    fprintf(stderr,"Values of blocking the fitting flags shuld only be 0 or 1.\n");
                    if(param.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) {
                    param.block_fitting[1] = (NPAR)atoi(ch);
                    if(param.block_fitting[1]!=0 && param.block_fitting[1]!=1) {
                        fprintf(stderr,"Values of blocking the fitting flags shuld only be 0 or 1.\n");
                        if(param.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(param.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) {
                    param.block_fitting[2] = (NPAR)atoi(ch);
                    if(param.block_fitting[2]!=0 && param.block_fitting[2]!=1) {
                        fprintf(stderr,"Values of blocking the fitting flags shuld only be 0 or 1.\n");
                        if(param.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(param.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 = param.nS;
                    NPAR nO = param.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();
                    }
                    param.Cslices = (NPAR) ( tmp_array->getSize() / nPerSlice );
                    param.Cw = Calloc(NUMBER, (size_t)param.Cslices);
                    param.Ccenters = Calloc(NUMBER, (size_t)(param.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++) {
                        param.Cw[c1++] = tmp_array->get((NDAT)i++);
                        for(int j=0; j<nCenters; j++)
                            param.Ccenters[c2++] = tmp_array->get((NDAT)i++);
                    }
                    delete tmp_array;
                }
                break;
                
        } // end switch
    }// end for
    // post parse actions
    
    if(!param.lo_lims_specd && (param.nS!=2 || param.nO!=2) ) { // if not specified, and it's not 2-state 2-obs case, set to 0
        if(param.param_lo!=NULL) free(param.param_lo);
        param.param_lo = Calloc(NUMBER, (size_t)( param.nS*(1+param.nS+param.nO) ) );
    }
 
    if(!param.hi_lims_specd && (param.nS!=2 || param.nO!=2) ) {  // if not specified, and it's not 2-state 2-obs case, set to 1
        if(param.param_hi!=NULL) free(param.param_hi);  // if not specified, set to 1
        param.param_hi = Calloc(NUMBER, (size_t)( param.nS*(1+param.nS+param.nO) ) );
        for(int j=0; j<( param.nS*(1+param.nS+param.nO) ); j++)
            param.param_hi[j] = (NUMBER)1.0;
    }
    
    // post-argument checks
    if( param.cv_target_obs>(param.nO-1)) {
        fprintf(stderr,"target observation to be cross-validated against cannot be '%d'\n",param.cv_target_obs+1);
        if(param.duplicate_console==1) fprintf(fid_console,"target observation to be cross-validated against cannot be '%d'\n",param.cv_target_obs+1);
        exit_with_help();
    }
    if(param.metrics_target_obs>(param.nO-1)) {
        fprintf(stderr,"target observation to compute metrics against cannot be '%d'\n",param.metrics_target_obs+1);
        if(param.duplicate_console==1) fprintf(fid_console,"target observation to compute metrics against cannot be '%d'\n",param.metrics_target_obs+1);
        exit_with_help();
    }
    
    // upper and lower bounds
    if( (param.sliced==1) && (param.structure == STRUCTURE_SKABslc || param.structure == STRUCTURE_SKAslc) &&
       !(param.lo_lims_specd && param.hi_lims_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();
    }

    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, 0x8(%rsp)
cmpl $0x2, %edi
jl 0x8669
movq %rsi, %r12
movl %edi, %edx
movl $0x1, %r15d
leaq 0x2f33a(%rip), %r14     # 0x37387
movq %rsi, 0x20(%rsp)
movq %rdx, 0x30(%rsp)
movq (%r12,%r15,8), %rax
cmpb $0x2d, (%rax)
jne 0x8669
leaq 0x1(%r15), %rcx
cmpq %rdx, %rcx
jae 0x883d
movzbl 0x1(%rax), %eax
cmpl $0x62, %eax
jle 0x80d1
cmpl $0x63, %eax
je 0x8167
cmpl $0x6c, %eax
je 0x82fa
cmpl $0x75, %eax
movq %r14, %r13
jne 0x85ab
movq 0x8(%r12,%r15,8), %rbx
movq %rbx, %rdi
callq 0x4110
testl %eax, %eax
jle 0x849a
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %ebp
xorl %ecx, %ecx
xorl %edx, %edx
cmpb $0x2c, (%rbx,%rcx)
sete %dl
addl %edx, %ebp
incq %rcx
cmpq %rcx, %rax
jne 0x80b9
jmp 0x849f
cmpl $0x30, %eax
je 0x832c
cmpl $0x42, %eax
movq %r14, %r13
jne 0x85ab
movq 0x8(%r12,%r15,8), %rdi
movq %r13, %rsi
callq 0x43e0
movq %rax, %rdi
callq 0x43d0
movb %al, 0x3db28(%rip)      # 0x45c29
testb $-0x2, %al
jne 0x886a
xorl %edi, %edi
movq %r13, %rsi
callq 0x43e0
testq %rax, %rax
je 0x8892
movq %rax, %rdi
callq 0x43d0
movb %al, 0x3db00(%rip)      # 0x45c2a
testb $-0x2, %al
jne 0x8874
xorl %edi, %edi
movq %r13, %rsi
callq 0x43e0
testq %rax, %rax
je 0x8888
movq %rax, %rdi
callq 0x43d0
movb %al, 0x3dad8(%rip)      # 0x45c2b
testb $-0x2, %al
leaq 0x2f22b(%rip), %r13     # 0x37387
je 0x85ab
jmp 0x887e
movq %r15, %rbx
movsbl 0x3d9ee(%rip), %r15d    # 0x45b60
movsbl 0x3d9e8(%rip), %ebp     # 0x45b61
movl $0x18, %edi
callq 0x4240
movq %rax, %r13
movabsq $0x4e2000000000, %rax   # imm = 0x4E2000000000
movq %rax, (%r13)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x8(%r13)
movq %rbx, 0x28(%rsp)
movq 0x8(%r12,%rbx,8), %rdi
movq %r14, %rsi
callq 0x43e0
testq %rax, %rax
je 0x81c9
movq %rax, %rdi
callq 0x4300
movq %r13, %rdi
callq 0x9c24
xorl %edi, %edi
jmp 0x81a8
movl %ebp, %ecx
imull %r15d, %ecx
leal 0x1(%r15), %r12d
imull %r15d, %r12d
leal (%r12,%rcx), %edi
incl %edi
movl (%r13), %esi
movl %esi, %eax
cltd
movl %edi, 0x14(%rsp)
idivl %edi
testl %edx, %edx
jne 0x8861
movl %eax, %ebx
addl %ecx, %r12d
movb %bl, 0x3d0ed(%rip)      # 0x452ea
movsbq %bl, %rdi
movl $0x8, %esi
callq 0x4140
movq %rax, 0x3d0de(%rip)     # 0x452f0
movsbl %bl, %eax
imull %r12d, %eax
movslq %eax, %rdi
movl $0x8, %esi
callq 0x4140
movq %rax, 0x3d0cb(%rip)     # 0x452f8
testl %ebx, %ebx
jle 0x82d6
leal 0x1(%r12), %eax
movl %eax, 0x18(%rsp)
leal (%r15,%rbp), %r14d
incl %r14d
imull %r15d, %r14d
negl %r14d
xorl %ebp, %ebp
xorl %ebx, %ebx
xorl %r15d, %r15d
movq %r12, 0x38(%rsp)
movq %r13, %rdi
movl %ebx, %esi
callq 0x9c8c
movq %rbx, %rcx
incl %ebx
movq 0x3d082(%rip), %rax     # 0x452f0
movq %xmm0, (%rax,%rbp,8)
testl %r12d, %r12d
jle 0x82c6
movl %r15d, 0x1c(%rsp)
movslq %r15d, %r12
addl 0x18(%rsp), %ecx
movq %rcx, 0x40(%rsp)
xorl %r15d, %r15d
movq %r13, %rdi
movl %ebx, %esi
callq 0x9c8c
movq 0x3d05b(%rip), %rax     # 0x452f8
movq %xmm0, (%rax,%r12,8)
incq %r12
incl %ebx
decl %r15d
cmpl %r15d, %r14d
jne 0x828c
movl 0x1c(%rsp), %eax
subl %r15d, %eax
movl %eax, %r15d
movq 0x38(%rsp), %r12
movq 0x40(%rsp), %rbx
jmp 0x82c6
incq %rbp
movl (%r13), %eax
cltd
idivl 0x14(%rsp)
cmpl %ebp, %eax
jg 0x8258
movq %r13, %rdi
callq 0x9cce
movl $0x18, %esi
movq %r13, %rdi
callq 0x4250
movq 0x20(%rsp), %r12
movq 0x28(%rsp), %r15
jmp 0x85a4
movq 0x8(%r12,%r15,8), %rbx
movq %rbx, %rdi
callq 0x4110
testl %eax, %eax
jle 0x8381
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %ebp
xorl %ecx, %ecx
xorl %edx, %edx
cmpb $0x2c, (%rbx,%rcx)
sete %dl
addl %edx, %ebp
incq %rcx
cmpq %rcx, %rax
jne 0x8317
jmp 0x8386
movq %r15, %r14
movq 0x8(%r12,%r15,8), %r15
movq %r15, %rdi
callq 0x4110
testl %eax, %eax
jle 0x8490
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %ebp
xorl %ecx, %ecx
movl %ebp, %edx
movb (%r15,%rcx), %sil
xorl %ebp, %ebp
cmpb $0x2c, %sil
sete %bpl
addl %edx, %ebp
andb $-0x21, %sil
addb $-0x41, %sil
cmpb $0x19, %sil
jbe 0x85c5
incq %rcx
cmpq %rcx, %rax
jne 0x8350
jmp 0x85d4
movl $0x1, %ebp
movq %r15, %r14
movq 0x3cf30(%rip), %rdi     # 0x452c0
testq %rdi, %rdi
je 0x839a
callq 0x42d0
movl %ebp, %r15d
movl $0x8, %esi
movq %r15, %rdi
callq 0x4140
movq %rax, 0x3cf0f(%rip)     # 0x452c0
movq 0x8(%r12,%r14,8), %rdi
leaq 0x2efca(%rip), %r13     # 0x37387
movq %r13, %rsi
callq 0x43e0
movq %rax, %rdi
callq 0x4300
movq 0x3ceec(%rip), %rax     # 0x452c0
movq %xmm0, (%rax)
cmpl $0x2, %ebp
jb 0x8408
movl $0x1, %ebx
xorl %edi, %edi
movq %r13, %rsi
callq 0x43e0
movq %rax, %rdi
callq 0x4300
movq 0x3cec5(%rip), %rax     # 0x452c0
movq %xmm0, (%rax,%rbx,8)
incq %rbx
cmpq %rbx, %r15
jne 0x83e2
movsbl 0x3d751(%rip), %eax     # 0x45b60
movb 0x3cec6(%rip), %cl      # 0x452db
movb 0x3cecb(%rip), %dl      # 0x452e6
cmpb $0x1, %cl
jne 0x8442
leal -0xb(%rdx), %esi
cmpb $0x2, %sil
movl 0x3d743(%rip), %edi     # 0x45b70
movl %edi, %esi
movl $0x1, %r8d
cmovael %r8d, %esi
movsbl %sil, %esi
movq %r14, %r15
jmp 0x8457
movl $0x1, %esi
movb 0x3d722(%rip), %dil     # 0x45b70
movq %r14, %r15
movl $0x1, %r8d
xorb $0x1, %cl
imull %eax, %esi
xorb $0xb, %dl
orb %cl, %dl
movsbl %dil, %ecx
cmovnel %r8d, %ecx
movsbl 0x3d6f0(%rip), %edx     # 0x45b61
imull %ecx, %edx
leal (%rsi,%rdx), %edi
incl %edi
imull %eax, %edi
cmpl %edi, %ebp
jne 0x885a
movb $0x1, 0x3d737(%rip)     # 0x45bc2
jmp 0x85a4
movl $0x1, %ebp
jmp 0x85d4
movl $0x1, %ebp
movq %r15, %r14
movq 0x3ce1f(%rip), %rdi     # 0x452c8
testq %rdi, %rdi
je 0x84b3
callq 0x42d0
movl %ebp, %r15d
movl $0x8, %esi
movq %r15, %rdi
callq 0x4140
movq %rax, 0x3cdfe(%rip)     # 0x452c8
movq 0x8(%r12,%r14,8), %rdi
leaq 0x2eeb1(%rip), %r13     # 0x37387
movq %r13, %rsi
callq 0x43e0
movq %rax, %rdi
callq 0x4300
movq 0x3cddb(%rip), %rax     # 0x452c8
movq %xmm0, (%rax)
cmpl $0x2, %ebp
jb 0x8521
movl $0x1, %ebx
xorl %edi, %edi
movq %r13, %rsi
callq 0x43e0
movq %rax, %rdi
callq 0x4300
movq 0x3cdb4(%rip), %rax     # 0x452c8
movq %xmm0, (%rax,%rbx,8)
incq %rbx
cmpq %rbx, %r15
jne 0x84fb
movsbl 0x3d638(%rip), %eax     # 0x45b60
movb 0x3cdad(%rip), %cl      # 0x452db
movb 0x3cdb2(%rip), %dl      # 0x452e6
cmpb $0x1, %cl
jne 0x855b
leal -0xb(%rdx), %esi
cmpb $0x2, %sil
movl 0x3d62a(%rip), %edi     # 0x45b70
movl %edi, %esi
movl $0x1, %r8d
cmovael %r8d, %esi
movsbl %sil, %esi
movq %r14, %r15
jmp 0x8570
movl $0x1, %esi
movb 0x3d609(%rip), %dil     # 0x45b70
movq %r14, %r15
movl $0x1, %r8d
xorb $0x1, %cl
imull %eax, %esi
xorb $0xb, %dl
orb %cl, %dl
movsbl %dil, %ecx
cmovnel %r8d, %ecx
movsbl 0x3d5d7(%rip), %edx     # 0x45b61
imull %ecx, %edx
leal (%rsi,%rdx), %edi
incl %edi
imull %eax, %edi
cmpl %edi, %ebp
jne 0x8853
movb $0x1, 0x3d61f(%rip)     # 0x45bc3
leaq 0x2eddc(%rip), %r13     # 0x37387
addq $0x2, %r15
movq 0x30(%rsp), %rdx
cmpq %rdx, %r15
movq %r13, %r14
jb 0x8057
jmp 0x8669
leaq 0x3cd48(%rip), %rdi     # 0x45314
movq %r15, %rsi
callq 0x4210
movq 0x3ccd5(%rip), %rdi     # 0x452b0
testq %rdi, %rdi
je 0x85e5
callq 0x42d0
movslq %ebp, %rbx
movl $0x8, %esi
movq %rbx, %rdi
callq 0x4140
movq %rax, 0x3ccb4(%rip)     # 0x452b0
movb %bl, 0x3ccb6(%rip)      # 0x452b8
movq %r14, %r15
movq 0x8(%r12,%r14,8), %rdi
leaq 0x2ed76(%rip), %r13     # 0x37387
movq %r13, %rsi
callq 0x43e0
movq %rax, %rdi
callq 0x4300
movq 0x3cc88(%rip), %rax     # 0x452b0
movq %xmm0, (%rax)
cmpl $0x2, %ebx
jl 0x85ab
movl %ebp, %ebx
movl $0x1, %r14d
xorl %edi, %edi
movq %r13, %rsi
callq 0x43e0
movq %rax, %rdi
callq 0x4300
movq 0x3cc5a(%rip), %rax     # 0x452b0
movq %xmm0, (%rax,%r14,8)
incq %r14
cmpq %r14, %rbx
jne 0x863d
jmp 0x85ab
movb 0x3d4f2(%rip), %bl      # 0x45b61
cmpb $0x0, 0x3d54c(%rip)     # 0x45bc2
jne 0x86cd
movb 0x3d4e2(%rip), %al      # 0x45b60
movl %eax, %ecx
xorb $0x2, %cl
movl %ebx, %edx
xorb $0x2, %dl
movb $0x2, %bpl
orb %cl, %dl
je 0x86cf
movq 0x3cc2a(%rip), %rdi     # 0x452c0
testq %rdi, %rdi
je 0x86ac
callq 0x42d0
movb 0x3d4ba(%rip), %al      # 0x45b60
movb 0x3d4b5(%rip), %bl      # 0x45b61
movsbl %al, %eax
movsbl %bl, %ecx
addl %eax, %ecx
incl %ecx
imull %eax, %ecx
movslq %ecx, %rdi
movl $0x8, %esi
callq 0x4140
movq %rax, 0x3cbf3(%rip)     # 0x452c0
movl %ebx, %ebp
cmpb $0x0, 0x3d4ed(%rip)     # 0x45bc3
jne 0x87e1
movb 0x3d47e(%rip), %al      # 0x45b60
movl %eax, %edx
xorb $0x2, %dl
movl %ebp, %esi
xorb $0x2, %sil
movb $0x2, %cl
orb %dl, %sil
je 0x87e3
movq 0x3cbc9(%rip), %rdi     # 0x452c8
testq %rdi, %rdi
je 0x8716
callq 0x42d0
movb 0x3d451(%rip), %al      # 0x45b60
movb 0x3d44b(%rip), %bpl     # 0x45b61
movsbl %al, %eax
movsbl %bpl, %ecx
leal (%rax,%rcx), %r14d
incl %r14d
imull %eax, %r14d
movslq %r14d, %rbx
movl $0x8, %esi
movq %rbx, %rdi
callq 0x4140
movq %rax, 0x3cb89(%rip)     # 0x452c8
testl %ebx, %ebx
jle 0x87e1
movl %r14d, %ecx
incl %r14d
andl $-0x2, %r14d
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0x2ea6a(%rip), %xmm1    # 0x371d0
xorl %ecx, %ecx
movdqa 0x2ea70(%rip), %xmm2    # 0x371e0
pxor %xmm2, %xmm0
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
pcmpeqd %xmm3, %xmm3
movdqa 0x2ea76(%rip), %xmm4    # 0x37200
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, %esi
notl %esi
testb $0x1, %sil
je 0x87c0
movq %rdx, (%rax,%rcx,8)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x87d4
movq %rdx, 0x8(%rax,%rcx,8)
addq $0x2, %rcx
paddq %xmm4, %xmm1
cmpq %rcx, %r14
jne 0x878a
movl %ebp, %ecx
movb 0x3cf2d(%rip), %al      # 0x45716
cmpb %al, %cl
jle 0x889c
movb 0x3cb0d(%rip), %al      # 0x45304
cmpb %al, %cl
jle 0x88a9
cmpb $0x1, 0x3cad5(%rip)     # 0x452db
jne 0x882e
movb 0x3cad8(%rip), %al      # 0x452e6
addb $-0xb, %al
cmpb $0x1, %al
ja 0x882e
cmpb $0x1, 0x3d3a7(%rip)     # 0x45bc2
jne 0x88b6
cmpb $0x0, 0x3d39b(%rip)     # 0x45bc3
je 0x88b6
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2f696(%rip), %rdi     # 0x37eda
callq 0x43b0
movl $0x1, %edi
callq 0x42e0
movl %ebp, %esi
callq 0x4ca5
movl %ebp, %esi
callq 0x4cd6
movl 0x14(%rsp), %edi
callq 0x4ada
movq 0x8(%rsp), %rdi
callq 0x4b0b
movq 0x8(%rsp), %rdi
callq 0x4b5d
movq 0x8(%rsp), %rdi
callq 0x4baf
movq 0x8(%rsp), %rdi
callq 0x4c01
movq 0x8(%rsp), %rdi
callq 0x4c53
movzbl %al, %edi
movq 0x8(%rsp), %rsi
callq 0x4d07
movzbl %al, %edi
movq 0x8(%rsp), %rsi
callq 0x4d60
callq 0x4db9