// File: /workspace/github_c_makefile_star2_O1/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 %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 0x6998
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, -0x58(%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 0x6ad8
xorl %r12d, %r12d
xorl %ebx, %ebx
xorl %r14d, %r14d
movl $0x0, -0x2c(%rbp)
movslq %ebx, %r13
addq -0x58(%rbp), %r13
movl $0x2, %edx
movq %r13, %rdi
leaq 0x25d8c(%rip), %rsi     # 0x2c77b
callq 0x60b0
testl %eax, %eax
je 0x6a21
movl $0x3, %edx
movq %r13, %rdi
leaq 0x27bb3(%rip), %rsi     # 0x2e5ba
callq 0x60b0
testl %eax, %eax
je 0x6a39
xorl %eax, %eax
cmpb $0x25, (%r13)
sete %al
addl %eax, %ebx
jmp 0x6ac5
movl -0x50(%rbp), %ecx
cmpq $0x28, %rcx
ja 0x6a51
movq %rcx, %rax
addq -0x40(%rbp), %rax
addl $0x8, %ecx
movl %ecx, -0x50(%rbp)
jmp 0x6a5d
movl -0x50(%rbp), %ecx
cmpq $0x28, %rcx
ja 0x6a72
movq %rcx, %rax
addq -0x40(%rbp), %rax
addl $0x8, %ecx
movl %ecx, -0x50(%rbp)
jmp 0x6a7e
movq -0x48(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x48(%rbp)
movq (%rax), %rdi
movslq %r14d, %rax
movq %rdi, -0x90(%rbp,%rax,8)
callq 0x6180
jmp 0x6abc
movq -0x48(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x48(%rbp)
movq (%rax), %r13
cmpq $0x0, (%r13)
jne 0x6a92
movq 0x8(%r13), %rax
movq %r13, %rdi
callq *0x18(%rax)
movl 0x14(%r13), %eax
movq (%r13), %rcx
movslq %r14d, %rdx
movq %rcx, -0x90(%rbp,%rdx,8)
movl -0x2c(%rbp), %edx
movslq %edx, %rcx
incl %edx
movl %edx, -0x2c(%rbp)
movq %r13, -0xc0(%rbp,%rcx,8)
incl 0x10(%r13)
incl %r14d
addl %r12d, %eax
movl %eax, %r12d
incl %ebx
cmpl %r15d, %ebx
jge 0x6ae2
cmpl $0x5, %r14d
jl 0x69d9
jmp 0x6ae2
movl $0x0, -0x2c(%rbp)
xorl %r12d, %r12d
leal (%r15,%r12), %eax
incl %eax
movslq %eax, %r15
xorl %edi, %edi
movq %r15, %rsi
callq *0x31792(%rip)          # 0x38288
movq %rax, %r12
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 -0x58(%rbp), %rdx
xorl %eax, %eax
callq 0x61e0
movq -0x60(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0xaf08
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 0x6b54
movq %r15, %rdi
callq 0x759a
movq %r14, (%r15)
movl -0x2c(%rbp), %eax
testl %eax, %eax
jle 0x6b89
movl %eax, %ebx
xorl %r14d, %r14d
movq -0xc0(%rbp,%r14,8), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x6b81
movq %r15, %rdi
callq 0x759a
incq %r14
cmpq %r14, %rbx
jne 0x6b63
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq