// File: /workspace/github_cpp_makefile_star2_O3/corecodec[P]coremake/coremake.c
// Function: preprocess_stdafx_includes
void preprocess_stdafx_includes(item* p,int lib)
{
	item** child;
	if (!p) return;
	for (child=p->child;child!=p->childend;++child)
	{
		size_t i;
		int prj = 0, host = 0;
        char gen_path[MAX_PATH];
		item* plugin = getvalue(item_find(*child,"plugin"));
		item* no_stdafx = getvalue(item_find(*child,"no_stdafx"));
		item* no_project = getvalue(item_find(*child,"no_project"));
		item* cls = item_get(*child,"class",0);
		item* reg = item_get(*child,"reg",0);
		item* path = getvalue(item_get(*child,"path",0));
        item *include = item_get(*child,"include",0);

        if (!path)
            continue;

        strcpy(gen_path,path->value);
        strip_path_abs(gen_path,path->flags);
        getabspath(gen_path,FLAG_PATH_GENERATED,"",FLAG_PATH_GENERATED);

        if (!plugin)
		    for (i=0;i<item_childcount(*child);++i)
			    if (item_childcount((*child)->child[i]) && is_project_data((*child)->child[i]))
			    {
				    prj = 1;
                    break;
                }

		for (i=0;i<item_childcount(*child);++i)
			if (item_childcount((*child)->child[i]) && is_host_data((*child)->child[i]))
			{
				host = 1;
				break;
			}

		if (prj && !no_project)
		{
            /* add _project.h */
            item *src;
			char file[MAX_PATH];
            item *add_inc;

            sprintf(file,"%s%s_project.h",gen_path,(*child)->value);
			src = item_get(item_get(*child,"header",0),file,1);
            set_path_type(src,FLAG_PATH_GENERATED);

            add_inc = item_get(include,gen_path,0);
            set_path_type(add_inc,FLAG_PATH_GENERATED);
            add_inc->flags |= FLAG_ATTRIB;
		}

		if (host && !lib)
		{
            /* add _host.h */
            item *src;
			char file[MAX_PATH];
            item *add_inc;

            sprintf(file,"%s%s_host.h",gen_path,(*child)->value);
			src = item_get(item_get(*child,"header",0),file,1);
            set_path_type(src,FLAG_PATH_GENERATED);

            add_inc = item_get(include,gen_path,0);
            set_path_type(add_inc,FLAG_PATH_GENERATED);
            add_inc->flags |= FLAG_ATTRIB;
        }

		if ((item_childcount(reg) || item_childcount(cls) || prj) && !lib && !no_stdafx)
		{
			/* add _stdafx.c */
            item *src;
			char file[MAX_PATH];
            item *add_inc;

            src = item_get(item_get(*child,"expinclude",0),gen_path,1);
            set_path_type(src,FLAG_PATH_GENERATED);
			sprintf(file,"%s%s_stdafx.c",gen_path,(*child)->value);
			src = item_get(item_get(*child,"source",0),file,1);
            set_path_type(src,FLAG_PATH_GENERATED);
            src = item_get(src,"NO_PCH",1);
            item_get(src,".",1);

            add_inc = item_get(include,gen_path,0);
            set_path_type(add_inc,FLAG_PATH_GENERATED);
            add_inc->flags |= FLAG_ATTRIB;

			/* add _stdafx.h */
			sprintf(file,"%s%s_stdafx.h",gen_path,(*child)->value);
			src = item_get(item_get(*child,"header",0),file,1);
            set_path_type(src,FLAG_PATH_GENERATED);
        }
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2438, %rsp           # imm = 0x2438
movl %esi, 0xc(%rsp)
testq %rdi, %rdi
je 0x69c4
movq %rdi, %r13
movq 0x18(%rdi), %rbx
cmpq 0x20(%rdi), %rbx
je 0x69c4
leaq 0x430(%rsp), %rbp
movq %r13, 0x18(%rsp)
movq (%rbx), %r15
movq %r15, %rdi
leaq 0xb0b6(%rip), %rsi      # 0x115b7
callq 0x2694
movb $0x1, %r12b
testq %rax, %rax
je 0x6536
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
cmpq %rax, %rcx
je 0x6536
movq (%rcx), %rdx
testb $0x40, 0x30(%rdx)
je 0x652f
addq $0x8, %rcx
cmpq %rax, %rcx
jne 0x651b
xorl %edx, %edx
testq %rdx, %rdx
sete %r12b
movq %r15, %rdi
leaq 0xb07e(%rip), %rsi      # 0x115be
callq 0x2694
testq %rax, %rax
je 0x6577
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
cmpq %rax, %rcx
je 0x6577
movq (%rcx), %rdx
testb $0x40, 0x30(%rdx)
je 0x656b
addq $0x8, %rcx
cmpq %rax, %rcx
jne 0x6557
xorl %edx, %edx
testq %rdx, %rdx
setne %al
movl %eax, 0x8(%rsp)
jmp 0x657f
movl $0x0, 0x8(%rsp)
movq %r15, %rdi
leaq 0xb03f(%rip), %rsi      # 0x115c8
callq 0x2694
testq %rax, %rax
je 0x65bd
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
cmpq %rax, %rcx
je 0x65bd
movq (%rcx), %rdx
testb $0x40, 0x30(%rdx)
je 0x65b4
addq $0x8, %rcx
cmpq %rax, %rcx
jne 0x65a0
xorl %edx, %edx
testq %rdx, %rdx
setne %r14b
jmp 0x65c0
xorl %r14d, %r14d
movq %r15, %rdi
leaq 0xae99(%rip), %rsi      # 0x11463
xorl %edx, %edx
callq 0x270b
movq %rax, 0x20(%rsp)
movq (%rbx), %rdi
leaq 0xae7f(%rip), %rsi      # 0x1145f
xorl %edx, %edx
callq 0x270b
movq %rax, 0x28(%rsp)
movq (%rbx), %rdi
leaq 0xba7a(%rip), %rsi      # 0x12070
xorl %edx, %edx
callq 0x270b
testq %rax, %rax
je 0x661f
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
cmpq %rax, %rcx
je 0x661f
movq (%rcx), %r15
testb $0x40, 0x30(%r15)
je 0x6643
addq $0x8, %rcx
jmp 0x660a
movq (%rbx), %rdi
leaq 0xac62(%rip), %rsi      # 0x1128b
xorl %edx, %edx
callq 0x270b
addq $0x8, %rbx
cmpq 0x20(%r13), %rbx
jne 0x64f4
jmp 0x69c4
movq (%rbx), %rdi
leaq 0xac3e(%rip), %rsi      # 0x1128b
xorl %edx, %edx
callq 0x270b
movq %rax, 0x10(%rsp)
movq (%r15), %rsi
leaq 0x30(%rsp), %r13
movq %r13, %rdi
callq 0x20b0
movl 0x30(%r15), %esi
movq %r13, %rdi
callq 0x4533
movq %r13, %rdi
leaq 0xaf29(%rip), %r13      # 0x115a8
movl $0x2, %esi
leaq 0xb1d9(%rip), %rdx      # 0x11864
movl $0x2, %ecx
callq 0x69d6
movb $0x1, %r15b
testb %r12b, %r12b
je 0x66ff
xorl %r12d, %r12d
movq (%rbx), %rax
testq %rax, %rax
je 0x66b6
movq 0x20(%rax), %rcx
subq 0x18(%rax), %rcx
sarq $0x3, %rcx
jmp 0x66b8
xorl %ecx, %ecx
cmpq %rcx, %r12
setae %r15b
jae 0x66ff
movq 0x18(%rax), %rax
movq (%rax,%r12,8), %rax
testq %rax, %rax
je 0x66fa
movq 0x20(%rax), %rcx
cmpq 0x18(%rax), %rcx
je 0x66fa
movq (%rax), %rsi
movq %rbp, %rdi
callq 0x20b0
movb $0x0, 0x438(%rsp)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2070
testl %eax, %eax
je 0x66ff
incq %r12
jmp 0x66a0
xorl %r12d, %r12d
movq (%rbx), %rax
testq %rax, %rax
je 0x6718
movq 0x20(%rax), %r13
subq 0x18(%rax), %r13
sarq $0x3, %r13
jmp 0x671b
xorl %r13d, %r13d
cmpq %r13, %r12
jae 0x6762
movq 0x18(%rax), %rax
movq (%rax,%r12,8), %rax
testq %rax, %rax
je 0x675d
movq 0x20(%rax), %rcx
cmpq 0x18(%rax), %rcx
je 0x675d
movq (%rax), %rsi
movq %rbp, %rdi
callq 0x20b0
movb $0x0, 0x435(%rsp)
movq %rbp, %rdi
leaq 0xae5d(%rip), %rsi      # 0x115b1
callq 0x2070
testl %eax, %eax
je 0x6762
incq %r12
jmp 0x6702
orb %r15b, %r14b
jne 0x67d5
movq (%rbx), %rax
movq (%rax), %rcx
movq %rbp, %rdi
leaq 0xae5c(%rip), %rsi      # 0x115d3
leaq 0x30(%rsp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x2310
movq (%rbx), %rdi
leaq 0xabdc(%rip), %rsi      # 0x1136c
xorl %edx, %edx
callq 0x270b
movq %rax, %rdi
movq %rbp, %rsi
movl $0x1, %edx
callq 0x270b
movl 0x30(%rax), %ecx
andl $-0x10, %ecx
orl $0x2, %ecx
movl %ecx, 0x30(%rax)
movq 0x10(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x270b
movl 0x30(%rax), %ecx
movl $0xfffffef0, %edx       # imm = 0xFFFFFEF0
andl %edx, %ecx
orl $0x102, %ecx            # imm = 0x102
movl %ecx, 0x30(%rax)
cmpl $0x0, 0xc(%rsp)
jne 0x684f
cmpq %r13, %r12
jae 0x684f
movq (%rbx), %rax
movq (%rax), %rcx
movq %rbp, %rdi
leaq 0xadf1(%rip), %rsi      # 0x115e2
leaq 0x30(%rsp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x2310
movq (%rbx), %rdi
leaq 0xab62(%rip), %rsi      # 0x1136c
xorl %edx, %edx
callq 0x270b
movq %rax, %rdi
movq %rbp, %rsi
movl $0x1, %edx
callq 0x270b
movl 0x30(%rax), %ecx
andl $-0x10, %ecx
orl $0x2, %ecx
movl %ecx, 0x30(%rax)
movq 0x10(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x270b
movl 0x30(%rax), %ecx
movl $0xfffffef0, %edx       # imm = 0xFFFFFEF0
andl %edx, %ecx
orl $0x102, %ecx            # imm = 0x102
movl %ecx, 0x30(%rax)
movq 0x28(%rsp), %rcx
testq %rcx, %rcx
je 0x687c
movq 0x20(%rcx), %rax
cmpq 0x18(%rcx), %rax
je 0x687c
cmpl $0x0, 0xc(%rsp)
setne %al
orb 0x8(%rsp), %al
movq 0x18(%rsp), %r13
jne 0x6630
jmp 0x68b5
movq 0x20(%rsp), %rcx
testq %rcx, %rcx
movq 0x18(%rsp), %r13
je 0x6898
movq 0x20(%rcx), %rax
cmpq 0x18(%rcx), %rax
sete %al
jmp 0x689a
movb $0x1, %al
cmpl $0x0, 0xc(%rsp)
jne 0x6630
andb %al, %r15b
movl 0x8(%rsp), %eax
orb %r15b, %al
jne 0x6630
movq (%rbx), %rdi
leaq 0xaa52(%rip), %rsi      # 0x11311
xorl %edx, %edx
callq 0x270b
movq %rax, %rdi
leaq 0x30(%rsp), %r14
movq %r14, %rsi
movl $0x1, %edx
callq 0x270b
movl 0x30(%rax), %ecx
andl $-0x10, %ecx
orl $0x2, %ecx
movl %ecx, 0x30(%rax)
movq (%rbx), %rax
movq (%rax), %rcx
movq %rbp, %rdi
leaq 0xacf7(%rip), %rsi      # 0x115ee
movq %r14, %rdx
xorl %eax, %eax
callq 0x2310
movq (%rbx), %rdi
leaq 0xad94(%rip), %rsi      # 0x1169f
xorl %edx, %edx
callq 0x270b
movq %rax, %rdi
movq %rbp, %rsi
movl $0x1, %edx
callq 0x270b
movl 0x30(%rax), %ecx
andl $-0x10, %ecx
orl $0x2, %ecx
movl %ecx, 0x30(%rax)
movq %rax, %rdi
leaq 0xacc4(%rip), %rsi      # 0x115fc
movl $0x1, %edx
callq 0x270b
movq %rax, %rdi
leaq 0xa845(%rip), %rsi      # 0x11191
movl $0x1, %edx
callq 0x270b
movq 0x10(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x270b
movl 0x30(%rax), %ecx
movl $0xfffffef0, %edx       # imm = 0xFFFFFEF0
andl %edx, %ecx
orl $0x102, %ecx            # imm = 0x102
movl %ecx, 0x30(%rax)
movq (%rbx), %rax
movq (%rax), %rcx
movq %rbp, %rdi
leaq 0xac7b(%rip), %rsi      # 0x11603
movq %r14, %rdx
xorl %eax, %eax
callq 0x2310
movq (%rbx), %rdi
leaq 0xa9d0(%rip), %rsi      # 0x1136c
xorl %edx, %edx
callq 0x270b
movq %rax, %rdi
movq %rbp, %rsi
movl $0x1, %edx
callq 0x270b
movl 0x30(%rax), %ecx
andl $-0x10, %ecx
orl $0x2, %ecx
movl %ecx, 0x30(%rax)
jmp 0x6630
addq $0x2438, %rsp           # imm = 0x2438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq