// File: /workspace/github_c_makefile_star2_O3/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_SetResultFormatted
void Jim_SetResultFormatted(Jim_Interp *interp, const char *format, ...)
{

    int len = strlen(format);
    int extra = 0;
    int n = 0;
    const char *params[5];
    int nobjparam = 0;
    Jim_Obj *objparam[5];
    char *buf;
    va_list args;
    int i;

    va_start(args, format);

    for (i = 0; i < len && n < 5; i++) {
        int l;

        if (strncmp(format + i, "%s", 2) == 0) {
            params[n] = va_arg(args, char *);

            l = strlen(params[n]);
        }
        else if (strncmp(format + i, "%#s", 3) == 0) {
            Jim_Obj *objPtr = va_arg(args, Jim_Obj *);

            params[n] = Jim_GetString(objPtr, &l);
            objparam[nobjparam++] = objPtr;
            Jim_IncrRefCount(objPtr);
        }
        else {
            if (format[i] == '%') {
                i++;
            }
            continue;
        }
        n++;
        extra += l;
    }

    len += extra;
    buf = Jim_Alloc(len + 1);
    len = snprintf(buf, len + 1, format, params[0], params[1], params[2], params[3], params[4]);

    va_end(args);

    Jim_SetResult(interp, Jim_NewStringObjNoAlloc(interp, buf, len));

    for (i = 0; i < nobjparam; i++) {
        Jim_DecrRefCount(interp, objparam[i]);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rsi, %r14
movq %rdi, -0x70(%rbp)
leaq -0x180(%rbp), %rbx
movq %rdx, 0x10(%rbx)
movq %rcx, 0x18(%rbx)
movq %r8, 0x20(%rbx)
movq %r9, 0x28(%rbx)
testb %al, %al
je 0x6991
movaps %xmm0, -0x150(%rbp)
movaps %xmm1, -0x140(%rbp)
movaps %xmm2, -0x130(%rbp)
movaps %xmm3, -0x120(%rbp)
movaps %xmm4, -0x110(%rbp)
movaps %xmm5, -0x100(%rbp)
movaps %xmm6, -0xf0(%rbp)
movaps %xmm7, -0xe0(%rbp)
movq %rsi, %rdi
callq 0x6180
movq %rax, %r15
movq %rbx, -0x40(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, -0x50(%rbp)
testl %r15d, %r15d
jle 0x6af1
xorl %r12d, %r12d
xorl %ebx, %ebx
xorl %r13d, %r13d
movl $0x0, -0x2c(%rbp)
movslq %ebx, %rcx
movb (%r14,%rcx), %al
cmpb $0x25, %al
jne 0x6a25
cmpb $0x73, 0x1(%r14,%rcx)
jne 0x69f9
movl -0x50(%rbp), %ecx
cmpq $0x28, %rcx
ja 0x6a30
movq %rcx, %rax
addq -0x40(%rbp), %rax
addl $0x8, %ecx
movl %ecx, -0x50(%rbp)
jmp 0x6a3c
cmpb $0x23, 0x1(%r14,%rcx)
jne 0x6a25
cmpb $0x73, 0x2(%r14,%rcx)
jne 0x6a25
movl -0x50(%rbp), %ecx
cmpq $0x28, %rcx
movq %r12, -0x58(%rbp)
ja 0x6a6b
movq %rcx, %rax
addq -0x40(%rbp), %rax
addl $0x8, %ecx
movl %ecx, -0x50(%rbp)
jmp 0x6a77
xorl %ecx, %ecx
cmpb $0x25, %al
sete %cl
addl %ecx, %ebx
jmp 0x6a58
movq -0x48(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x48(%rbp)
movq (%rax), %rdi
movslq %r13d, %rax
movq %rdi, -0xa0(%rbp,%rax,8)
callq 0x6180
incl %r13d
addl %r12d, %eax
movl %eax, %r12d
incl %ebx
cmpl %r15d, %ebx
jge 0x6ac0
cmpl $0x5, %r13d
jl 0x69ce
jmp 0x6ac0
movq -0x48(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x48(%rbp)
movq (%rax), %r12
movq (%r12), %rcx
testq %rcx, %rcx
jne 0x6a92
movq 0x8(%r12), %rax
movq %r12, %rdi
callq *0x18(%rax)
movq (%r12), %rcx
movl 0x14(%r12), %eax
movslq %r13d, %rdx
movq %rcx, -0xa0(%rbp,%rdx,8)
movl -0x2c(%rbp), %edx
movslq %edx, %rcx
incl %edx
movl %edx, -0x2c(%rbp)
movq %r12, -0xd0(%rbp,%rcx,8)
incl 0x10(%r12)
movq -0x58(%rbp), %r12
jmp 0x6a4f
movq %r12, %rax
movq -0xa0(%rbp), %r12
movq -0x98(%rbp), %rcx
movq %rcx, -0x60(%rbp)
movq -0x90(%rbp), %rcx
movq %rcx, -0x68(%rbp)
movq -0x88(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movq -0x80(%rbp), %rbx
jmp 0x6afa
movl $0x0, -0x2c(%rbp)
xorl %eax, %eax
addl %r15d, %eax
incl %eax
movslq %eax, %r15
xorl %edi, %edi
movq %r15, %rsi
callq *0x3077b(%rip)          # 0x37288
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
movq -0x60(%rbp), %r8
movq -0x68(%rbp), %r9
xorl %eax, %eax
pushq %rbx
pushq -0x58(%rbp)
callq 0x61e0
addq $0x10, %rsp
movq -0x70(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0xaee8
movq %rax, %r14
incl 0x10(%rax)
movq (%r15), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x6b63
movq %r15, %rdi
callq 0x758c
movq %r14, (%r15)
movl -0x2c(%rbp), %eax
testl %eax, %eax
jle 0x6b98
movl %eax, %ebx
xorl %r14d, %r14d
movq -0xd0(%rbp,%r14,8), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x6b90
movq %r15, %rdi
callq 0x758c
incq %r14
cmpq %r14, %rbx
jne 0x6b72
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq