// File: /workspace/github_c_makefile_star2_O2/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 0x20fe4(%rip), %r14     # 0x676f0
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 0x468a5
cmpl $0xe, %eax
ja 0x46771
movl %eax, %eax
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
ucomisd %xmm1, %xmm0
jne 0x468a5
jnp 0x4688e
jmp 0x468a5
callq 0x4b1f1
movq %rax, %r13
movq %r12, %rdi
callq 0x4b1f1
cmpq %rax, %r13
je 0x4688e
jmp 0x468a5
callq 0x4b1f1
movq %rax, %r13
movq %r12, %rdi
callq 0x4b1f1
cmpq %rax, %r13
je 0x4688e
movl -0x14(%r13), %ecx
cmpl -0x14(%rax), %ecx
jne 0x468a5
movl -0x18(%r13), %ecx
cmpl -0x18(%rax), %ecx
jne 0x468a5
cmpq $0x0, -0x8(%r13)
movq -0x8(%rax), %rcx
je 0x46874
testq %rcx, %rcx
jne 0x46879
jmp 0x468a5
callq 0x4b1f1
movq %rax, %r13
movq %r12, %rdi
callq 0x4b1f1
movq %r13, %rdi
movq %rax, %rsi
callq 0x468b6
testl %eax, %eax
je 0x4688e
jmp 0x468a5
xorl %edi, %r12d
testb $0x1, %r12b
je 0x4688e
jmp 0x468a5
callq 0x4b1f1
movq %rax, %r13
movq %r12, %rdi
callq 0x4b1f1
movq %r13, %rdi
movq %rax, %rsi
callq 0x411da
testl %eax, %eax
jne 0x4688e
jmp 0x468a5
callq 0x4b1f1
movq %rax, %r13
movq %r12, %rdi
callq 0x4b1f1
cmpq %rax, %r13
je 0x4688e
movl -0x20(%rax), %ecx
xorl -0x20(%r13), %ecx
btl $0x10, %ecx
jb 0x468a5
movl -0xc(%r13), %ecx
cmpl -0xc(%rax), %ecx
jne 0x468a5
movl -0x10(%r13), %ecx
cmpl -0x10(%rax), %ecx
jne 0x468a5
addq $-0x20, %r13
addq $-0x20, %rax
jmp 0x46881
testq %rcx, %rcx
jne 0x468a5
addq $-0x28, %r13
addq $-0x28, %rax
movq %r13, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x468f0
leaq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0x469f5
testl %eax, %eax
je 0x4670e
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq