// File: /workspace/github_c_makefile_star2_O1/goodpaul6[P]generic/script.c
// Function: compare_values
static char compare_values(script_value_t* a, script_value_t* b)
{
	if(a->type != b->type) return 0;
	switch(a->type)
	{
		case VAL_NATIVE: return a->nat.value == b->nat.value;
		case VAL_BOOL: return a->boolean == b->boolean;
		case VAL_CHAR: return a->code == b->code;
		case VAL_NUMBER: return a->number == b->number;
		case VAL_STRING: return strcmp(a->string.data, b->string.data) == 0;
		case VAL_NULL: return 1;
		case VAL_FUNC: return (a->function.is_extern == b->function.is_extern) && (a->function.index == b->function.index);
		case VAL_ARRAY:
		{
			int min_index = (int)(a->array.length < b->array.length ? a->array.length : b->array.length);
			for(int i = 0; i < min_index; ++i)
			{
				if(!compare_values(vec_get_value(&a->array, i, script_value_t*), vec_get_value(&b->array, i, script_value_t*)))
					return 0;
			}
			
			return 1;
		} break;
		case VAL_STRUCT_INSTANCE:
		{
			if(a->ds.members.length != b->ds.members.length) return 0;
			for(int i = 0; i < a->ds.members.length; ++i)
			{
				if(!compare_values(vec_get_value(&a->ds.members, i, script_value_t*), vec_get_value(&b->ds.members, i, script_value_t*)))
					return 0;
			}
			
			return 1;
		} break;
	}
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0xc(%rdi), %eax
cmpl 0xc(%rsi), %eax
jne 0xdaaa
cmpl $0x8, %eax
ja 0xdaaa
movq %rsi, %rbx
movq %rdi, %r14
movl %eax, %eax
leaq 0x1c57(%rip), %rcx      # 0xf60c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb 0x20(%r14), %al
cmpb 0x20(%rbx), %al
jmp 0xdb4d
movq 0x28(%r14), %rdi
movq 0x28(%rbx), %rsi
callq 0x2150
testl %eax, %eax
jmp 0xdb4d
movb $0x1, %r15b
jmp 0xdb51
movsd 0x20(%rbx), %xmm0
cmpeqsd 0x20(%r14), %xmm0
movq %xmm0, %r15
andl $0x1, %r15d
jmp 0xdb51
movq 0x30(%r14), %rax
cmpq 0x30(%rbx), %rax
jne 0xdaaa
cmpq $0x0, 0x30(%r14)
sete %r15b
je 0xdb51
leaq 0x20(%r14), %rdi
addq $0x20, %rbx
movq %rdi, -0x30(%rbp)
xorl %esi, %esi
callq 0xdf24
movq (%rax), %r13
movq %rbx, %rdi
xorl %esi, %esi
callq 0xdf24
movq (%rax), %rsi
movq %r13, %rdi
callq 0xd983
testb %al, %al
je 0xdb51
movl $0x1, %r13d
cmpq %r13, 0x30(%r14)
setbe %r15b
jbe 0xdb51
movq -0x30(%rbp), %rdi
movq %r13, %rsi
callq 0xdf24
movq (%rax), %r12
movq %rbx, %rdi
movq %r13, %rsi
callq 0xdf24
movq (%rax), %rsi
movq %r12, %rdi
callq 0xd983
incq %r13
testb %al, %al
jne 0xda56
jmp 0xdb51
movb 0x20(%r14), %al
cmpb 0x20(%rbx), %al
jne 0xdaaa
movl 0x24(%r14), %eax
cmpl 0x24(%rbx), %eax
jmp 0xdb4d
xorl %r15d, %r15d
jmp 0xdb51
movq 0x30(%r14), %rax
movq 0x30(%rbx), %r13
cmpq %r13, %rax
cmovbq %rax, %r13
testl %r13d, %r13d
setle %r15b
jle 0xdb51
addq $0x20, %r14
addq $0x20, %rbx
movq %r14, %rdi
xorl %esi, %esi
callq 0xdf24
movq (%rax), %r12
movq %rbx, %rdi
xorl %esi, %esi
callq 0xdf24
movq (%rax), %rsi
movq %r12, %rdi
callq 0xd983
testb %al, %al
je 0xdb51
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movl $0x1, %ecx
movq %rcx, %r15
cmpq %rcx, %r13
je 0xdb3c
movq %r14, %rdi
movq %r15, %rsi
callq 0xdf24
movq (%rax), %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdf24
movq (%rax), %rsi
movq %r12, %rdi
callq 0xd983
leaq 0x1(%r15), %rcx
testb %al, %al
jne 0xdb08
cmpq %r13, %r15
setae %r15b
jmp 0xdb51
movq 0x20(%r14), %rax
cmpq 0x20(%rbx), %rax
sete %r15b
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq