// File: /workspace/github_c_makefile_star2_O2/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_RandCoreCommand
static int Jim_RandCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
    jim_wide min = 0, max = 0, len, maxMul;

    if (argc < 1 || argc > 3) {
        Jim_WrongNumArgs(interp, 1, argv, "?min? max");
        return JIM_ERR;
    }
    if (argc == 1) {
        max = JIM_WIDE_MAX;
    } else if (argc == 2) {
        if (Jim_GetWideExpr(interp, argv[1], &max) != JIM_OK)
            return JIM_ERR;
    } else if (argc == 3) {
        if (Jim_GetWideExpr(interp, argv[1], &min) != JIM_OK ||
            Jim_GetWideExpr(interp, argv[2], &max) != JIM_OK)
            return JIM_ERR;
    }
    len = max-min;
    if (len < 0) {
        Jim_SetResultString(interp, "Invalid arguments (max < min)", -1);
        return JIM_ERR;
    }
    maxMul = JIM_WIDE_MAX - (len ? (JIM_WIDE_MAX%len) : 0);
    while (1) {
        jim_wide r;

        JimRandomBytes(interp, &r, sizeof(jim_wide));
        if (r < 0 || r >= maxMul) continue;
        r = (len == 0) ? 0 : r%len;
        Jim_SetResultInt(interp, min+r);
        return JIM_OK;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
andq $0x0, -0x38(%rbp)
movq %rdx, %r15
andq $0x0, -0x30(%rbp)
movq %rdi, %rbx
leal -0x4(%rsi), %eax
cmpl $-0x4, %eax
ja 0x1e8da
leaq 0xab8a(%rip), %rcx      # 0x2944d
pushq $0x1
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rdx
callq 0x72a5
jmp 0x1ea13
movabsq $0x7fffffffffffffff, %r12 # imm = 0x7FFFFFFFFFFFFFFF
pushq $0x1
popq %r14
cmpl $0x2, %esi
je 0x1e8f8
cmpl $0x1, %esi
jne 0x1e970
movq %r12, -0x30(%rbp)
jmp 0x1e910
movq 0x8(%r15), %rsi
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
callq 0xcace
testl %eax, %eax
jne 0x1ea13
xorl %eax, %eax
movq -0x30(%rbp), %rcx
movq %rcx, %r13
subq %rax, %r13
js 0x1e9a5
movq %rax, -0x48(%rbp)
movq %rcx, -0x40(%rbp)
je 0x1e93e
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
xorl %edx, %edx
divq %r13
xorq %rdx, %r12
leaq -0x50(%rbp), %r14
pushq $0x8
popq %r15
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x183bd
movq -0x50(%rbp), %rax
testq %rax, %rax
js 0x1e946
cmpq %r12, %rax
jge 0x1e946
movq -0x48(%rbp), %rcx
cmpq %rcx, -0x40(%rbp)
jne 0x1e9db
xorl %esi, %esi
jmp 0x1e9e3
movq 0x8(%r15), %rsi
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
callq 0xcace
testl %eax, %eax
jne 0x1ea13
movq 0x10(%r15), %rsi
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
callq 0xcace
testl %eax, %eax
jne 0x1ea13
movq -0x38(%rbp), %rax
jmp 0x1e912
leaq 0xaaab(%rip), %rsi      # 0x29457
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x7363
movq %rax, %r15
incl 0x10(%rax)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1e9d6
movq %rbx, %rdi
callq 0x73bf
movq %r15, (%rbx)
jmp 0x1ea13
xorl %edx, %edx
divq %r13
movq %rdx, %rsi
addq %rcx, %rsi
movq %rbx, %rdi
callq 0x8212
movq %rax, %r14
incl 0x10(%rax)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1ea0d
movq %rbx, %rdi
callq 0x73bf
movq %r14, (%rbx)
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq