// File: /workspace/github_cpp_makefile_star2_O1/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, 0x4(%rsp)
movq %rdi, 0x10(%rsp)
testq %rdi, %rdi
je 0x69da
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rbp
cmpq 0x20(%rax), %rbp
je 0x69da
movq (%rbp), %rbx
movq %rbx, %rdi
leaq 0xc0ed(%rip), %rsi      # 0x125b5
callq 0x26b0
testq %rax, %rax
je 0x64fe
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rdx
cmpq %rdx, %rcx
sete %al
je 0x64fa
movq (%rcx), %r14
testb $0x40, 0x30(%r14)
je 0x64fa
addq $0x8, %rcx
cmpq %rdx, %rcx
sete %al
jne 0x64e2
jmp 0x64fa
testb $0x1, %al
je 0x6501
xorl %r14d, %r14d
movq %rbx, %rdi
leaq 0xc0b1(%rip), %rsi      # 0x125bc
callq 0x26b0
testq %rax, %rax
je 0x6541
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rdx
cmpq %rdx, %rcx
sete %al
je 0x653d
movq (%rcx), %r15
testb $0x40, 0x30(%r15)
je 0x653d
addq $0x8, %rcx
cmpq %rdx, %rcx
sete %al
jne 0x6525
jmp 0x653d
testb $0x1, %al
je 0x6544
xorl %r15d, %r15d
movq %rbx, %rdi
leaq 0xc078(%rip), %rsi      # 0x125c6
callq 0x26b0
testq %rax, %rax
je 0x6585
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rdx
cmpq %rdx, %rcx
sete %al
je 0x6581
movq (%rcx), %r12
testb $0x40, 0x30(%r12)
je 0x6581
addq $0x8, %rcx
cmpq %rdx, %rcx
sete %al
jne 0x6568
jmp 0x6581
testb $0x1, %al
je 0x6588
xorl %r12d, %r12d
movq %rbx, %rdi
leaq 0xbecf(%rip), %rsi      # 0x12461
xorl %edx, %edx
callq 0x2745
movq %rax, 0x20(%rsp)
movq (%rbp), %rdi
leaq 0xbeb4(%rip), %rsi      # 0x1245d
xorl %edx, %edx
callq 0x2745
movq %rax, 0x28(%rsp)
movq (%rbp), %rdi
leaq 0xcaae(%rip), %rsi      # 0x1306e
xorl %edx, %edx
callq 0x2745
testq %rax, %rax
je 0x65f7
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rdx
cmpq %rdx, %rcx
sete %al
je 0x65f3
movq (%rcx), %rbx
testb $0x40, 0x30(%rbx)
je 0x65f3
addq $0x8, %rcx
cmpq %rdx, %rcx
sete %al
jne 0x65dc
jmp 0x65f3
testb $0x1, %al
je 0x65f9
xorl %ebx, %ebx
movq (%rbp), %rdi
leaq 0xbc85(%rip), %rsi      # 0x12289
xorl %edx, %edx
callq 0x2745
movq %rax, 0x8(%rsp)
testq %rbx, %rbx
je 0x69cc
movq %r15, 0x18(%rsp)
movq (%rbx), %rsi
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x20b0
movl 0x30(%rbx), %esi
movq %r15, %rdi
callq 0x44c5
movq %r15, %rdi
movl $0x2, %esi
leaq 0xc21a(%rip), %rdx      # 0x12862
movl $0x2, %ecx
callq 0x69ec
movb $0x1, %bl
testq %r14, %r14
je 0x6821
xorl %r14d, %r14d
movq (%rbp), %rax
testq %rax, %rax
je 0x6677
movq 0x20(%rax), %r15
subq 0x18(%rax), %r15
sarq $0x3, %r15
jmp 0x667a
xorl %r15d, %r15d
cmpq %r15, %r14
jae 0x66c9
movq 0x18(%rax), %rax
movq (%rax,%r14,8), %rax
testq %rax, %rax
je 0x66c4
movq 0x20(%rax), %rcx
cmpq 0x18(%rax), %rcx
je 0x66c4
movq (%rax), %rsi
leaq 0x430(%rsp), %r13
movq %r13, %rdi
callq 0x20b0
movb $0x0, 0x435(%rsp)
movq %r13, %rdi
leaq 0xbef4(%rip), %rsi      # 0x125af
callq 0x2070
testl %eax, %eax
je 0x66c9
incq %r14
jmp 0x6660
testq %r12, %r12
setne %al
orb %bl, %al
jne 0x674b
movq (%rbp), %rax
movq (%rax), %rcx
leaq 0x430(%rsp), %r13
movq %r13, %rdi
leaq 0xbee5(%rip), %rsi      # 0x125d1
leaq 0x30(%rsp), %r12
movq %r12, %rdx
xorl %eax, %eax
callq 0x2320
movq (%rbp), %rdi
leaq 0xbc64(%rip), %rsi      # 0x1236a
xorl %edx, %edx
callq 0x2745
movq %rax, %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x2745
movl 0x30(%rax), %ecx
andl $-0x10, %ecx
orl $0x2, %ecx
movl %ecx, 0x30(%rax)
movq 0x8(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x2745
movl 0x30(%rax), %ecx
movl $0xfffffef0, %edx       # imm = 0xFFFFFEF0
andl %edx, %ecx
orl $0x102, %ecx            # imm = 0x102
movl %ecx, 0x30(%rax)
cmpl $0x0, 0x4(%rsp)
jne 0x67cf
cmpq %r15, %r14
jae 0x67cf
movq (%rbp), %rax
movq (%rax), %rcx
leaq 0x430(%rsp), %r15
movq %r15, %rdi
leaq 0xbe70(%rip), %rsi      # 0x125e0
leaq 0x30(%rsp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x2320
movq (%rbp), %rdi
leaq 0xbbe0(%rip), %rsi      # 0x1236a
xorl %edx, %edx
callq 0x2745
movq %rax, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x2745
movl 0x30(%rax), %ecx
andl $-0x10, %ecx
orl $0x2, %ecx
movl %ecx, 0x30(%rax)
movq 0x8(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2745
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 0x6801
movq 0x20(%rcx), %rax
cmpq 0x18(%rcx), %rax
je 0x6801
cmpl $0x0, 0x4(%rsp)
movq 0x18(%rsp), %rax
jne 0x69cc
testq %rax, %rax
je 0x68b5
jmp 0x69cc
movq 0x20(%rsp), %rdx
testq %rdx, %rdx
movq 0x18(%rsp), %rcx
je 0x6897
movq 0x20(%rdx), %rax
cmpq 0x18(%rdx), %rax
sete %al
jmp 0x6899
xorl %r14d, %r14d
movq (%rbp), %rax
testq %rax, %rax
je 0x683b
movq 0x20(%rax), %rcx
subq 0x18(%rax), %rcx
sarq $0x3, %rcx
jmp 0x683d
xorl %ecx, %ecx
cmpq %rcx, %r14
setae %bl
jae 0x665d
movq 0x18(%rax), %rax
movq (%rax,%r14,8), %rax
testq %rax, %rax
je 0x6892
movq 0x20(%rax), %rcx
cmpq 0x18(%rax), %rcx
je 0x6892
movq (%rax), %rsi
leaq 0x430(%rsp), %r15
movq %r15, %rdi
callq 0x20b0
movb $0x0, 0x438(%rsp)
movq %r15, %rdi
leaq 0xbd21(%rip), %rsi      # 0x125a6
callq 0x2070
testl %eax, %eax
je 0x665d
incq %r14
jmp 0x6824
movb $0x1, %al
cmpl $0x0, 0x4(%rsp)
jne 0x69cc
testq %rcx, %rcx
jne 0x69cc
andb %al, %bl
jne 0x69cc
movq (%rbp), %rdi
leaq 0xba4f(%rip), %rsi      # 0x1230f
xorl %edx, %edx
callq 0x2745
movq %rax, %rdi
leaq 0x30(%rsp), %rbx
movq %rbx, %rsi
movl $0x1, %edx
callq 0x2745
movl 0x30(%rax), %ecx
andl $-0x10, %ecx
orl $0x2, %ecx
movl %ecx, 0x30(%rax)
movq (%rbp), %rax
movq (%rax), %rcx
leaq 0x430(%rsp), %r14
movq %r14, %rdi
leaq 0xbceb(%rip), %rsi      # 0x125ec
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2320
movq (%rbp), %rdi
leaq 0xbd87(%rip), %rsi      # 0x1269d
xorl %edx, %edx
callq 0x2745
movq %rax, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x2745
movl 0x30(%rax), %ecx
andl $-0x10, %ecx
orl $0x2, %ecx
movl %ecx, 0x30(%rax)
movq %rax, %rdi
leaq 0xbcb7(%rip), %rsi      # 0x125fa
movl $0x1, %edx
callq 0x2745
movq %rax, %rdi
leaq 0xc854(%rip), %rsi      # 0x131ab
movl $0x1, %edx
callq 0x2745
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2745
movl 0x30(%rax), %ecx
movl $0xfffffef0, %edx       # imm = 0xFFFFFEF0
andl %edx, %ecx
orl $0x102, %ecx            # imm = 0x102
movl %ecx, 0x30(%rax)
movq (%rbp), %rax
movq (%rax), %rcx
movq %r14, %rdi
leaq 0xbc6d(%rip), %rsi      # 0x12601
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2320
movq (%rbp), %rdi
leaq 0xb9c1(%rip), %rsi      # 0x1236a
xorl %edx, %edx
callq 0x2745
movq %rax, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x2745
movl 0x30(%rax), %ecx
andl $-0x10, %ecx
orl $0x2, %ecx
movl %ecx, 0x30(%rax)
addq $0x8, %rbp
movq 0x10(%rsp), %rax
jmp 0x64b0
addq $0x2438, %rsp           # imm = 0x2438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq