// File: /workspace/github_c_makefile_star2_O1/msteveb[P]autosetup/./jimsh0.c
// Function: JimStringMap
static Jim_Obj *JimStringMap(Jim_Interp *interp, Jim_Obj *mapListObjPtr,
    Jim_Obj *objPtr, int nocase)
{
    int numMaps;
    const char *str, *noMatchStart = NULL;
    int strLen, i;
    Jim_Obj *resultObjPtr;

    numMaps = Jim_ListLength(interp, mapListObjPtr);
    if (numMaps % 2) {
        Jim_SetResultString(interp, "list must contain an even number of elements", -1);
        return NULL;
    }

    str = Jim_String(objPtr);
    strLen = Jim_Utf8Length(interp, objPtr);


    resultObjPtr = Jim_NewStringObj(interp, "", 0);
    while (strLen) {
        for (i = 0; i < numMaps; i += 2) {
            Jim_Obj *eachObjPtr;
            const char *k;
            int kl;

            eachObjPtr = Jim_ListGetIndex(interp, mapListObjPtr, i);
            k = Jim_String(eachObjPtr);
            kl = Jim_Utf8Length(interp, eachObjPtr);

            if (strLen >= kl && kl) {
                int rc;
                rc = JimStringCompareUtf8(str, kl, k, kl, nocase);
                if (rc == 0) {
                    if (noMatchStart) {
                        Jim_AppendString(interp, resultObjPtr, noMatchStart, str - noMatchStart);
                        noMatchStart = NULL;
                    }
                    Jim_AppendObj(interp, resultObjPtr, Jim_ListGetIndex(interp, mapListObjPtr, i + 1));
                    str += utf8_index(str, kl);
                    strLen -= kl;
                    break;
                }
            }
        }
        if (i == numMaps) {
            int c;
            if (noMatchStart == NULL)
                noMatchStart = str;
            str += utf8_tounicode(str, &c);
            strLen--;
        }
    }
    if (noMatchStart) {
        Jim_AppendString(interp, resultObjPtr, noMatchStart, str - noMatchStart);
    }
    return resultObjPtr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, -0x5c(%rbp)
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
callq 0xe338
movq %rbx, -0x68(%rbp)
movl 0x20(%rbx), %eax
testb $0x1, %al
jne 0x23cac
movl %eax, -0x44(%rbp)
cmpq $0x0, (%r14)
jne 0x23b33
movq 0x8(%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq (%r14), %rbx
testq %rbx, %rbx
jne 0x23b45
movq 0x8(%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq %rbx, -0x40(%rbp)
movl 0x14(%r14), %r12d
movq %r15, %rdi
callq 0xae58
leaq 0x1473c(%rip), %rcx     # 0x38298
movq %rcx, (%rax)
movl $0x0, 0x14(%rax)
movq %rax, -0x50(%rbp)
movq $0x0, 0x8(%rax)
testl %r12d, %r12d
je 0x23ce6
movq $0x0, -0x38(%rbp)
movl -0x44(%rbp), %esi
movq %r15, -0x58(%rbp)
xorl %r14d, %r14d
testl %esi, %esi
jle 0x23c72
movq %r15, %rdi
movq -0x68(%rbp), %rsi
movl %r14d, %edx
callq 0xe871
movq %rax, %r15
cmpq $0x0, (%rax)
jne 0x23bb7
movq 0x8(%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movq (%r15), %rbx
testq %rbx, %rbx
jne 0x23bc9
movq 0x8(%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movl 0x14(%r15), %r15d
movl %r12d, %r13d
movb $0x1, %al
subl %r15d, %r13d
jl 0x23bf9
testl %r15d, %r15d
je 0x23bf9
movq -0x40(%rbp), %rdi
movl %r15d, %esi
movq %rbx, %rdx
movl %r15d, %ecx
movl -0x5c(%rbp), %r8d
callq 0xb384
testl %eax, %eax
setne %al
je 0x23c15
movl %r12d, %r13d
movq -0x58(%rbp), %r15
testb %al, %al
movl -0x44(%rbp), %esi
je 0x23c75
addl $0x2, %r14d
movl %r13d, %r12d
cmpl %esi, %r14d
jl 0x23b95
jmp 0x23c75
movb %al, -0x29(%rbp)
movq -0x38(%rbp), %rdx
testq %rdx, %rdx
movq -0x58(%rbp), %r12
movq -0x40(%rbp), %rbx
je 0x23c39
movl %ebx, %ecx
subl %edx, %ecx
movq %r12, %rdi
movq -0x50(%rbp), %rsi
callq 0x8653
movslq %r15d, %r15
leal 0x1(%r14), %edx
movq %r12, %rdi
movq -0x68(%rbp), %rsi
callq 0xe871
movq %r12, %rdi
movq -0x50(%rbp), %rsi
movq %rax, %rdx
callq 0xafb0
addq %r15, %rbx
movq %rbx, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq %r12, %r15
movb -0x29(%rbp), %al
jmp 0x23c00
movl %r12d, %r13d
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
movq %rdi, %rax
movq -0x40(%rbp), %rdx
cmoveq %rdx, %rax
xorl %ecx, %ecx
cmpl %esi, %r14d
cmoveq %rax, %rdi
movq %rdi, -0x38(%rbp)
sete %cl
addq %rcx, %rdx
movq %rdx, -0x40(%rbp)
subl %ecx, %r13d
movl %r13d, %r12d
jne 0x23b8a
jmp 0x23cee
leaq 0xa065(%rip), %rsi      # 0x2dd18
movq %r15, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %rax, %rbx
incl 0x10(%rax)
movq (%r15), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x23cdf
movq %r15, %rdi
callq 0x759a
movq %rbx, (%r15)
xorl %ebx, %ebx
jmp 0x23d12
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rdx
testq %rdx, %rdx
je 0x23d0e
movq -0x40(%rbp), %rcx
subl %edx, %ecx
movq %r15, %rdi
movq -0x50(%rbp), %rbx
movq %rbx, %rsi
callq 0x8653
jmp 0x23d12
movq -0x50(%rbp), %rbx
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq