// File: corecodec[P]coremake/coremake.c
// Function: preprocess_dependency_include
void preprocess_dependency_include(item* base, item* list, int keep_exp_inc, int discard_exp_def)
{
	size_t i;
	for (i=0;i<item_childcount(list);++i)
	{
		item* ref = findref(list->child[i]);
		if (ref && ref->stamp != stamp)
		{
            ref->stamp = stamp;

			// add to "expinclude" to "include" or "expinclude"
            item_merge(item_get(base,keep_exp_inc?"expinclude":"include",0),item_find(ref,"expinclude"),list->child[i]);
			// also merge "subinclude"
			item_merge(item_get(base,"subinclude",0),item_find(ref,"subinclude"),list->child[i]);
			// also merge "sysinclude"
			item_merge(item_get(base,"sysinclude",0),item_find(ref,"sysinclude"),list->child[i]);
			// also merge "linkfile"
			item_merge(item_get(base,"linkfile",0),item_find(ref,"linkfile"),list->child[i]);
			// also merge "crt0"
			item_merge(item_get(base,"crt0",0),item_find(ref,"crt0"),list->child[i]);
			// also merge "expdefine" to "define" or "expdefine"
            if (!discard_exp_def)
			    item_merge(item_get(base,"define",0),item_find(ref,"expdefine"),list->child[i]);

            preprocess_dependency_include(base,item_get(ref,"useinclude",0),keep_exp_inc,1);
            preprocess_dependency_include(base,item_get(ref,"use",0),keep_exp_inc,0);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x25d0
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
jae 0xd382
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2a60
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xd36f
movq -0x28(%rbp), %rax
movl 0x34(%rax), %eax
cmpl 0xd460(%rip), %eax      # 0x1a5c0
je 0xd36f
movl 0xd454(%rip), %ecx      # 0x1a5c0
movq -0x28(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %ecx
leaq 0x9139(%rip), %rsi      # 0x162ba
leaq 0x91b8(%rip), %rax      # 0x16340
cmpl $0x0, %ecx
cmovneq %rax, %rsi
xorl %edx, %edx
callq 0x28d0
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x919b(%rip), %rsi      # 0x16340
callq 0x27d0
movq -0x58(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x3b20
movq -0x8(%rbp), %rdi
leaq 0x917a(%rip), %rsi      # 0x1634b
xorl %edx, %edx
callq 0x28d0
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x9164(%rip), %rsi      # 0x1634b
callq 0x27d0
movq -0x50(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x3b20
movq -0x8(%rbp), %rdi
leaq 0x9143(%rip), %rsi      # 0x16356
xorl %edx, %edx
callq 0x28d0
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x912d(%rip), %rsi      # 0x16356
callq 0x27d0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x3b20
movq -0x8(%rbp), %rdi
leaq 0x91db(%rip), %rsi      # 0x16430
xorl %edx, %edx
callq 0x28d0
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x91c5(%rip), %rsi      # 0x16430
callq 0x27d0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x3b20
movq -0x8(%rbp), %rdi
leaq 0x91a2(%rip), %rsi      # 0x16439
xorl %edx, %edx
callq 0x28d0
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x918c(%rip), %rsi      # 0x16439
callq 0x27d0
movq -0x38(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x3b20
cmpl $0x0, -0x18(%rbp)
jne 0xd316
movq -0x8(%rbp), %rdi
leaq 0x9cf6(%rip), %rsi      # 0x16fd5
xorl %edx, %edx
callq 0x28d0
movq %rax, -0x60(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x9cdd(%rip), %rsi      # 0x16fd2
callq 0x27d0
movq -0x60(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x3b20
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x8de8(%rip), %rsi      # 0x16111
xorl %edx, %edx
callq 0x28d0
movq -0x70(%rbp), %rdi
movq %rax, %rsi
movl -0x14(%rbp), %edx
movl $0x1, %ecx
callq 0xd0f0
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x8db6(%rip), %rsi      # 0x1610d
xorl %edx, %edx
callq 0x28d0
movq -0x68(%rbp), %rdi
movq %rax, %rsi
movl -0x14(%rbp), %edx
xorl %ecx, %ecx
callq 0xd0f0
jmp 0xd371
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xd10e
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)