// File: /workspace/github_cpp_makefile_star2_O3/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, 0x28(%rsp)
movl %edx, 0x10(%rsp)
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xc7ed(%rip), %rbp      # 0x1128a
leaq 0x60(%rsp), %r14
testb $0x2, 0x11(%rbx)
jne 0x4ab8
movq %rbx, %rdi
callq 0x3747
testl %eax, %eax
je 0x5a56
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x39b0
movq %rbx, %rdi
testl %eax, %eax
je 0x4c65
leaq 0xc7be(%rip), %rsi      # 0x11293
callq 0x39b0
testl %eax, %eax
je 0x5a6a
movb $0x0, 0x60(%rsp)
movq 0x38(%rbx), %r12
movq %r12, %rdi
movl $0x2f, %esi
callq 0x2150
leaq 0x1(%rax), %rdx
testq %rax, %rax
cmoveq %r12, %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3598
cmpb $0x0, 0x60(%rsp)
leaq 0xc677(%rip), %rdi      # 0x11191
je 0x4b46
movq %r14, %rdi
callq 0x2120
cmpb $0x2f, 0x5f(%rsp,%rax)
movq %r14, %rdi
jne 0x4b46
movb $0x0, 0x5f(%rsp,%rax)
cmpb $0x0, 0x60(%rsp)
movq %r14, %rdi
leaq 0xc64f(%rip), %rax      # 0x11191
cmoveq %rax, %rdi
callq 0x2100
testq %rax, %rax
je 0x4aa2
movq %rax, %r12
movq %r14, %rdi
callq 0x3dcf
movq %r12, %rdi
callq 0x2250
testq %rax, %rax
je 0x4c58
movq %rax, %r13
movq 0x30(%rbx), %rdi
addq $0x13, %r13
leaq 0xc71a(%rip), %rsi      # 0x1129c
movq %r14, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x2310
movq 0x30(%rbx), %rdi
leaq 0x468(%rsp), %rsi
callq 0x2230
testb $0x40, 0x481(%rsp)
je 0x4c44
cmpb $0x2e, (%r13)
je 0x4c44
movq 0x30(%rbx), %rdi
leaq 0xc6dd(%rip), %rsi      # 0x112a1
movq %r14, %rdx
movq %r13, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x2310
movq 0x30(%rbx), %rsi
movq %r15, %rdi
movl $0x1, %edx
movq 0x28(%rsp), %rcx
callq 0x5afd
testl %eax, %eax
jne 0x4c44
movq %r13, %rdi
movl $0x2d, %esi
callq 0x2150
testq %rax, %rax
je 0x4c44
movq 0x30(%rbx), %rdi
movl $0x2d, %esi
callq 0x2150
movb $0x0, (%rax)
movq 0x30(%rbx), %r13
movq %r13, %rdi
callq 0x2120
movl $0x6f72702e, (%r13,%rax) # imm = 0x6F72702E
movw $0x6a, 0x4(%r13,%rax)
movq 0x30(%rbx), %rsi
movq %r15, %rdi
movl $0x1, %edx
movq 0x28(%rsp), %rcx
callq 0x5afd
movq %r12, %rdi
callq 0x2250
movq %rax, %r13
testq %rax, %rax
jne 0x4b73
movq %r12, %rdi
callq 0x2190
jmp 0x4aa2
leaq 0xc64f(%rip), %rsi      # 0x112bb
callq 0x39b0
testl %eax, %eax
je 0x4db5
xorl %r12d, %r12d
movq %r15, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x49bf
movq %rax, %r13
testq %rax, %rax
je 0x4c98
incl (%r13)
movq %r13, %rdi
movq 0x28(%rsp), %rsi
callq 0x3154
movq %rax, %rdi
movq %r12, %rsi
callq 0x3154
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
movl $0x2, %edx
movq %rax, %rcx
callq 0x4a76
movl %eax, %ebp
movq %r14, %rdi
callq 0x2d31
cmpl $0x2, %ebp
jne 0x4d28
movl $0x20, %edi
callq 0x24fa
movq %rax, %rbp
movabsq $0x300000001, %rax      # imm = 0x300000001
movq %rax, (%rbp)
movq $0x0, 0x8(%rbp)
testq %r13, %r13
je 0x4d01
incl (%r13)
movq %r13, 0x10(%rbp)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x3154
movq %rax, %r12
movq %rbp, %rdi
callq 0x2d31
movq %r13, %rdi
callq 0x2d31
jmp 0x4c7c
cmpl $0x1, %ebp
leaq 0xc558(%rip), %rbp      # 0x1128a
leaq 0x60(%rsp), %r14
jne 0x4da0
movl $0x20, %edi
callq 0x24fa
movabsq $0x300000001, %rcx      # imm = 0x300000001
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
testq %r13, %r13
je 0x4d61
incl (%r13)
movq %r13, 0x10(%rax)
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x3154
movq %rax, %rdi
movq %r12, %rsi
callq 0x3154
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
movl $0x3, %edx
movq %rax, %rcx
callq 0x4a76
movq %r14, %rdi
callq 0x2d31
leaq 0x60(%rsp), %r14
movq %r13, %rdi
callq 0x2d31
movq %r12, %rdi
callq 0x2d31
jmp 0x4aa2
movq %rbx, %rdi
leaq 0xc4ef(%rip), %rsi      # 0x112ae
callq 0x39b0
testl %eax, %eax
jne 0x59fd
movq %rbx, %rdi
leaq 0xd3d7(%rip), %rsi      # 0x121ad
callq 0x39b0
testl %eax, %eax
jne 0x4aa2
movq %rbx, %rdi
leaq 0xc4c6(%rip), %rsi      # 0x112b3
callq 0x39b0
testl %eax, %eax
jne 0x5a0e
movq %rbx, %rdi
leaq 0xc4b4(%rip), %rsi      # 0x112b8
callq 0x39b0
testl %eax, %eax
jne 0x5a1c
movq %rbx, %rdi
leaq 0xd13a(%rip), %rsi      # 0x11f55
callq 0x39b0
testl %eax, %eax
jne 0x5a2a
movq %rbx, %rdi
callq 0x3b40
cmpq $0x0, 0x10(%r15)
movq 0x30(%rbx), %r14
je 0x528d
movl $0x0, 0x14(%rsp)
movl $0x0, 0x18(%rsp)
movq %r14, %rdi
leaq 0xc46f(%rip), %rsi      # 0x112c8
callq 0x2070
movb $0x1, 0xd(%rsp)
movb $0x1, 0xf(%rsp)
testl %eax, %eax
je 0x4e82
movq %r14, %rdi
leaq 0xc459(%rip), %rsi      # 0x112cf
callq 0x2070
testl %eax, %eax
sete 0xf(%rsp)
movq %r14, %rdi
leaq 0xc44c(%rip), %rsi      # 0x112d8
callq 0x2070
testl %eax, %eax
je 0x51f4
movq %r14, %rdi
leaq 0xc441(%rip), %rsi      # 0x112e4
callq 0x2070
testl %eax, %eax
je 0x51f4
movq %r14, %rdi
leaq 0xc439(%rip), %rsi      # 0x112f3
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc431(%rip), %rsi      # 0x11302
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc429(%rip), %rsi      # 0x11311
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc41d(%rip), %rsi      # 0x1131c
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc411(%rip), %rsi      # 0x11327
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc35e(%rip), %rsi      # 0x1128b
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc407(%rip), %rsi      # 0x1134b
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc401(%rip), %rsi      # 0x1135c
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc3c0(%rip), %rsi      # 0x11332
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc3b4(%rip), %rsi      # 0x1133d
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc3a8(%rip), %rsi      # 0x11348
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc3a2(%rip), %rsi      # 0x11359
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xd2f9(%rip), %rsi      # 0x122c7
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc3ee(%rip), %rsi      # 0x113d3
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc370(%rip), %rsi      # 0x1136c
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc360(%rip), %rsi      # 0x11373
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc354(%rip), %rsi      # 0x1137e
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc349(%rip), %rsi      # 0x1138a
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc33f(%rip), %rsi      # 0x11397
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc334(%rip), %rsi      # 0x113a3
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc329(%rip), %rsi      # 0x113af
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc31a(%rip), %rsi      # 0x113b7
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc311(%rip), %rsi      # 0x113c5
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc2fe(%rip), %rsi      # 0x113c9
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc2ed(%rip), %rsi      # 0x113cf
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc2df(%rip), %rsi      # 0x113d8
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc2d4(%rip), %rsi      # 0x113e4
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc578(%rip), %rsi      # 0x1169f
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc2b1(%rip), %rsi      # 0x113ef
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc2a4(%rip), %rsi      # 0x113f9
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc295(%rip), %rsi      # 0x11401
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc28b(%rip), %rsi      # 0x1140a
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc27d(%rip), %rsi      # 0x1140f
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc277(%rip), %rsi      # 0x1141c
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc270(%rip), %rsi      # 0x11428
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc265(%rip), %rsi      # 0x11430
callq 0x2070
testl %eax, %eax
je 0x51ea
movq %r14, %rdi
leaq 0xc267(%rip), %rsi      # 0x11445
callq 0x2070
testl %eax, %eax
sete 0xd(%rsp)
movl $0x0, 0x8(%rsp)
jmp 0x51fa
movb $0x1, %al
movl %eax, 0x8(%rsp)
movq %r14, %rdi
leaq 0xc0fe(%rip), %rsi      # 0x11302
callq 0x2070
movl %eax, 0x34(%rsp)
movq %r14, %rdi
leaq 0xc11b(%rip), %rsi      # 0x11332
callq 0x2070
movl %eax, %r12d
movb $0x1, 0xe(%rsp)
cmpb $0x0, 0xd(%rsp)
jne 0x5267
movq %r14, %rdi
leaq 0xc21d(%rip), %rsi      # 0x11452
callq 0x2070
testl %eax, %eax
je 0x5267
movq %r14, %rdi
leaq 0xc217(%rip), %rsi      # 0x1145f
callq 0x2070
testl %eax, %eax
je 0x5267
movq %r14, %rdi
leaq 0xc208(%rip), %rsi      # 0x11463
callq 0x2070
testl %eax, %eax
sete 0xe(%rsp)
movq %r14, %rdi
leaq 0xbe60(%rip), %rsi      # 0x110d1
callq 0x2070
movl %eax, 0x1c(%rsp)
testl %eax, %eax
je 0x53c5
movq %r15, %rdi
movq %r14, %rsi
jmp 0x53db
movq %r14, %rdi
leaq 0xc334(%rip), %rsi      # 0x115cb
callq 0x2070
testl %eax, %eax
sete %al
movl %eax, 0x14(%rsp)
movq %r14, %rdi
leaq 0xcec3(%rip), %rsi      # 0x12172
callq 0x2070
movb $0x1, %cl
movl %ecx, 0x18(%rsp)
testl %eax, %eax
je 0x4e4f
movq %r14, %rdi
leaq 0xce52(%rip), %rsi      # 0x1211e
callq 0x2070
testl %eax, %eax
je 0x4e4f
movq %r14, %rdi
leaq 0xbe1a(%rip), %rsi      # 0x110fd
callq 0x2070
testl %eax, %eax
je 0x4e4f
movq %r14, %rdi
leaq 0xcea5(%rip), %rsi      # 0x1219f
callq 0x2070
testl %eax, %eax
je 0x4e4f
movq %r14, %rdi
leaq 0xce6c(%rip), %rsi      # 0x1217d
callq 0x2070
testl %eax, %eax
je 0x4e4f
movq %r14, %rdi
leaq 0xbdfc(%rip), %rsi      # 0x11124
callq 0x2070
testl %eax, %eax
je 0x4e4f
movq %r14, %rdi
leaq 0xbdc4(%rip), %rsi      # 0x11103
callq 0x2070
testl %eax, %eax
je 0x4e4f
movq %r14, %rdi
leaq 0xbdc3(%rip), %rsi      # 0x11119
callq 0x2070
testl %eax, %eax
je 0x4e4f
movq %r14, %rdi
leaq 0xbda1(%rip), %rsi      # 0x1110e
callq 0x2070
testl %eax, %eax
je 0x4e4f
movq %r14, %rdi
leaq 0xbdab(%rip), %rsi      # 0x1112f
callq 0x2070
testl %eax, %eax
je 0x4e4f
movq %r14, %rdi
leaq 0xbda0(%rip), %rsi      # 0x1113b
callq 0x2070
testl %eax, %eax
je 0x4e4f
movq %r14, %rdi
leaq 0xbf0c(%rip), %rsi      # 0x112be
callq 0x2070
testl %eax, %eax
sete %al
movl %eax, 0x18(%rsp)
jmp 0x4e4f
movq %r15, %rax
movq %rax, %rdi
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x53c8
leaq 0xbcf6(%rip), %rsi      # 0x110d1
xorl %edx, %edx
callq 0x270b
movq %rax, 0x20(%rsp)
cmpl $0x0, 0x1c(%rsp)
setne %bpl
testq %r15, %r15
sete %r14b
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x49bf
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x3154
movq %rax, %r13
testq %rax, %rax
sete %al
orb %bpl, %r14b
orb %al, %r14b
je 0x542b
leaq 0xbe61(%rip), %rbp      # 0x1128a
jmp 0x544d
movq %r15, %r14
leaq 0xbe55(%rip), %rbp      # 0x1128a
movq 0x8(%r14), %rsi
movq %r13, %rdi
callq 0x3154
movq %rax, %r13
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0x5435
movq %rbx, %rdi
leaq 0xcafe(%rip), %rsi      # 0x11f55
callq 0x39b0
testl %eax, %eax
jne 0x5a39
movq %rbx, %rdi
leaq 0xbffd(%rip), %rsi      # 0x1146b
callq 0x39b0
testl %eax, %eax
jne 0x548a
movq %rbx, %rdi
leaq 0xcd2c(%rip), %rsi      # 0x121ad
callq 0x39b0
testl %eax, %eax
je 0x54b2
movq 0x20(%rsp), %rdi
leaq 0xbfd3(%rip), %rsi      # 0x11469
movl $0x1, %edx
callq 0x270b
leaq 0x60(%rsp), %r14
movq %r13, %rdi
callq 0x2d31
jmp 0x4aa2
movq %rbx, %rdi
leaq 0xbfb1(%rip), %rsi      # 0x1146d
callq 0x39b0
testl %eax, %eax
leaq 0x60(%rsp), %r14
je 0x54ec
cmpl $0x0, 0x1c(%rsp)
je 0x5a31
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
movl $0x1, %edx
movq %r13, %rcx
callq 0x4a76
jmp 0x54a5
xorl %eax, %eax
testl %r12d, %r12d
sete %al
movl 0x34(%rsp), %edx
testl %edx, %edx
leal 0x1(%rax,%rax,2), %esi
movl $0x3, %ecx
cmovel %ecx, %esi
movb 0xd(%rsp), %al
orb 0x18(%rsp), %al
movzbl %al, %edi
andl $0x1, %edi
cmpb $0x0, 0x8(%rsp)
movl $0x2, %eax
cmovnel %eax, %esi
cmovnel %eax, %edi
testl %edx, %edx
cmovel %ecx, %edi
movl %edi, 0x44(%rsp)
movq %rsi, 0x50(%rsp)
leal 0x10(%rsi), %eax
movl %eax, 0x40(%rsp)
cmpb $0x0, 0x14(%rsp)
movl $0x0, %eax
cmovneq %r13, %rax
movq %rax, 0x58(%rsp)
movq %rbx, %rdi
callq 0x3af7
movb $0x1, %bpl
cmpb $0x0, 0xd(%rsp)
je 0x557e
movq 0x30(%rbx), %rdi
callq 0x3ff4
testl %eax, %eax
sete %bpl
movl 0x40(%rsp), %esi
cmovel 0x50(%rsp), %esi
movq %rbx, %rdi
callq 0x4620
movq 0x30(%rbx), %r14
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x2694
movq %rax, 0x38(%rsp)
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x270b
movq %rax, %r12
cmpb $0x0, 0xe(%rsp)
je 0x55b4
orb $0x1, 0x31(%r12)
testb %bpl, %bpl
leaq 0x60(%rsp), %r14
jne 0x55c4
orb $0x10, 0x30(%r12)
movl 0x30(%r12), %eax
andl $-0x10, %eax
addl 0x44(%rsp), %eax
movl %eax, 0x30(%r12)
cmpb $0x0, 0x18(%rsp)
leaq 0xbca9(%rip), %rbp      # 0x1128a
movq %r12, 0x48(%rsp)
je 0x56a1
movq %r12, %rdi
leaq 0xbc11(%rip), %rsi      # 0x11207
xorl %edx, %edx
callq 0x270b
cmpq $0x0, 0x38(%rsp)
jne 0x5aac
movq %rax, 0x38(%rsp)
movb $0x0, 0x60(%rsp)
movq 0x38(%rbx), %r14
movq %r14, %rdi
movl $0x2f, %esi
callq 0x2150
leaq 0x1(%rax), %rdx
testq %rax, %rax
cmoveq %r14, %rdx
leaq 0x60(%rsp), %rdi
movq %r14, %rsi
movq %rdi, %r14
callq 0x3598
movl 0x14(%rbx), %esi
movq %r14, %rdi
callq 0x4533
cmpb $0x0, 0x8(%rsp)
je 0x56cf
leaq 0x113a8(%rip), %rdi     # 0x16a00
callq 0x2120
movq %r14, %rbp
movq %rax, %r12
leaq (%rsp,%rax), %r14
addq $0x60, %r14
movq %rbp, %rdi
callq 0x2120
leaq 0x1(%rax), %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x22c0
movq %rbp, %r14
movq %rbp, %rdi
leaq 0x11371(%rip), %rsi     # 0x16a00
movq %r12, %rdx
callq 0x2240
movl $0x2, %ebp
jmp 0x5758
cmpb $0x0, 0x14(%rsp)
jne 0x58a6
cmpq $0x0, 0x38(%rsp)
je 0x5898
movq 0x8(%r12), %rdi
movq %r13, %rsi
callq 0x31a8
movq %rax, 0x8(%r12)
jmp 0x58a6
movq %r14, %rdi
callq 0x2120
movq %rax, %rbp
incq %rbp
cmpl $0x0, 0x34(%rsp)
je 0x571f
leaq 0x10f15(%rip), %rdi     # 0x16600
callq 0x2120
movq %rax, %r12
leaq (%rsp,%rax), %rdi
addq $0x60, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x22c0
movq %r14, %rdi
leaq 0x10ef0(%rip), %rsi     # 0x16600
movq %r12, %rdx
callq 0x2240
movl $0x1, %ebp
jmp 0x5758
leaq 0x116da(%rip), %rdi     # 0x16e00
callq 0x2120
movq %rax, %r12
leaq (%rsp,%rax), %rdi
addq $0x60, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x22c0
movq %r14, %rdi
leaq 0x116b5(%rip), %rsi     # 0x16e00
movq %r12, %rdx
callq 0x2240
movl $0x3, %ebp
movq 0x38(%rsp), %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x270b
movl 0x30(%rax), %ecx
andl $-0x10, %ecx
orl %ebp, %ecx
movl %ecx, 0x30(%rax)
movq 0x48(%rsp), %r12
movq %r12, %rdi
leaq 0xbd17(%rip), %rsi      # 0x1149b
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbd0d(%rip), %rsi      # 0x114a2
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbd07(%rip), %rsi      # 0x114ad
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbd01(%rip), %rsi      # 0x114b8
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbcfb(%rip), %rsi      # 0x114c3
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbcf5(%rip), %rsi      # 0x114ce
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbcf5(%rip), %rsi      # 0x114df
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbccb(%rip), %rsi      # 0x114c6
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbcc5(%rip), %rsi      # 0x114d1
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbcc5(%rip), %rsi      # 0x114e2
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbcc4(%rip), %rsi      # 0x114f2
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbcb6(%rip), %rsi      # 0x114f5
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbcc7(%rip), %rsi      # 0x11517
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbc9b(%rip), %rsi      # 0x114fc
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbc95(%rip), %rsi      # 0x11507
xorl %edx, %edx
callq 0x270b
movq %r12, %rdi
leaq 0xbc91(%rip), %rsi      # 0x11514
xorl %edx, %edx
callq 0x270b
cmpb $0x0, 0x14(%rsp)
leaq 0xb9f4(%rip), %rbp      # 0x1128a
jne 0x58a6
testq %r13, %r13
je 0x58a1
incl (%r13)
movq %r13, 0x8(%r12)
cmpb $0x0, 0xf(%rsp)
je 0x5953
movb $0x0, 0x60(%rsp)
movq 0x38(%rbx), %r14
movq %r14, %rdi
movl $0x2f, %esi
callq 0x2150
leaq 0x1(%rax), %rdx
testq %rax, %rax
cmoveq %r14, %rdx
leaq 0x60(%rsp), %rdi
movq %r14, %rsi
callq 0x3598
movq %r15, %rdi
leaq 0xba54(%rip), %rsi      # 0x1133d
xorl %edx, %edx
callq 0x270b
movq %rax, %r14
movq %rax, %rdi
leaq 0x60(%rsp), %rsi
callq 0x2694
movq %rax, %rbp
movq %r14, %rdi
leaq 0x60(%rsp), %r14
movq %r14, %rsi
xorl %edx, %edx
callq 0x270b
movq %rax, %r12
movl 0x14(%rbx), %eax
movl %eax, 0x30(%r12)
testq %rbp, %rbp
je 0x5939
movq 0x8(%r12), %rdi
movq %r13, %rsi
callq 0x31a8
movq %rax, 0x8(%r12)
jmp 0x5947
testq %r13, %r13
je 0x5942
incl (%r13)
movq %r13, 0x8(%r12)
leaq 0xb93c(%rip), %rbp      # 0x1128a
movq 0x48(%rsp), %r12
movq %rbx, %rdi
leaq 0xbbbf(%rip), %rsi      # 0x1151c
callq 0x39b0
testl %eax, %eax
je 0x59ae
movq %rbx, %rdi
callq 0x3af7
movq 0x30(%rbx), %rdi
leaq 0xbdec(%rip), %rsi      # 0x11765
movq %r14, %rdx
xorl %eax, %eax
callq 0x2270
cmpl $0x1, %eax
jne 0x5a91
movq %r12, %rdi
leaq 0xbb88(%rip), %rsi      # 0x1151e
xorl %edx, %edx
callq 0x270b
movq 0x30(%rbx), %rsi
movq %rax, %rdi
movl $0x1, %edx
callq 0x270b
movq %rbx, %rdi
leaq 0xbab5(%rip), %rsi      # 0x1146d
callq 0x39b0
testl %eax, %eax
je 0x59e1
cmpl $0x0, 0x1c(%rsp)
je 0x5a91
movq %r12, %rdi
movq %rbx, %rsi
movl $0x1, %edx
movq 0x58(%rsp), %rcx
callq 0x4a76
movq %rbx, %rdi
leaq 0xba80(%rip), %rsi      # 0x1146b
callq 0x39b0
testl %eax, %eax
jne 0x554c
jmp 0x54a5
movl $0x1, %eax
cmpl $0x2, 0x10(%rsp)
je 0x5a58
jmp 0x5a91
movl $0x2, %eax
cmpl $0x2, 0x10(%rsp)
je 0x5a58
jmp 0x5a31
movl 0x10(%rsp), %eax
addl $-0x4, %eax
cmpl $-0x3, %eax
ja 0x5a56
jmp 0x5a31
cmpl $0x1, 0x10(%rsp)
je 0x5a56
movq %rbx, %rdi
callq 0x24d6
cmpl $0x1, 0x10(%rsp)
jne 0x5a91
leaq 0xba22(%rip), %rsi      # 0x11469
movq 0x20(%rsp), %rdi
movl $0x1, %edx
callq 0x270b
xorl %eax, %eax
addq $0x4f8, %rsp            # imm = 0x4F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x3af7
leaq 0xb7b4(%rip), %rdi      # 0x1122d
leaq 0xb626(%rip), %rsi      # 0x110a6
leaq 0xb7d9(%rip), %rcx      # 0x11260
movl $0x4fc, %edx            # imm = 0x4FC
callq 0x2160
movq 0x38(%rbx), %rsi
movl 0xc(%rbx), %edx
movq 0x28(%rbx), %rcx
leaq 0xb5cd(%rip), %rdi      # 0x11070
xorl %eax, %eax
callq 0x2140
jmp 0x5af3
leaq 0xb9e6(%rip), %rsi      # 0x11499
testq %rax, %rax
je 0x5ada
movq %rax, %rcx
movq 0x18(%rax), %rax
movq 0x20(%rcx), %rcx
cmpq %rcx, %rax
je 0x5ada
movq (%rax), %rdx
testb $0x40, 0x30(%rdx)
je 0x5ad7
addq $0x8, %rax
jmp 0x5ac3
movq (%rdx), %rsi
movq 0x38(%rbx), %rdx
movl 0xc(%rbx), %ecx
movq 0x28(%rbx), %r8
leaq 0xb983(%rip), %rdi      # 0x1146f
xorl %eax, %eax
callq 0x2140
movl $0x1, %edi
callq 0x2320