// File: /workspace/github_c_makefile_star2_O3/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_ScanString
Jim_Obj *Jim_ScanString(Jim_Interp *interp, Jim_Obj *strObjPtr, Jim_Obj *fmtObjPtr, int flags)
{
    size_t i, pos;
    int scanned = 1;
    const char *str = Jim_String(strObjPtr);
    int str_bytelen = Jim_Length(strObjPtr);
    Jim_Obj *resultList = 0;
    Jim_Obj **resultVec = 0;
    int resultc;
    Jim_Obj *emptyStr = 0;
    ScanFmtStringObj *fmtObj;


    JimPanic((fmtObjPtr->typePtr != &scanFmtStringObjType, "Jim_ScanString() for non-scan format"));

    fmtObj = (ScanFmtStringObj *) fmtObjPtr->internalRep.ptr;

    if (fmtObj->error != 0) {
        if (flags & JIM_ERRMSG)
            Jim_SetResultString(interp, fmtObj->error, -1);
        return 0;
    }

    emptyStr = Jim_NewEmptyStringObj(interp);
    Jim_IncrRefCount(emptyStr);

    resultList = Jim_NewListObj(interp, NULL, 0);
    if (fmtObj->maxPos > 0) {
        for (i = 0; i < fmtObj->maxPos; ++i)
            Jim_ListAppendElement(interp, resultList, emptyStr);
        JimListGetElements(interp, resultList, &resultc, &resultVec);
    }

    for (i = 0, pos = 0; i < fmtObj->count; ++i) {
        ScanFmtPartDescr *descr = &(fmtObj->descr[i]);
        Jim_Obj *value = 0;


        if (descr->type == 0)
            continue;

        if (scanned > 0)
            scanned = ScanOneEntry(interp, str, pos, str_bytelen, fmtObj, i, &value);

        if (scanned == -1 && i == 0)
            goto eof;

        pos += scanned;


        if (value == 0)
            value = Jim_NewEmptyStringObj(interp);

        if (descr->pos == -1) {
            Jim_FreeNewObj(interp, value);
        }
        else if (descr->pos == 0)

            Jim_ListAppendElement(interp, resultList, value);
        else if (resultVec[descr->pos - 1] == emptyStr) {

            Jim_DecrRefCount(interp, resultVec[descr->pos - 1]);
            Jim_IncrRefCount(value);
            resultVec[descr->pos - 1] = value;
        }
        else {

            Jim_FreeNewObj(interp, value);
            goto err;
        }
    }
    Jim_DecrRefCount(interp, emptyStr);
    return resultList;
  eof:
    Jim_DecrRefCount(interp, emptyStr);
    Jim_FreeNewObj(interp, resultList);
    return (Jim_Obj *)EOF;
  err:
    Jim_DecrRefCount(interp, emptyStr);
    Jim_FreeNewObj(interp, resultList);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %ecx, %r14d
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, -0x30(%rbp)
movq (%rsi), %rcx
movq %rcx, -0x50(%rbp)
testq %rcx, %rcx
jne 0xfdaa
movq 0x8(%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movq (%r15), %rcx
movq %rcx, -0x50(%rbp)
testq %rcx, %rcx
jne 0xfdaa
movq 0x8(%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movq $0x0, -0x50(%rbp)
movq 0x18(%r12), %r13
movq 0x28(%r13), %rsi
testq %rsi, %rsi
je 0xfdf8
testb $0x1, %r14b
movq -0x30(%rbp), %rbx
je 0xfdf1
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %rax, %r14
incl 0x10(%rax)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0xfdee
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
xorl %eax, %eax
jmp 0x103e9
movslq 0x14(%r15), %rax
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0xae38
movq %rax, %r12
leaq 0x27482(%rip), %rax     # 0x37298
movq %rax, (%r12)
movl $0x0, 0x14(%r12)
xorl %ebx, %ebx
movq %rbx, 0x8(%r12)
incl 0x10(%r12)
movq %r14, %rdi
callq 0xae38
movq %rax, %r15
leaq 0x25527(%rip), %rax     # 0x35368
movq %rax, 0x8(%r15)
movq %rbx, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r15)
movq $0x0, -0x80(%rbp)
cmpq %rbx, 0x20(%r13)
je 0xfe8c
xorl %ebx, %ebx
movq -0x30(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x7683
incq %rbx
cmpq 0x20(%r13), %rbx
jb 0xfe60
movq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0xe2fe
movq 0x18(%r15), %rax
movq %rax, -0x80(%rbp)
movq %r12, -0x78(%rbp)
movq %r15, -0x60(%rbp)
cmpq $0x0, 0x10(%r13)
je 0x10399
leaq 0x38(%r13), %rax
movl $0x1, %r14d
xorl %r15d, %r15d
xorl %r8d, %r8d
movq %r13, -0x88(%rbp)
movq %rax, -0x40(%rbp)
movq %r15, %rbx
shlq $0x5, %rbx
movzbl 0x1c(%rax,%rbx), %ecx
testl %ecx, %ecx
je 0x10149
addq %rax, %rbx
testl %r14d, %r14d
jle 0xff85
movq %rcx, -0x58(%rbp)
movq 0x8(%rbx), %r12
testq %r12, %r12
je 0xff8d
cmpl %r8d, -0x68(%rbp)
jle 0x10010
movq %rbx, -0x38(%rbp)
xorl %r13d, %r13d
movq %r8, -0x48(%rbp)
movl %r8d, %ebx
movzbl (%r12,%r13), %r14d
testq %r14, %r14
je 0x1015b
callq 0x64e0
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r14,2)
jne 0xff3a
movslq %ebx, %rax
movq -0x50(%rbp), %rcx
cmpb (%rcx,%rax), %r14b
jne 0x1015b
incl %ebx
movq -0x68(%rbp), %r8
jmp 0xff69
movq -0x68(%rbp), %r8
cmpl %r8d, %ebx
jge 0xff69
movslq %ebx, %rcx
movq %r8, %rdx
subq %rcx, %rdx
addq -0x50(%rbp), %rcx
xorl %esi, %esi
movzbl (%rcx,%rsi), %edi
testb $0x20, 0x1(%rax,%rdi,2)
je 0xff67
incq %rsi
cmpq %rsi, %rdx
jne 0xff52
jmp 0xff71
addl %esi, %ebx
incq %r13
cmpl %r8d, %ebx
jl 0xff03
xorl %r13d, %r13d
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %r8
movq -0x38(%rbp), %rbx
jmp 0x10013
xorl %r13d, %r13d
jmp 0x10072
movq %rbx, -0x38(%rbp)
movl %r8d, %ebx
movq -0x58(%rbp), %r12
leal -0x5b(%r12), %eax
cmpl $0x13, %eax
ja 0xffac
movl $0x80101, %ecx          # imm = 0x80101
btl %eax, %ecx
jb 0xffd3
movq %r8, %r13
callq 0x64e0
movq %r13, %r8
movq (%rax), %rax
movslq %ebx, %rcx
leal -0x1(%rcx), %ebx
addq -0x50(%rbp), %rcx
movzbl (%rcx), %edx
incl %ebx
incq %rcx
testb $0x20, 0x1(%rax,%rdx,2)
jne 0xffc4
movslq %ebx, %r9
movq %r9, %r14
subq %r8, %r14
cmpb $0x6e, %r12b
jne 0x1001b
movq -0x30(%rbp), %rdi
movq %r8, %rbx
movq %r9, %r12
callq 0xae38
movq %rbx, %r8
movq %rax, %r13
leaq 0x252f2(%rip), %rax     # 0x352f0
movq %rax, 0x8(%r13)
movq $0x0, (%r13)
movq %r12, 0x18(%r13)
jmp 0x1006a
xorl %r13d, %r13d
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x10072
cmpl -0x68(%rbp), %ebx
jge 0x10061
cmpb $0x63, %r12b
jne 0x1017d
movq -0x50(%rbp), %rax
movzbl (%rax,%r9), %ebx
movq -0x30(%rbp), %rdi
movq %r8, %r13
callq 0xae38
movq %r13, %r8
movq %rax, %r13
leaq 0x252a4(%rip), %rax     # 0x352f0
movq %rax, 0x8(%r13)
movq $0x0, (%r13)
movq %rbx, 0x18(%r13)
incl %r14d
jmp 0x1006a
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
xorl %r13d, %r13d
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rbx
testq %r15, %r15
jne 0x10081
cmpl $-0x1, %r14d
je 0x103ba
movq %rax, %r12
movl %r14d, %eax
addq %rax, %r8
testq %r13, %r13
jne 0x100bc
movq -0x30(%rbp), %rdi
movq %r8, %r13
callq 0xae38
movq %r13, %r8
movq %rax, %r13
leaq 0x271f0(%rip), %rax     # 0x37298
movq %rax, (%r13)
movl $0x0, 0x14(%r13)
movq $0x0, 0x8(%r13)
movslq 0x18(%rbx), %rax
testq %rax, %rax
je 0x100db
cmpl $-0x1, %eax
jne 0x100f3
movq -0x30(%rbp), %rdi
movq %r13, %rsi
movq %r8, %r13
callq 0x758c
jmp 0x100ee
movq -0x30(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %r13, %rdx
movq %r8, %r13
callq 0x7683
movq %r13, %r8
jmp 0x1013f
movq -0x80(%rbp), %rcx
movq -0x8(%rcx,%rax,8), %rsi
cmpq -0x78(%rbp), %rsi
jne 0x103f8
movl 0x10(%rsi), %ecx
leal -0x1(%rcx), %edx
movl %edx, 0x10(%rsi)
cmpl $0x1, %ecx
jg 0x10132
movq -0x30(%rbp), %rdi
movq %r14, -0x38(%rbp)
movq %rbx, %r14
movq %r8, %rbx
callq 0x758c
movq %rbx, %r8
movslq 0x18(%r14), %rax
movq -0x38(%rbp), %r14
incl 0x10(%r13)
movq -0x80(%rbp), %rcx
movq %r13, -0x8(%rcx,%rax,8)
movq -0x88(%rbp), %r13
movq %r12, %rax
incq %r15
cmpq 0x10(%r13), %r15
jb 0xfeba
jmp 0x10399
movl %r13d, %eax
cmpb $0x0, (%r12,%rax)
movq -0x48(%rbp), %r8
je 0xff94
movq -0x40(%rbp), %r12
movq -0x38(%rbp), %rbx
xorl %r14d, %r14d
jmp 0x1008f
movq -0x38(%rbp), %rax
movq 0x10(%rax), %r12
testq %r12, %r12
movq %r8, -0x48(%rbp)
je 0x101d7
movq -0x68(%rbp), %rax
subl %ebx, %eax
jns 0x101a9
movq -0x50(%rbp), %rax
leaq (%rax,%r9), %rdi
movq %r9, %rbx
callq 0x6180
movq %rbx, %r9
movslq %eax, %rdx
cmpq %rdx, %r12
cmovbel %r12d, %edx
addq -0x50(%rbp), %r9
movq -0x30(%rbp), %rdi
movq %r9, %rsi
callq 0x7508
movq %rax, %r12
movq (%rax), %r9
movq -0x38(%rbp), %rbx
movb 0x1c(%rbx), %sil
movq -0x48(%rbp), %r8
jmp 0x101e6
addq -0x50(%rbp), %r9
xorl %r12d, %r12d
movq -0x38(%rbp), %rbx
movq -0x58(%rbp), %rsi
movzbl %sil, %eax
leal -0x5b(%rax), %ecx
cmpl $0x1d, %ecx
ja 0x10394
movl $0x24104200, %edx       # imm = 0x24104200
btl %ecx, %edx
jb 0x1027c
movl $0x1c00, %eax           # imm = 0x1C00
btl %ecx, %eax
jae 0x10293
movq %rbx, -0x38(%rbp)
movq %r9, %rdi
leaq -0x70(%rbp), %rsi
movq %r9, %rbx
callq 0x6120
movq %rbx, %rax
movq -0x70(%rbp), %rbx
cmpq %rax, %rbx
je 0x10355
movq -0x30(%rbp), %rdi
movq %r12, -0x58(%rbp)
movq %rax, %r12
movsd %xmm0, -0x90(%rbp)
callq 0xae38
movq %rax, %r13
leaq 0x250ed(%rip), %rax     # 0x35340
movq %rax, 0x8(%r13)
movq $0x0, (%r13)
movsd -0x90(%rbp), %xmm0
movsd %xmm0, 0x18(%r13)
subq %r12, %r14
movq -0x58(%rbp), %r12
addq %rbx, %r14
jmp 0x10364
cmpb $0x69, %sil
je 0x102d3
cmpl $0x6f, %eax
je 0x102cc
cmpl $0x78, %eax
jne 0x102e4
movl $0x10, %edx
jmp 0x102e9
movl $0x1000001, %eax        # imm = 0x1000001
btl %ecx, %eax
jae 0x10394
movq (%rbx), %rsi
movq -0x30(%rbp), %rdi
movq %r9, %rdx
callq 0x1b00e
movq %rax, %r13
cmpq $0x0, (%rax)
jne 0x102c3
movq 0x8(%r13), %rax
movq %r13, %rdi
callq *0x18(%rax)
movl 0x14(%r13), %eax
addq %rax, %r14
jmp 0x1034b
movl $0x8, %edx
jmp 0x102e9
movq %r9, %rdi
leaq -0x70(%rbp), %rsi
movq %r9, %r13
callq 0xd4a0
jmp 0x102f8
movl $0xa, %edx
movq %r9, %rdi
leaq -0x70(%rbp), %rsi
movq %r9, %r13
callq 0x6460
cmpq %r13, -0x70(%rbp)
je 0x1033a
movq -0x30(%rbp), %rdi
movq %r12, -0x58(%rbp)
movq %r13, -0x38(%rbp)
movq %rax, %r12
callq 0xae38
movq %rax, %r13
leaq 0x24fd4(%rip), %rax     # 0x352f0
movq %rax, 0x8(%r13)
movq $0x0, (%r13)
movq %r12, 0x18(%r13)
subq -0x38(%rbp), %r14
movq -0x58(%rbp), %r12
addq -0x70(%rbp), %r14
jmp 0x1034b
cmpb $0x1, (%r13)
movl $0x0, %r14d
sbbq %r14, %r14
xorl %r13d, %r13d
movq -0x48(%rbp), %r8
movq -0x40(%rbp), %rax
jmp 0x10370
cmpb $0x1, (%rax)
movl $0x0, %r14d
sbbq %r14, %r14
xorl %r13d, %r13d
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %r8
movq -0x38(%rbp), %rbx
testq %r12, %r12
je 0x10072
movq -0x30(%rbp), %rdi
movq %r12, %rsi
movq %rax, %r12
callq 0x758c
movq %r12, %rax
movq -0x48(%rbp), %r8
jmp 0x10072
xorl %r13d, %r13d
jmp 0x1034f
movq -0x78(%rbp), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x103b4
movq -0x30(%rbp), %rdi
callq 0x758c
movq -0x60(%rbp), %rax
jmp 0x103e9
movq -0x78(%rbp), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x103d5
movq -0x30(%rbp), %rdi
callq 0x758c
movq -0x30(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x758c
movq $-0x1, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x30(%rbp), %rdi
movq %r13, %rsi
callq 0x758c
movq -0x78(%rbp), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1041f
movq -0x30(%rbp), %rdi
callq 0x758c
movq -0x30(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x758c
jmp 0xfdf1