// File: /workspace/github_cpp_makefile_star2_O2/corecodec[P]coremake/coremake.c
// Function: load_item
int load_item(item* p,reader* file,int sub,itemcond* cond0)
{
	int result=0;
	item *i,*j=NULL;
    while (!reader_eof(file))
	{
		if (reader_istoken(file,"#include"))
		{
			if (reader_istoken(file,"*/*.proj"))
			{
				char path[MAX_PATH];
				DIR* dir;
				path[0] = 0;
				strins(path,file->filename,getfilename(file->filename));
				delendpath(path);
				dir = opendir(path[0]?path:".");
				if (dir)
				{
					struct dirent* entry;
                    struct stat entrystats;
					addendpath(path);
					while ((entry = readdir(dir)) != NULL)
					{
						sprintf(file->token,"%s%s",path,entry->d_name);
                        stat(file->token,&entrystats);
						if ((entrystats.st_mode & S_IFDIR) && entry->d_name[0]!='.')
						{
    						sprintf(file->token,"%s%s/%s.proj",path,entry->d_name,entry->d_name);
                            if (!load_file(p,file->token,FLAG_PATH_SOURCE,cond0) && strrchr(entry->d_name,'-'))
                            {
                                // if it's a UNIX library name, try without the version
						        char *empty = strrchr(file->token,'-');
                                *empty = 0;
                                strcat(file->token,".proj");
                                load_file(p,file->token,FLAG_PATH_SOURCE,cond0);
                            }
						}
					}
					closedir(dir);
				}
			}
			else
			{
                reader_token(file);
				reader_filename(file,0);
				load_file(p,file->token,FLAG_PATH_SOURCE,cond0);
			}
		}
		else
		if (reader_istoken(file,"if"))
		{
            itemcond* condextra = NULL;
			int mode;
			do
			{
				itemcond* cond = load_cond(p,file,1);
                itemcond* cond1 = itemcond_and(itemcond_and(itemcond_dup(cond),cond0),condextra);
				mode = load_item(p,file,2,cond1);
				itemcond_delete(cond1);
				if (mode==1)
				{
					itemcond* not1 = (itemcond*)itemcond_new(COND_NOT,NULL);
					not1->a = itemcond_dup(cond);
                    not1 = itemcond_and(itemcond_and(not1,cond0),condextra);
					load_item(p,file,3,not1);
	    			itemcond_delete(not1);
				}
                else if (mode==2)
                {
					itemcond* not1 = itemcond_new(COND_NOT,NULL);
					not1->a = itemcond_dup(cond);
                    condextra = itemcond_and(condextra,not1);
	    			itemcond_delete(not1);
                }
				itemcond_delete(cond);
			}
			while (mode==2);
            itemcond_delete(condextra);
		}
		else
		if (reader_istoken(file,"else"))
		{
			if (sub != 2)
				syntax(file);
			result = 1;
			break;
		}
		else
		if (reader_istoken(file,";"))
        {
            //nothing to do
        }
        else
		if (reader_istoken(file,"elif"))
		{
			if (sub != 2)
				syntax(file);
			result = 2;
			break;
		}
		else
		if (reader_istoken(file,"endif"))
		{
			if (sub != 2 && sub != 3)
				syntax(file);
			break;
		}
		else
		if (reader_istoken(file,"}"))
		{
			if (sub != 1)
				syntax(file);
			break;
		}
		else
		{
			int config = 0;
			int need_path;
			int filename;
            int uselib;
            int deepercond;
            int attrib;
            int generated_dir;
            int coremake_dir;
            int system_dir;
			itemcond* cond;
			reader_name(file);

            deepercond = !p->parent && stricmp(file->token,"project")==0;

			need_path = !p->parent && (
				   stricmp(file->token,"con")==0 ||
				   stricmp(file->token,"exe")==0 ||
				   stricmp(file->token,"group")==0 ||
				   stricmp(file->token,"lib")==0 ||
				   stricmp(file->token,"dll")==0 ||
				   stricmp(file->token,"lib_csharp")==0 ||
				   stricmp(file->token,"dll_csharp")==0 ||
				   stricmp(file->token,"exe_csharp")==0 ||
				   stricmp(file->token,"con_csharp")==0 ||
				   stricmp(file->token,"exe_android")==0 ||
				   stricmp(file->token,"dll_android")==0 ||
			       stricmp(file->token,"workspace")==0);

            uselib = stricmp(file->token,"uselib")==0 || stricmp(file->token,"builtlib")==0;

			filename = stricmp(file->token,"config_file")==0 ||
					   stricmp(file->token,"config_include")==0 ||
					   stricmp(file->token,"config_cleaner")==0 ||
					   stricmp(file->token,"platform_files")==0 ||
					   stricmp(file->token,"expinclude")==0 ||
					   stricmp(file->token,"subinclude")==0 ||
					   stricmp(file->token,"sysinclude")==0 ||
					   stricmp(file->token,"include")==0 ||
					   stricmp(file->token,"include_debug")==0 ||
					   stricmp(file->token,"include_release")==0 ||
					   stricmp(file->token,"os_include")==0 ||
					   stricmp(file->token,"libinclude")==0 ||
					   stricmp(file->token,"libinclude_debug")==0 ||
					   stricmp(file->token,"libinclude_release")==0 ||
					   stricmp(file->token,"def")==0 ||
					   stricmp(file->token,"icon")==0 ||
					   stricmp(file->token,"header")==0 ||
					   stricmp(file->token,"header_qt4")==0 ||
					   stricmp(file->token,"ui_form_qt4")==0 ||
					   stricmp(file->token,"resource_qt4")==0 ||
					   stricmp(file->token,"install_zip")==0 ||
					   stricmp(file->token,"install_cab")==0 ||
					   stricmp(file->token,"install")==0 ||
					   stricmp(file->token,"android_value")==0 ||
					   stricmp(file->token,"nsi")==0 ||
					   stricmp(file->token,"pmdoc")==0 ||
					   stricmp(file->token,"osx_icon")==0 ||
					   stricmp(file->token,"source_m68k")==0 ||
					   stricmp(file->token,"export_svn")==0 ||
					   stricmp(file->token,"source")==0 ||
					   stricmp(file->token, "sourcedir") == 0 ||
					   stricmp(file->token,"compile")==0 ||
					   stricmp(file->token,"linkfile")==0 ||
					   stricmp(file->token,"crt0")==0 ||
					   stricmp(file->token,"symbian_cert")==0 ||
					   stricmp(file->token,"symbian_key")==0 ||
					   stricmp(file->token,"doxygen")==0 ||
                       stricmp(file->token,"project_svn_revision")==0 || /* TODO really ? */
                       stricmp(file->token,"project_help")==0;

            generated_dir = stricmp(file->token,"config_file")==0 ||
                            stricmp(file->token,"config_include")==0;

            coremake_dir = stricmp(file->token,"platform_files")==0;

            system_dir = stricmp(file->token,"os_include")==0;

            attrib = filename ||
					   stricmp(file->token,"register_cab")==0 ||
                       stricmp(file->token,"reg")==0 ||
					   stricmp(file->token,"class")==0; // we need this because priority would mess up conditions

			if (stricmp(file->token,"config")==0)
			{
				config = 1;
				j = getconfig(p);
			}
			else
				j = item_get(p,file->token,0);

			cond = load_cond(p,file,0);
			cond = itemcond_and(cond,cond0);

			if (cond && config)
			{
				item* v;
				for (v=p;v;v=v->parent)
					cond = itemcond_and(cond,v->cond);
			}

			if (reader_istoken(file,"}"))
			{
				if (sub != 1)
					syntax(file);
				item_get(j,"1",1);
				break;
			}

			if (reader_istoken(file,",") || reader_istoken(file,";"))
			{
				item_get(j,"1",1);
			}
			else
			if (reader_istoken(file,"{"))
			{
				if (config)
					syntax(file);
				load_item(j,file,1,cond);
			}
			else
			{
				do
				{
                    int exists;
                    int is_abs=0;

					reader_token(file);
                    if (filename)
                    {
                        int file_flags = generated_dir?FLAG_PATH_GENERATED:(coremake_dir?FLAG_PATH_COREMAKE:(system_dir?FLAG_PATH_SYSTEM:FLAG_PATH_SOURCE));
                        if (ispathabs(file->token))
                        {
                            is_abs = 1;
                            file_flags |= FLAG_PATH_SET_ABSOLUTE;
                        }
                        reader_filename(file,file_flags);
                    }

                    exists = item_find(j,file->token)!=NULL;
					i = item_get(j,file->token,0);
                    if (attrib)
                        i->flags |= FLAG_ATTRIB;
                    if (is_abs)
                        i->flags |= FLAG_PATH_SET_ABSOLUTE;

                    if (coremake_dir)
                        set_path_type(i,FLAG_PATH_COREMAKE);
                    else if (generated_dir)
                        set_path_type(i,FLAG_PATH_GENERATED);
                    else if (filename || need_path)
                        set_path_type(i,FLAG_PATH_SOURCE);
                    else
                        set_path_type(i,FLAG_PATH_NOT_PATH);

					if (need_path)
					{
						char path[MAX_PATH];
						item *v = item_get(i,"PATH",0);
                        item *j;

                        if (exists)
                        {
                            item* existing = getvalue(v);
                            printf("project already defined at %s!\n%s:%d\n%s\r\n",existing?existing->value:"?",file->filename,file->r.no,file->line);
	                        exit(1);
                        }

                        path[0]=0;
                        strins(path,file->filename,getfilename(file->filename));
                        strip_path_abs(path,file->r.filename_kind);
                        if (generated_dir)
                            strins(path,proj_root,NULL);
                        else if (coremake_dir)
                            strins(path,coremake_root,NULL);
                        else
                            strins(path,src_root,NULL);

						j = item_get(v,path,1);
                        if (generated_dir)
                            set_path_type(j,FLAG_PATH_GENERATED);
                        else if (coremake_dir)
                            set_path_type(j,FLAG_PATH_COREMAKE);
                        else
                            set_path_type(j,FLAG_PATH_SOURCE);

                        // pre-define some items
						item_get(i,"OUTPUT",0);
						item_get(i,"EXPINCLUDE",0);
						item_get(i,"SUBINCLUDE",0);
						item_get(i,"SYSINCLUDE",0);
						item_get(i,"LIBINCLUDE",0);
						item_get(i,"LIBINCLUDE_DEBUG",0);
						item_get(i,"LIBINCLUDE_RELEASE",0);
						item_get(i,"INCLUDE",0);
						item_get(i,"INCLUDE_DEBUG",0);
						item_get(i,"INCLUDE_RELEASE",0);
						item_get(i,"EXPDEFINE",0);
						item_get(i,"DEFINE",0);
						item_get(i,"LIBS",0);
						item_get(i,"LIBS_DEBUG",0);
						item_get(i,"LIBS_RELEASE",0);
						item_get(i,"SYSLIBS",0);
					}

                    if (!deepercond)
                    {
                        if (exists)
                            i->cond = itemcond_or(i->cond,cond);
                        else
                            i->cond = itemcond_dup(cond);
                    }

                    if (uselib)
                    {
                        int exists;
                        item *incs;
                        item* i;
                        char path[MAX_PATH];
                        path[0]=0;
                        strins(path,file->filename,getfilename(file->filename));
                        incs = item_get(p,"libinclude",0);
                        exists = item_find(incs,path)!=NULL;
                        i = item_get(incs,path,0);
                        i->flags = file->r.filename_kind;
                        if (exists)
                            i->cond = itemcond_or(i->cond,cond);
                        else
                            i->cond = itemcond_dup(cond);
                    }

					if (reader_istoken(file,":"))
					{
                        int pri;
                        reader_token(file);
                        if (sscanf(file->token,"%d",&pri)!=1)
                            syntax(file);

                        item_get(item_get(i,"priority",0),file->token,1);
                    }

					if (reader_istoken(file,"{"))
					{
						if (config)
							syntax(file);
                        load_item(i,file,1,deepercond?cond:NULL);
					}
				}
				while (reader_istoken(file,","));
			}

			itemcond_delete(cond);
		}
	}
	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4f8, %rsp            # imm = 0x4F8
movq %rcx, 0x20(%rsp)
movl %edx, 0x10(%rsp)
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xbedd(%rip), %rbp      # 0x1028a
pushq $0x1
popq %r14
movq %rbx, %rdi
callq 0x369c
testl %eax, %eax
jne 0x5217
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x36b2
movq %rbx, %rdi
testl %eax, %eax
je 0x453e
leaq 0xbeb5(%rip), %rsi      # 0x10293
callq 0x36b2
testl %eax, %eax
je 0x465a
movb $0x0, 0xf0(%rsp)
movq 0x38(%rbx), %r14
movq %r14, %rdi
callq 0x3853
leaq 0xf0(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
pushq $0x1
popq %r14
movq %rax, %rdx
callq 0x334b
movq %r12, %rdi
callq 0x3a15
cmpb $0x0, 0xf0(%rsp)
leaq 0xbd61(%rip), %rax      # 0x10191
cmoveq %rax, %r12
movq %r12, %rdi
callq 0x2100
testq %rax, %rax
je 0x43b1
movq %rax, %r12
leaq 0xf0(%rsp), %rdi
callq 0x39f0
movq %r12, %rdi
callq 0x2250
testq %rax, %rax
je 0x464d
movq %rax, %r13
movq 0x30(%rbx), %rdi
addq $0x13, %r13
leaq 0xbe24(%rip), %rsi      # 0x1029c
leaq 0xf0(%rsp), %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x2310
movq 0x30(%rbx), %rdi
leaq 0x60(%rsp), %rsi
callq 0x2230
testb $0x40, 0x79(%rsp)
je 0x4455
cmpb $0x2e, (%r13)
je 0x4455
movq 0x30(%rbx), %rdi
leaq 0xbdf0(%rip), %rsi      # 0x102a1
leaq 0xf0(%rsp), %rdx
movq %r13, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x2310
movq 0x30(%rbx), %rsi
movq %r15, %rdi
movl %r14d, %edx
movq 0x20(%rsp), %rcx
callq 0x5271
testl %eax, %eax
jne 0x4455
movq %r13, %rdi
pushq $0x2d
popq %rsi
callq 0x2150
testq %rax, %rax
je 0x4455
movq 0x30(%rbx), %rdi
pushq $0x2d
popq %rsi
callq 0x2150
movb $0x0, (%rax)
movq 0x30(%rbx), %r14
movq %r14, %rdi
callq 0x2120
movl $0x6f72702e, (%r14,%rax) # imm = 0x6F72702E
movw $0x6a, 0x4(%r14,%rax)
pushq $0x1
popq %r14
movq 0x30(%rbx), %rsi
movq %r15, %rdi
movl %r14d, %edx
movq 0x20(%rsp), %rcx
callq 0x5271
jmp 0x4455
leaq 0xbd76(%rip), %rsi      # 0x102bb
callq 0x36b2
testl %eax, %eax
je 0x4685
xorl %r12d, %r12d
movq %r15, %rdi
movq %rbx, %rsi
movl %r14d, %edx
callq 0x430e
movq %rax, %r13
testq %rax, %rax
je 0x456f
incl (%r13)
movq %r13, %rdi
movq 0x20(%rsp), %rsi
callq 0x2f38
movq %rax, %rdi
movq %r12, %rsi
callq 0x2f38
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
pushq $0x2
popq %rdx
movq %rax, %rcx
callq 0x4386
movl %eax, %ebp
movq %r14, %rdi
callq 0x2bbf
cmpl $0x2, %ebp
je 0x45f4
cmpl $0x1, %ebp
jne 0x4624
pushq $0x3
popq %rdi
xorl %esi, %esi
callq 0x2c45
testq %r13, %r13
je 0x45c2
incl (%r13)
movq %r13, 0x10(%rax)
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x2f38
movq %rax, %rdi
movq %r12, %rsi
callq 0x2f38
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
pushq $0x3
popq %rdx
movq %rax, %rcx
callq 0x4386
jmp 0x461c
pushq $0x3
popq %rdi
xorl %esi, %esi
callq 0x2c45
movq %rax, %r14
testq %r13, %r13
je 0x460a
incl (%r13)
movq %r13, 0x10(%r14)
movq %r12, %rdi
movq %r14, %rsi
callq 0x2f38
movq %rax, %r12
movq %r14, %rdi
callq 0x2bbf
pushq $0x1
popq %r14
movq %r13, %rdi
callq 0x2bbf
cmpl $0x2, %ebp
je 0x4555
movq %r12, %rdi
callq 0x2bbf
leaq 0xbc42(%rip), %rbp      # 0x1028a
jmp 0x43b1
movq %r12, %rdi
callq 0x2190
jmp 0x43b1
movq %rbx, %rdi
callq 0x37dd
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4058
movq 0x30(%rbx), %rsi
movq %r15, %rdi
movl %r14d, %edx
movq 0x20(%rsp), %rcx
callq 0x5271
jmp 0x43b1
movq %rbx, %rdi
leaq 0xbc1f(%rip), %rsi      # 0x102ae
callq 0x36b2
testl %eax, %eax
jne 0x51d0
movq %rbx, %rdi
leaq 0xcb07(%rip), %rsi      # 0x111ad
callq 0x36b2
testl %eax, %eax
jne 0x43b1
movq %rbx, %rdi
leaq 0xbbf6(%rip), %rsi      # 0x102b3
callq 0x36b2
testl %eax, %eax
jne 0x51cc
movq %rbx, %rdi
leaq 0xbbe4(%rip), %rsi      # 0x102b8
callq 0x36b2
testl %eax, %eax
jne 0x51d9
movq %rbx, %rdi
leaq 0xc86a(%rip), %rsi      # 0x10f55
callq 0x36b2
testl %eax, %eax
jne 0x51ed
movq %rbx, %rdi
callq 0x380b
cmpq $0x0, 0x10(%r15)
movq 0x30(%rbx), %r14
je 0x4b5b
movl $0x0, 0x14(%rsp)
movl $0x0, 0x18(%rsp)
movq %r14, %rdi
leaq 0xbb9f(%rip), %rsi      # 0x102c8
callq 0x2070
movb $0x1, 0xd(%rsp)
movb $0x1, 0xf(%rsp)
testl %eax, %eax
je 0x4752
movq %r14, %rdi
leaq 0xbb89(%rip), %rsi      # 0x102cf
callq 0x2070
testl %eax, %eax
sete 0xf(%rsp)
movq %r14, %rdi
leaq 0xbb7c(%rip), %rsi      # 0x102d8
callq 0x2070
testl %eax, %eax
je 0x4abe
movq %r14, %rdi
leaq 0xbb71(%rip), %rsi      # 0x102e4
callq 0x2070
testl %eax, %eax
je 0x4abe
movq %r14, %rdi
leaq 0xbb69(%rip), %rsi      # 0x102f3
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xbb61(%rip), %rsi      # 0x10302
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xbb59(%rip), %rsi      # 0x10311
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xbb4d(%rip), %rsi      # 0x1031c
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xbb41(%rip), %rsi      # 0x10327
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xba8e(%rip), %rsi      # 0x1028b
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xbb37(%rip), %rsi      # 0x1034b
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xbb31(%rip), %rsi      # 0x1035c
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xbaf0(%rip), %rsi      # 0x10332
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xbae4(%rip), %rsi      # 0x1033d
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xbad8(%rip), %rsi      # 0x10348
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xbad2(%rip), %rsi      # 0x10359
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xca2b(%rip), %rsi      # 0x112c9
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xbb1e(%rip), %rsi      # 0x103d3
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xbaa0(%rip), %rsi      # 0x1036c
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xba90(%rip), %rsi      # 0x10373
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xba84(%rip), %rsi      # 0x1037e
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xba79(%rip), %rsi      # 0x1038a
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xba6f(%rip), %rsi      # 0x10397
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xba64(%rip), %rsi      # 0x103a3
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xba59(%rip), %rsi      # 0x103af
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xba4a(%rip), %rsi      # 0x103b7
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xba41(%rip), %rsi      # 0x103c5
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xba2e(%rip), %rsi      # 0x103c9
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xba1d(%rip), %rsi      # 0x103cf
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xba0f(%rip), %rsi      # 0x103d8
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xba04(%rip), %rsi      # 0x103e4
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xbca8(%rip), %rsi      # 0x1069f
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xb9e1(%rip), %rsi      # 0x103ef
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xb9d4(%rip), %rsi      # 0x103f9
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xb9c5(%rip), %rsi      # 0x10401
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xb9bb(%rip), %rsi      # 0x1040a
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xb9ad(%rip), %rsi      # 0x1040f
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xb9a7(%rip), %rsi      # 0x1041c
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xb9a0(%rip), %rsi      # 0x10428
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xb995(%rip), %rsi      # 0x10430
callq 0x2070
testl %eax, %eax
je 0x4aba
movq %r14, %rdi
leaq 0xb997(%rip), %rsi      # 0x10445
callq 0x2070
testl %eax, %eax
sete 0xd(%rsp)
xorl %ebp, %ebp
jmp 0x4ac1
movb $0x1, %bpl
movq %r14, %rdi
leaq 0xb837(%rip), %rsi      # 0x10302
callq 0x2070
movl %eax, 0x30(%rsp)
movq %r14, %rdi
leaq 0xb854(%rip), %rsi      # 0x10332
callq 0x2070
movl %eax, %r13d
movb $0x1, 0xe(%rsp)
cmpb $0x0, 0xd(%rsp)
jne 0x4b2e
movq %r14, %rdi
leaq 0xb956(%rip), %rsi      # 0x10452
callq 0x2070
testl %eax, %eax
je 0x4b2e
movq %r14, %rdi
leaq 0xb950(%rip), %rsi      # 0x1045f
callq 0x2070
testl %eax, %eax
je 0x4b2e
movq %r14, %rdi
leaq 0xb941(%rip), %rsi      # 0x10463
callq 0x2070
testl %eax, %eax
sete 0xe(%rsp)
movq %r14, %rdi
leaq 0xb599(%rip), %rsi      # 0x100d1
callq 0x2070
movl %eax, 0x1c(%rsp)
movq %r15, %rdi
testl %eax, %eax
je 0x4c93
movq %r14, %rsi
xorl %edx, %edx
callq 0x26a2
jmp 0x4c98
movq %r14, %rdi
leaq 0xba66(%rip), %rsi      # 0x105cb
callq 0x2070
testl %eax, %eax
sete %al
movl %eax, 0x14(%rsp)
movq %r14, %rdi
leaq 0xc5f5(%rip), %rsi      # 0x11172
callq 0x2070
movb $0x1, %cl
movl %ecx, 0x18(%rsp)
testl %eax, %eax
je 0x471f
movq %r14, %rdi
leaq 0xc584(%rip), %rsi      # 0x1111e
callq 0x2070
testl %eax, %eax
je 0x471f
movq %r14, %rdi
leaq 0xb54c(%rip), %rsi      # 0x100fd
callq 0x2070
testl %eax, %eax
je 0x471f
movq %r14, %rdi
leaq 0xc5d7(%rip), %rsi      # 0x1119f
callq 0x2070
testl %eax, %eax
je 0x471f
movq %r14, %rdi
leaq 0xc59e(%rip), %rsi      # 0x1117d
callq 0x2070
testl %eax, %eax
je 0x471f
movq %r14, %rdi
leaq 0xb52e(%rip), %rsi      # 0x10124
callq 0x2070
testl %eax, %eax
je 0x471f
movq %r14, %rdi
leaq 0xb4f6(%rip), %rsi      # 0x10103
callq 0x2070
testl %eax, %eax
je 0x471f
movq %r14, %rdi
leaq 0xb4f5(%rip), %rsi      # 0x10119
callq 0x2070
testl %eax, %eax
je 0x471f
movq %r14, %rdi
leaq 0xb4d3(%rip), %rsi      # 0x1010e
callq 0x2070
testl %eax, %eax
je 0x471f
movq %r14, %rdi
leaq 0xb4dd(%rip), %rsi      # 0x1012f
callq 0x2070
testl %eax, %eax
je 0x471f
movq %r14, %rdi
leaq 0xb4d2(%rip), %rsi      # 0x1013b
callq 0x2070
testl %eax, %eax
je 0x471f
movq %r14, %rdi
leaq 0xb63e(%rip), %rsi      # 0x102be
callq 0x2070
testl %eax, %eax
sete %al
movl %eax, 0x18(%rsp)
jmp 0x471f
callq 0x2702
movq %rax, 0x28(%rsp)
cmpl $0x0, 0x1c(%rsp)
setne %r14b
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x430e
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x2f38
movq %rax, %r12
testq %rax, %rax
sete %al
orb %r14b, %al
jne 0x4ceb
movq %r15, %r14
testq %r14, %r14
je 0x4ceb
movq 0x8(%r14), %rsi
movq %r12, %rdi
callq 0x2f38
movq %rax, %r12
movq 0x10(%r14), %r14
jmp 0x4cd1
movq %rbx, %rdi
leaq 0xc260(%rip), %rsi      # 0x10f55
callq 0x36b2
testl %eax, %eax
pushq $0x1
popq %r14
jne 0x51fc
movq %rbx, %rdi
leaq 0xb75b(%rip), %rsi      # 0x1046b
callq 0x36b2
testl %eax, %eax
jne 0x4d2c
movq %rbx, %rdi
leaq 0xc48a(%rip), %rsi      # 0x111ad
callq 0x36b2
testl %eax, %eax
je 0x4d54
movq 0x28(%rsp), %rdi
leaq 0xb731(%rip), %rsi      # 0x10469
movl %r14d, %edx
callq 0x26a2
leaq 0xb543(%rip), %rbp      # 0x1028a
movq %r12, %rdi
callq 0x2bbf
jmp 0x43b1
movq %rbx, %rdi
leaq 0xb70f(%rip), %rsi      # 0x1046d
callq 0x36b2
testl %eax, %eax
je 0x4d87
cmpl $0x0, 0x1c(%rsp)
je 0x522f
movq 0x28(%rsp), %rdi
movq %rbx, %rsi
movl %r14d, %edx
movq %r12, %rcx
callq 0x4386
jmp 0x4d40
xorl %eax, %eax
testl %r13d, %r13d
sete %al
movb 0xd(%rsp), %cl
orb 0x18(%rsp), %cl
movzbl %cl, %esi
andl $0x1, %esi
testb %bpl, %bpl
pushq $0x2
popq %rdx
cmovnel %edx, %esi
xorl %ecx, %ecx
cmpl $0x0, 0x30(%rsp)
sete %cl
leal 0x1(%rax,%rax,2), %edi
pushq $0x3
popq %rax
cmovel %eax, %edi
cmovel %eax, %esi
movl %esi, 0x44(%rsp)
leaq 0x11838(%rip), %rsi     # 0x16600
leaq 0x12031(%rip), %rax     # 0x16e00
cmoveq %rax, %rsi
testb %bpl, %bpl
cmovnel %edx, %edi
leaq 0x11c20(%rip), %rax     # 0x16a00
cmovneq %rax, %rsi
movq %rsi, 0x48(%rsp)
leal 0x1(%rcx,%rcx), %eax
cmovnel %edx, %eax
movl %eax, 0x3c(%rsp)
movq %rdi, 0x50(%rsp)
leal 0x10(%rdi), %eax
movl %eax, 0x40(%rsp)
cmpb $0x0, 0x14(%rsp)
movl $0x0, %eax
cmovneq %r12, %rax
movq %rax, 0x58(%rsp)
movq %rbx, %rdi
callq 0x37dd
movb $0x1, %bpl
cmpb $0x0, 0xd(%rsp)
je 0x4e45
movq 0x30(%rbx), %rdi
callq 0x3bd2
testl %eax, %eax
sete %bpl
movl 0x40(%rsp), %esi
cmovel 0x50(%rsp), %esi
movq %rbx, %rdi
callq 0x4058
movq 0x30(%rbx), %r14
movq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x262e
movq %rax, 0x30(%rsp)
movq %r13, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x26a2
movq %rax, %r13
cmpb $0x0, 0xe(%rsp)
je 0x4e7a
orb $0x1, 0x31(%r13)
testb %bpl, %bpl
jne 0x4e84
orb $0x10, 0x30(%r13)
movl 0x30(%r13), %eax
andl $-0x10, %eax
addl 0x44(%rsp), %eax
movl %eax, 0x30(%r13)
cmpb $0x0, 0x18(%rsp)
pushq $0x1
popq %r14
je 0x504a
movq %r13, %rdi
leaq 0xb35b(%rip), %rsi      # 0x10207
xorl %edx, %edx
callq 0x26a2
movq %rax, %rbp
cmpq $0x0, 0x30(%rsp)
jne 0x5237
movb $0x0, 0xf0(%rsp)
movq 0x38(%rbx), %r14
movq %r14, %rdi
callq 0x3853
leaq 0xf0(%rsp), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x334b
movl 0x14(%rbx), %esi
leaq 0xf0(%rsp), %r14
movq %r14, %rdi
callq 0x3f6b
movq %r14, %rdi
movq 0x48(%rsp), %rsi
xorl %edx, %edx
callq 0x334b
movq %rbp, %rdi
movq %r14, %rsi
pushq $0x1
popq %r14
movl %r14d, %edx
callq 0x26a2
movl 0x30(%rax), %ecx
andl $-0x10, %ecx
addl 0x3c(%rsp), %ecx
movl %ecx, 0x30(%rax)
movq %r13, %rdi
leaq 0xb567(%rip), %rsi      # 0x1049b
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb55d(%rip), %rsi      # 0x104a2
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb557(%rip), %rsi      # 0x104ad
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb551(%rip), %rsi      # 0x104b8
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb54b(%rip), %rsi      # 0x104c3
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb545(%rip), %rsi      # 0x104ce
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb545(%rip), %rsi      # 0x104df
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb51b(%rip), %rsi      # 0x104c6
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb515(%rip), %rsi      # 0x104d1
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb515(%rip), %rsi      # 0x104e2
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb514(%rip), %rsi      # 0x104f2
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb506(%rip), %rsi      # 0x104f5
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb517(%rip), %rsi      # 0x10517
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb4eb(%rip), %rsi      # 0x104fc
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb4e5(%rip), %rsi      # 0x10507
xorl %edx, %edx
callq 0x26a2
movq %r13, %rdi
leaq 0xb4e1(%rip), %rsi      # 0x10514
xorl %edx, %edx
callq 0x26a2
cmpb $0x0, 0x14(%rsp)
leaq 0xb244(%rip), %rbp      # 0x1028a
jne 0x507f
jmp 0x5072
cmpb $0x0, 0x14(%rsp)
leaq 0xb234(%rip), %rbp      # 0x1028a
jne 0x507f
cmpq $0x0, 0x30(%rsp)
je 0x5072
movq 0x8(%r13), %rdi
movq %r12, %rsi
callq 0x2f77
movq %rax, 0x8(%r13)
jmp 0x507f
testq %r12, %r12
je 0x507b
incl (%r12)
movq %r12, 0x8(%r13)
cmpb $0x0, 0xf(%rsp)
je 0x5121
movb $0x0, 0xf0(%rsp)
movq 0x38(%rbx), %r14
movq %r14, %rdi
callq 0x3853
leaq 0xf0(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x334b
movq %r15, %rdi
leaq 0xb27f(%rip), %rsi      # 0x1033d
xorl %edx, %edx
callq 0x26a2
movq %rax, %r14
movq %rax, %rdi
movq %rbp, %rsi
callq 0x262e
movq %rax, %rbp
movq %r14, %rdi
leaq 0xf0(%rsp), %rsi
xorl %edx, %edx
callq 0x26a2
movq %rax, %r14
movl 0x14(%rbx), %eax
movl %eax, 0x30(%r14)
testq %rbp, %rbp
je 0x5109
movq 0x8(%r14), %rdi
movq %r12, %rsi
callq 0x2f77
movq %rax, 0x8(%r14)
jmp 0x5116
testq %r12, %r12
je 0x5112
incl (%r12)
movq %r12, 0x8(%r14)
leaq 0xb16d(%rip), %rbp      # 0x1028a
pushq $0x1
popq %r14
movq %rbx, %rdi
leaq 0xb3f1(%rip), %rsi      # 0x1051c
callq 0x36b2
testl %eax, %eax
je 0x517f
movq %rbx, %rdi
callq 0x37dd
movq 0x30(%rbx), %rdi
leaq 0xb61e(%rip), %rsi      # 0x10765
leaq 0xf0(%rsp), %rdx
xorl %eax, %eax
callq 0x2270
cmpl $0x1, %eax
jne 0x522f
movq %r13, %rdi
leaq 0xb3b5(%rip), %rsi      # 0x1051e
xorl %edx, %edx
callq 0x26a2
movq 0x30(%rbx), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x26a2
movq %rbx, %rdi
leaq 0xb2e4(%rip), %rsi      # 0x1046d
callq 0x36b2
testl %eax, %eax
je 0x51b0
cmpl $0x0, 0x1c(%rsp)
je 0x522f
movq %r13, %rdi
movq %rbx, %rsi
movl %r14d, %edx
movq 0x58(%rsp), %rcx
callq 0x4386
movq %rbx, %rdi
leaq 0xb2b1(%rip), %rsi      # 0x1046b
callq 0x36b2
testl %eax, %eax
jne 0x4e13
jmp 0x4d47
pushq $0x2
popq %r14
cmpl $0x2, 0x10(%rsp)
je 0x521a
jmp 0x522f
movl 0x10(%rsp), %eax
addl $-0x4, %eax
movl $0x0, %r14d
cmpl $-0x3, %eax
ja 0x521a
jmp 0x522f
movl $0x0, %r14d
cmpl $0x1, 0x10(%rsp)
je 0x521a
jmp 0x522f
cmpl $0x1, 0x10(%rsp)
jne 0x522f
leaq 0xb25f(%rip), %rsi      # 0x10469
pushq $0x1
popq %rdx
movq 0x28(%rsp), %rdi
callq 0x26a2
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x4f8, %rsp            # imm = 0x4F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x24c2
movq %rbp, %rdi
callq 0x270e
testq %rax, %rax
jne 0x524d
leaq 0xb24e(%rip), %rsi      # 0x10499
jmp 0x5250
movq (%rax), %rsi
movq 0x38(%rbx), %rdx
movl 0xc(%rbx), %ecx
movq 0x28(%rbx), %r8
leaq 0xb20d(%rip), %rdi      # 0x1046f
xorl %eax, %eax
callq 0x2140
pushq $0x1
popq %rdi
callq 0x2320