// File: /workspace/github_c_makefile_star2_O3/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 $0x68, %rsp
movl %ecx, -0x48(%rbp)
movl %edx, %r12d
movq %rsi, %r14
leaq -0x90(%rbp), %rax
cmpl $0x9, %edx
movq %rdi, -0x38(%rbp)
jge 0x10ba4
movq %rax, -0x30(%rbp)
testl %r12d, %r12d
jg 0x10bb7
xorl %r15d, %r15d
movq %rax, -0x30(%rbp)
jmp 0x10d84
movl %r12d, %esi
shlq $0x3, %rsi
xorl %edi, %edi
callq *0x266d5(%rip)          # 0x37288
movq %rax, -0x30(%rbp)
xorl %ebx, %ebx
movq %r14, -0x50(%rbp)
movq %r14, %r15
xorl %r13d, %r13d
movq $0x0, -0x40(%rbp)
movl 0x8(%r15), %eax
leal -0x1(%rax), %ecx
cmpl $0x4, %ecx
ja 0x10bef
movl %r12d, %r14d
leaq 0x165f3(%rip), %rdx     # 0x271d4
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq (%r15), %rax
jmp 0x10c5e
cmpl $0x11, %eax
jne 0x10d32
movl %r12d, %r14d
movq (%r15), %rsi
movq -0x38(%rbp), %rdi
callq 0xd8ce
movl %eax, %r12d
testl %eax, %eax
jne 0x10c73
movq -0x38(%rbp), %rax
movq (%rax), %rax
xorl %r12d, %r12d
jmp 0x10c64
movq (%r15), %rsi
movq -0x38(%rbp), %rdi
callq 0x908a
movl %eax, %r12d
testl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jne 0x10c73
movq -0x38(%rbp), %rax
movq (%rax), %rax
jmp 0x10c64
movq (%r15), %rsi
movl $0x1, %r12d
movq -0x38(%rbp), %rdi
movl $0x1, %edx
callq 0x98e7
jmp 0x10c64
movq (%r15), %rsi
movq -0x38(%rbp), %rdi
callq 0x10add
movl $0x1, %r12d
testq %rax, %rax
je 0x10c73
movq -0x30(%rbp), %rcx
movq %rax, (%rcx,%r13,8)
jmp 0x10c90
cmpl $0x4, %r12d
ja 0x10d32
movl %r12d, %eax
leaq 0x16561(%rip), %rcx     # 0x271e8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x30(%rbp), %rax
movq (%rax,%r13,8), %rdi
incl 0x10(%rdi)
cmpq $0x0, (%rdi)
jne 0x10cb0
movq 0x8(%rdi), %rax
callq *0x18(%rax)
movq -0x30(%rbp), %rax
movq (%rax,%r13,8), %rdi
movl %r14d, %r12d
movq -0x40(%rbp), %rax
addl 0x14(%rdi), %eax
movq %rax, -0x40(%rbp)
incq %r13
movslq %r12d, %rax
addq $-0x8, %rbx
addq $0x10, %r15
cmpq %rax, %r13
jl 0x10bcb
jmp 0x10cf9
cmpb $0x0, -0x48(%rbp)
jns 0x10d32
movq -0x30(%rbp), %rax
movq $0x0, (%rax,%r13,8)
movl %r14d, %r12d
jmp 0x10cbe
cmpb $0x0, -0x48(%rbp)
jns 0x10d32
movl %r13d, %r12d
jmp 0x10cbe
cmpl $0x1, %r12d
movq -0x38(%rbp), %rdi
jne 0x10d7c
movq -0x30(%rbp), %rdx
movq (%rdx), %r13
testq %r13, %r13
setne %al
leaq -0x90(%rbp), %rcx
cmpq %rcx, %rdx
sete %cl
testb %cl, %al
movq -0x40(%rbp), %r15
je 0x10df7
decl 0x10(%r13)
jmp 0x10ee5
testq %rbx, %rbx
movq -0x38(%rbp), %r15
je 0x10d63
negq %rbx
movq -0x30(%rbp), %rax
movq -0x8(%rax,%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x10d5d
movq %r15, %rdi
callq 0x758c
addq $-0x8, %rbx
jne 0x10d3e
leaq -0x90(%rbp), %rax
cmpq %rax, -0x30(%rbp)
je 0x10ef7
xorl %r13d, %r13d
jmp 0x10ed9
movq -0x40(%rbp), %r15
movq -0x50(%rbp), %r14
callq 0xae38
movq %rax, %r13
leaq 0x14(%rax), %rbx
movl $0x0, 0x14(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
testl %r12d, %r12d
je 0x10e37
movq %r13, %rax
addq $0x8, %rax
cmpl $0x4, %r12d
jne 0x10e1a
movl $0x4, %r12d
cmpl $0x2, 0x8(%r14)
jne 0x10e1a
cmpl $0x2, 0x18(%r14)
jne 0x10e1a
cmpl $0x3, 0x28(%r14)
jne 0x10e1a
leaq 0x24fd3(%rip), %rax     # 0x35da8
movq %rax, 0x8(%r13)
movq (%r14), %rax
movq %rax, 0x18(%r13)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x20(%r13)
incl 0x10(%rax)
movl $0x4, %r14d
jmp 0x10e3a
callq 0xae38
movq %rax, %r13
leaq 0x14(%rax), %rbx
movl $0x0, 0x14(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
addq $0x8, %rax
movl $0x1, %r12d
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x10e37
leaq 0x243bb(%rip), %rdx     # 0x351e8
cmpq %rdx, 0x8(%rcx)
je 0x10efc
movl %r12d, %r14d
leal 0x1(%r15), %eax
movslq %eax, %rsi
xorl %edi, %edi
callq *0x2643f(%rip)          # 0x37288
movq %rax, %r12
movq %rax, (%r13)
movl %r15d, (%rbx)
testl %r14d, %r14d
jle 0x10ec4
movq %r13, -0x48(%rbp)
movq %r15, -0x40(%rbp)
movl %r14d, %ebx
xorl %r15d, %r15d
movq -0x30(%rbp), %rax
movq (%rax,%r15,8), %rax
testq %rax, %rax
je 0x10eaa
movq (%rax), %rsi
movslq 0x14(%rax), %rdx
movq %r12, %rdi
callq 0x6320
movq -0x30(%rbp), %rax
movq (%rax,%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 0x10ead
movq -0x38(%rbp), %rdi
callq 0x758c
jmp 0x10ead
movq %r12, %r13
incq %r15
movq %r13, %r12
cmpq %r15, %rbx
jne 0x10e66
movq -0x48(%rbp), %r13
movq (%r13), %r12
movq -0x40(%rbp), %r15
movslq %r15d, %rax
movb $0x0, (%r12,%rax)
leaq -0x90(%rbp), %rax
cmpq %rax, -0x30(%rbp)
je 0x10ee5
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq *0x263a3(%rip)          # 0x37288
movq %r13, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r13d, %r13d
jmp 0x10ee5
movl %r12d, %r14d
movq 0x18(%rcx), %rsi
movl 0x20(%rcx), %ecx
incl 0x10(%rsi)
movq %rsi, 0x18(%r13)
movl %ecx, 0x20(%r13)
movq %rdx, (%rax)
jmp 0x10e3a