// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: g_integer_decode_float
static s7_pointer g_integer_decode_float(s7_scheme *sc, s7_pointer args)
    {
#define H_integer_decode_float "(integer-decode-float x) returns a list containing the significand, exponent, and \
        sign of 'x' (1 = positive, -1 = negative).  (integer-decode-float 0.0): (0 0 1)"
#define Q_integer_decode_float s7_make_signature(sc, 2, sc->is_pair_symbol, sc->is_float_symbol)

        /* no matter what s7_double is, integer-decode-float acts as if x is a C double */

        typedef union {
            int64_t ix;
            double fx;
        } decode_float_t;

        decode_float_t num;
        s7_pointer x;
        x = car(args);

        switch (type(x))
        {
            case T_REAL:
                num.fx = (double)real(x);
                break;

#if WITH_GMP
            case T_BIG_REAL:
                num.fx = (double)s7_real(x);
                break;
#endif

            default:
                return(method_or_bust_with_type_one_arg(sc, x, sc->integer_decode_float_symbol, args, wrap_string(sc, "a non-rational real", 19)));
        }

        if (num.fx == 0.0)
            return(list_3(sc, small_int(0), small_int(0), small_int(1)));

        return(list_3(sc,
                    make_integer(sc, (s7_int)((num.ix & 0xfffffffffffffLL) | 0x10000000000000LL)),
                    make_integer(sc, (s7_int)(((num.ix & 0x7fffffffffffffffLL) >> 52) - 1023 - 52)),
                    make_integer(sc, ((num.ix & 0x8000000000000000LL) != 0) ? -1 : 1)));
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rcx
movq %rdi, %rbx
movq 0x8(%rsi), %rsi
cmpb $0xd, (%rsi)
jne 0x753d1
movsd 0x8(%rsi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7541f
jp 0x7541f
movq 0xd95ed(%rip), %r14     # 0x14e950
movq 0xd95ee(%rip), %r15     # 0x14e958
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r12
cmpq 0x98(%rbx), %rax
ja 0x75389
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movl $0x200001, %ecx         # imm = 0x200001
movq %rcx, (%rax)
movq %r15, 0x8(%rax)
movq %r12, 0x10(%rax)
movq 0x90(%rbx), %rdx
leaq -0x8(%rdx), %rsi
movq %rsi, 0x90(%rbx)
movq -0x8(%rdx), %rdx
movq %rcx, (%rdx)
movq %r14, 0x8(%rdx)
jmp 0x7558d
movq 0xfc0(%rbx), %rdx
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rdi
movq (%rax,%rdi,8), %r8
leal 0x1(%rdi), %eax
andl $0x7, %eax
movl %eax, 0x7dc(%rbx)
leaq 0xaf23b(%rip), %rax     # 0x124638
movq %rax, 0x10(%r8)
movq $0x13, 0x8(%r8)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x103001
movq %xmm0, %r12
movabsq $0xfffffffffffff, %rax  # imm = 0xFFFFFFFFFFFFF
movq %r12, %rcx
andq %rax, %rcx
leaq (%rcx,%rax), %r15
incq %r15
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x75453
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %r14
movq $0xb, (%r14)
movq %r15, 0x8(%r14)
movq %r12, %rax
shrq $0x34, %rax
movl $0x7ff, %ecx            # imm = 0x7FF
andq %rcx, %rax
leaq -0x433(%rax), %rbp
leaq 0xd94bf(%rip), %r13     # 0x14e950
cmpq %rcx, %rbp
ja 0x754a0
movq -0x2198(%r13,%rax,8), %r15
jmp 0x754d9
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x754b8
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %r15
movq $0xb, (%r15)
movq %rbp, 0x8(%r15)
movq %r12, %rbp
sarq $0x3f, %rbp
orq $0x1, %rbp
testq %r12, %r12
js 0x754f0
movq (%r13,%rbp,8), %r12
jmp 0x7552b
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x75508
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %r12
movq $0xb, (%r12)
movq %rbp, 0x8(%r12)
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r13
cmpq 0x98(%rbx), %rax
ja 0x7554a
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movl $0x200001, %ecx         # imm = 0x200001
movq %rcx, (%rax)
movq %r12, 0x8(%rax)
movq %r13, 0x10(%rax)
movq 0x90(%rbx), %rdx
leaq -0x8(%rdx), %rsi
movq %rsi, 0x90(%rbx)
movq -0x8(%rdx), %rdx
movq %rcx, (%rdx)
movq %r15, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rsi
movq %rsi, 0x90(%rbx)
movq -0x8(%rax), %rax
movq %rcx, (%rax)
movq %r14, 0x8(%rax)
movq %rdx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq