// File: /workspace/github_cpp_makefile_star2_O1/corecodec[P]coremake/coremake.c
// Function: preprocess_dependency_init
void preprocess_dependency_init(item* p,int onlysource)
{
	item** child;
	if (!p) return;
	for (child=p->child;child!=p->childend;++child)
	{
		size_t i;
		item* list;
		int empty = 1;

		(*child)->flags &= ~FLAG_PROCESSED;

        ++stamp;
        preprocess_dependency_include(*child,item_get(*child,"useinclude",0),0,1);
        preprocess_dependency_include(*child,item_get(*child,"use",0),0,0);

		list = item_find(*child,"source");
		for (i=0;i<item_childcount(list);++i)
			if (!(list->child[i]->flags & FLAG_REMOVED) && !item_find(list->child[i],"sys"))
			{
				empty = 0;
				break;
			}

		if (empty) {
			list = item_find(*child, "sourcedir");
			for (i = 0; i < item_childcount(list); ++i)
			if (!(list->child[i]->flags & FLAG_REMOVED) && !item_find(list->child[i], "sys"))
			{
				empty = 0;
				break;
			}
		}

		if (empty && !onlysource)
		{
			list = item_find(*child,"use");
			for (i=0;i<item_childcount(list);++i)
				if (!(list->child[i]->flags & FLAG_REMOVED))
				{
					item* ref = findref(list->child[i]);
					if (ref && !(ref->flags & FLAG_REMOVED) && stricmp(ref->parent->value,"lib")==0)
					{
						empty = 0;
						break;
					}
				}
		}

		if (empty)
			preprocess_setremoved(*child); // empty project
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, 0xc(%rsp)
movq %rdi, 0x10(%rsp)
testq %rdi, %rdi
je 0xa624
movq 0x10(%rsp), %rax
movq 0x18(%rax), %r15
cmpq 0x20(%rax), %r15
je 0xa624
leaq 0x8a61(%rip), %rbp      # 0x12ec6
movq (%r15), %r12
andl $0xffffff7f, 0x30(%r12) # imm = 0xFFFFFF7F
incl 0xd159(%rip)            # 0x175d0
movq %r12, %rdi
leaq 0x7c5f(%rip), %rsi      # 0x120e0
xorl %edx, %edx
callq 0x2745
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0xa207
movq (%r15), %r12
movq %r12, %rdi
leaq 0x7c35(%rip), %rsi      # 0x120dc
xorl %edx, %edx
callq 0x2745
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xa207
movq (%r15), %r13
movq %r13, %rdi
leaq 0x81d3(%rip), %rsi      # 0x1269d
callq 0x26b0
movq %rax, %r12
xorl %ebx, %ebx
testq %r12, %r12
je 0xa4e9
movq 0x20(%r12), %rax
subq 0x18(%r12), %rax
sarq $0x3, %rax
jmp 0xa4eb
xorl %eax, %eax
cmpq %rax, %rbx
jae 0xa511
movq 0x18(%r12), %rax
movq (%rax,%rbx,8), %rdi
testb $0x40, 0x30(%rdi)
jne 0xa50c
movq %rbp, %rsi
callq 0x26b0
testq %rax, %rax
je 0xa56e
incq %rbx
jmp 0xa4d4
movq %r13, %rdi
leaq 0x7ed2(%rip), %rsi      # 0x123ed
callq 0x26b0
movq %rax, %r12
xorl %ebx, %ebx
testq %r12, %r12
je 0xa53a
movq 0x20(%r12), %rax
subq 0x18(%r12), %rax
sarq $0x3, %rax
jmp 0xa53c
xorl %eax, %eax
cmpq %rax, %rbx
setb %r14b
jae 0xa566
movq 0x18(%r12), %rax
movq (%rax,%rbx,8), %rdi
testb $0x40, 0x30(%rdi)
jne 0xa561
movq %rbp, %rsi
callq 0x26b0
testq %rax, %rax
je 0xa576
incq %rbx
jmp 0xa525
movl $0x1, %r12d
jmp 0xa579
xorl %r12d, %r12d
movb $0x1, %r14b
jmp 0xa579
xorl %r12d, %r12d
cmpl $0x0, 0xc(%rsp)
jne 0xa604
testb %r14b, %r14b
jne 0xa604
movq %r13, %rdi
leaq 0x7b49(%rip), %rsi      # 0x120dc
callq 0x26b0
movq %rax, %r13
movl $0x1, %r12d
xorl %ebx, %ebx
testq %r13, %r13
je 0xa5b6
movq 0x20(%r13), %rax
subq 0x18(%r13), %rax
sarq $0x3, %rax
jmp 0xa5b8
xorl %eax, %eax
cmpq %rax, %rbx
jae 0xa604
movq 0x18(%r13), %rax
movq (%rax,%rbx,8), %rdi
testb $0x40, 0x30(%rdi)
jne 0xa5f8
callq 0x2877
testq %rax, %rax
je 0xa5f2
testb $0x40, 0x30(%rax)
jne 0xa5f2
movq 0x10(%rax), %rax
movq (%rax), %rdi
leaq 0x8bb4(%rip), %rsi      # 0x1319d
callq 0x2070
testl %eax, %eax
je 0xa5fd
movb $0x1, %al
testb %al, %al
je 0xa604
incq %rbx
jmp 0xa5a3
xorl %eax, %eax
xorl %r12d, %r12d
jmp 0xa5f4
testl %r12d, %r12d
je 0xa611
movq (%r15), %rdi
callq 0x5e49
addq $0x8, %r15
movq 0x10(%rsp), %rax
cmpq 0x20(%rax), %r15
jne 0xa465
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq