// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: inexact_to_exact
static s7_pointer inexact_to_exact(s7_scheme *sc, s7_pointer x, bool with_error)
    {
        switch (type(x))
        {
            case T_INTEGER:
            case T_RATIO:
                return(x);

            case T_REAL:
                {
                    s7_int numer = 0, denom = 1;
                    s7_double val;

                    val = real(x); /* no fall through */
                    if ((is_inf(val)) || (is_NaN(val)))
                    {
                        if (with_error)
                            return(simple_wrong_type_argument_with_type(sc, sc->inexact_to_exact_symbol, x, a_normal_real_string));
                        return(sc->nil);
                    }

                    if ((val > s7_int_max) ||
                            (val < s7_int_min))
                    {
                        if (with_error)
                            return(simple_out_of_range(sc, sc->inexact_to_exact_symbol, x, its_too_large_string));
                        return(sc->nil);
                    }

                    if (c_rationalize(val, sc->default_rationalize_error, &numer, &denom))
                        return(s7_make_ratio(sc, numer, denom));
                }

            default:
                if (with_error)
                    return(method_or_bust_one_arg(sc, x, sc->inexact_to_exact_symbol, list_1(sc, x), T_REAL));
                return(sc->nil);
        }
        return(x);
    }

// Assembly:
subq $0x78, %rsp
movb %dl, %al
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
andb $0x1, %al
movb %al, 0x5f(%rsp)
movq 0x60(%rsp), %rax
movzbl (%rax), %eax
movl %eax, 0x1c(%rsp)
addl $-0xb, %eax
subl $0x2, %eax
jb 0x1c1a0a
jmp 0x1c19fc
movl 0x1c(%rsp), %eax
subl $0xd, %eax
je 0x1c1a19
jmp 0x1c1bae
movq 0x60(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x1c1ca7
movq $0x0, 0x50(%rsp)
movq $0x1, 0x48(%rsp)
movq 0x60(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x40(%rsp), %xmm1
movaps %xmm1, %xmm0
movaps 0x20055(%rip), %xmm2    # 0x1e1aa0
pand %xmm2, %xmm0
movq %xmm1, %rdx
movl $0x1, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x0, %rdx
cmovll %eax, %ecx
movsd 0x1ff03(%rip), %xmm1    # 0x1e1970
xorl %eax, %eax
ucomisd %xmm1, %xmm0
setnp %sil
sete %dl
testb %sil, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
jne 0x1c1a96
movsd 0x40(%rsp), %xmm0
callq 0x13860
testb $0x1, %al
jne 0x1c1a96
jmp 0x1c1aef
testb $0x1, 0x5f(%rsp)
je 0x1c1ad9
movq 0x68(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0xf98(%rax), %rax
movq 0x8(%rax), %rsi
movq 0x60(%rsp), %rdx
movq 0x68(%rsp), %rax
movq 0x140(%rax), %rcx
movq 0x58a9e(%rip), %r8      # 0x21a568
callq 0x14a60
movq %rax, 0x70(%rsp)
jmp 0x1c1ca7
movq 0x68(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x1c1ca7
movsd 0x40(%rsp), %xmm0
cvtsi2sdq 0x58c3a(%rip), %xmm1 # 0x21a738
ucomisd %xmm1, %xmm0
ja 0x1c1b19
movsd 0x40(%rsp), %xmm1
cvtsi2sdq 0x58a45(%rip), %xmm0 # 0x21a558
ucomisd %xmm1, %xmm0
jbe 0x1c1b66
testb $0x1, 0x5f(%rsp)
je 0x1c1b50
movq 0x68(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0xf98(%rax), %rax
movq 0x8(%rax), %rsi
movq 0x60(%rsp), %rdx
movq 0x58a2f(%rip), %rcx     # 0x21a570
callq 0x45240
movq %rax, 0x70(%rsp)
jmp 0x1c1ca7
movq 0x68(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x1c1ca7
movsd 0x40(%rsp), %xmm0
movq 0x68(%rsp), %rax
movsd 0x258(%rax), %xmm1
leaq 0x50(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x114e0
testb $0x1, %al
jne 0x1c1b8e
jmp 0x1c1bac
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x11a80
movq %rax, 0x70(%rsp)
jmp 0x1c1ca7
jmp 0x1c1bae
testb $0x1, 0x5f(%rsp)
je 0x1c1c96
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rax
movq 0xf98(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x68(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x68(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x1c1c1c
movq 0x68(%rsp), %rdi
callq 0xc670
movq 0x68(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq (%rsp), %rdi
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x28(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x38(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rcx
movl $0xd, %r8d
callq 0xcfd30
movq %rax, 0x70(%rsp)
jmp 0x1c1ca7
movq 0x68(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)