// File: /workspace/github_c_makefile_star2_O2/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, -0x60(%rbp)
leaq -0x170(%rbp), %rbx
movq %rdx, 0x10(%rbx)
movq %rcx, 0x18(%rbx)
movq %r8, 0x20(%rbx)
movq %r9, 0x28(%rbx)
testb %al, %al
je 0x6915
movaps %xmm0, -0x140(%rbp)
movaps %xmm1, -0x130(%rbp)
movaps %xmm2, -0x120(%rbp)
movaps %xmm3, -0x110(%rbp)
movaps %xmm4, -0x100(%rbp)
movaps %xmm5, -0xf0(%rbp)
movaps %xmm6, -0xe0(%rbp)
movaps %xmm7, -0xd0(%rbp)
movq %rsi, %rdi
callq 0x6180
movq %rax, %r13
movq %rbx, -0x30(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
xorl %ebx, %ebx
xorl %r12d, %r12d
xorl %edx, %edx
movq %r13, -0x68(%rbp)
cmpl %r13d, %r12d
jge 0x6a39
cmpl $0x4, %ebx
jg 0x6a39
movslq %r12d, %rcx
movb (%r14,%rcx), %al
cmpb $0x25, %al
jne 0x69bd
cmpb $0x73, 0x1(%r14,%rcx)
movslq %ebx, %r15
jne 0x6991
movl -0x40(%rbp), %ecx
cmpq $0x28, %rcx
movq %rdx, -0x58(%rbp)
ja 0x69c9
movq %rcx, %rax
addq -0x30(%rbp), %rax
addl $0x8, %ecx
movl %ecx, -0x40(%rbp)
jmp 0x69d5
cmpb $0x23, 0x1(%r14,%rcx)
jne 0x69bd
cmpb $0x73, 0x2(%r14,%rcx)
jne 0x69bd
movl -0x40(%rbp), %ecx
cmpq $0x28, %rcx
movq %rdx, -0x58(%rbp)
ja 0x69f4
movq %rcx, %rax
addq -0x30(%rbp), %rax
addl $0x8, %ecx
movl %ecx, -0x40(%rbp)
jmp 0x6a00
xorl %ecx, %ecx
cmpb $0x25, %al
sete %cl
addl %ecx, %r12d
jmp 0x69ec
movq -0x38(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x38(%rbp)
movq (%rax), %rdi
movq %rdi, -0x90(%rbp,%r15,8)
callq 0x6180
incl %ebx
addl -0x58(%rbp), %eax
movl %eax, %edx
incl %r12d
jmp 0x694d
movq -0x38(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x38(%rbp)
movq (%rax), %r13
movq %r13, %rdi
leaq -0x4c(%rbp), %rsi
callq 0x7fc7
movq %rax, -0x90(%rbp,%r15,8)
movq -0x48(%rbp), %rcx
movslq %ecx, %rax
incl %ecx
movq %rcx, -0x48(%rbp)
movq %r13, -0xc0(%rbp,%rax,8)
incl 0x10(%r13)
movl -0x4c(%rbp), %eax
movq -0x68(%rbp), %r13
jmp 0x69e5
leal (%rdx,%r13), %eax
incl %eax
movslq %eax, %r15
xorl %ebx, %ebx
xorl %edi, %edi
movq %r15, %rsi
callq *0x2c839(%rip)          # 0x33288
movq %rax, %r13
movq -0x90(%rbp), %rcx
movq -0x88(%rbp), %r8
movq -0x80(%rbp), %r9
movups -0x78(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x61e0
movq -0x60(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0xa654
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 0x6aac
movq %r15, %rdi
callq 0x73bf
movq %r14, (%r15)
movq -0x48(%rbp), %r14
testl %r14d, %r14d
cmovlel %ebx, %r14d
cmpq %rbx, %r14
je 0x6ae2
movq -0xc0(%rbp,%rbx,8), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x6add
movq %r15, %rdi
callq 0x73bf
incq %rbx
jmp 0x6aba
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq