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

					exit_with_help();
				}
				if(task.cv_folds>10) {
					fprintf(stderr,"please keep number of cross-validation folds less than or equal to 10\n");
					exit_with_help();
				}
                if(task.cv_strat != CV_GROUP && task.cv_strat != CV_ITEM && task.cv_strat != CV_NSTR){
					fprintf(stderr,"cross-validation stratification parameter '%c' is illegal\n",task.cv_strat);
					exit_with_help();
                }
				if(task.cv_target_obs<0) {// || 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);
					exit_with_help();
				}
                if( task.cv_inout_flag!='i' && task.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",task.cv_inout_flag);
					exit_with_help();
                }
                
				break;
            case  'p':
                task.predictions = atoi(argv[i]);
                if(task.predictions<0 || task.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':
                task.update_known = *strtok(argv[i],",\t\n\r");
                ch = strtok(NULL, ",\t\n\r");
                task.update_unknown = ch[0];
                
                if( (task.update_known!='r' && task.update_known!='g') ||
                   (task.update_unknown!='t' && task.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':
				task.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();
                }
                task.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
                    task.first_iteration_qualify = 0;
                    task.iterations_to_qualify   = (NPAR)n;
                } else {
                    task.first_iteration_qualify = (NPAR)n;
                    task.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();
                }
                task.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();
                    }
                    task.Cslices = (NPAR) tmp_array->getSize() / 4;
                    task.Cw = Calloc(NUMBER, (size_t)task.Cslices);
                    task.Ccenters = Calloc(NUMBER, (size_t)(task.Cslices * 3) );
                    int c1 = 0, c2 = 0, i = 0;
                    for(int l=0; l<(int)tmp_array->getSize() / 4; l++) {
                        task.Cw[c1++] = tmp_array->get((NDAT)i++);
                        for(int j=0; j<3; j++)
                            task.Ccenters[c2++] = tmp_array->get((NDAT)i++);
                    }
                    delete tmp_array;
                }
                break;
                */
            case 'c': // just to keep it a valid option
                break;
            case 'o':
                task.duplicate_console = 1;
                strcpy(console_file_name,argv[i]);
                break;
            case '0':
                task.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;
            case 'k': // 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(task.cv_folds>0 && task.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(task.is_scaled == 1 && task.solver != METHOD_BW) {
        task.is_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(task.nS > 2 && !task.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( (task.sliced==1) != (task.structure == STRUCTURE_SKABslc || task.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 %r8, %r12
movq %rcx, 0x10(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, %r14
movl %edi, %ebp
movl $0x1, %ebx
cmpl $0x2, %edi
setge %r13b
jl 0x562c
movq 0x8(%r14), %rax
cmpb $0x2d, (%rax)
jne 0x562c
movq %r9, 0x18(%rsp)
movq %r12, 0x8(%rsp)
movl $0x3, %ebx
movl $0x2, %r12d
leaq 0xfeff(%rip), %r15      # 0x15020
cmpl %ebp, %r12d
jge 0x5728
movzbl 0x1(%rax), %edi
leal -0x42(%rdi), %eax
cmpl $0x34, %eax
ja 0x5161
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
cmpl %ebp, %ebx
setl %r13b
jge 0x5627
movq 0x8(%r14,%r12,8), %rax
addl $0x2, %ebx
addq $0x2, %r12
cmpb $0x2d, (%rax)
je 0x5121
jmp 0x5624
cmpl $0x30, %edi
jne 0x574d
movb $0x1, 0x18a08(%rip)     # 0x1db79
jmp 0x513f
movq (%r14,%r12,8), %rdi
leaq 0x10288(%rip), %r13     # 0x15406
movq %r13, %rsi
callq 0x3350
movq %rax, %rdi
callq 0x3340
movb %al, 0x18112(%rip)      # 0x1d2a6
xorl %edi, %edi
movq %r13, %rsi
callq 0x3350
testq %rax, %rax
je 0x51b1
movq %rax, %rdi
callq 0x3340
movb %al, 0x180f6(%rip)      # 0x1d2a7
xorl %edi, %edi
leaq 0x100cc(%rip), %rsi     # 0x15286
callq 0x3350
testq %rax, %rax
je 0x51d2
movq %rax, %rdi
callq 0x3340
movb %al, 0x180d6(%rip)      # 0x1d2a8
movzbl 0x180cd(%rip), %eax     # 0x1d2a6
cmpl $0xe, %eax
ja 0x57d5
movl $0x7efa, %ecx           # imm = 0x7EFA
btl %eax, %ecx
jae 0x57d5
movb 0x180b1(%rip), %cl      # 0x1d2a7
leal -0x6(%rcx), %edx
cmpb $-0x6, %dl
jbe 0x5776
xorb $0xd, %al
movl %ecx, %edx
xorb $0x1, %dl
orb %al, %dl
je 0x5771
cmpb $0x3, %cl
sete %cl
movb 0x1808b(%rip), %al      # 0x1d2a8
leal -0x5(%rax), %edx
cmpb $-0x4, %dl
setb %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x513f
jmp 0x5769
movq (%r14,%r12,8), %rdi
leaq 0x10044(%rip), %r15     # 0x15285
movq %r15, %rsi
callq 0x3350
movq %rax, %rdi
callq 0x3340
movl %eax, %r13d
xorl %edi, %edi
movq %r15, %rsi
callq 0x3350
testq %rax, %rax
je 0x560a
movb %r13b, 0x1896a(%rip)    # 0x1dbd8
movq %rax, %rdi
callq 0x3340
movb %al, 0x1895d(%rip)      # 0x1dbd9
jmp 0x5618
movq (%r14,%r12,8), %rdi
callq 0x3340
movb %al, 0x18015(%rip)      # 0x1d2a5
jmp 0x513f
movq (%r14,%r12,8), %rdi
callq 0x3340
movl %eax, 0x17ffc(%rip)     # 0x1d2a0
cmpl $0x9, %eax
jg 0x513f
jmp 0x579a
movq (%r14,%r12,8), %rdi
callq 0x3340
movl %eax, 0x18007(%rip)     # 0x1d2c8
cmpl $0x4, %eax
jb 0x513f
jmp 0x5783
movq (%r14,%r12,8), %rdi
callq 0x3340
testl %eax, %eax
jle 0x57b3
movsbl %al, %eax
movl %eax, 0x188f3(%rip)     # 0x1dbdc
jmp 0x513f
movq (%r14,%r12,8), %rdi
callq 0x3340
movb %al, 0x17f9e(%rip)      # 0x1d29b
testb $-0x2, %al
je 0x513f
jmp 0x5764
movq (%r14,%r12,8), %rdi
leaq 0xff70(%rip), %rsi      # 0x15285
callq 0x3350
movq %rax, %rdi
callq 0x3340
movl %eax, 0x17f98(%rip)     # 0x1d2c0
xorl %edi, %edi
leaq 0xff55(%rip), %rsi      # 0x15286
callq 0x3350
testq %rax, %rax
je 0x534b
movq %rax, %rdi
callq 0x3340
decb %al
movb %al, 0x17f79(%rip)      # 0x1d2c4
cmpl $0x2, 0x17f6e(%rip)     # 0x1d2c0
jae 0x5795
movb 0x17f66(%rip), %al      # 0x1d2c4
testb %al, %al
jns 0x513f
jmp 0x578d
movb $0x1, 0x17f2a(%rip)     # 0x1d29c
movq (%r14,%r12,8), %rsi
movq 0x18(%rsp), %rdi
callq 0x31c0
jmp 0x513f
movq (%r14,%r12,8), %rdi
callq 0x3340
movb %al, 0x187c4(%rip)      # 0x1db58
cmpb $0x1, %al
jle 0x5788
cmpb $0x2, %al
je 0x513f
movb $0x1, 0x187d1(%rip)     # 0x1db7c
jmp 0x513f
movq (%r14,%r12,8), %rdi
callq 0x3340
cmpl $0x3, %eax
jae 0x57b8
movb %al, 0x17ee1(%rip)      # 0x1d2a9
jmp 0x513f
movq (%r14,%r12,8), %rdi
leaq 0xfead(%rip), %r13      # 0x15285
movq %r13, %rsi
callq 0x3350
movb (%rax), %al
movb %al, 0x17ee4(%rip)      # 0x1d2cc
xorl %edi, %edi
movq %r13, %rsi
callq 0x3350
movzbl (%rax), %eax
movb %al, 0x17ed2(%rip)      # 0x1d2cd
movzbl 0x17eca(%rip), %ecx     # 0x1d2cc
cmpl $0x72, %ecx
je 0x5410
cmpl $0x67, %ecx
jne 0x57a9
cmpl $0x67, %eax
je 0x513f
cmpl $0x74, %eax
je 0x513f
jmp 0x57a9
movq (%r14,%r12,8), %rdi
leaq 0xfe54(%rip), %rsi      # 0x15286
callq 0x3350
movq %rax, %rdi
callq 0x3340
movl %eax, 0x17e8b(%rip)     # 0x1d2d0
jmp 0x513f
movq (%r14,%r12,8), %rdi
callq 0x3340
movb %al, 0x17e40(%rip)      # 0x1d299
testb $-0x2, %al
je 0x513f
jmp 0x57ae
movq (%r14,%r12,8), %rdi
callq 0x3340
movb %al, 0x17e2f(%rip)      # 0x1d2a4
testb $-0x2, %al
je 0x513f
jmp 0x577e
movq (%r14,%r12,8), %rdi
leaq 0xfdf8(%rip), %r13      # 0x15285
movq %r13, %rsi
callq 0x3350
movq %rax, %rdi
callq 0x32a0
movsd %xmm0, 0x17deb(%rip)    # 0x1d290
xorl %edi, %edi
movq %r13, %rsi
callq 0x3350
testq %rax, %rax
je 0x54bc
movb (%rax), %al
movb %al, 0x17ddc(%rip)      # 0x1d298
movsd 0x17dcc(%rip), %xmm0    # 0x1d290
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x57a4
ucomisd 0xfb36(%rip), %xmm0     # 0x15010
ja 0x579f
movzbl 0x17db1(%rip), %eax     # 0x1d298
cmpl $0x6c, %eax
je 0x513f
cmpl $0x70, %eax
je 0x513f
jmp 0x57c5
movq (%r14,%r12,8), %rax
movb (%rax), %al
movb %al, 0x1866e(%rip)      # 0x1db78
jmp 0x513f
movq (%r14,%r12,8), %rdi
leaq 0xfd6b(%rip), %r13      # 0x15285
movq %r13, %rsi
callq 0x3350
movq %rax, %rdi
callq 0x3340
movb %al, 0x181a4(%rip)      # 0x1d6d4
xorl %edi, %edi
movq %r13, %rsi
callq 0x3350
testq %rax, %rax
je 0x5547
movb (%rax), %al
movb %al, 0x1818e(%rip)      # 0x1d6d5
xorl %edi, %edi
leaq 0xfd35(%rip), %rsi      # 0x15285
callq 0x3350
testq %rax, %rax
je 0x556a
movq %rax, %rdi
callq 0x3340
decb %al
movb %al, 0x1816c(%rip)      # 0x1d6d6
xorl %edi, %edi
leaq 0xfd12(%rip), %rsi      # 0x15285
callq 0x3350
testq %rax, %rax
je 0x558c
leaq 0x18153(%rip), %rdi     # 0x1d6d7
movq %rax, %rsi
callq 0x31c0
xorl %edi, %edi
leaq 0xfcf0(%rip), %rsi      # 0x15285
callq 0x3350
testq %rax, %rax
je 0x55a7
movb (%rax), %al
movb %al, 0x18530(%rip)      # 0x1dad7
movb 0x18127(%rip), %al      # 0x1d6d4
cmpb $0x1, %al
jle 0x575f
cmpb $0xb, %al
jge 0x575a
movzbl 0x18111(%rip), %eax     # 0x1d6d5
leal -0x67(%rax), %ecx
cmpl $0x7, %ecx
ja 0x57cd
movl $0x85, %edx
btl %ecx, %edx
jae 0x57cd
movb 0x180f2(%rip), %al      # 0x1d6d6
testb %al, %al
js 0x5752
movzbl 0x184e4(%rip), %eax     # 0x1dad7
cmpl $0x69, %eax
je 0x513f
cmpl $0x6f, %eax
je 0x513f
jmp 0x57bd
movb $0x0, 0x185c7(%rip)     # 0x1dbd8
movb %r13b, 0x185c1(%rip)    # 0x1dbd9
leaq 0xfa01(%rip), %r15      # 0x15020
jmp 0x513f
addl $-0x2, %ebx
movq 0x8(%rsp), %r12
cmpb $0x0, 0x180a1(%rip)     # 0x1d6d4
jle 0x5642
cmpl $0x0, 0x17c84(%rip)     # 0x1d2c0
jg 0x573e
cmpb $0x1, 0x17c50(%rip)     # 0x1d299
jne 0x5667
cmpb $0x1, 0x17c55(%rip)     # 0x1d2a7
je 0x5667
movb $0x0, 0x17c3e(%rip)     # 0x1d299
leaq 0x10720(%rip), %rdi     # 0x15d82
callq 0x3320
cmpb $0x3, 0x184ea(%rip)     # 0x1db58
jl 0x567d
cmpb $0x0, 0x18502(%rip)     # 0x1db79
je 0x5748
cmpb $0x1, 0x17c17(%rip)     # 0x1d29b
sete %al
movb 0x17c19(%rip), %cl      # 0x1d2a6
addb $-0xd, %cl
cmpb $-0x2, %cl
setb %cl
xorb %al, %cl
je 0x5743
testb %r13b, %r13b
je 0x5728
leal 0x1(%rbx), %r15d
movl %ebx, %eax
movq (%r14,%rax,8), %rsi
movq 0x20(%rsp), %rdi
callq 0x31c0
cmpl %ebp, %r15d
jge 0x56f4
addl $0x2, %ebx
movl %r15d, %eax
movq (%r14,%rax,8), %rsi
movq 0x10(%rsp), %rdi
callq 0x31c0
cmpl %ebp, %ebx
jge 0x570d
movl %ebx, %eax
movq (%r14,%rax,8), %rsi
movq %r12, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31c0
movabsq $0x682e74757074756f, %rax # imm = 0x682E74757074756F
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movl $0x6d6d68, 0x7(%rcx)    # imm = 0x6D6D68
movups 0x1023a(%rip), %xmm0    # 0x1594e
movups %xmm0, (%r12)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x106d8(%rip), %rdi     # 0x15e07
callq 0x3320
movl $0x1, %edi
callq 0x3280
callq 0x388a
callq 0x3859
callq 0x3828
callq 0x394e
movzbl %al, %edi
callq 0x353a
callq 0x35a2
callq 0x35d3
callq 0x37f7
movzbl %al, %edi
callq 0x366c
callq 0x369d
movzbl %cl, %edi
callq 0x36d1
callq 0x3795
callq 0x34d8
callq 0x3764
movzbl %al, %edi
callq 0x3604
callq 0x363b
callq 0x37c6
callq 0x38ec
callq 0x391d
callq 0x34a7
callq 0x3733
callq 0x3445
callq 0x3476
movzbl %al, %edi
callq 0x3509
movzbl %al, %edi
callq 0x38bb
movzbl %al, %edi
callq 0x3571
movzbl %al, %edi
callq 0x3702