// File: /workspace/github_c_makefile_star2_O1/msteveb[P]autosetup/./jimsh0.c
// Function: JimInterpolateTokens
static Jim_Obj *JimInterpolateTokens(Jim_Interp *interp, const ScriptToken * token, int tokens, int flags)
{
    int totlen = 0, i;
    Jim_Obj **intv;
    Jim_Obj *sintv[JIM_EVAL_SINTV_LEN];
    Jim_Obj *objPtr;
    char *s;

    if (tokens <= JIM_EVAL_SINTV_LEN)
        intv = sintv;
    else
        intv = Jim_Alloc(sizeof(Jim_Obj *) * tokens);

    for (i = 0; i < tokens; i++) {
        switch (JimSubstOneToken(interp, &token[i], &intv[i])) {
            case JIM_OK:
            case JIM_RETURN:
                break;
            case JIM_BREAK:
                if (flags & JIM_SUBST_FLAG) {

                    tokens = i;
                    continue;
                }


            case JIM_CONTINUE:
                if (flags & JIM_SUBST_FLAG) {
                    intv[i] = NULL;
                    continue;
                }


            default:
                while (i--) {
                    Jim_DecrRefCount(interp, intv[i]);
                }
                if (intv != sintv) {
                    Jim_Free(intv);
                }
                return NULL;
        }
        Jim_IncrRefCount(intv[i]);
        Jim_String(intv[i]);
        totlen += intv[i]->length;
    }


    if (tokens == 1 && intv[0] && intv == sintv) {

        intv[0]->refCount--;
        return intv[0];
    }

    objPtr = Jim_NewStringObjNoAlloc(interp, NULL, 0);

    if (tokens == 4 && token[0].type == JIM_TT_ESC && token[1].type == JIM_TT_ESC
        && token[2].type == JIM_TT_VAR) {

        objPtr->typePtr = &interpolatedObjType;
        objPtr->internalRep.dictSubstValue.varNameObjPtr = token[0].objPtr;
        objPtr->internalRep.dictSubstValue.indexObjPtr = intv[2];
        Jim_IncrRefCount(intv[2]);
    }
    else if (tokens && intv[0] && intv[0]->typePtr == &sourceObjType) {

        int line;
        Jim_Obj *fileNameObj = Jim_GetSourceInfo(interp, intv[0], &line);
        Jim_SetSourceInfo(interp, objPtr, fileNameObj, line);
    }


    s = objPtr->bytes = Jim_Alloc(totlen + 1);
    objPtr->length = totlen;
    for (i = 0; i < tokens; i++) {
        if (intv[i]) {
            memcpy(s, intv[i]->bytes, intv[i]->length);
            s += intv[i]->length;
            Jim_DecrRefCount(interp, intv[i]);
        }
    }
    objPtr->bytes[totlen] = '\0';

    if (intv != sintv) {
        Jim_Free(intv);
    }

    return objPtr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %ecx, -0x4c(%rbp)
movq %rsi, %r12
movq %rdi, -0x48(%rbp)
cmpl $0x9, %edx
jge 0x10cbf
leaq -0xa0(%rbp), %rbx
jmp 0x10cd4
movl %edx, %esi
shlq $0x3, %rsi
xorl %edi, %edi
movl %edx, %ebx
callq *0x275b9(%rip)          # 0x38288
movl %ebx, %edx
movq %rax, %rbx
testl %edx, %edx
movq %rbx, -0x58(%rbp)
jle 0x10e48
xorl %r14d, %r14d
xorl %r15d, %r15d
xorl %esi, %esi
movq %r12, -0x30(%rbp)
movl 0x8(%r12,%r14,2), %eax
movl $0x1, %r13d
leal -0x1(%rax), %ecx
cmpl $0x4, %ecx
ja 0x10d18
leaq 0x174ce(%rip), %rdi     # 0x281d4
movslq (%rdi,%rcx,4), %rax
addq %rdi, %rax
jmpq *%rax
movq (%r12,%r14,2), %rax
jmp 0x10dbc
cmpl $0x11, %eax
jne 0x10d3d
movl %edx, -0x34(%rbp)
movq %rsi, -0x40(%rbp)
movq (%r12,%r14,2), %rsi
movq -0x48(%rbp), %r12
movq %r12, %rdi
callq 0xd8dd
testl %eax, %eax
je 0x10da4
movl %eax, %r13d
jmp 0x10d62
xorl %eax, %eax
jmp 0x10dbc
movl %edx, -0x34(%rbp)
movq %rsi, -0x40(%rbp)
movq (%r12,%r14,2), %rsi
movq -0x48(%rbp), %r12
movq %r12, %rdi
callq 0x9078
movl %eax, %r13d
testl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
je 0x10dad
xorl %eax, %eax
jmp 0x10db1
movq %rsi, -0x40(%rbp)
movq (%r12,%r14,2), %rsi
movq -0x48(%rbp), %rdi
movl %edx, %r12d
movl $0x1, %edx
callq 0x98ef
movq -0x40(%rbp), %rsi
jmp 0x10d9f
movq %rsi, %rbx
movq (%r12,%r14,2), %rsi
movq -0x48(%rbp), %rdi
movl %edx, %r12d
callq 0x10c0e
movq %rbx, %rsi
movq -0x58(%rbp), %rbx
movl %r12d, %edx
jmp 0x10db8
movq (%r12), %rax
xorl %r13d, %r13d
jmp 0x10db1
movq (%r12), %rax
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %edx
movq -0x30(%rbp), %r12
testq %rax, %rax
je 0x10dc8
movq %rax, (%rbx,%r14)
xorl %r13d, %r13d
cmpl $0x4, %r13d
ja 0x10ef0
movl %r13d, %eax
leaq 0x1740c(%rip), %rcx     # 0x281e8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rbx,%r14), %rdi
incl 0x10(%rdi)
cmpq $0x0, (%rdi)
jne 0x10e0d
movq 0x8(%rdi), %rax
movl %edx, %r12d
movq %rsi, %rbx
callq *0x18(%rax)
movq %rbx, %rsi
movq -0x58(%rbp), %rbx
movl %r12d, %edx
movq -0x30(%rbp), %r12
movq (%rbx,%r14), %rax
addl 0x14(%rax), %esi
jmp 0x10e33
cmpb $0x0, -0x4c(%rbp)
js 0x10e30
cmpb $0x0, -0x4c(%rbp)
jns 0x10ef0
movq $0x0, (%rbx,%r14)
jmp 0x10e33
movl %r15d, %edx
incq %r15
movslq %edx, %rax
addq $0x8, %r14
cmpq %rax, %r15
jl 0x10cec
jmp 0x10e4a
xorl %esi, %esi
cmpl $0x1, %edx
jne 0x10e75
movq (%rbx), %r14
testq %r14, %r14
setne %al
leaq -0xa0(%rbp), %rcx
cmpq %rcx, %rbx
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x10e75
decl 0x10(%r14)
jmp 0x1101c
movq -0x48(%rbp), %rdi
movl %edx, %r13d
movq %rsi, %rbx
callq 0xae58
movq %rbx, %rdx
movq -0x58(%rbp), %rbx
movq %rax, %r15
movl $0x0, 0x14(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
testl %r13d, %r13d
movq %rdx, -0x40(%rbp)
je 0x10f7f
movl %r13d, %ecx
cmpl $0x4, %r13d
jne 0x10f2d
cmpl $0x2, 0x8(%r12)
jne 0x10f29
cmpl $0x2, 0x18(%r12)
jne 0x10f29
cmpl $0x3, 0x28(%r12)
jne 0x10f29
leaq 0x25ed8(%rip), %rax     # 0x36da8
movq %rax, 0x8(%r15)
movq (%r12), %rax
movq %rax, 0x18(%r15)
movq 0x10(%rbx), %rax
movq %rax, 0x20(%r15)
movq 0x10(%rbx), %rax
incl 0x10(%rax)
jmp 0x10f7f
testq %r14, %r14
movq -0x48(%rbp), %r15
je 0x10f1a
movq -0x8(%rbx,%r14), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x10f14
movq %r15, %rdi
callq 0x759a
addq $-0x8, %r14
jne 0x10ef9
leaq -0xa0(%rbp), %rax
xorl %r14d, %r14d
jmp 0x1100c
testl %ecx, %ecx
je 0x10f7f
movq (%rbx), %rax
testq %rax, %rax
je 0x10f7f
leaq 0x2529c(%rip), %r14     # 0x361d8
cmpq %r14, 0x8(%rax)
jne 0x10f7f
movl 0x20(%rax), %ecx
movq 0x18(%rax), %r12
movq 0x8(%r15), %rax
testq %rax, %rax
je 0x10f6a
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x10f6a
movq -0x48(%rbp), %rdi
movq %r15, %rsi
movl %ecx, -0x30(%rbp)
callq *%rax
movl -0x30(%rbp), %ecx
incl 0x10(%r12)
movq %r12, 0x18(%r15)
movl %ecx, 0x20(%r15)
movq %r14, 0x8(%r15)
movq -0x40(%rbp), %rdx
leal 0x1(%rdx), %eax
movq %rdx, %r14
movslq %eax, %rsi
xorl %edi, %edi
callq *0x272f8(%rip)          # 0x38288
movq %r14, %rcx
movq %rax, (%r15)
movq %r15, -0x30(%rbp)
movl %ecx, 0x14(%r15)
testl %r13d, %r13d
jle 0x10ff6
movq %rax, %r12
movl %r13d, %r14d
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rax
testq %rax, %rax
je 0x10fe8
movq (%rax), %rsi
movslq 0x14(%rax), %rdx
movq %r12, %rdi
callq 0x6320
movq (%rbx,%r15,8), %rsi
movslq 0x14(%rsi), %r13
addq %r12, %r13
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x10feb
movq -0x48(%rbp), %rdi
callq 0x759a
jmp 0x10feb
movq %r12, %r13
incq %r15
movq %r13, %r12
cmpq %r15, %r14
jne 0x10fac
movq -0x30(%rbp), %r14
movq (%r14), %rax
movslq -0x40(%rbp), %rcx
movb $0x0, (%rax,%rcx)
leaq -0xa0(%rbp), %rax
cmpq %rax, %rbx
je 0x1101c
movq %rbx, %rdi
xorl %esi, %esi
callq *0x2726c(%rip)          # 0x38288
movq %r14, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq