// File: /workspace/github_cpp_makefile_star2_O2/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 $0x118, %rsp            # imm = 0x118
movq %rsi, %r14
movq %rdi, %r15
leaq 0x21024(%rip), %rsi     # 0x2c044
callq 0x4280
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0xbb0a
movl $0x400, 0x2ed27(%rip)   # imm = 0x400
movl $0x400, %edi            # imm = 0x400
callq 0x4300
movq %rax, 0x2ed1a(%rip)     # 0x39d68
pushq $0x18
popq %rbx
movq %rbx, %rdi
callq 0x4220
movabsq $0x4e2000000000, %r12   # imm = 0x4E2000000000
movq %r12, (%rax)
xorps %xmm0, %xmm0
movq %rax, 0x78(%rsp)
movups %xmm0, 0x8(%rax)
movq %rbx, %rdi
callq 0x4220
movq %r12, (%rax)
movq %rax, 0x70(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movb 0x918(%r14), %bpl
movq %rbx, %rdi
callq 0x4220
xorps %xmm0, %xmm0
movq %rax, %r13
movq %r12, (%rax)
movups %xmm0, 0x8(%rax)
testb %bpl, %bpl
je 0xb0e5
pushq $0x18
popq %rbx
movq %rbx, %rdi
callq 0x4220
movq %r12, (%rax)
movq %rax, 0x38(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rbx, %rdi
callq 0x4220
movq %r12, (%rax)
movq %rax, 0x40(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %r13, 0x48(%rsp)
xorl %r13d, %r13d
jmp 0xb100
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x48(%rsp)
pushq $0x18
popq %rdi
callq 0x4220
movq %r12, (%rax)
movq %rax, 0x68(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
xorl %r15d, %r15d
cmpb $0x0, 0x33(%r14)
movq %r13, 0x58(%rsp)
je 0xb13f
pushq $0x18
popq %rdi
callq 0x4220
movq %r12, (%rax)
xorps %xmm0, %xmm0
movq %rax, 0x60(%rsp)
movups %xmm0, 0x8(%rax)
jmp 0xb148
movq $0x0, 0x60(%rsp)
pushq $0x30
popq %rbx
movq %rbx, %rdi
callq 0x4220
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
andq $0x0, 0x28(%rax)
movq %rax, 0x920(%r14)
movq %rbx, %rdi
callq 0x4220
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
andq $0x0, 0x28(%rax)
movq %rax, 0x928(%r14)
movq %rbx, %rdi
callq 0x4220
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
andq $0x0, 0x28(%rax)
movq %rax, 0x940(%r14)
movq %rbx, %rdi
callq 0x4220
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
andq $0x0, 0x28(%rax)
movq %rax, 0x948(%r14)
movq %rbx, %rdi
callq 0x4220
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
andq $0x0, 0x28(%rax)
movq %rax, 0x930(%r14)
movq %rbx, %rdi
callq 0x4220
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
andq $0x0, 0x28(%rax)
movq %rax, 0x938(%r14)
leaq 0x108(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq 0xe8(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %r15b, (%rax)
movb %r15b, (%rcx)
leaq 0xa8(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %r15b, (%rax)
andq $0x0, 0x8b0(%r14)
andl $0x0, 0x8cc(%r14)
leaq 0x10(%rsp), %r12
leaq 0xb8(%rsp), %r13
movq $0x0, (%rsp)
movq 0x2eab9(%rip), %rdi     # 0x39d68
movl 0x2eaaf(%rip), %esi     # 0x39d64
movq 0x50(%rsp), %rdx
callq 0x43d0
testq %rax, %rax
je 0xb93f
movq 0x2ea99(%rip), %rbx     # 0x39d68
movq %rbx, %rdi
pushq $0xa
popq %rsi
callq 0x4260
testq %rax, %rax
jne 0xb341
movq %rbx, %rdi
pushq $0xd
popq %rsi
callq 0x4260
testq %rax, %rax
jne 0xb341
movslq 0x2ea6e(%rip), %r15     # 0x39d64
addq %r15, %r15
movl %r15d, 0x2ea64(%rip)    # 0x39d64
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4410
movq %rax, %rbx
movq %rax, 0x2ea53(%rip)     # 0x39d68
movq %rax, %rdi
callq 0x40e0
cltq
addq %rax, %rbx
subl %eax, %r15d
movq %rbx, %rdi
movl %r15d, %esi
movq 0x50(%rsp), %rdx
callq 0x43d0
testq %rax, %rax
jne 0xb2c8
movq 0x2ea27(%rip), %rbx     # 0x39d68
testq %rbx, %rbx
je 0xb93f
movq %rbx, %rdi
leaq 0x20e9d(%rip), %rsi     # 0x2c1f1
callq 0x43c0
testq %rax, %rax
je 0xbb29
movq %rax, %rdi
callq 0x43b0
movl %eax, %ebx
leal -0x1(%rbx), %ebp
cmpb $0x7f, %bpl
je 0xbb2e
movsbl %bpl, %esi
movq 0x78(%rsp), %rdi
callq 0xc980
testb %bpl, %bpl
js 0xb39c
cmpb %bpl, 0x8b9(%r14)
jg 0xb39c
movb %bl, 0x8b9(%r14)
xorl %edi, %edi
leaq 0x20e4c(%rip), %rsi     # 0x2c1f1
callq 0x43c0
testq %rax, %rax
je 0xbb49
movq %r12, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x7dea
leaq 0xf8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x42b0
movq %r12, %rdi
callq 0x40f0
movq 0x920(%r14), %rdi
movq %rbx, %rsi
callq 0xce76
movq 0x920(%r14), %rcx
leaq 0x8(%rcx), %rdx
cmpq %rdx, %rax
je 0xb40a
movl 0x40(%rax), %esi
movq 0x70(%rsp), %rdi
callq 0xc9ea
jmp 0xb487
movq 0x28(%rcx), %rbx
cmpq $0x7fffffff, %rbx       # imm = 0x7FFFFFFF
je 0xbbbd
movq 0x70(%rsp), %rdi
movl %ebx, %esi
callq 0xc9ea
movq 0x920(%r14), %r15
movq %r12, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x4320
movl %ebx, 0x30(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xcf7e
movq %r12, %rdi
callq 0x40f0
movq 0x928(%r14), %r15
movl %ebx, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x4320
movq %r15, %rdi
movq %r12, %rsi
callq 0xd16a
leaq 0x18(%rsp), %rdi
callq 0x40f0
xorl %edi, %edi
leaq 0x20d61(%rip), %rsi     # 0x2c1f1
callq 0x43c0
testq %rax, %rax
je 0xbb4d
movq %r12, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x7dea
leaq 0xd8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x42b0
movq %r12, %rdi
callq 0x40f0
movq 0x930(%r14), %rdi
movq %rbx, %rsi
callq 0xce76
movq 0x930(%r14), %rcx
leaq 0x8(%rcx), %rdx
cmpq %rdx, %rax
je 0xb4f5
movl 0x40(%rax), %esi
movq 0x68(%rsp), %rdi
callq 0xc9ea
jmp 0xb572
movq 0x28(%rcx), %rbx
cmpq $0x7fffffff, %rbx       # imm = 0x7FFFFFFF
je 0xbbd0
movq 0x68(%rsp), %rdi
movl %ebx, %esi
callq 0xc9ea
movq 0x930(%r14), %r15
movq %r12, %rdi
leaq 0xd8(%rsp), %rsi
callq 0x4320
movl %ebx, 0x30(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xcf7e
movq %r12, %rdi
callq 0x40f0
movq 0x938(%r14), %r15
movl %ebx, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x4320
movq %r15, %rdi
movq %r12, %rsi
callq 0xd16a
leaq 0x18(%rsp), %rdi
callq 0x40f0
xorl %edi, %edi
leaq 0x20c76(%rip), %rsi     # 0x2c1f1
callq 0x43c0
testq %rax, %rax
je 0xbb51
movq %r12, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x7dea
leaq 0x98(%rsp), %rdi
movq %r12, %rsi
callq 0x42b0
movq %r12, %rdi
callq 0x40f0
cmpb $0x0, 0x33(%r14)
je 0xb5ff
xorl %edi, %edi
leaq 0x20c32(%rip), %rsi     # 0x2c1f1
callq 0x43c0
testq %rax, %rax
je 0xbb55
movq %rax, %rdi
callq 0x43b0
movsbl %al, %esi
testl %esi, %esi
js 0xbb9f
movsbl 0x8c8(%r14), %ecx
cmpl %ecx, %esi
jl 0xb5f5
incb %al
movb %al, 0x8c8(%r14)
movq 0x60(%rsp), %rdi
callq 0xc980
movq 0xa0(%rsp), %rax
testq %rax, %rax
je 0xb627
cmpq $0x1, %rax
jne 0xb67d
movq 0x98(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x2e, %eax
je 0xb627
cmpl $0x20, %eax
jne 0xb67d
incl 0x8cc(%r14)
incl 0x8b4(%r14)
cmpb $0x0, 0x918(%r14)
pushq $-0x1
popq %rsi
je 0xb877
movq 0x38(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0xc9ea
movq 0x40(%rsp), %rdi
movq (%rsp), %rsi
callq 0xc9ea
movq 0x48(%rsp), %rdi
pushq $-0x1
popq %rsi
callq 0xc9ea
movq (%rsp), %rax
incl %eax
movq %rax, (%rsp)
jmp 0xb881
cmpb $0x0, 0x918(%r14)
je 0xb850
leaq 0x80(%rsp), %rax
movq %rax, 0x88(%rsp)
movq %rax, 0x80(%rsp)
andq $0x0, 0x90(%rsp)
movq 0x98(%rsp), %rdi
leaq 0x219b8(%rip), %rsi     # 0x2d073
callq 0x43c0
movq %rax, %rbx
leaq 0xc8(%rsp), %rax
movq %rax, 0xb8(%rsp)
andq $0x0, 0xc0(%rsp)
movb $0x0, 0xc8(%rsp)
movq 0x40(%rsp), %rdi
movq (%rsp), %rsi
callq 0xc9ea
xorl %ebp, %ebp
testq %rbx, %rbx
je 0xb81b
movq %r12, %rdi
movq %rbx, %rsi
leaq 0xf(%rsp), %rdx
callq 0x7dea
movq %r13, %rdi
movq %r12, %rsi
callq 0x42b0
movq %r12, %rdi
callq 0x40f0
incl 0x8b4(%r14)
movq 0x940(%r14), %rdi
movq %r13, %rsi
callq 0xce76
movq %rax, %r15
movq 0x940(%r14), %rax
leaq 0x8(%rax), %rcx
cmpq %rcx, %r15
je 0xb768
addq $0x40, %r15
leaq 0x80(%rsp), %rdi
movq %rdi, %rsi
movq %r15, %rdx
callq 0xca54
movl (%r15), %esi
jmp 0xb7f9
movq 0x28(%rax), %rax
cmpq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
je 0xb915
movl %eax, 0x10(%rsp)
leaq 0x80(%rsp), %rdi
movq %rdi, %rsi
movq %r12, %rdx
callq 0xd30e
movq 0x940(%r14), %rbx
movq 0x28(%rbx), %r15
movq %r12, %rdi
movq %r13, %rsi
callq 0x4320
movl %r15d, 0x30(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xcf7e
movq %r12, %rdi
callq 0x40f0
movq 0x948(%r14), %rbx
movl 0x28(%rbx), %eax
movl %eax, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r13, %rsi
callq 0x4320
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd16a
leaq 0x18(%rsp), %rdi
callq 0x40f0
movq 0x940(%r14), %rax
movl 0x28(%rax), %esi
decl %esi
movq 0x48(%rsp), %rdi
callq 0xc9ea
xorl %edi, %edi
leaq 0x21867(%rip), %rsi     # 0x2d073
callq 0x43c0
movq %rax, %rbx
incl %ebp
jmp 0xb6f4
movq 0x38(%rsp), %rdi
movl %ebp, %esi
callq 0xc9ea
movq (%rsp), %rax
addl %ebp, %eax
movq %rax, (%rsp)
movq %r13, %rdi
callq 0x40f0
leaq 0x80(%rsp), %rdi
callq 0xcdce
testq %rbx, %rbx
je 0xb881
jmp 0xbb06
movq 0x940(%r14), %rdi
leaq 0x98(%rsp), %rsi
callq 0xce76
movq 0x940(%r14), %rcx
leaq 0x8(%rcx), %rdx
cmpq %rdx, %rax
je 0xb88d
movl 0x40(%rax), %esi
movq 0x58(%rsp), %rdi
callq 0xc9ea
incl 0x8b0(%r14)
jmp 0xb2a8
movq 0x28(%rcx), %rsi
cmpq $0x7fffffff, %rsi       # imm = 0x7FFFFFFF
je 0xbbf4
movq 0x58(%rsp), %rdi
callq 0xc9ea
movq 0x940(%r14), %rbx
movq 0x28(%rbx), %r15
movq %r12, %rdi
leaq 0x98(%rsp), %rsi
callq 0x4320
movl %r15d, 0x30(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xcf7e
movq %r12, %rdi
callq 0x40f0
movq 0x948(%r14), %rbx
movl 0x28(%rbx), %eax
movl %eax, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x4320
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd16a
leaq 0x18(%rsp), %rdi
callq 0x40f0
jmp 0xb881
movq 0x2d6bc(%rip), %rax     # 0x38fd8
movq (%rax), %rdi
leaq 0x21751(%rip), %rsi     # 0x2d077
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %eax, %eax
callq 0x4350
movq (%rsp), %rax
addl %ebp, %eax
incl %eax
jmp 0xb82d
movq 0x920(%r14), %rax
movq 0x930(%r14), %rcx
movl 0x28(%rax), %eax
movl %eax, 0x8bc(%r14)
movq 0x940(%r14), %rax
movl 0x28(%rax), %eax
movl %eax, 0x8c0(%r14)
movl 0x28(%rcx), %eax
movl %eax, 0x8c4(%r14)
movq 0x78(%rsp), %r15
movq %r15, %rdi
callq 0xca82
movq %rax, 0x870(%r14)
movq %r15, %rdi
callq 0xcafa
pushq $0x18
popq %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4230
movq 0x70(%rsp), %r15
movq %r15, %rdi
callq 0xcb2c
movq %rax, 0x878(%r14)
movq %r15, %rdi
callq 0xcbb8
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4230
cmpb $0x0, 0x918(%r14)
je 0xba34
movq 0x48(%rsp), %r13
movq %r13, %rdi
callq 0xcb2c
movq %rax, 0x888(%r14)
movq 0x38(%rsp), %r15
movq %r15, %rdi
callq 0xcb2c
movq %rax, 0x890(%r14)
movq 0x40(%rsp), %r12
movq %r12, %rdi
callq 0xcb2c
movq %rax, 0x898(%r14)
movq %r13, %rdi
callq 0xcbb8
pushq $0x18
popq %rbx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4230
movq %r15, %rdi
callq 0xcbb8
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4230
jmp 0xba48
movq 0x58(%rsp), %r12
movq %r12, %rdi
callq 0xcb2c
movq %rax, 0x880(%r14)
movq %r12, %rdi
callq 0xcbb8
pushq $0x18
popq %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4230
movq 0x68(%rsp), %r15
movq %r15, %rdi
callq 0xcb2c
movq %rax, 0x8a0(%r14)
movq %r15, %rdi
callq 0xcbb8
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4230
cmpb $0x0, 0x33(%r14)
je 0xbab3
movq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0xca82
movq %rax, 0x8a8(%r14)
movq %rbx, %rdi
callq 0xcafa
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x4230
movq 0x50(%rsp), %rdi
callq 0x4210
movq 0x2e2a4(%rip), %rdi     # 0x39d68
callq 0x4290
movb $0x1, %bl
leaq 0x98(%rsp), %rdi
callq 0x40f0
leaq 0xd8(%rsp), %rdi
callq 0x40f0
leaq 0xf8(%rsp), %rdi
callq 0x40f0
movl %ebx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0xbacb
movq 0x2d4c7(%rip), %rax     # 0x38fd8
movq (%rax), %rdi
leaq 0x2146d(%rip), %rsi     # 0x2cf88
xorl %ebx, %ebx
movq %r15, %rdx
xorl %eax, %eax
callq 0x4350
jmp 0xbaf2
xorl %r8d, %r8d
jmp 0xbb59
movq 0x2d4a3(%rip), %rax     # 0x38fd8
movq (%rax), %rdi
leaq 0x2146a(%rip), %rsi     # 0x2cfa9
xorl %ebx, %ebx
pushq $0x7f
popq %rdx
jmp 0xbbe8
pushq $0x1
jmp 0xbb57
pushq $0x2
jmp 0xbb57
pushq $0x3
jmp 0xbb57
pushq $0x4
popq %r8
movq 0x2d478(%rip), %rax     # 0x38fd8
movq (%rax), %rdi
movl 0x8b0(%r14), %edx
incl %edx
movsbl 0x33(%r14), %ecx
addl $0x4, %ecx
leaq 0x21534(%rip), %rsi     # 0x2d0af
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4350
movq 0x2e1dd(%rip), %rdi     # 0x39d68
callq 0x4290
movq 0x50(%rsp), %rdi
callq 0x4210
jmp 0xbacb
movq 0x2d432(%rip), %rax     # 0x38fd8
movq (%rax), %rdi
movl 0x8b0(%r14), %edx
incl %edx
leaq 0x21495(%rip), %rsi     # 0x2d04e
xorl %ebx, %ebx
jmp 0xbbe8
movq 0x2d414(%rip), %rax     # 0x38fd8
movq (%rax), %rdi
leaq 0x21411(%rip), %rsi     # 0x2cfdf
jmp 0xbbe1
movq 0x2d401(%rip), %rax     # 0x38fd8
movq (%rax), %rdi
leaq 0x21436(%rip), %rsi     # 0x2d017
xorl %ebx, %ebx
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %eax, %eax
callq 0x4350
jmp 0xbacb
movq 0x2d3dd(%rip), %rax     # 0x38fd8
movq (%rax), %rdi
leaq 0x21472(%rip), %rsi     # 0x2d077
jmp 0xbbe1
jmp 0xbc1b
jmp 0xbc67
jmp 0xbc27
jmp 0xbc67
jmp 0xbc67
jmp 0xbc67
jmp 0xbc1b
jmp 0xbc67
jmp 0xbc27
jmp 0xbc67
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
jmp 0xbc2f
jmp 0xbc67
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x40f0
jmp 0xbc8f
jmp 0xbc67
jmp 0xbc67
jmp 0xbc72
jmp 0xbc67
jmp 0xbc67
jmp 0xbc67
jmp 0xbc67
jmp 0xbc67
jmp 0xbc67
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
jmp 0xbc60
jmp 0xbc72
jmp 0xbc72
jmp 0xbc72
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x40f0
jmp 0xbc75
movq %rax, %rbx
jmp 0xbc8f
jmp 0xbc72
jmp 0xbc72
jmp 0xbc72
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x40f0
leaq 0x80(%rsp), %rdi
callq 0xcdce
leaq 0x98(%rsp), %rdi
callq 0x40f0
leaq 0xd8(%rsp), %rdi
callq 0x40f0
leaq 0xf8(%rsp), %rdi
callq 0x40f0
movq %rbx, %rdi
callq 0x4450