// File: /workspace/github_c_makefile_star2_O3/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 -0x30(%rbp), %rax
movq %rdi, (%rax)
leaq -0x38(%rbp), %r15
movq %rsi, (%r15)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movq 0x118(%rax), %rcx
movq %rcx, 0x108(%rax)
leaq 0x214cf(%rip), %r14     # 0x6b6d0
xorl %ebx, %ebx
movq -0x30(%rbp), %xmm0
movq %xmm0, %rdi
movq %rdi, %rax
shrq $0x2f, %rax
andl $0xf, %eax
ucomisd %xmm0, %xmm0
cmovnpl %ebx, %eax
movq -0x38(%rbp), %xmm1
movq %xmm1, %r12
movq %r12, %rcx
shrq $0x2f, %rcx
andl $0xf, %ecx
ucomisd %xmm1, %xmm1
cmovnpl %ebx, %ecx
cmpl %ecx, %eax
jne 0x4a3bd
cmpl $0xe, %eax
ja 0x4a266
movl %eax, %eax
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
ucomisd %xmm1, %xmm0
jne 0x4a3bd
jnp 0x4a3a4
jmp 0x4a3bd
callq 0x4ebc4
movq %rax, %r13
movq %r12, %rdi
callq 0x4ebc4
cmpq %rax, %r13
je 0x4a3a4
jmp 0x4a3bd
callq 0x4ebc4
movq %rax, %r13
movq %r12, %rdi
callq 0x4ebc4
cmpq %rax, %r13
je 0x4a3a4
movl -0x14(%r13), %ecx
cmpl -0x14(%rax), %ecx
jne 0x4a3bd
movl -0x18(%r13), %ecx
cmpl -0x18(%rax), %ecx
jne 0x4a3bd
cmpq $0x0, -0x8(%r13)
movq -0x8(%rax), %rcx
je 0x4a38a
testq %rcx, %rcx
jne 0x4a38f
jmp 0x4a3bd
callq 0x4ebc4
movq %rax, %r13
movq %r12, %rdi
callq 0x4ebc4
cmpq %rax, %r13
je 0x4a3a4
movq -0x10(%r13), %rcx
cmpq -0x10(%rax), %rcx
jne 0x4a3bd
movq 0x40(%rcx), %rcx
testq %rcx, %rcx
je 0x4a3bd
movq %r13, %rdi
movq %rax, %rsi
callq *%rcx
testl %eax, %eax
je 0x4a3a4
jmp 0x4a3bd
xorl %edi, %r12d
testb $0x1, %r12b
je 0x4a3a4
jmp 0x4a3bd
callq 0x4ebc4
movq %rax, %r13
movq %r12, %rdi
callq 0x4ebc4
movq %r13, %rdi
movq %rax, %rsi
callq 0x4481c
testl %eax, %eax
jne 0x4a3a4
jmp 0x4a3bd
callq 0x4ebc4
movq %rax, %r13
movq %r12, %rdi
callq 0x4ebc4
cmpq %rax, %r13
je 0x4a3a4
movl -0x20(%rax), %ecx
xorl -0x20(%r13), %ecx
btl $0x10, %ecx
jb 0x4a3bd
movl -0xc(%r13), %ecx
cmpl -0xc(%rax), %ecx
jne 0x4a3bd
movl -0x10(%r13), %ecx
cmpl -0x10(%rax), %ecx
jne 0x4a3bd
addq $-0x20, %r13
addq $-0x20, %rax
jmp 0x4a397
testq %rcx, %rcx
jne 0x4a3bd
addq $-0x28, %r13
addq $-0x28, %rax
movq %r13, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x4a3ce
leaq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0x4a4c7
testl %eax, %eax
je 0x4a203
movl $0x1, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq