// File: corecodec[P]coremake/coremake.c
// Function: findref
item* findref(const item* p)
{
	if (p->parent && (stricmp(p->parent->value,"project")==0 ||
		              stricmp(p->parent->value,"dep")==0 ||
		              stricmp(p->parent->value,"use")==0 ||
					  stricmp(p->parent->value,"useinclude")==0 ||
					  stricmp(p->parent->value,"usemerge")==0 ||
					  stricmp(p->parent->value,"usebuilt")==0))
	{
		item* v = item_find(getroot(p,"exe"),p->value);
		if (!v)
			v = item_find(getroot(p,"con"),p->value);
		if (!v)
			v = item_find(getroot(p,"lib"),p->value);
		if (!v)
			v = item_find(getroot(p,"dll"),p->value);
		if (!v)
			v = item_find(getroot(p,"group"),p->value);
		if (!v)
			v = item_find(getroot(p,"dll_csharp"),p->value);
		if (!v)
			v = item_find(getroot(p,"con_csharp"),p->value);
		if (!v)
			v = item_find(getroot(p,"exe_csharp"),p->value);
		if (!v)
			v = item_find(getroot(p,"lib_csharp"),p->value);
		if (!v)
			v = item_find(getroot(p,"exe_android"),p->value);
		if (!v)
			v = item_find(getroot(p,"dll_android"),p->value);
		return v;
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x2cfc
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
leaq 0x13c52(%rip), %rsi     # 0x166df
callq 0x2050
cmpl $0x0, %eax
je 0x2b2b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
leaq 0x1365c(%rip), %rsi     # 0x16109
callq 0x2050
cmpl $0x0, %eax
je 0x2b2b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
leaq 0x13644(%rip), %rsi     # 0x1610d
callq 0x2050
cmpl $0x0, %eax
je 0x2b2b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
leaq 0x1362c(%rip), %rsi     # 0x16111
callq 0x2050
cmpl $0x0, %eax
je 0x2b2b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
leaq 0x1361b(%rip), %rsi     # 0x1611c
callq 0x2050
cmpl $0x0, %eax
je 0x2b2b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
leaq 0x13608(%rip), %rsi     # 0x16125
callq 0x2050
cmpl $0x0, %eax
jne 0x2cfc
movq -0x10(%rbp), %rdi
leaq 0x146fc(%rip), %rsi     # 0x17232
callq 0x2890
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x27d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2b78
movq -0x10(%rbp), %rdi
leaq 0x14726(%rip), %rsi     # 0x17286
callq 0x2890
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x27d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2ba2
movq -0x10(%rbp), %rdi
leaq 0x14729(%rip), %rsi     # 0x172b3
callq 0x2890
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x27d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2bcc
movq -0x10(%rbp), %rdi
leaq 0x146dd(%rip), %rsi     # 0x17291
callq 0x2890
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x27d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2bf6
movq -0x10(%rbp), %rdi
leaq 0x13550(%rip), %rsi     # 0x1612e
callq 0x2890
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x27d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2c20
movq -0x10(%rbp), %rdi
leaq 0x1352c(%rip), %rsi     # 0x16134
callq 0x2890
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x27d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2c4a
movq -0x10(%rbp), %rdi
leaq 0x1350d(%rip), %rsi     # 0x1613f
callq 0x2890
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x27d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2c74
movq -0x10(%rbp), %rdi
leaq 0x134ee(%rip), %rsi     # 0x1614a
callq 0x2890
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x27d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2c9e
movq -0x10(%rbp), %rdi
leaq 0x134cf(%rip), %rsi     # 0x16155
callq 0x2890
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x27d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2cc8
movq -0x10(%rbp), %rdi
leaq 0x134b0(%rip), %rsi     # 0x16160
callq 0x2890
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x27d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2cf2
movq -0x10(%rbp), %rdi
leaq 0x13492(%rip), %rsi     # 0x1616c
callq 0x2890
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x27d0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2d04
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop