// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/InputUtil.cpp
// Function: InputUtil::readTxt(char const*, param*)
bool InputUtil::readTxt(const char *fn, struct param * param) {
	FILE *fid = fopen(fn,"r");
    if( fid == NULL) {
        fprintf(stderr,"Could not read input file (%s).\n",fn);
        return false;
    }
    
	int number_columns = 0;
	max_line_length = 1024;
	char *col;
    
	// count lines and check for number of columns
	line = (char *)malloc((size_t)max_line_length);// Malloc(char,max_line_length);
	
	// grab memory and read all data
	StripedArray<NPAR> *striped_dat_obs = new StripedArray<NPAR>();
	StripedArray<NCAT> *striped_dat_group = new StripedArray<NCAT>();
    StripedArray<NCAT> *striped_dat_skill = NULL;
    StripedArray<NCAT> *striped_dat_skill_stacked = NULL;
    StripedArray<NCAT> *striped_dat_skill_rcount  = NULL;
    StripedArray<NCAT> *striped_dat_skill_rix     = NULL;
    NDAT current_stacked = 0;
    if(param->multiskill==0)
        striped_dat_skill = new StripedArray<NCAT>();
    else {
//        param->dat_multiskill = new StripedArray< NCAT* >(true);
        striped_dat_skill_stacked = new StripedArray<NCAT>();
        striped_dat_skill_rcount  = new StripedArray<NCAT>();
        striped_dat_skill_rix     = new StripedArray<NCAT>();
    }
	StripedArray<NCAT> * striped_dat_item = new StripedArray<NCAT>();
    StripedArray<NPAR> *striped_dat_slice = NULL;
    if(param->sliced)
        striped_dat_slice = new StripedArray<NPAR>();
    param->map_group_fwd = new map<string,NCAT>();
    param->map_group_bwd = new map<NCAT,string>();
    param->map_skill_fwd = new map<string,NCAT>();
    param->map_skill_bwd = new map<NCAT,string>();
    param->map_step_fwd = new map<string,NCAT>();
    param->map_step_bwd = new map<NCAT,string>();
	string s_group, s_step, s_skill;
    NPAR slice = 0;
	map<string,NCAT>::iterator it;
	map<string,NCAT>::iterator it2;
	bool wrong_no_columns = false;
    param->N = 0;
    param->Nstacked = 0;
    NDAT Nstacked_alt = 0;
    param->N_null = 0;
	while( readline(fid)!=NULL && !wrong_no_columns) {
        //    while( NULL!=fgets(line,max_line_length,fid) && !wrong_no_columns) {
		number_columns = 0;
		// Observation
		col = strtok(line,"\t\n\r");
		if(col == NULL) {
			wrong_no_columns = true;
			break;
		}
		number_columns++;
		NPAR obs = (NPAR)(atoi( col )-1);
		if(obs==NPAR_MAX) {
			fprintf(stderr,"Number of observtions exceeds allowed maximum of %d.\n",NPAR_MAX);
			return false;
		}
		striped_dat_obs->add(obs); // dat_obs[t] = (NPAR)obs;
		if( (obs >= 0) && ((param->nO-1) < obs) )
			param->nO = (NPAR)(obs + 1); // obs[t] + 1;

		// Group
		col = strtok(NULL,"\t\n\r");
		if(col == NULL) {
			wrong_no_columns = true;
			break;
		}
		number_columns++;
		s_group = string( col );
		it = param->map_group_fwd->find(s_group);
		if( it==param->map_group_fwd->end() ) { // not found
			if(param->map_group_fwd->size()==NCAT_MAX) {
				fprintf(stderr,"Number of unique groups exceeds allowed maximum of %d.\n",NCAT_MAX);
				return false;
			}
			NCAT newg = (NCAT)param->map_group_fwd->size();
			striped_dat_group->add(newg); //[t] = param->map_group_fwd.size();
			param->map_group_fwd->insert(pair<string,NCAT>(s_group, newg));
			param->map_group_bwd->insert(pair<NCAT,string>(newg, s_group));
		}
		else
			striped_dat_group->add(it->second); // [t] = it->second;
		
		
		// Step
		col = strtok(NULL,"\t\n\r");
		if(col == NULL) {
			wrong_no_columns = true;
			break;
		}
		number_columns++;
		s_step = string( col );
		it2 = param->map_step_fwd->find(s_step);
		if( it2==param->map_step_fwd->end() ) { // not found
			if(param->map_step_fwd->size()==NCAT_MAX) {
				fprintf(stderr,"Number of unique steps exceeds allowed maximum of %d.\n",NCAT_MAX);
				return false;
			}
            NCAT news = (NCAT)param->map_step_fwd->size();
			striped_dat_item->add(news); //[t] = param->map_group_fwd.size();
			param->map_step_fwd->insert(pair<string,NCAT>(s_step, news));
			param->map_step_bwd->insert(pair<NCAT,string>(news, s_step));
		}
		else
            striped_dat_item->add(it2->second);
		
        
		// Skill
		col = strtok(NULL,"\t\n\r");
		if(col == NULL) {
			wrong_no_columns = true;
			break;
		}
		number_columns++;
		s_skill = string( col );
        // process skills later
        
        // Slice
        if(param->sliced) {
            col = strtok(NULL,"\t\n\r");
            if(col == NULL) {
                wrong_no_columns = true;
                break;
            }
            number_columns++;
            slice = (NPAR) atoi( col );
            if( slice<0 ) {
                fprintf(stderr,"Slice cannot be negative (line %d).\n",param->N+1);
				return false;
            }
            if( (slice >= 0) && ((param->nZ-1) < slice) ) // update slice count
                param->nZ = (NPAR)(slice + 1);
            striped_dat_slice->add(slice);
        } // time
        
        // back to skill processing
		if( (s_skill.empty() || ( s_skill.size()==1 && (s_skill[0]=='.' || s_skill[0]==' ') ) ) ) { // null skill
            param->N_null++;
            param->Nstacked++;	// increase stackd count too
            if(param->multiskill == 0) {
                striped_dat_skill->add(-1); // [t] = -1;
            }
            else {
                NCAT* a_skills = Malloc(NCAT, 2);
                a_skills[0] = 1; // count
                a_skills[1] = -1; // value
//                param->dat_multiskill->add(a_skills);
                // add whole multi-skill row
                striped_dat_skill_rcount->add(1);
                striped_dat_skill_rix->add(current_stacked++); // first add pointer, then increase
                striped_dat_skill_stacked->add(-1);
            }
		} // empty skill
		else { // non-empty skill
            // multiskill
            if(param->multiskill != 0) {
                list<NCAT> a_skills;//
                char* a_kc;
                col = &s_skill[0];//. c_str();
                a_kc  = strtok(col, "~\n\r");
                string s_kc;
                // stacked
                NDAT skill_count = 0;
                striped_dat_skill_rix->add(current_stacked); // add stacked pointer once (but increase it with every next skill
                while(a_kc != NULL) {
                    s_kc = string(a_kc);
                    // stacked
                    skill_count++;
                    current_stacked++;
                    param->Nstacked++;	// increase line count
                    // adding vvvv
                    it = param->map_skill_fwd->find(s_kc);
                    if( it==param->map_skill_fwd->end() ) { // not found
                        if(param->map_skill_fwd->size()==NCAT_MAX) {
                            fprintf(stderr,"Number of unique skills exceeds allowed maximum of %d.\n",NCAT_MAX);
                            return false;
                        }
                        a_skills.insert(a_skills.end(), (NCAT)param->map_skill_fwd->size()); //dat_skill->add(param->map_skill_fwd->size());
                        param->map_skill_fwd->insert(pair<string,NCAT>(s_kc, (NCAT)param->map_skill_fwd->size()));
                        param->map_skill_bwd->insert(pair<NCAT,string>((NCAT)param->map_skill_bwd->size(),s_kc));
                        // add stacked skill
                        striped_dat_skill_stacked->add((NCAT)param->map_skill_fwd->size()-1); // -1 because after adding
                    }
                    else {
                        a_skills.insert(a_skills.end(), it->second); //dat_skill->add(it->second); //[t] = it->second;
                        // add stacked skill
                        striped_dat_skill_stacked->add(it->second);
                    }
                    // adding ^^^^
                    a_kc  = strtok(NULL,"~\n\r");
                }
//                NCAT *b_skills = Malloc(NCAT, a_skills.size()+1);
//                b_skills[0] = (NCAT)a_skills.size();
//                int count = 0;
//                for(list<NCAT>::iterator it=a_skills.begin(); it!=a_skills.end(); it++)
//                    b_skills[++count] = *it;
//                param->dat_multiskill->add(b_skills);
                // add stacked count
                striped_dat_skill_rcount->add(skill_count);
                Nstacked_alt+=skill_count;
                // multi skill
            } else {
                // single skill
                it = param->map_skill_fwd->find(s_skill);
                if( it==param->map_skill_fwd->end() ) { // not found
                    if(param->map_skill_fwd->size()==NCAT_MAX) {
                        fprintf(stderr,"Number of unique skills exceeds allowed maximum of %d.\n",NCAT_MAX);
                        return false;
                    }
                    striped_dat_skill->add((NCAT)param->map_skill_fwd->size()); //[t] = param->map_skill_fwd.size();
                    param->map_skill_fwd->insert(pair<string,NCAT>(s_skill, (NCAT)param->map_skill_fwd->size()));
                    param->map_skill_bwd->insert(pair<NCAT,string>((NCAT)param->map_skill_bwd->size(),s_skill));
                }
                else
                    striped_dat_skill->add(it->second); //[t] = it->second;
            } // single skill
		} // non empty skill
        
		// count lines
		param->N++;	// increase line count
	}// reading loop
	if(wrong_no_columns) {
		fprintf(stderr,"Wrong number of columns in line %u. Expected %d, found %d\n",param->N+1,COLUMNS+param->sliced, number_columns);
		free(line);
		fclose(fid);
        return false;
	}
	param->nG = (NCAT)param->map_group_fwd->size();
	param->nK = (NCAT)param->map_skill_fwd->size();
	param->nI = (NCAT)param->map_step_fwd->size();
    
    // copy striped to lined
    param->dat_obs = striped_dat_obs->toArray();
  
    delete striped_dat_obs;
    param->dat_group = striped_dat_group->toArray();
    delete striped_dat_group;
    if(param->multiskill==0) {
        param->dat_skill = striped_dat_skill->toArray();
        delete striped_dat_skill;
    } else {
        param->dat_skill_stacked = striped_dat_skill_stacked->toArray();
        param->dat_skill_rcount  = striped_dat_skill_rcount->toArray();
        param->dat_skill_rix     = striped_dat_skill_rix->toArray();
        delete striped_dat_skill_stacked;
        delete striped_dat_skill_rcount;
        delete striped_dat_skill_rix;
    }
    param->dat_item = striped_dat_item->toArray();
    delete striped_dat_item;
    if(param->sliced) {
        param->dat_slice = striped_dat_slice->toArray();
        delete striped_dat_slice;
    }

	fclose(fid);
	free(line);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x26438(%rip), %rsi     # 0x34044
callq 0x4290
movq %rax, 0x58(%rsp)
testq %rax, %rax
je 0xeb52
movl $0x400, 0x3311b(%rip)   # imm = 0x400
movl $0x400, %edi            # imm = 0x400
callq 0x4300
movq %rax, 0x3310e(%rip)     # 0x40d48
movl $0x18, %edi
callq 0x4210
movabsq $0x4e2000000000, %r15   # imm = 0x4E2000000000
movq %r15, (%rax)
xorps %xmm0, %xmm0
movq %rax, 0x130(%rsp)
movups %xmm0, 0x8(%rax)
movl $0x18, %edi
callq 0x4210
movq %r15, (%rax)
movq %rax, 0xa0(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movb 0x918(%rbx), %bpl
movl $0x18, %edi
callq 0x4210
xorps %xmm0, %xmm0
movq %rax, %r12
movq %r15, (%rax)
movups %xmm0, 0x8(%rax)
testb %bpl, %bpl
je 0xdcdb
movl $0x18, %edi
callq 0x4210
movq %r15, (%rax)
movq %rax, 0x40(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movl $0x18, %edi
callq 0x4210
movq %r15, (%rax)
movq %rax, 0x48(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %r12, 0x50(%rsp)
xorl %r12d, %r12d
jmp 0xdcf6
movq $0x0, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq %r12, 0x80(%rsp)
movl $0x18, %edi
callq 0x4210
movq %r15, (%rax)
movq %rax, 0x98(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
xorl %r12d, %r12d
cmpb $0x0, 0x33(%rbx)
je 0xdd41
movl $0x18, %edi
callq 0x4210
movq %r15, (%rax)
xorps %xmm0, %xmm0
movq %rax, 0x88(%rsp)
movups %xmm0, 0x8(%rax)
jmp 0xdd4d
movq $0x0, 0x88(%rsp)
leaq 0x33(%rbx), %rax
movq %rax, 0x128(%rsp)
movl $0x30, %edi
callq 0x4210
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %r12, 0x28(%rax)
movq %rax, 0x920(%rbx)
movl $0x30, %edi
callq 0x4210
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %r12, 0x28(%rax)
movq %rax, 0x928(%rbx)
movl $0x30, %edi
callq 0x4210
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %r12, 0x28(%rax)
movq %rax, 0x940(%rbx)
movl $0x30, %edi
callq 0x4210
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %r12, 0x28(%rax)
movq %rax, 0x948(%rbx)
movl $0x30, %edi
callq 0x4210
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %r12, 0x28(%rax)
movq %rax, 0x930(%rbx)
movl $0x30, %edi
callq 0x4210
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %r12, 0x28(%rax)
movq %rax, 0x938(%rbx)
leaq 0x118(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r12, -0x8(%rax)
movb %r12b, (%rax)
leaq 0xf8(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r12, -0x8(%rax)
movb %r12b, (%rax)
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r12, -0x8(%rax)
movb %r12b, (%rax)
leaq 0x8b0(%rbx), %rax
movq %rax, 0x90(%rsp)
movq %r12, 0x8b0(%rbx)
movl $0x0, 0x8cc(%rbx)
movq $0x0, 0x38(%rsp)
movl $0x0, 0x34(%rsp)
xorl %r15d, %r15d
movq 0x32e64(%rip), %rdi     # 0x40d48
movl 0x32e5a(%rip), %esi     # 0x40d44
movq 0x58(%rsp), %rdx
callq 0x43c0
testq %rax, %rax
je 0xdf80
movq 0x32e44(%rip), %r12     # 0x40d48
movq %r12, %rdi
movl $0xa, %esi
callq 0x4250
testq %rax, %rax
jne 0xdf73
movq %r12, %rdi
movl $0xd, %esi
callq 0x4250
testq %rax, %rax
jne 0xdf73
movslq 0x32e15(%rip), %r13     # 0x40d44
addq %r13, %r13
movl %r13d, 0x32e0b(%rip)    # 0x40d44
movq %r12, %rdi
movq %r13, %rsi
callq 0x43f0
movq %rax, %r12
movq %rax, 0x32dfa(%rip)     # 0x40d48
movq %rax, %rdi
callq 0x4100
cltq
addq %rax, %r12
subl %eax, %r13d
movq %r12, %rdi
movl %r13d, %esi
movq 0x58(%rsp), %rdx
callq 0x43c0
testq %rax, %rax
jne 0xdefd
cmpq $0x0, 0x32dcd(%rip)     # 0x40d48
sete %al
jmp 0xdf82
movb $0x1, %al
testb %al, %al
jne 0xe932
testb $0x1, 0x38(%rsp)
jne 0xe932
movq 0x32dac(%rip), %rdi     # 0x40d48
leaq 0x2624e(%rip), %rsi     # 0x341f1
callq 0x43b0
testq %rax, %rax
je 0xe928
movq %rax, %rdi
callq 0x43a0
movl %eax, %r15d
leal -0x1(%r15), %r12d
cmpb $0x7f, %r12b
je 0xe6e4
movsbl %r12b, %esi
movq 0x130(%rsp), %rdi
callq 0xfd0e
testb %r12b, %r12b
js 0xdff0
cmpb %r12b, 0x8b9(%rbx)
jg 0xdff0
movb %r15b, 0x8b9(%rbx)
xorl %edi, %edi
leaq 0x261f8(%rip), %rsi     # 0x341f1
callq 0x43b0
movl $0x3, %r13d
testq %rax, %rax
je 0xe098
movq %rax, %r15
leaq 0x18(%rsp), %r12
movq %r12, 0x8(%rsp)
movq %rax, %rdi
callq 0x4100
movq %r15, %rdx
addq %rax, %rdx
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0xa7c0
leaq 0x108(%rsp), %rdi
movq %rbp, %rsi
callq 0x42c0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xe05f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x920(%rbx), %rdi
leaq 0x108(%rsp), %rsi
callq 0x10148
movq 0x920(%rbx), %rcx
leaq 0x8(%rcx), %rdx
cmpq %rdx, %rax
je 0xe0a3
movl 0x40(%rax), %esi
movq 0xa0(%rsp), %rdi
callq 0xfd60
jmp 0xe17d
movl $0x1, %r15d
jmp 0xe225
movq 0x28(%rcx), %r15
cmpq $0x7fffffff, %r15       # imm = 0x7FFFFFFF
je 0xe7cc
movq 0xa0(%rsp), %rdi
movl %r15d, %esi
callq 0xfd60
movq 0x920(%rbx), %r12
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x108(%rsp), %rsi
movq 0x110(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
callq 0xa6c2
movl %r15d, 0x28(%rsp)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x10240
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xe121
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x928(%rbx), %r12
movl %r15d, 0x8(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x108(%rsp), %rsi
movq 0x110(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xa6c2
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1040a
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xe17d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4220
xorl %edi, %edi
leaq 0x2606b(%rip), %rsi     # 0x341f1
callq 0x43b0
testq %rax, %rax
je 0xe21f
movq %rax, %r15
leaq 0x18(%rsp), %r12
movq %r12, 0x8(%rsp)
movq %rax, %rdi
callq 0x4100
movq %r15, %rdx
addq %rax, %rdx
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0xa7c0
leaq 0xe8(%rsp), %rdi
movq %r13, %rsi
callq 0x42c0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xe1e6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x930(%rbx), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x10148
movq 0x930(%rbx), %rcx
leaq 0x8(%rcx), %rdx
cmpq %rdx, %rax
je 0xe23a
movl 0x40(%rax), %esi
movq 0x98(%rsp), %rdi
callq 0xfd60
jmp 0xe30f
movl $0x2, %r15d
movb $0x1, %al
movq %rax, 0x38(%rsp)
testl %r13d, %r13d
je 0xdedd
jmp 0xe906
movq 0x28(%rcx), %r15
cmpq $0x7fffffff, %r15       # imm = 0x7FFFFFFF
je 0xe8c1
movq 0x98(%rsp), %rdi
movl %r15d, %esi
callq 0xfd60
movq 0x930(%rbx), %r12
leaq 0x18(%rsp), %r13
movq %r13, 0x8(%rsp)
movq 0xe8(%rsp), %rsi
movq 0xf0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
callq 0xa6c2
movl %r15d, 0x28(%rsp)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x10240
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xe2b3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x938(%rbx), %r12
movl %r15d, 0x8(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xe8(%rsp), %rsi
movq 0xf0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xa6c2
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x1040a
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xe30f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4220
xorl %edi, %edi
leaq 0x25ed9(%rip), %rsi     # 0x341f1
callq 0x43b0
movl $0x3, %r13d
testq %rax, %rax
je 0xe3da
movq %rax, %r15
leaq 0x18(%rsp), %r12
movq %r12, 0x8(%rsp)
movq %rax, %rdi
callq 0x4100
movq %r15, %rdx
addq %rax, %rdx
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0xa7c0
leaq 0x60(%rsp), %rdi
movq %rbp, %rsi
callq 0x42c0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xe37b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x128(%rsp), %rax
cmpb $0x0, (%rax)
je 0xe3ec
xorl %edi, %edi
leaq 0x25e60(%rip), %rsi     # 0x341f1
callq 0x43b0
testq %rax, %rax
je 0xe6fa
movq %rax, %rdi
callq 0x43a0
movsbl %al, %esi
testl %esi, %esi
js 0xe8d1
movsbl 0x8c8(%rbx), %ecx
cmpl %ecx, %esi
jl 0xe3c5
incb %al
movb %al, 0x8c8(%rbx)
movl $0x5, %r15d
movq 0x88(%rsp), %rdi
callq 0xfd0e
jmp 0xe3f2
movb $0x1, %al
movq %rax, 0x38(%rsp)
movl $0x3, %r15d
jmp 0xe22c
movl $0x4, %r15d
movq 0x68(%rsp), %rax
testq %rax, %rax
je 0xe414
cmpq $0x1, %rax
jne 0xe466
movq 0x60(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x2e, %eax
je 0xe414
cmpl $0x20, %eax
jne 0xe466
incl 0x8cc(%rbx)
incl 0x8b4(%rbx)
cmpb $0x0, 0x918(%rbx)
je 0xe705
movq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0xfd60
movl 0x34(%rsp), %ebp
movq 0x48(%rsp), %rdi
movl %ebp, %esi
callq 0xfd60
movq 0x50(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xfd60
incl %ebp
movl %ebp, 0x34(%rsp)
jmp 0xe8af
cmpb $0x0, 0x918(%rbx)
leaq 0xc8(%rsp), %rax
je 0xe714
movq %rbx, %rbp
movl %r15d, 0xe4(%rsp)
movq %rax, 0xd0(%rsp)
movq %rax, 0xc8(%rsp)
xorl %r15d, %r15d
movq %r15, 0xd8(%rsp)
movq 0x60(%rsp), %rdi
leaq 0x26b36(%rip), %rsi     # 0x34fe3
callq 0x43b0
movq %rax, %r13
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq %r15, 0xb0(%rsp)
movb $0x0, 0xb8(%rsp)
movq 0x48(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0xfd60
testq %r13, %r13
sete %bl
je 0xe74e
xorl %r14d, %r14d
movq %rbp, %r12
leaq 0x18(%rsp), %rbp
movq %rbp, 0x8(%rsp)
movq %r13, %rdi
callq 0x4100
leaq (%rax,%r13), %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0xa7c0
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
callq 0x42c0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xe542
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
movq %r12, %r15
incl 0x8b4(%r12)
movq 0x940(%r12), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x10148
movq %rax, %r13
incl 0x34(%rsp)
movq 0x940(%r15), %rax
leaq 0x8(%rax), %rcx
cmpq %rcx, %r13
je 0xe5ae
movl $0x18, %edi
callq 0x4210
movl 0x40(%r13), %ecx
movl %ecx, 0x10(%rax)
movq %rax, %rdi
leaq 0xc8(%rsp), %rsi
callq 0x4070
incq 0xd8(%rsp)
movl 0x40(%r13), %esi
movq %r12, %rbx
jmp 0xe6b5
movq 0x28(%rax), %r13
cmpq $0x7fffffff, %r13       # imm = 0x7FFFFFFF
je 0xe8ef
movl $0x18, %edi
callq 0x4210
movq %r12, %rbx
movl %r13d, 0x10(%rax)
movq %rax, %rdi
leaq 0xc8(%rsp), %rsi
callq 0x4070
incq 0xd8(%rsp)
movq 0x940(%r12), %r13
movq 0x28(%r13), %r15
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0xa6c2
movl %r15d, 0x28(%rsp)
movq %r13, %rdi
movq %r12, %rsi
callq 0x10240
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xe64a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x948(%rbx), %r13
movl 0x28(%r13), %eax
movl %eax, 0x8(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xa6c2
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1040a
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xe6a9
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x940(%rbx), %rax
movl 0x28(%rax), %esi
decl %esi
movq %rbx, %rbp
movq 0x50(%rsp), %rdi
callq 0xfd60
xorl %edi, %edi
leaq 0x26918(%rip), %rsi     # 0x34fe3
callq 0x43b0
movq %rax, %r13
incl %r14d
testq %rax, %rax
sete %bl
jne 0xe4f2
jmp 0xe751
callq 0x4904
movl $0x1, %r15d
movl $0x1, %r13d
jmp 0xe22c
movl $0x4, %r15d
jmp 0xe225
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq 0x80(%rsp), %rdi
jmp 0xe744
movq 0x940(%rbx), %rdi
leaq 0x60(%rsp), %rsi
callq 0x10148
movq 0x940(%rbx), %rcx
leaq 0x8(%rcx), %rdx
cmpq %rdx, %rax
movq 0x80(%rsp), %rdi
je 0xe7e2
movl 0x40(%rax), %esi
callq 0xfd60
jmp 0xe8af
xorl %r14d, %r14d
movq 0x40(%rsp), %rdi
movl %r14d, %esi
callq 0xfd60
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
movl 0xe4(%rsp), %r15d
je 0xe78b
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0xc8(%rsp), %rdi
leaq 0xc8(%rsp), %r13
cmpq %r13, %rdi
je 0xe7b5
movq (%rdi), %r12
movl $0x18, %esi
callq 0x4220
movq %r12, %rdi
cmpq %r13, %r12
jne 0xe7a0
movl $0x1, %r13d
testb $0x1, %bl
movq %rbp, %rbx
je 0xe22c
jmp 0xe8af
callq 0x48e1
movl $0x1, %r13d
movl $0x2, %r15d
jmp 0xe22c
movq 0x28(%rcx), %rsi
cmpq $0x7fffffff, %rsi       # imm = 0x7FFFFFFF
je 0xe8fc
callq 0xfd60
movl %r15d, %ebp
movq 0x940(%rbx), %r12
movq 0x28(%r12), %r15
leaq 0x18(%rsp), %r14
movq %r14, 0x8(%rsp)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0xa6c2
movl %r15d, 0x28(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x10240
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
movl %ebp, %r15d
je 0xe855
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x948(%rbx), %r12
movl 0x28(%r12), %eax
movl %eax, 0x8(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xa6c2
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x1040a
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xe8af
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x90(%rsp), %rax
incl (%rax)
xorl %r13d, %r13d
jmp 0xe22c
callq 0x48be
movl $0x1, %r13d
jmp 0xe3e1
movq 0x90(%rsp), %rdi
callq 0x4853
movl $0x1, %r13d
movl $0x5, %r15d
jmp 0xe22c
callq 0x4878
movq %r12, %rbp
jmp 0xe75e
callq 0x489b
jmp 0xe6ef
cmpl $0x3, %r13d
je 0xe932
xorl %ebx, %ebx
leaq 0x118(%rsp), %r14
leaq 0xf8(%rsp), %r12
leaq 0x70(%rsp), %r13
jmp 0xeaed
xorl %r15d, %r15d
movb $0x1, %al
movq %rax, 0x38(%rsp)
testb $0x1, 0x38(%rsp)
jne 0xeb71
movq 0x920(%rbx), %rax
movq 0x930(%rbx), %rcx
movl 0x28(%rax), %eax
movl %eax, 0x8bc(%rbx)
movq 0x940(%rbx), %rax
movl 0x28(%rax), %eax
movl %eax, 0x8c0(%rbx)
movl 0x28(%rcx), %eax
movl %eax, 0x8c4(%rbx)
movq 0x130(%rsp), %r15
movq %r15, %rdi
callq 0xfdb0
movq %rax, 0x870(%rbx)
movq %r15, %rdi
callq 0xfe32
movl $0x18, %esi
movq %r15, %rdi
callq 0x4220
movq 0xa0(%rsp), %r15
movq %r15, %rdi
callq 0xfe6c
movq %rax, 0x878(%rbx)
movq %r15, %rdi
callq 0xff00
movl $0x18, %esi
movq %r15, %rdi
callq 0x4220
cmpb $0x0, 0x918(%rbx)
leaq 0x118(%rsp), %r14
leaq 0x70(%rsp), %r13
je 0xea43
movq 0x50(%rsp), %r12
movq %r12, %rdi
callq 0xfe6c
movq %rax, 0x888(%rbx)
movq 0x40(%rsp), %rbp
movq %rbp, %rdi
callq 0xfe6c
movq %rax, 0x890(%rbx)
movq 0x48(%rsp), %r15
movq %r15, %rdi
callq 0xfe6c
movq %rax, 0x898(%rbx)
movq %r12, %rdi
callq 0xff00
movl $0x18, %esi
movq %r12, %rdi
callq 0x4220
movq %rbp, %rdi
callq 0xff00
movl $0x18, %esi
movq %rbp, %rdi
callq 0x4220
jmp 0xea5a
movq 0x80(%rsp), %r15
movq %r15, %rdi
callq 0xfe6c
movq %rax, 0x880(%rbx)
movq %r15, %rdi
callq 0xff00
movl $0x18, %esi
movq %r15, %rdi
callq 0x4220
movq 0x98(%rsp), %rbp
movq %rbp, %rdi
callq 0xfe6c
movq %rax, 0x8a0(%rbx)
movq %rbp, %rdi
callq 0xff00
movl $0x18, %esi
movq %rbp, %rdi
callq 0x4220
cmpb $0x0, 0x33(%rbx)
je 0xeacd
movq 0x88(%rsp), %rbp
movq %rbp, %rdi
callq 0xfdb0
movq %rax, 0x8a8(%rbx)
movq %rbp, %rdi
callq 0xfe32
movl $0x18, %esi
movq %rbp, %rdi
callq 0x4220
movq 0x58(%rsp), %rdi
callq 0x4200
movq 0x3226a(%rip), %rdi     # 0x40d48
callq 0x42a0
movb $0x1, %bl
leaq 0xf8(%rsp), %r12
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0xeb04
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0xe8(%rsp), %rdi
cmpq %r12, %rdi
je 0xeb21
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0xeb3e
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x4220
movl %ebx, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3147f(%rip), %rax     # 0x3ffd8
movq (%rax), %rdi
leaq 0x26395(%rip), %rsi     # 0x34ef8
xorl %ebx, %ebx
movq %r15, %rdx
xorl %eax, %eax
callq 0x4330
jmp 0xeb3e
movq 0x90(%rsp), %rdi
movq 0x128(%rsp), %rsi
movl %r15d, %edx
movq 0x58(%rsp), %rcx
callq 0x4925
jmp 0xe90c
jmp 0xebe3
jmp 0xecde
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
jne 0xec1b
jmp 0xece1
jmp 0xecde
jmp 0xecde
jmp 0xec8a
jmp 0xebe3
jmp 0xecde
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
jne 0xec1b
jmp 0xece1
jmp 0xecde
jmp 0xecde
jmp 0xecde
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xece1
movq 0x20(%rsp), %rsi
jmp 0xec20
jmp 0xecde
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xece1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
jmp 0xece1
jmp 0xecde
jmp 0xecde
jmp 0xecde
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xec8d
movq 0x20(%rsp), %rsi
jmp 0xec6e
jmp 0xec8a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xec8d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
jmp 0xec8d
jmp 0xec8a
jmp 0xec8a
jmp 0xecde
jmp 0xecde
jmp 0xec8a
jmp 0xecde
jmp 0xecde
jmp 0xec8a
jmp 0xec8a
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0xecb2
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0xc8(%rsp), %rdi
leaq 0xc8(%rsp), %r15
cmpq %r15, %rdi
je 0xece1
movq (%rdi), %r14
movl $0x18, %esi
callq 0x4220
movq %r14, %rdi
cmpq %r15, %r14
jne 0xecc7
jmp 0xece1
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xecfd
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0xed22
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0xed47
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x4220
movq %rbx, %rdi
callq 0x4430
nop