// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xd3ab
jmp 0xd684
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 0xd684
movl $0x1, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl 0x30(%rax), %ecx
andl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
movl %ecx, 0x30(%rax)
movl 0xd1d7(%rip), %eax      # 0x1a5c0
addl $0x1, %eax
movl %eax, 0xd1ce(%rip)      # 0x1a5c0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x8d06(%rip), %rsi      # 0x16111
xorl %edx, %edx
callq 0x28d0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0xd0f0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x8ccf(%rip), %rsi      # 0x1610d
xorl %edx, %edx
callq 0x28d0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xd0f0
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x9350(%rip), %rsi      # 0x167b3
callq 0x27d0
movq %rax, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rdi
callq 0x25d0
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpq %rcx, %rax
jae 0xd4e7
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x30(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0xd4d7
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x9b19(%rip), %rsi      # 0x16fdc
callq 0x27d0
cmpq $0x0, %rax
jne 0xd4d7
movl $0x0, -0x2c(%rbp)
jmp 0xd4e7
jmp 0xd4d9
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xd474
cmpl $0x0, -0x2c(%rbp)
je 0xd585
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x8f1f(%rip), %rsi      # 0x1641e
callq 0x27d0
movq %rax, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rdi
callq 0x25d0
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpq %rcx, %rax
jae 0xd583
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x30(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0xd573
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x9a7d(%rip), %rsi      # 0x16fdc
callq 0x27d0
cmpq $0x0, %rax
jne 0xd573
movl $0x0, -0x2c(%rbp)
jmp 0xd583
jmp 0xd575
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xd510
jmp 0xd585
cmpl $0x0, -0x2c(%rbp)
je 0xd65f
cmpl $0x0, -0xc(%rbp)
jne 0xd65f
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x8b66(%rip), %rsi      # 0x1610d
callq 0x27d0
movq %rax, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x28(%rbp), %rdi
callq 0x25d0
movq %rax, %rcx
movq -0x60(%rbp), %rax
cmpq %rcx, %rax
jae 0xd65d
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x30(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0xd64a
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2a60
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0xd648
movq -0x38(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0xd648
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
leaq 0x9c7e(%rip), %rsi      # 0x172b3
callq 0x2050
cmpl $0x0, %eax
jne 0xd648
movl $0x0, -0x2c(%rbp)
jmp 0xd65d
jmp 0xd64a
jmp 0xd64c
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xd5b8
jmp 0xd65f
cmpl $0x0, -0x2c(%rbp)
je 0xd671
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x7980
jmp 0xd673
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
jmp 0xd3b7
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)