// File: /workspace/github_c_makefile_star2_O3/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
movq %rdx, %r14
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, -0x38(%rbp)
movq %rax, -0x30(%rbp)
leal -0x4(%rsi), %eax
cmpl $-0x4, %eax
ja 0x21615
leaq 0xbe03(%rip), %rcx      # 0x2d3fd
movl $0x1, %r15d
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x7446
jmp 0x21787
cmpl $0x2, %esi
je 0x21633
cmpl $0x1, %esi
jne 0x216bb
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, -0x30(%rbp)
jmp 0x21651
movq 0x8(%r14), %rsi
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
callq 0xd7f8
movl $0x1, %r15d
testl %eax, %eax
jne 0x21787
xorl %eax, %eax
movq -0x30(%rbp), %r13
movq %r13, %r15
subq %rax, %r15
js 0x216fa
movabsq $0x7fffffffffffffff, %r12 # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, -0x40(%rbp)
je 0x21685
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
xorl %edx, %edx
divq %r15
xorq %rdx, %r12
leaq -0x48(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x1a873
movq (%r14), %rax
testq %rax, %rax
js 0x21685
cmpq %r12, %rax
jge 0x21685
movq -0x40(%rbp), %rcx
cmpq %rcx, %r13
jne 0x21738
xorl %r15d, %r15d
jmp 0x21740
movq 0x8(%r14), %rsi
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
callq 0xd7f8
movl $0x1, %r15d
testl %eax, %eax
jne 0x21787
movq 0x10(%r14), %rsi
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
callq 0xd7f8
testl %eax, %eax
jne 0x21787
movq -0x38(%rbp), %rax
jmp 0x21653
leaq 0xbd06(%rip), %rsi      # 0x2d407
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
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 0x2172d
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
movl $0x1, %r15d
jmp 0x21787
xorl %edx, %edx
divq %r15
movq %rdx, %r15
addq %rcx, %r15
movq %rbx, %rdi
callq 0xae38
movq %rax, %r14
leaq 0x13b9b(%rip), %rax     # 0x352f0
movq %rax, 0x8(%r14)
movq $0x0, (%r14)
movq %r15, 0x18(%r14)
incl 0x10(%r14)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x21781
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq