// File: /workspace/github_cpp_makefile_star2_O2/myudelson[P]hmm-scalable/trainhmm.cpp
// Function: parse_arguments_step1(int, char**, char*, char*, char*, char*)
void parse_arguments_step1(int argc, char **argv, char *input_file_name, char *output_file_name, char *predict_file_name, char *console_file_name) {
	// 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 not know nO (the number of observations) yet
	int i;
    int n;
    char *ch, *ch2;
	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 'e':
				param.tol = atof( strtok(argv[i],",\t\n\r") );
                ch = strtok(NULL,",\t\n\r"); // could be NULL
                if(ch != NULL)
                    param.tol_mode = ch[0];
				if(param.tol<0) {
					fprintf(stderr,"ERROR! Fitting tolerance cannot be negative\n");
					exit_with_help();
				}
                if(param.tol>10) {
                    fprintf(stderr,"ERROR! Fitting tolerance cannot be >10\n");
                    exit_with_help();
                }
                if(param.tol_mode!='p' && param.tol_mode!='l') {
                    fprintf(stderr,"ERROR! Tolerance mode '%c' is not allowed\n",param.tol_mode);
                    exit_with_help();
                }
				break;
			case 't':
				param.sliced = (NPAR)atoi(argv[i]);
				if(param.sliced!=0 && param.sliced!=1) {
					fprintf(stderr,"ERROR! Time parameter should be either 0 (off) or 1(on)\n");
					exit_with_help();
				}
				break;
			case 'i':
				param.maxiter = atoi(argv[i]);
				if(param.maxiter<10) {
					fprintf(stderr,"ERROR! Maximum iterations should be at least 10\n");
					exit_with_help();
				}
				break;
			case 'q':
				param.quiet = (NPAR)atoi(argv[i]);
				if(param.quiet!=0 && param.quiet!=1) {
					fprintf(stderr,"ERROR! Quiet param should be 0 or 1\n");
					exit_with_help();
				}
				break;
			case 'n':
				param.nS = (NPAR)atoi(argv[i]);
				if(param.nS<2) {
					fprintf(stderr,"ERROR! Number of hidden states should be at least 2\n");
					exit_with_help();
				}
                if(param.nS != 2) {
                    param.stat_specd_gt2 = true;
                }
				break;
			case 'S':
				param.scaled = (NPAR)atoi(argv[i]);
				if(param.scaled < 0 || param.scaled > 1) {
					fprintf(stderr,"ERROR! Scaling flag should be either 0 (off) or 1 (in)\n");
					exit_with_help();
				}
				break;
			case 's':
				param.structure = (NPAR)atoi( strtok(argv[i],".\t\n\r") );
                ch = strtok(NULL,".\t\n\r"); // could be NULL (default GD solver)
                if(ch != NULL)
                    param.solver = (NPAR)atoi(ch);
                ch = strtok(NULL,"\t\n\r"); // could be NULL (default GD solver)
                if(ch != NULL)
                    param.solver_setting = (NPAR)atoi(ch);
                if( param.structure != STRUCTURE_SKILL && // param.structure != STRUCTURE_GROUP &&
                   param.structure != STRUCTURE_PIg   && param.structure != STRUCTURE_PIgk  &&
                   param.structure != STRUCTURE_PIAgk && param.structure != STRUCTURE_Agk &&
                   param.structure != STRUCTURE_PIABgk && param.structure != STRUCTURE_Agki &&
                   param.structure != STRUCTURE_PIgkww && param.structure != STRUCTURE_SKABslc &&
                   param.structure != STRUCTURE_SKAslc && param.structure != STRUCTURE_COMP &&
                   param.structure != STRUCTURE_ELOK ) {
                    fprintf(stderr, "Model Structure specified (%d) is out of range of allowed values\n",param.structure);
					exit_with_help();
                }
                if( param.solver != METHOD_BW  && param.solver != METHOD_GD &&
                   param.solver != METHOD_CGD && param.solver != METHOD_GDL &&
                   param.solver != METHOD_GBB) {
                    fprintf(stderr, "Method specified (%d) is out of range of allowed values\n",param.solver);
					exit_with_help();
                }
//                if( (param.structure == STRUCTURE_SKABslc || param.structure == STRUCTURE_SKAslc) && param.solver == METHOD_BW) {
//                    fprintf(stderr, "Method specified (%d) is not defined for this structure (%d) \n",param.solver,param.structure);
//                    exit_with_help();
//                }
                if( param.structure == STRUCTURE_COMP && param.solver == METHOD_BW) {
                    fprintf(stderr, "Method specified (%d) is not defined for this structure (%d) \n",param.solver,param.structure);
                    exit_with_help();
                }
                if( param.structure == STRUCTURE_ELOK && !(param.solver == METHOD_GD || param.solver == METHOD_CGD) ) {
                    fprintf(stderr, "Method specified (%d) is not defined for this structure (%d) \n",param.solver,param.structure);
                    exit_with_help();
                }
                if( param.solver == METHOD_BW && ( param.solver != STRUCTURE_SKILL /*&& param.solver != STRUCTURE_GROUP*/ ) ) {
                    fprintf(stderr, "Baum-Welch solver does not support model structure specified (%d)\n",param.solver);
					exit_with_help();
                }
                if( param.solver == METHOD_CGD  &&
                   ( param.solver_setting != 1 && param.solver_setting != 2 &&
                    param.solver_setting != 3 && param.solver_setting !=4 )
                   ) {
                    fprintf(stderr, "Conjugate Gradient Descent setting specified (%d) is out of range of allowed values\n",param.solver_setting);
					exit_with_help();
                }
				break;
            case 'f':
                param.single_skill = (NPAR)atoi(argv[i]);
                break;
			case 'm':
                param.metrics = atoi( strtok(argv[i],",\t\n\r"));
                ch = strtok(NULL, "\t\n\r");
                if(ch!=NULL) {
                    param.metrics_target_obs = (NPAR)(atoi(ch)-1);
                }
				if(param.metrics<0 || param.metrics>1) {
					fprintf(stderr,"value for -m should be either 0 or 1.\n");
					exit_with_help();
				}
				if(param.metrics_target_obs<0) {// || param.metrics_target_obs>(param.nO-1)) {
					fprintf(stderr,"target observation to compute metrics against cannot be '%d'\n",param.metrics_target_obs+1);
					exit_with_help();
				}
                break;
			case 'b':
                param.binaryinput = atoi( strtok(argv[i],"\t\n\r"));
                break;
			case 'v':
				param.cv_folds   = (NPAR)atoi( strtok(argv[i],",\t\n\r"));
                ch2 = strtok(NULL, ",\t\n\r");
                if(ch2!=NULL)
                    param.cv_strat = ch2[0];
                ch = strtok(NULL, ",\t\n\r");
                if(ch!=NULL)
                    param.cv_target_obs = (NPAR)(atoi(ch)-1);
                ch = strtok(NULL, ",\t\n\r");
                if(ch!=NULL)
                    strcpy(param.cv_folds_file, ch);
                ch = strtok(NULL, ",\t\n\r");
                if(ch!=NULL)
                    param.cv_inout_flag = ch[0];
                
				if(param.cv_folds<2) {
					fprintf(stderr,"number of cross-validation folds should be at least 2\n");

					exit_with_help();
				}
				if(param.cv_folds>10) {
					fprintf(stderr,"please keep number of cross-validation folds less than or equal to 10\n");
					exit_with_help();
				}
                if(param.cv_strat != CV_GROUP && param.cv_strat != CV_ITEM && param.cv_strat != CV_NSTR){
					fprintf(stderr,"cross-validation stratification parameter '%c' is illegal\n",param.cv_strat);
					exit_with_help();
                }
				if(param.cv_target_obs<0) {// || 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);
					exit_with_help();
				}
                if( param.cv_inout_flag!='i' && param.cv_inout_flag!='o') {
					fprintf(stderr,"cross-validation folds input/output flag should be ither 'o' (out) or 'i' (in), while it is '%c'\n",param.cv_inout_flag);
					exit_with_help();
                }
                
				break;
            case  'p':
                param.predictions = atoi(argv[i]);
                if(param.predictions<0 || param.predictions>3) {
                    fprintf(stderr,"a flag of whether to report predictions for training data (-p) should be 0, 1, 2, or 3\n");
                    exit_with_help();
                }
                break;
            case  'U':
                param.update_known = *strtok(argv[i],",\t\n\r");
                ch = strtok(NULL, ",\t\n\r");
                param.update_unknown = ch[0];
                
                if( (param.update_known!='r' && param.update_known!='g') ||
                   (param.update_unknown!='t' && param.update_unknown!='g') ) {
                    fprintf(stderr,"specification of how probabilities of states should be updated (-U) is incorrect, it sould be r|g[,t|g] \n");
                    exit_with_help();
                }
                break;
            case  'd':
				param.multiskill = argv[i][0]; // just grab first character (later, maybe several)
                break;
            case  'P':
				n = atoi(argv[i]);
                if(n!=0 && n!=1 && n!=2) {
					fprintf(stderr,"parallel processing flag (-P) should be 0 or 1\n");
					exit_with_help();
                }
                param.parallel = (NPAR)n;
                break;
            case 'r': // coordinate descend parameters
                // if two first_iteration_qualify,iterations_to_qualify
                // if one iterations_to_qualify (first_iteration_qualify==0)
                n = atoi( strtok(argv[i],",\t\n\r") );
                ch = strtok(NULL,",\t\n\r"); // could be NULL (default GD solver)
                if(ch==NULL) {// one parameter
                    param.first_iteration_qualify = 0;
                    param.iterations_to_qualify   = (NPAR)n;
                } else {
                    param.first_iteration_qualify = (NPAR)n;
                    param.iterations_to_qualify   = (NPAR)atoi(ch);
                }
                break;
            case 'R': // coordinate descend parameter for hard iterations limit of skill/group/other fitting
                n = atoi(argv[i]);
                if(n<=0) {
                    fprintf(stderr,"skill/group gradient descent iteration limit (-R) should be an integer >0\n");
                    exit_with_help();
                }
                if(n<=0) {
                    fprintf(stderr,"skill/group gradient descent iteration limit (-R) should be an integer >0\n");
                    exit_with_help();
                }
                param.iterations_limit = (NPAR)n;
                break;
            /*
            case 'c': {
                    // this version is with single center of gravity per Pi, A, and B
                    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() % 4) != 0 ) {
                        fprintf(stderr,"The number of regularization parameters should be a multiple of 4 and it is %d\n",tmp_array->getSize());
                        exit_with_help();
                    }
                    param.Cslices = (NPAR) tmp_array->getSize() / 4;
                    param.Cw = Calloc(NUMBER, (size_t)param.Cslices);
                    param.Ccenters = Calloc(NUMBER, (size_t)(param.Cslices * 3) );
                    int c1 = 0, c2 = 0, i = 0;
                    for(int l=0; l<(int)tmp_array->getSize() / 4; l++) {
                        param.Cw[c1++] = tmp_array->get((NDAT)i++);
                        for(int j=0; j<3; j++)
                            param.Ccenters[c2++] = tmp_array->get((NDAT)i++);
                    }
                    delete tmp_array;
                }
                break;
                */
            case 'c': // just to keep it a valid option
                break;
            case 'o':
                param.duplicate_console = 1;
                strcpy(console_file_name,argv[i]);
                break;
            case '0':
                param.init_reset = true;
                break;
            case 'l': // just to keep it a valid option
                break;
            case 'u': // just to keep it a valid option
                break;
            case 'B': // just to keep it a valid option
                break;
			default:
				fprintf(stderr,"unknown option: -%c\n", argv[i-1][1]);
				exit_with_help();
				break;
		}
	}
    // post-process checks
    // -v and -m collision
    if(param.cv_folds>0 && param.metrics>0) { // correct for 0-start coding
        fprintf(stderr,"values for -v and -m cannot be both non-zeros\n");
        exit_with_help();
    }
    // scaling
    if(param.scaled == 1 && param.solver != METHOD_BW) {
        param.scaled = 0;
        printf("Scaling can only be enabled for Baum-Welch method. Setting it to off\n");
    }
    // specifying >2 states via -n and mandatory specification of -0 (initial parameters)
    if(param.nS > 2 && !param.init_reset) {
        fprintf(stderr,"when >2 latent states specified via '-n', initial values of parameters have to be explicitly set via '-0'!\n");
        exit_with_help();
    }
    // STRUCTURE_SKABslc solver and -t 1 should be set together
    if( (param.sliced==1) != (param.structure == STRUCTURE_SKABslc || param.structure == STRUCTURE_SKAslc) ) {
        fprintf(stderr,"Error! sliced parameter ('-t 1') and STRUCTURE_SKABslc or STRUCTURE_SKAslc structure should be either both set on or off.\n");
        exit_with_help();
    }
    
	// next argument should be input file name
	if(i>=argc) // if not
		exit_with_help(); // leave
	
	strcpy(input_file_name, argv[i++]); // copy and advance
	
	if(i>=argc) { // no output file name specified
		strcpy(output_file_name,"output.hmm");
		strcpy(predict_file_name,"predict_hmm.txt"); // the predict file too
	}
	else {
		strcpy(output_file_name,argv[i++]); // copy and advance
		if(i>=argc) // no prediction file name specified
			strcpy(predict_file_name,"predict_hmm.txt"); // the predict file too
		else
			strcpy(predict_file_name,argv[i]);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x18(%rsp)
movq %r8, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, %r14
movl %edi, %ebp
movslq %edi, %r15
pushq $0x1
popq %rbx
pushq $0x2
popq %r12
cmpq %r15, %rbx
jge 0x56b5
movq (%r14,%rbx,8), %rax
cmpb $0x2d, (%rax)
jne 0x56b5
leaq 0x1(%rbx), %r13
cmpl %ebp, %r13d
jge 0x57ab
movzbl 0x1(%rax), %eax
leal -0x42(%rax), %ecx
cmpl $0x34, %ecx
ja 0x51e8
leaq 0x29e93(%rip), %rdx     # 0x2f054
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x8(%r14,%rbx,8), %rdi
callq 0x43e0
cmpl $0x3, %eax
jae 0x58a1
movb %al, 0x39126(%rip)      # 0x3e309
jmp 0x56a6
cmpl $0x30, %eax
jne 0x57e0
movb $0x1, 0x399e9(%rip)     # 0x3ebe1
jmp 0x56a6
movq 0x8(%r14,%rbx,8), %rdi
callq 0x43e0
movb %al, 0x390ec(%rip)      # 0x3e2f9
testb $-0x2, %al
je 0x56a6
jmp 0x590c
movq 0x8(%r14,%rbx,8), %rdi
leaq 0x2a111(%rip), %rbx     # 0x2f337
movq %rbx, %rsi
callq 0x43f0
movb (%rax), %al
movb %al, 0x390f6(%rip)      # 0x3e32c
xorl %edi, %edi
movq %rbx, %rsi
callq 0x43f0
movzbl (%rax), %eax
movb %al, 0x390e4(%rip)      # 0x3e32d
movzbl 0x390dc(%rip), %ecx     # 0x3e32c
cmpl $0x72, %ecx
je 0x525e
cmpl $0x67, %ecx
jne 0x5924
cmpl $0x67, %eax
je 0x56a6
cmpl $0x74, %eax
je 0x56a6
jmp 0x5924
movq 0x8(%r14,%rbx,8), %rdi
callq 0x43e0
movb %al, 0x39080(%rip)      # 0x3e305
jmp 0x56a6
movq 0x8(%r14,%rbx,8), %rdi
callq 0x43e0
movb %al, 0x39061(%rip)      # 0x3e2fb
testb $-0x2, %al
je 0x56a6
jmp 0x5969
movq 0x8(%r14,%rbx,8), %rax
movb (%rax), %al
movb %al, 0x3992c(%rip)      # 0x3ebe0
jmp 0x56a6
movq 0x8(%r14,%rbx,8), %rdi
leaq 0x2a1f3(%rip), %rbx     # 0x2f4b8
movq %rbx, %rsi
callq 0x43f0
movq %rax, %rdi
callq 0x43e0
movb %al, 0x3902b(%rip)      # 0x3e306
xorl %edi, %edi
movq %rbx, %rsi
callq 0x43f0
testq %rax, %rax
je 0x52f8
movq %rax, %rdi
callq 0x43e0
movb %al, 0x3900f(%rip)      # 0x3e307
xorl %edi, %edi
leaq 0x2a037(%rip), %rsi     # 0x2f338
callq 0x43f0
testq %rax, %rax
je 0x5319
movq %rax, %rdi
callq 0x43e0
movb %al, 0x38fef(%rip)      # 0x3e308
movzbl 0x38fe6(%rip), %eax     # 0x3e306
cmpl $0xe, %eax
ja 0x5a35
movl $0x7efa, %ecx           # imm = 0x7EFA
btl %eax, %ecx
jae 0x5a35
movsbl 0x38fc9(%rip), %edx     # 0x3e307
leal -0x6(%rdx), %ecx
cmpb $-0x6, %cl
jbe 0x5843
movl %eax, %ecx
xorb $0xd, %cl
movl %edx, %esi
xorb $0x1, %sil
orb %cl, %sil
je 0x58b9
cmpb $0xe, %al
setne %al
movl %edx, %ecx
andb $0x6, %cl
cmpb $0x2, %cl
sete %cl
orb %al, %cl
je 0x5811
cmpb $0x3, %dl
sete %cl
movb 0x38f86(%rip), %al      # 0x3e308
leal -0x5(%rax), %edx
cmpb $-0x4, %dl
setb %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x56a6
jmp 0x582a
movq 0x8(%r14,%rbx,8), %rdi
callq 0x43e0
movl %eax, 0x38f55(%rip)     # 0x3e300
cmpl $0x9, %eax
jg 0x56a6
jmp 0x5859
movq 0x8(%r14,%rbx,8), %rdi
leaq 0x29f72(%rip), %rbx     # 0x2f337
movq %rbx, %rsi
callq 0x43f0
movq %rax, %rdi
callq 0x42f0
movsd %xmm0, 0x38f13(%rip)    # 0x3e2f0
xorl %edi, %edi
movq %rbx, %rsi
callq 0x43f0
testq %rax, %rax
je 0x53f4
movb (%rax), %al
movb %al, 0x38f04(%rip)      # 0x3e2f8
movsd 0x38ef4(%rip), %xmm0    # 0x3e2f0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x597e
ucomisd 0x29bfe(%rip), %xmm0    # 0x2f010
ja 0x58dc
movzbl 0x38ed9(%rip), %eax     # 0x3e2f8
cmpl $0x6c, %eax
je 0x56a6
cmpl $0x70, %eax
je 0x56a6
jmp 0x59f3
movq 0x8(%r14,%rbx,8), %rdi
leaq 0x29ef6(%rip), %rsi     # 0x2f338
callq 0x43f0
movq %rax, %rdi
callq 0x43e0
movl %eax, 0x38edb(%rip)     # 0x3e330
jmp 0x56a6
movq 0x8(%r14,%rbx,8), %rdi
callq 0x43e0
testl %eax, %eax
jle 0x58f4
movsbl %al, %eax
movl %eax, 0x397cf(%rip)     # 0x3ec44
jmp 0x56a6
movq 0x8(%r14,%rbx,8), %rdi
leaq 0x29eb1(%rip), %rsi     # 0x2f337
callq 0x43f0
movq %rax, %rdi
callq 0x43e0
movl %eax, 0x38e87(%rip)     # 0x3e320
xorl %edi, %edi
leaq 0x29e96(%rip), %rsi     # 0x2f338
callq 0x43f0
testq %rax, %rax
je 0x54bc
movq %rax, %rdi
callq 0x43e0
decb %al
movb %al, 0x38e68(%rip)      # 0x3e324
cmpl $0x2, 0x38e5d(%rip)     # 0x3e320
jae 0x5993
movsbl 0x38e54(%rip), %edx     # 0x3e324
testl %edx, %edx
jns 0x56a6
jmp 0x5871
movq 0x8(%r14,%rbx,8), %rdi
callq 0x43e0
movb %al, 0x38e17(%rip)      # 0x3e304
testb $-0x2, %al
je 0x56a6
jmp 0x593c
movq 0x8(%r14,%rbx,8), %rdi
leaq 0x29e31(%rip), %rbx     # 0x2f337
movq %rbx, %rsi
callq 0x43f0
movq %rax, %rdi
callq 0x43e0
movb %al, 0x39218(%rip)      # 0x3e734
xorl %edi, %edi
movq %rbx, %rsi
callq 0x43f0
testq %rax, %rax
je 0x5533
movb (%rax), %al
movb %al, 0x39202(%rip)      # 0x3e735
xorl %edi, %edi
leaq 0x29dfb(%rip), %rsi     # 0x2f337
callq 0x43f0
testq %rax, %rax
je 0x5556
movq %rax, %rdi
callq 0x43e0
decb %al
movb %al, 0x391e0(%rip)      # 0x3e736
xorl %edi, %edi
leaq 0x29dd8(%rip), %rsi     # 0x2f337
callq 0x43f0
testq %rax, %rax
je 0x5578
leaq 0x391c7(%rip), %rdi     # 0x3e737
movq %rax, %rsi
callq 0x4210
xorl %edi, %edi
leaq 0x29db6(%rip), %rsi     # 0x2f337
callq 0x43f0
testq %rax, %rax
je 0x5593
movb (%rax), %al
movb %al, 0x395a4(%rip)      # 0x3eb37
movb 0x3919b(%rip), %al      # 0x3e734
cmpb $0x1, %al
jle 0x5954
cmpb $0xb, %al
jae 0x59a8
movzbl 0x39185(%rip), %eax     # 0x3e735
leal -0x67(%rax), %ecx
cmpl $0x7, %ecx
ja 0x5a1f
movl $0x85, %edx
btl %ecx, %edx
jae 0x5a1f
movsbl 0x39165(%rip), %edx     # 0x3e736
testl %edx, %edx
js 0x57f9
movzbl 0x39557(%rip), %eax     # 0x3eb37
cmpl $0x69, %eax
je 0x56a6
cmpl $0x6f, %eax
je 0x56a6
jmp 0x5a09
movq 0x8(%r14,%rbx,8), %rdi
callq 0x43e0
movb %al, 0x39579(%rip)      # 0x3eb80
cmpb $0x1, %al
jle 0x5889
cmpb $0x2, %al
je 0x56a6
movb $0x1, 0x395c6(%rip)     # 0x3ebe4
jmp 0x56a6
movq 0x8(%r14,%rbx,8), %rdi
callq 0x43e0
movl %eax, 0x38cf5(%rip)     # 0x3e328
cmpl $0x4, %eax
jb 0x56a6
jmp 0x59bd
movb $0x1, 0x38cb8(%rip)     # 0x3e2fc
movq 0x8(%r14,%rbx,8), %rsi
movq 0x18(%rsp), %rdi
callq 0x4210
jmp 0x56a6
movq 0x8(%r14,%rbx,8), %rdi
leaq 0x29cd6(%rip), %rsi     # 0x2f337
callq 0x43f0
movq %rax, %rdi
callq 0x43e0
movl %eax, %ebx
xorl %edi, %edi
leaq 0x29cbe(%rip), %rsi     # 0x2f337
callq 0x43f0
testq %rax, %rax
je 0x5699
movb %bl, 0x395b7(%rip)      # 0x3ec40
movq %rax, %rdi
callq 0x43e0
movb %al, 0x395aa(%rip)      # 0x3ec41
jmp 0x56a6
movb $0x0, 0x395a0(%rip)     # 0x3ec40
movb %bl, 0x3959b(%rip)      # 0x3ec41
addl $0x2, %r12d
incq %r13
movq %r13, %rbx
jmp 0x518b
cmpb $0x0, 0x39078(%rip)     # 0x3e734
jle 0x56cb
cmpl $0x0, 0x38c5b(%rip)     # 0x3e320
jg 0x57b0
cmpb $0x1, 0x38c27(%rip)     # 0x3e2f9
jne 0x56f0
cmpb $0x1, 0x38c2c(%rip)     # 0x3e307
je 0x56f0
movb $0x0, 0x38c15(%rip)     # 0x3e2f9
leaq 0x2a71a(%rip), %rdi     # 0x2fe05
callq 0x43d0
cmpb $0x3, 0x39489(%rip)     # 0x3eb80
jl 0x5706
cmpb $0x0, 0x394e1(%rip)     # 0x3ebe1
je 0x59d2
cmpb $0x1, 0x38bee(%rip)     # 0x3e2fb
sete %al
movb 0x38bf0(%rip), %cl      # 0x3e306
addb $-0xd, %cl
cmpb $-0x2, %cl
setb %cl
xorb %al, %cl
je 0x57c8
cmpq %r15, %rbx
jge 0x57ab
movq (%r14,%rbx,8), %rsi
movq 0x20(%rsp), %rdi
callq 0x4210
cmpl %ebp, %r12d
jge 0x5774
leal 0x2(%rbx), %r15d
movq 0x8(%r14,%rbx,8), %rsi
movq 0x10(%rsp), %rdi
callq 0x4210
cmpl %ebp, %r15d
jge 0x578d
movq 0x10(%r14,%rbx,8), %rsi
movq 0x8(%rsp), %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4210
movabsq $0x682e74757074756f, %rax # imm = 0x682E74757074756F
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movl $0x6d6d68, 0x7(%rcx)    # imm = 0x6D6D68
movups 0x2a26c(%rip), %xmm0    # 0x2fa00
movq 0x8(%rsp), %rax
movups %xmm0, (%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x8140
movq 0x38821(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x2a11e(%rip), %rdi     # 0x2f8df
pushq $0x2e
jmp 0x59e5
movq 0x38809(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x2a1a1(%rip), %rdi     # 0x2f97a
pushq $0x7a
jmp 0x59e5
movsbl %al, %edx
movq 0x387ee(%rip), %rax     # 0x3dfd8
movq (%rax), %rdi
leaq 0x2a0d6(%rip), %rsi     # 0x2f8ca
jmp 0x5a49
movq 0x387d8(%rip), %rax     # 0x3dfd8
movq (%rax), %rdi
incl %edx
leaq 0x29ede(%rip), %rsi     # 0x2f6ea
jmp 0x5a49
movq 0x387c0(%rip), %rax     # 0x3dfd8
movq (%rax), %rdi
leaq 0x29d16(%rip), %rsi     # 0x2f538
pushq $0xe
popq %rcx
jmp 0x58d0
movsbl %al, %edx
movq 0x387a4(%rip), %rax     # 0x3dfd8
movq (%rax), %rdi
leaq 0x29d39(%rip), %rsi     # 0x2f577
jmp 0x5a49
movq 0x3878e(%rip), %rax     # 0x3dfd8
movq (%rax), %rdi
leaq 0x29cab(%rip), %rsi     # 0x2f4ff
jmp 0x5a49
movq 0x38778(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x29b8b(%rip), %rdi     # 0x2f3f5
pushq $0x30
jmp 0x59e5
movq 0x38760(%rip), %rax     # 0x3dfd8
movq (%rax), %rdi
incl %edx
leaq 0x29d6f(%rip), %rsi     # 0x2f5f3
jmp 0x5a49
movq 0x38748(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x29bb1(%rip), %rdi     # 0x2f44b
pushq $0x34
jmp 0x59e5
movq 0x38730(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x29f9d(%rip), %rdi     # 0x2f84f
pushq $0x2f
jmp 0x59e5
movq 0x38718(%rip), %rax     # 0x3dfd8
movq (%rax), %rdi
leaq 0x29c6e(%rip), %rsi     # 0x2f538
pushq $0x1
popq %rdx
pushq $0xd
popq %rcx
xorl %eax, %eax
callq 0x4380
callq 0x8140
movq 0x386f5(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x29a7c(%rip), %rdi     # 0x2f369
pushq $0x27
jmp 0x59e5
movq 0x386dd(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x29f7a(%rip), %rdi     # 0x2f87f
pushq $0x4a
jmp 0x59e5
movq 0x386c5(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x29b63(%rip), %rdi     # 0x2f480
pushq $0x37
jmp 0x59e5
movq 0x386ad(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x29eb0(%rip), %rdi     # 0x2f7e5
pushq $0x69
jmp 0x59e5
movq 0x38695(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x29ad9(%rip), %rdi     # 0x2f426
pushq $0x24
jmp 0x59e5
movq 0x3867d(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x29ccc(%rip), %rdi     # 0x2f631
pushq $0x36
jmp 0x59e5
movq 0x38668(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x29a42(%rip), %rdi     # 0x2f3bc
pushq $0x38
jmp 0x59e5
movq 0x38653(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x299ad(%rip), %rdi     # 0x2f33c
pushq $0x2c
jmp 0x59e5
movq 0x3863e(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x29c28(%rip), %rdi     # 0x2f5cc
pushq $0x26
jmp 0x59e5
movq 0x38629(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x29caf(%rip), %rdi     # 0x2f668
pushq $0x46
jmp 0x59e5
movq 0x38614(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x29dbf(%rip), %rdi     # 0x2f78d
pushq $0x57
jmp 0x59e5
movq 0x385ff(%rip), %rax     # 0x3dfd8
movq (%rax), %rcx
leaq 0x29f2b(%rip), %rdi     # 0x2f90e
pushq $0x6b
popq %rsi
pushq $0x1
popq %rdx
callq 0x44e0
callq 0x8140
movsbl %al, %edx
movq 0x385db(%rip), %rax     # 0x3dfd8
movq (%rax), %rdi
leaq 0x2998a(%rip), %rsi     # 0x2f391
jmp 0x5a49
movsbl %al, %edx
movq 0x385c5(%rip), %rax     # 0x3dfd8
movq (%rax), %rdi
leaq 0x29d0e(%rip), %rsi     # 0x2f72b
jmp 0x5a49
movsbl %al, %edx
movq 0x385af(%rip), %rax     # 0x3dfd8
movq (%rax), %rdi
leaq 0x29c7c(%rip), %rsi     # 0x2f6af
jmp 0x5a49
movsbl %al, %edx
movq 0x38599(%rip), %rax     # 0x3dfd8
movq (%rax), %rdi
leaq 0x29a74(%rip), %rsi     # 0x2f4bd
xorl %eax, %eax
callq 0x4380
callq 0x8140