// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/value.c
// Function: janet_equals
int janet_equals(Janet x, Janet y) {
    janet_vm.traversal = janet_vm.traversal_base;
    do {
        if (janet_type(x) != janet_type(y)) return 0;
        switch (janet_type(x)) {
            case JANET_NIL:
                break;
            case JANET_BOOLEAN:
                if (janet_unwrap_boolean(x) != janet_unwrap_boolean(y)) return 0;
                break;
            case JANET_NUMBER:
                if (janet_unwrap_number(x) != janet_unwrap_number(y)) return 0;
                break;
            case JANET_STRING:
                if (!janet_string_equal(janet_unwrap_string(x), janet_unwrap_string(y))) return 0;
                break;
            case JANET_ABSTRACT:
                if (janet_compare_abstract(janet_unwrap_abstract(x), janet_unwrap_abstract(y))) return 0;
                break;
            default:
                if (janet_unwrap_pointer(x) != janet_unwrap_pointer(y)) return 0;
                break;
            case JANET_TUPLE: {
                const Janet *t1 = janet_unwrap_tuple(x);
                const Janet *t2 = janet_unwrap_tuple(y);
                if (t1 == t2) break;
                if (JANET_TUPLE_FLAG_BRACKETCTOR & (janet_tuple_flag(t1) ^ janet_tuple_flag(t2))) return 0;
                if (janet_tuple_hash(t1) != janet_tuple_hash(t2)) return 0;
                if (janet_tuple_length(t1) != janet_tuple_length(t2)) return 0;
                push_traversal_node(janet_tuple_head(t1), janet_tuple_head(t2), 0);
                break;
            }
            break;
            case JANET_STRUCT: {
                const JanetKV *s1 = janet_unwrap_struct(x);
                const JanetKV *s2 = janet_unwrap_struct(y);
                if (s1 == s2) break;
                if (janet_struct_hash(s1) != janet_struct_hash(s2)) return 0;
                if (janet_struct_length(s1) != janet_struct_length(s2)) return 0;
                if (janet_struct_proto(s1) && !janet_struct_proto(s2)) return 0;
                if (!janet_struct_proto(s1) && janet_struct_proto(s2)) return 0;
                push_traversal_node(janet_struct_head(s1), janet_struct_head(s2), 0);
                break;
            }
            break;
        }
    } while (!traversal_next(&x, &y));
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq -0x38(%rbp), %r14
movq %rdi, (%r14)
leaq -0x30(%rbp), %r15
movq %rsi, (%r15)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq 0x118(%rax), %rcx
movq %rcx, 0x108(%rax)
leaq 0x219de(%rip), %r13     # 0x6c6f0
xorl %ebx, %ebx
movq -0x38(%rbp), %xmm0
movq %xmm0, %rdi
movq %rdi, %rcx
shrq $0x2f, %rcx
andl $0xf, %ecx
ucomisd %xmm0, %xmm0
cmovnpl %ebx, %ecx
movq -0x30(%rbp), %xmm1
movq %xmm1, %rax
movq %rax, %rdx
shrq $0x2f, %rdx
andl $0xf, %edx
ucomisd %xmm1, %xmm1
cmovnpl %ebx, %edx
cmpl %edx, %ecx
jne 0x4aed8
cmpl $0xe, %ecx
ja 0x4ad78
movl %ecx, %ecx
movslq (%r13,%rcx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
ucomisd %xmm1, %xmm0
jne 0x4aed8
jnp 0x4aec0
jmp 0x4aed8
callq 0x4f838
movq %rax, %r12
movq -0x30(%rbp), %rdi
callq 0x4f838
cmpq %rax, %r12
je 0x4aec0
jmp 0x4aed8
callq 0x4f838
movq %rax, %r12
movq -0x30(%rbp), %rdi
callq 0x4f838
cmpq %rax, %r12
je 0x4aec0
movl -0x14(%r12), %ecx
cmpl -0x14(%rax), %ecx
jne 0x4aed8
movl -0x18(%r12), %ecx
cmpl -0x18(%rax), %ecx
jne 0x4aed8
movq -0x8(%r12), %rcx
testq %rcx, %rcx
je 0x4ade7
cmpq $0x0, -0x8(%rax)
je 0x4aed8
testq %rcx, %rcx
jne 0x4adf2
cmpq $0x0, -0x8(%rax)
jne 0x4aed8
addq $-0x28, %r12
addq $-0x28, %rax
jmp 0x4aeb3
callq 0x4f838
movq %rax, %r12
movq -0x30(%rbp), %rdi
callq 0x4f838
cmpq %rax, %r12
je 0x4aec0
movq -0x10(%r12), %rcx
cmpq -0x10(%rax), %rcx
jne 0x4aed8
movq 0x40(%rcx), %rcx
testq %rcx, %rcx
je 0x4aed8
movq %r12, %rdi
movq %rax, %rsi
callq *%rcx
testl %eax, %eax
je 0x4aec0
jmp 0x4aed8
xorl %edi, %eax
testb $0x1, %al
je 0x4aec0
jmp 0x4aed8
callq 0x4f838
movq %rax, %r12
movq -0x30(%rbp), %rdi
callq 0x4f838
movq %r12, %rdi
movq %rax, %rsi
callq 0x4515c
testl %eax, %eax
jne 0x4aec0
jmp 0x4aed8
callq 0x4f838
movq %rax, %r12
movq -0x30(%rbp), %rdi
callq 0x4f838
cmpq %rax, %r12
je 0x4aec0
movl -0x20(%rax), %ecx
xorl -0x20(%r12), %ecx
btl $0x10, %ecx
jb 0x4aed8
movl -0xc(%r12), %ecx
cmpl -0xc(%rax), %ecx
jne 0x4aed8
movl -0x10(%r12), %ecx
cmpl -0x10(%rax), %ecx
jne 0x4aed8
addq $-0x20, %r12
addq $-0x20, %rax
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x4aee9
movq %r14, %rdi
movq %r15, %rsi
callq 0x4aff6
testl %eax, %eax
je 0x4ad14
movl $0x1, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq