// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, 0xc(%rsp)
movq %rsi, %r14
movq %rdi, %r15
movl %edx, 0x8(%rsp)
testl %edx, %edx
leaq 0x805d(%rip), %rax      # 0x12289
leaq 0x80dc(%rip), %rcx      # 0x1230f
cmovneq %rcx, %rax
movq %rax, 0x10(%rsp)
xorl %r12d, %r12d
testq %r14, %r14
je 0xa252
movq 0x20(%r14), %rax
subq 0x18(%r14), %rax
sarq $0x3, %rax
jmp 0xa254
xorl %eax, %eax
cmpq %rax, %r12
jae 0xa41c
movq 0x18(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0x2877
testq %rax, %rax
je 0xa414
movq %rax, %rbx
movl 0xd354(%rip), %eax      # 0x175d0
cmpl %eax, 0x34(%rbx)
je 0xa414
movl %eax, 0x34(%rbx)
movq %r15, %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x2745
movq %rax, %r13
movq %rbx, %rdi
leaq 0x806b(%rip), %rsi      # 0x1230f
callq 0x26b0
movq 0x18(%r14), %rcx
movq (%rcx,%r12,8), %rdx
movq %r13, %rdi
movq %rax, %rsi
callq 0x334b
movq %r15, %rdi
leaq 0x8054(%rip), %rbp      # 0x1231a
movq %rbp, %rsi
xorl %edx, %edx
callq 0x2745
movq %rax, %r13
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x26b0
movq 0x18(%r14), %rcx
movq (%rcx,%r12,8), %rdx
movq %r13, %rdi
movq %rax, %rsi
callq 0x334b
movq %r15, %rdi
leaq 0x802a(%rip), %rbp      # 0x12325
movq %rbp, %rsi
xorl %edx, %edx
callq 0x2745
movq %rax, %r13
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x26b0
movq 0x18(%r14), %rcx
movq (%rcx,%r12,8), %rdx
movq %r13, %rdi
movq %rax, %rsi
callq 0x334b
movq %r15, %rdi
leaq 0x80cf(%rip), %rbp      # 0x123ff
movq %rbp, %rsi
xorl %edx, %edx
callq 0x2745
movq %rax, %r13
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x26b0
movq 0x18(%r14), %rcx
movq (%rcx,%r12,8), %rdx
movq %r13, %rdi
movq %rax, %rsi
callq 0x334b
movq %r15, %rdi
leaq 0x80a3(%rip), %rbp      # 0x12408
movq %rbp, %rsi
xorl %edx, %edx
callq 0x2745
movq %rax, %r13
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x26b0
movq 0x18(%r14), %rcx
movq (%rcx,%r12,8), %rdx
movq %r13, %rdi
movq %rax, %rsi
callq 0x334b
cmpl $0x0, 0xc(%rsp)
jne 0xa3cd
movq %r15, %rdi
leaq 0x8b1e(%rip), %rsi      # 0x12ebf
xorl %edx, %edx
callq 0x2745
movq %rax, %r13
movq %rbx, %rdi
leaq 0x8b07(%rip), %rsi      # 0x12ebc
callq 0x26b0
movq 0x18(%r14), %rcx
movq (%rcx,%r12,8), %rdx
movq %r13, %rdi
movq %rax, %rsi
callq 0x334b
movq %rbx, %rdi
leaq 0x7d09(%rip), %rsi      # 0x120e0
xorl %edx, %edx
callq 0x2745
movq %r15, %rdi
movq %rax, %rsi
movl 0x8(%rsp), %ebp
movl %ebp, %edx
movl $0x1, %ecx
callq 0xa207
movq %rbx, %rdi
leaq 0x7cde(%rip), %rsi      # 0x120dc
xorl %edx, %edx
callq 0x2745
movq %r15, %rdi
movq %rax, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0xa207
incq %r12
jmp 0xa23f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq