// File: corecodec[P]coremake/coremake.c
// Function: preprocess_dependency_project
void preprocess_dependency_project(item* p)
{
	if (!(p->flags & FLAG_PROCESSED))
	{
		// remove not exising dependencies
		size_t i;
		item* use = item_get(p,"use",0);

		p->flags |= FLAG_PROCESSED;

		for (i=0;i<item_childcount(use);++i)
		{
			item* ref = findref(use->child[i]);
			if (!ref || (ref->flags & FLAG_REMOVED) || ref==p)
			{
				preprocess_setremoved(use->child[i]);
			}
			else
			if (stricmp(ref->parent->value,"lib")==0)
			{
				preprocess_dependency_project(ref);
				// copy use of lib's
				item_merge(use,item_find(ref,"use"),use->child[i]);

                item_merge_name(p,ref,"uselib",use->child[i]);
                item_merge_name(p,ref,"framework",use->child[i]);
                item_merge_name(p,ref,"framework_lib",use->child[i]);
                item_merge_name(p,ref,"privateframework",use->child[i]);
                item_merge_name(p,ref,"libinclude",use->child[i]);
                item_merge_name(p,ref,"libinclude_debug",use->child[i]);
                item_merge_name(p,ref,"libinclude_release",use->child[i]);
                item_merge_name(p,ref,"rpath",use->child[i]);
                item_merge_name(p,ref,"android_permission",use->child[i]);
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x7e2b
movq -0x8(%rbp), %rdi
leaq 0xe531(%rip), %rsi      # 0x1610d
xorl %edx, %edx
callq 0x28d0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %ecx
orl $0x80, %ecx
movl %ecx, 0x30(%rax)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x25d0
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x7e29
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2a60
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x7c59
movq -0x20(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x7c59
movq -0x20(%rbp), %rax
cmpq -0x8(%rbp), %rax
jne 0x7c73
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7980
jmp 0x7e16
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
leaq 0xf62e(%rip), %rsi      # 0x172b3
callq 0x2050
cmpl $0x0, %eax
jne 0x7e14
movq -0x20(%rbp), %rdi
callq 0x7bb0
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
leaq 0xe45e(%rip), %rsi      # 0x1610d
callq 0x27d0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x3b20
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0xe608(%rip), %rdx      # 0x162f7
callq 0x7b50
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0xe963(%rip), %rdx      # 0x16676
callq 0x7b50
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0xe92a(%rip), %rdx      # 0x16661
callq 0x7b50
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0xe914(%rip), %rdx      # 0x1666f
callq 0x7b50
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0xe5ed(%rip), %rdx      # 0x1636c
callq 0x7b50
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0xe5d4(%rip), %rdx      # 0x16377
callq 0x7b50
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0xe5c1(%rip), %rdx      # 0x16388
callq 0x7b50
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0xe895(%rip), %rdx      # 0x16680
callq 0x7b50
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0xe877(%rip), %rdx      # 0x16686
callq 0x7b50
jmp 0x7e16
jmp 0x7e18
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x7bff
jmp 0x7e2b
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)