// File: /workspace/github_c_makefile_star2_O3/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_TimeRateCoreCommand
static int Jim_TimeRateCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
    long us = 0;
    jim_wide start, delta, overhead;
    Jim_Obj *objPtr;
    double us_per_iter;
    int count;
    int n;

    if (argc < 2) {
        Jim_WrongNumArgs(interp, 1, argv, "script ?milliseconds?");
        return JIM_ERR;
    }
    if (argc == 3) {
        if (Jim_GetLong(interp, argv[2], &us) != JIM_OK)
            return JIM_ERR;
        us *= 1000;
    }
    if (us < 1) {

        us = 1000 * 1000;
    }


    start = Jim_GetTimeUsec(CLOCK_MONOTONIC_RAW);
    count = 0;
    do {
        int retval = Jim_EvalObj(interp, argv[1]);
        delta = Jim_GetTimeUsec(CLOCK_MONOTONIC_RAW) - start;
        if (retval != JIM_OK) {
            return retval;
        }
        count++;
    } while (delta < us);


    start = Jim_GetTimeUsec(CLOCK_MONOTONIC_RAW);
    n = 0;
    do {
        int retval = Jim_EvalObj(interp, interp->nullScriptObj);
        overhead = Jim_GetTimeUsec(CLOCK_MONOTONIC_RAW) - start;
        if (retval != JIM_OK) {
            return retval;
        }
        n++;
    } while (n < count);

    delta -= overhead;

    us_per_iter = (double)delta / count;
    objPtr = Jim_NewListObj(interp, NULL, 0);

    Jim_ListAppendElement(interp, objPtr, Jim_NewStringObj(interp, "us_per_iter", -1));
    Jim_ListAppendElement(interp, objPtr, Jim_NewDoubleObj(interp, us_per_iter));
    Jim_ListAppendElement(interp, objPtr, Jim_NewStringObj(interp, "iters_per_sec", -1));
    Jim_ListAppendElement(interp, objPtr, Jim_NewDoubleObj(interp, 1e6 / us_per_iter));
    Jim_ListAppendElement(interp, objPtr, Jim_NewStringObj(interp, "count", -1));
    Jim_ListAppendElement(interp, objPtr, Jim_NewIntObj(interp, count));
    Jim_ListAppendElement(interp, objPtr, Jim_NewStringObj(interp, "elapsed_us", -1));
    Jim_ListAppendElement(interp, objPtr, Jim_NewIntObj(interp, delta));
    Jim_SetResult(interp, objPtr);
    return JIM_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rdi, %r15
cmpl $0x1, %esi
jg 0x1f06a
leaq 0xdd11(%rip), %rcx      # 0x2cd53
movl $0x1, %r14d
movq %r15, %rdi
movl $0x1, %esi
movq %rbx, %rdx
callq 0x7446
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3, %esi
jne 0x1f0b2
movq 0x10(%rbx), %r12
leaq 0x16276(%rip), %rax     # 0x352f0
cmpq %rax, 0x8(%r12)
je 0x1f09b
movl $0x1, %r14d
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0xd6c3
testl %eax, %eax
jne 0x1f058
movq 0x18(%r12), %rax
testq %rax, %rax
jle 0x1f0b2
movq %rbx, -0x30(%rbp)
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
jmp 0x1f0bb
movq %rbx, -0x30(%rbp)
movl $0xf4240, %eax          # imm = 0xF4240
movq %rax, -0x38(%rbp)
xorl %r13d, %r13d
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6210
movq (%rbx), %rax
movq %rax, -0x50(%rbp)
movq 0x8(%rbx), %rbx
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x908a
movl %eax, %r14d
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
callq 0x6210
testl %r14d, %r14d
jne 0x1f058
movq -0x48(%rbp), %rax
subq -0x50(%rbp), %rax
movq -0x40(%rbp), %rcx
subq %rbx, %rcx
imulq $0xf4240, %rax, %r12    # imm = 0xF4240
addq %rcx, %r12
incq %r13
cmpq -0x38(%rbp), %r12
jl 0x1f0db
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6210
movq (%rbx), %rax
movq %rax, -0x38(%rbp)
movq 0x8(%rbx), %rax
movq %rax, -0x30(%rbp)
movl %r13d, %ebx
movq %r15, %rdi
movq 0x120(%r15), %rsi
callq 0x908a
movl %eax, %r14d
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
callq 0x6210
testl %r14d, %r14d
jne 0x1f058
decl %ebx
jne 0x1f144
movq -0x38(%rbp), %rax
subq -0x48(%rbp), %rax
movq -0x30(%rbp), %rbx
addq %r12, %rbx
subq -0x40(%rbp), %rbx
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
addq %rax, %rbx
cvtsi2sd %rbx, %xmm1
cvtsi2sd %r13d, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
movq %r15, %r12
movq %r15, %rdi
callq 0xae38
movq %rax, %r15
leaq 0x161b5(%rip), %rax     # 0x35368
movq %rax, 0x8(%r15)
xorl %r14d, %r14d
movq %r14, (%r15)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%r15)
leaq 0xdb9b(%rip), %rsi      # 0x2cd69
movq %r12, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7683
movq %r12, %rdi
callq 0xae38
leaq 0x16148(%rip), %rcx     # 0x35340
movq %rcx, 0x8(%rax)
movq %r14, (%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x18(%rax)
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7683
leaq 0xdb57(%rip), %rsi      # 0x2cd75
movq %r12, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7683
movsd 0x8567(%rip), %xmm0     # 0x277a8
divsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movq %r12, %rdi
callq 0xae38
leaq 0x160e6(%rip), %rcx     # 0x35340
movq %rcx, 0x8(%rax)
movq %r14, (%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x18(%rax)
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7683
leaq 0xbf99(%rip), %rsi      # 0x2b219
movq %r12, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7683
movq %r12, %rdi
callq 0xae38
leaq 0x16046(%rip), %rcx     # 0x352f0
movq %rcx, 0x8(%rax)
movq %r14, (%rax)
movq %r13, 0x18(%rax)
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7683
leaq 0xdab9(%rip), %rsi      # 0x2cd83
movq %r12, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7683
movq %r12, %rdi
callq 0xae38
leaq 0x15ffc(%rip), %rcx     # 0x352f0
movq %rcx, 0x8(%rax)
movq %r14, (%rax)
movq %rbx, 0x18(%rax)
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7683
incl 0x10(%r15)
movq (%r12), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1f32b
movq %r12, %rdi
callq 0x758c
movq %r15, (%r12)
jmp 0x1f058