// File: /workspace/github_c_makefile_star2_O1/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, %r15
cmpl $0x1, %esi
jg 0x1f797
leaq 0xe63f(%rip), %rcx      # 0x2ddb1
movl $0x1, %r14d
movl $0x1, %esi
movq %r15, %rdx
callq 0x7454
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
cmpl $0x3, %esi
movq %rdi, -0x40(%rbp)
jne 0x1f7ca
movq 0x10(%r15), %r14
leaq 0x16b33(%rip), %rax     # 0x362e0
cmpq %rax, 0x8(%r14)
je 0x1f7ce
movq %r14, %rsi
movl $0x1, %edx
callq 0xd6d7
testl %eax, %eax
je 0x1f7ce
xorl %eax, %eax
xorl %ecx, %ecx
jmp 0x1f7d8
xorl %eax, %eax
jmp 0x1f7e2
imulq $0x3e8, 0x18(%r14), %rax # imm = 0x3E8
movb $0x1, %cl
movl $0x1, %r14d
testb %cl, %cl
je 0x1f785
movq %r15, -0x38(%rbp)
testq %rax, %rax
movl $0xf4240, %ecx          # imm = 0xF4240
cmovgq %rax, %rcx
movq %rcx, -0x30(%rbp)
leaq -0x50(%rbp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x6210
movq (%r14), %r15
movq 0x8(%r14), %r12
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x40(%rbp), %rdi
callq 0x9078
movl %eax, %r13d
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x6210
testl %r13d, %r13d
cmovnel %r13d, %r14d
jne 0x1f785
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
cmpl $0x1, %r13d
adcl $0x0, %ebx
subq %r12, %rcx
subq %r15, %rax
imulq $0xf4240, %rax, %r13    # imm = 0xF4240
addq %rcx, %r13
cmpq -0x30(%rbp), %r13
jl 0x1f80b
leaq -0x50(%rbp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x6210
movq (%r15), %rax
movq %rax, -0x30(%rbp)
movq 0x8(%r15), %rax
movq %rax, -0x38(%rbp)
cmpl $0x1, %ebx
movl %ebx, %r15d
adcl $0x0, %r15d
movq -0x40(%rbp), %rdi
movq 0x120(%rdi), %rsi
callq 0x9078
movl %eax, %r12d
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x6210
testl %r12d, %r12d
cmovnel %r12d, %r14d
jne 0x1f785
decl %r15d
jne 0x1f883
movq -0x30(%rbp), %rax
subq -0x50(%rbp), %rax
movq -0x38(%rbp), %rcx
addq %r13, %rcx
subq -0x48(%rbp), %rcx
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
addq %rax, %rcx
movq %rcx, -0x38(%rbp)
cvtsi2sd %rcx, %xmm1
cvtsi2sd %ebx, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
movq -0x40(%rbp), %r13
movq %r13, %rdi
callq 0xae58
movq %rax, %r15
leaq 0x16a5c(%rip), %rax     # 0x36358
movq %rax, 0x8(%r15)
xorl %r14d, %r14d
movq %r14, (%r15)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%r15)
leaq 0xe4b0(%rip), %rsi      # 0x2ddc7
movq %r13, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7695
movq %r13, %rdi
callq 0xae58
leaq 0x169ef(%rip), %r12     # 0x36330
movq %r12, 0x8(%rax)
movq %r14, (%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x18(%rax)
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7695
leaq 0xe46c(%rip), %rsi      # 0x2ddd3
movq %r13, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7695
movsd 0x8e76(%rip), %xmm0     # 0x28800
divsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movq %r13, %rdi
callq 0xae58
movq %r12, 0x8(%rax)
movq %r14, (%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x18(%rax)
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7695
leaq 0xc8af(%rip), %rsi      # 0x2c271
movq %r13, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7695
movl %ebx, %r12d
movq %r13, %rdi
callq 0xae58
leaq 0x168f1(%rip), %rbx     # 0x362e0
movq %rbx, 0x8(%rax)
movq %r14, (%rax)
movq %r12, 0x18(%rax)
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7695
leaq 0xe3d2(%rip), %rsi      # 0x2dde1
movq %r13, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7695
movq %r13, %rdi
callq 0xae58
movq %rbx, 0x8(%rax)
movq %r14, (%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7695
incl 0x10(%r15)
movq (%r13), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1fa6d
movq %r13, %rdi
callq 0x759a
movq %r15, (%r13)
jmp 0x1f785