// File: /workspace/github_c_makefile_star2_O0/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
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
cmpl $0x1, -0x14(%rbp)
jl 0x2de9f
cmpl $0x3, -0x14(%rbp)
jle 0x2dec4
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x1, %esi
leaq 0xf90b(%rip), %rcx      # 0x3d7be
callq 0x7880
movl $0x1, -0x4(%rbp)
jmp 0x2e0aa
cmpl $0x1, -0x14(%rbp)
jne 0x2deda
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, -0x30(%rbp)
jmp 0x2df54
cmpl $0x2, -0x14(%rbp)
jne 0x2df08
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x30(%rbp), %rdx
callq 0xf830
cmpl $0x0, %eax
je 0x2df06
movl $0x1, -0x4(%rbp)
jmp 0x2e0aa
jmp 0x2df52
cmpl $0x3, -0x14(%rbp)
jne 0x2df50
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x28(%rbp), %rdx
callq 0xf830
cmpl $0x0, %eax
jne 0x2df42
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x30(%rbp), %rdx
callq 0xf830
cmpl $0x0, %eax
je 0x2df4e
movl $0x1, -0x4(%rbp)
jmp 0x2e0aa
jmp 0x2df50
jmp 0x2df52
jmp 0x2df54
movq -0x30(%rbp), %rax
subq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jge 0x2dfcb
jmp 0x2df69
movq -0x10(%rbp), %rdi
leaq 0xf854(%rip), %rsi      # 0x3d7c8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7990
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x2dfb4
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x2e0aa
cmpq $0x0, -0x38(%rbp)
je 0x2dfe8
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cqto
idivq -0x38(%rbp)
movq %rdx, -0x60(%rbp)
jmp 0x2dff0
xorl %eax, %eax
movq %rax, -0x60(%rbp)
jmp 0x2dff0
movq -0x60(%rbp), %rcx
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
subq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x8, %edx
callq 0x23ea0
cmpq $0x0, -0x50(%rbp)
jl 0x2e028
movq -0x50(%rbp), %rax
cmpq -0x40(%rbp), %rax
jl 0x2e02a
jmp 0x2e005
cmpq $0x0, -0x38(%rbp)
jne 0x2e03b
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x68(%rbp)
jmp 0x2e049
movq -0x50(%rbp), %rax
cqto
idivq -0x38(%rbp)
movq %rdx, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq -0x50(%rbp), %rsi
callq 0x8d60
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x2e098
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x58(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)