// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/inttypes.c
// Function: cfun_it_u64_compare
static Janet cfun_it_u64_compare(int32_t argc, Janet *argv) {
    janet_fixarity(argc, 2);
    if (janet_is_int(argv[0]) != JANET_INT_U64) {
        janet_panic("compare method requires int/u64 as first argument");
    }
    uint64_t x = janet_unwrap_u64(argv[0]);
    switch (janet_type(argv[1])) {
        default:
            break;
        case JANET_NUMBER : {
            double y = janet_unwrap_number(argv[1]);
            return janet_wrap_number(compare_uint64_double(x, y));
        }
        case JANET_ABSTRACT: {
            void *abst = janet_unwrap_abstract(argv[1]);
            if (janet_abstract_type(abst) == &janet_u64_type) {
                uint64_t y = *(uint64_t *)abst;
                return janet_wrap_number((x < y) ? -1 : (x > y ? 1 : 0));
            } else if (janet_abstract_type(abst) == &janet_s64_type) {
                int64_t y = *(int64_t *)abst;
                if (y < 0) {
                    return janet_wrap_number(1);
                } else if (x > INT64_MAX) {
                    return janet_wrap_number(1);
                } else {
                    int64_t x2 = (int64_t) x;
                    return janet_wrap_number((x2 < y) ? -1 : (x2 > y ? 1 : 0));
                }
            }
            break;
        }
    }
    return janet_wrap_nil();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movl -0xc(%rbp), %edi
movl $0x2, %esi
callq 0x1ae00
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x3b7c0
cmpl $0x2, %eax
je 0x3dc09
leaq 0x4d41b(%rip), %rdi     # 0x8b01f
callq 0x1ad60
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x3b600
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movsd 0x8(%rax), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x3dc2f
jmp 0x3dc44
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x2f, %rax
andq $0xf, %rax
movl %eax, -0x4c(%rbp)
jmp 0x3dc4b
xorl %eax, %eax
movl %eax, -0x4c(%rbp)
jmp 0x3dc4b
movl -0x4c(%rbp), %eax
movl %eax, -0x50(%rbp)
testl %eax, %eax
je 0x3dc66
jmp 0x3dc57
movl -0x50(%rbp), %eax
subl $0xe, %eax
je 0x3dc94
jmp 0x3dc61
jmp 0x3ddac
movq -0x18(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
callq 0x3ddd0
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x8(%rbp)
jmp 0x3ddbf
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7b260
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
leaq 0x6f020(%rip), %rcx     # 0xaccd0
cmpq %rcx, -0x10(%rax)
jne 0x3dd02
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x3dcd5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x54(%rbp)
jmp 0x3dced
movq -0x20(%rbp), %rdx
movq -0x38(%rbp), %rsi
xorl %eax, %eax
movl $0x1, %ecx
cmpq %rsi, %rdx
cmoval %ecx, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x8(%rbp)
jmp 0x3ddbf
movq -0x30(%rbp), %rax
leaq 0x6ef53(%rip), %rcx     # 0xacc60
cmpq %rcx, -0x10(%rax)
jne 0x3dda8
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jge 0x3dd3f
movsd 0x435ef(%rip), %xmm0    # 0x81320
callq 0x7b820
movq %rax, -0x8(%rbp)
jmp 0x3ddbf
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, -0x20(%rbp)
jbe 0x3dd62
movsd 0x435c9(%rip), %xmm0    # 0x81320
callq 0x7b820
movq %rax, -0x8(%rbp)
jmp 0x3ddbf
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
jge 0x3dd7e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x58(%rbp)
jmp 0x3dd96
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rsi
xorl %eax, %eax
movl $0x1, %ecx
cmpq %rsi, %rdx
cmovgl %ecx, %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x8(%rbp)
jmp 0x3ddbf
jmp 0x3ddaa
jmp 0x3ddac
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x7b460
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)