// File: 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
movq %rsp, %rbp
subq $0x10b0, %rsp           # imm = 0x10B0
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x828e
jmp 0x885a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x20(%rcx), %rax
je 0x885a
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0xe403(%rip), %rsi      # 0x166cb
callq 0x27d0
movq %rax, %rdi
callq 0x2990
movq %rax, -0x438(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0xe3e8(%rip), %rsi      # 0x166d2
callq 0x27d0
movq %rax, %rdi
callq 0x2990
movq %rax, -0x440(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0xe3d0(%rip), %rsi      # 0x166dc
callq 0x27d0
movq %rax, %rdi
callq 0x2990
movq %rax, -0x448(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0xe164(%rip), %rsi      # 0x16492
xorl %edx, %edx
callq 0x28d0
movq %rax, -0x450(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0xe144(%rip), %rsi      # 0x1648e
xorl %edx, %edx
callq 0x28d0
movq %rax, -0x458(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0xee1e(%rip), %rsi      # 0x17184
xorl %edx, %edx
callq 0x28d0
movq %rax, %rdi
callq 0x2990
movq %rax, -0x460(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0xdf30(%rip), %rsi      # 0x162ba
xorl %edx, %edx
callq 0x28d0
movq %rax, -0x468(%rbp)
cmpq $0x0, -0x460(%rbp)
jne 0x83a7
jmp 0x8849
leaq -0x430(%rbp), %rdi
movq -0x460(%rbp), %rax
movq (%rax), %rsi
callq 0x2090
leaq -0x430(%rbp), %rdi
movq -0x460(%rbp), %rax
movl 0x30(%rax), %esi
callq 0x5660
leaq -0x430(%rbp), %rdi
movl $0x2, %ecx
leaq 0xe592(%rip), %rdx      # 0x16978
movl %ecx, %esi
callq 0x8870
cmpq $0x0, -0x438(%rbp)
jne 0x847f
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x10a0(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x25d0
movq %rax, %rcx
movq -0x10a0(%rbp), %rax
cmpq %rcx, %rax
jae 0x847d
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x25d0
cmpq $0x0, %rax
je 0x846d
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8150
cmpl $0x0, %eax
je 0x846d
movl $0x1, -0x24(%rbp)
jmp 0x847d
jmp 0x846f
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x8403
jmp 0x847f
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x10a8(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x25d0
movq %rax, %rcx
movq -0x10a8(%rbp), %rax
cmpq %rcx, %rax
jae 0x8501
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x25d0
cmpq $0x0, %rax
je 0x84f1
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x81a0
cmpl $0x0, %eax
je 0x84f1
movl $0x1, -0x28(%rbp)
jmp 0x8501
jmp 0x84f3
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x8487
cmpl $0x0, -0x24(%rbp)
je 0x85c0
cmpq $0x0, -0x448(%rbp)
jne 0x85c0
leaq -0x870(%rbp), %rdi
leaq -0x430(%rbp), %rdx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
leaq 0xe1af(%rip), %rsi      # 0x166e7
movb $0x0, %al
callq 0x2300
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0xde4e(%rip), %rsi      # 0x1639b
xorl %edx, %edx
callq 0x28d0
movq %rax, %rdi
leaq -0x870(%rbp), %rsi
movl $0x1, %edx
callq 0x28d0
movq %rax, -0x470(%rbp)
movq -0x470(%rbp), %rdi
movl $0x2, %esi
callq 0x2570
movq -0x468(%rbp), %rdi
leaq -0x430(%rbp), %rsi
xorl %edx, %edx
callq 0x28d0
movq %rax, -0x878(%rbp)
movq -0x878(%rbp), %rdi
movl $0x2, %esi
callq 0x2570
movq -0x878(%rbp), %rax
movl 0x30(%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x30(%rax)
cmpl $0x0, -0x28(%rbp)
je 0x867b
cmpl $0x0, -0xc(%rbp)
jne 0x867b
leaq -0xc80(%rbp), %rdi
leaq -0x430(%rbp), %rdx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
leaq 0xe103(%rip), %rsi      # 0x166f6
movb $0x0, %al
callq 0x2300
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0xdd93(%rip), %rsi      # 0x1639b
xorl %edx, %edx
callq 0x28d0
movq %rax, %rdi
leaq -0xc80(%rbp), %rsi
movl $0x1, %edx
callq 0x28d0
movq %rax, -0x880(%rbp)
movq -0x880(%rbp), %rdi
movl $0x2, %esi
callq 0x2570
movq -0x468(%rbp), %rdi
leaq -0x430(%rbp), %rsi
xorl %edx, %edx
callq 0x28d0
movq %rax, -0xc88(%rbp)
movq -0xc88(%rbp), %rdi
movl $0x2, %esi
callq 0x2570
movq -0xc88(%rbp), %rax
movl 0x30(%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x30(%rax)
movq -0x458(%rbp), %rdi
callq 0x25d0
cmpq $0x0, %rax
jne 0x86a9
movq -0x450(%rbp), %rdi
callq 0x25d0
cmpq $0x0, %rax
jne 0x86a9
cmpl $0x0, -0x24(%rbp)
je 0x8847
cmpl $0x0, -0xc(%rbp)
jne 0x8847
cmpq $0x0, -0x440(%rbp)
jne 0x8847
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0xdc71(%rip), %rsi      # 0x16340
xorl %edx, %edx
callq 0x28d0
movq %rax, %rdi
leaq -0x430(%rbp), %rsi
movl $0x1, %edx
callq 0x28d0
movq %rax, -0xc90(%rbp)
movq -0xc90(%rbp), %rdi
movl $0x2, %esi
callq 0x2570
leaq -0x1090(%rbp), %rdi
leaq -0x430(%rbp), %rdx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
leaq 0xdfe1(%rip), %rsi      # 0x16702
movb $0x0, %al
callq 0x2300
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0xe07d(%rip), %rsi      # 0x167b3
xorl %edx, %edx
callq 0x28d0
movq %rax, %rdi
leaq -0x1090(%rbp), %rsi
movl $0x1, %edx
callq 0x28d0
movq %rax, -0xc90(%rbp)
movq -0xc90(%rbp), %rdi
movl $0x2, %esi
callq 0x2570
movq -0xc90(%rbp), %rdi
leaq 0xdf99(%rip), %rsi      # 0x16710
movl $0x1, %edx
callq 0x28d0
movq %rax, -0xc90(%rbp)
movq -0xc90(%rbp), %rdi
leaq 0xeb2b(%rip), %rsi      # 0x172c1
movl $0x1, %edx
callq 0x28d0
movq -0x468(%rbp), %rdi
leaq -0x430(%rbp), %rsi
xorl %edx, %edx
callq 0x28d0
movq %rax, -0x1098(%rbp)
movq -0x1098(%rbp), %rdi
movl $0x2, %esi
callq 0x2570
movq -0x1098(%rbp), %rax
movl 0x30(%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x30(%rax)
leaq -0x1090(%rbp), %rdi
leaq -0x430(%rbp), %rdx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
leaq 0xdf18(%rip), %rsi      # 0x16717
movb $0x0, %al
callq 0x2300
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0xdb87(%rip), %rsi      # 0x1639b
xorl %edx, %edx
callq 0x28d0
movq %rax, %rdi
leaq -0x1090(%rbp), %rsi
movl $0x1, %edx
callq 0x28d0
movq %rax, -0xc90(%rbp)
movq -0xc90(%rbp), %rdi
movl $0x2, %esi
callq 0x2570
jmp 0x8849
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
jmp 0x829a
addq $0x10b0, %rsp           # imm = 0x10B0
popq %rbp
retq
nopw %cs:(%rax,%rax)