// File: /workspace/github_c_makefile_star2_O1/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 $0x78, %rsp
movl %ecx, %r14d
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, -0x50(%rbp)
cmpq $0x0, (%rsi)
jne 0xfddf
movq 0x8(%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movq (%r15), %rax
movq %rax, -0x60(%rbp)
testq %rax, %rax
jne 0xfdf5
movq 0x8(%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movq 0x18(%r12), %r13
movq 0x28(%r13), %rsi
testq %rsi, %rsi
je 0xfe43
testb $0x1, %r14b
movq -0x50(%rbp), %rbx
je 0xfe3c
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
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 0xfe39
movq %rbx, %rdi
callq 0x759a
movq %r14, (%rbx)
xorl %eax, %eax
jmp 0x104e7
movl 0x14(%r15), %eax
movl %eax, -0x2c(%rbp)
movq -0x50(%rbp), %r12
movq %r12, %rdi
callq 0xae58
movq %rax, %r15
leaq 0x28438(%rip), %rax     # 0x38298
movq %rax, (%r15)
movl $0x0, 0x14(%r15)
xorl %ebx, %ebx
movq %rbx, 0x8(%r15)
incl 0x10(%r15)
movq %r12, %rdi
callq 0xae58
movq %rax, %r14
leaq 0x264d1(%rip), %rax     # 0x36358
movq %rax, 0x8(%r14)
movq %rbx, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r14)
movq $0x0, -0x90(%rbp)
cmpq %rbx, 0x20(%r13)
je 0xfedd
cmpq $0x0, 0x20(%r13)
je 0xfec7
xorl %ebx, %ebx
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x7695
incq %rbx
cmpq 0x20(%r13), %rbx
jb 0xfeb0
movq %r12, %rdi
movq %r14, %rsi
callq 0xe338
movq 0x18(%r14), %rax
movq %rax, -0x90(%rbp)
movq %r15, -0x88(%rbp)
movq %r14, -0x78(%rbp)
cmpq $0x0, 0x10(%r13)
movl -0x2c(%rbp), %r9d
je 0x104c6
movslq %r9d, %rax
movq %rax, -0x98(%rbp)
leaq 0x38(%r13), %rbx
movl $0x1, %ecx
xorl %r15d, %r15d
xorl %edi, %edi
movq %rbx, -0x40(%rbp)
movq %r13, -0xa0(%rbp)
movq %r15, %r10
shlq $0x5, %r10
movzbl 0x1c(%rbx,%r10), %r13d
testl %r13d, %r13d
je 0xfff2
addq %rbx, %r10
testl %ecx, %ecx
jle 0xfffc
movq 0x8(%r10), %r12
testq %r12, %r12
je 0x10004
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl %edi, %r9d
jle 0x10024
movb (%r12), %bl
testb %bl, %bl
movq %rdi, -0x38(%rbp)
je 0x10030
movq %r10, -0x48(%rbp)
movq %rdi, %r14
callq 0x64e0
movq -0x48(%rbp), %r10
movl -0x2c(%rbp), %r9d
movq (%rax), %rcx
movb $0x1, %dl
xorl %eax, %eax
movzbl %bl, %esi
testb $0x20, 0x1(%rcx,%rsi,2)
jne 0xff9c
movslq %r14d, %rsi
movq -0x60(%rbp), %rdi
cmpb (%rdi,%rsi), %bl
jne 0xffe9
incl %r14d
jmp 0xffd1
cmpl %r9d, %r14d
jge 0xffd1
movslq %r14d, %rdx
movq -0x98(%rbp), %rsi
subq %rdx, %rsi
addq -0x60(%rbp), %rdx
xorl %edi, %edi
movzbl (%rdx,%rdi), %r8d
testb $0x20, 0x1(%rcx,%r8,2)
je 0xffce
incq %rdi
cmpq %rdi, %rsi
jne 0xffb4
movl %r9d, %r14d
jmp 0xffd1
addl %edi, %r14d
cmpl %r9d, %r14d
setl %dl
jge 0x10287
movb 0x1(%r12,%rax), %bl
incq %rax
testb %bl, %bl
jne 0xff81
movl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
jmp 0x10037
movl $0x9, %eax
jmp 0x10257
xorl %r13d, %r13d
jmp 0x10135
movq %rdi, -0x38(%rbp)
movq %rdi, %r14
leal -0x5b(%r13), %eax
cmpl $0x13, %eax
ja 0x1005a
movl $0x80101, %ecx          # imm = 0x80101
btl %eax, %ecx
jae 0x1005a
movq -0x50(%rbp), %r12
jmp 0x1008b
xorl %r13d, %r13d
movq -0x50(%rbp), %r12
jmp 0x10135
movb $0x1, %dl
xorl %eax, %eax
movq %rdi, %r14
testb $0x1, %dl
movq -0x40(%rbp), %rbx
je 0x1004e
cmpb $0x0, (%r12,%rax)
je 0x1000b
xorl %r13d, %r13d
xorl %ecx, %ecx
jmp 0x10051
xorl %r13d, %r13d
movq -0x50(%rbp), %r12
jmp 0x10131
movq %r10, %r12
callq 0x64e0
movq %r12, %r10
movl -0x2c(%rbp), %r9d
movq (%rax), %rax
movslq %r14d, %rcx
leal -0x1(%rcx), %r14d
addq -0x60(%rbp), %rcx
movq -0x50(%rbp), %r12
movzbl (%rcx), %edx
incl %r14d
incq %rcx
testb $0x20, 0x1(%rax,%rdx,2)
jne 0x1007b
movslq %r14d, %r8
movq %r8, %rcx
subq -0x38(%rbp), %rcx
cmpl $0x6e, %r13d
jne 0x100d7
movq %r12, %rdi
movq %rcx, %r14
movq %r10, %r13
movq %r8, -0x70(%rbp)
callq 0xae58
movq %r13, %r10
movq %r14, %rcx
movl -0x2c(%rbp), %r9d
movq %rax, %r13
leaq 0x2621f(%rip), %rax     # 0x362e0
movq %rax, 0x8(%r13)
movq $0x0, (%r13)
movq -0x70(%rbp), %rax
movq %rax, 0x18(%r13)
jmp 0x10131
cmpl %r9d, %r14d
jge 0x10129
cmpl $0x63, %r13d
jne 0x102a0
movq -0x60(%rbp), %rax
movzbl (%rax,%r8), %ebx
movq %r12, %rdi
movq %rcx, %r14
movq %r10, %r13
callq 0xae58
movq %r13, %r10
movq %r14, %rcx
movl -0x2c(%rbp), %r9d
movq %rax, %r13
leaq 0x261cf(%rip), %rax     # 0x362e0
movq %rax, 0x8(%r13)
movq $0x0, (%r13)
movq %rbx, 0x18(%r13)
incl %ecx
movq -0x40(%rbp), %rbx
jmp 0x10131
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r13d, %r13d
movq -0x38(%rbp), %rdi
testq %r15, %r15
jne 0x1014e
cmpl $-0x1, %ecx
jne 0x1014e
movl $0xa, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
jmp 0x10257
testq %r13, %r13
movq %rcx, %r14
jne 0x1018b
movq %rdi, %rbx
movq %r12, %rdi
movq %r10, %r13
callq 0xae58
movq %rbx, %rdi
movq %r13, %r10
movq %r14, %rcx
movq %rax, %r13
leaq 0x28121(%rip), %rax     # 0x38298
movq %rax, (%r13)
movl $0x0, 0x14(%r13)
movq $0x0, 0x8(%r13)
movl %ecx, %eax
addq %rax, %rdi
movslq 0x18(%r10), %rax
testq %rax, %rax
je 0x101c1
cmpl $-0x1, %eax
jne 0x101e5
movq %rdi, %rbx
movq %r12, %rdi
movq %r13, %rsi
callq 0x759a
movq %rbx, %rdi
movq -0x40(%rbp), %rbx
movl -0x2c(%rbp), %r9d
xorl %eax, %eax
movq %r14, %rcx
jmp 0x10257
movq %rdi, %rbx
movq %r12, %rdi
movq -0x78(%rbp), %rsi
movq %r13, %rdx
callq 0x7695
movq %rbx, %rdi
movq -0x40(%rbp), %rbx
movq %r14, %rcx
movl -0x2c(%rbp), %r9d
xorl %eax, %eax
jmp 0x10257
movq -0x90(%rbp), %rcx
movq -0x8(%rcx,%rax,8), %rsi
cmpq -0x88(%rbp), %rsi
je 0x10212
movq %rdi, %rbx
movq %r12, %rdi
movq %r13, %rsi
callq 0x759a
movq %rbx, %rdi
movl $0xb, %eax
jmp 0x1024c
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x10236
movq %rdi, %rbx
movq %r12, %rdi
movq %r10, -0x48(%rbp)
callq 0x759a
movq %rbx, %rdi
movq -0x48(%rbp), %r10
incl 0x10(%r13)
movslq 0x18(%r10), %rax
movq -0x90(%rbp), %rcx
movq %r13, -0x8(%rcx,%rax,8)
xorl %eax, %eax
movl -0x2c(%rbp), %r9d
movq %r14, %rcx
movq -0x40(%rbp), %rbx
cmpl $0x8, %eax
movq -0xa0(%rbp), %r13
jle 0x1026d
cmpl $0x9, %eax
je 0x10275
jmp 0x104f6
testl %eax, %eax
jne 0x1052e
incq %r15
cmpq 0x10(%r13), %r15
jb 0xff1a
jmp 0x104c6
xorl %r13d, %r13d
movq -0x50(%rbp), %r12
movq -0x40(%rbp), %rbx
movq -0x38(%rbp), %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
jmp 0x10135
movq %rcx, -0x58(%rbp)
movq 0x10(%r10), %rbx
testq %rbx, %rbx
je 0x102f2
movq %r10, %r13
movl %r9d, %eax
subl %r14d, %eax
jns 0x102cb
movq -0x60(%rbp), %rax
leaq (%rax,%r8), %rdi
movq %r8, %r14
callq 0x6180
movq %r14, %r8
movslq %eax, %rdx
cmpq %rdx, %rbx
cmovbel %ebx, %edx
addq -0x60(%rbp), %r8
movq %r12, %rdi
movq %r8, %rsi
callq 0x7516
movq %rax, %rsi
movq (%rax), %r8
movq -0x38(%rbp), %rdi
movq %r13, %r10
jmp 0x102fc
addq -0x60(%rbp), %r8
xorl %esi, %esi
movq -0x38(%rbp), %rdi
movzbl 0x1c(%r10), %eax
leal -0x5b(%rax), %ecx
cmpl $0x1d, %ecx
movq -0x40(%rbp), %rbx
ja 0x10491
movl $0x24104200, %edx       # imm = 0x24104200
btl %ecx, %edx
movq %rdi, -0x38(%rbp)
movq %rsi, -0x68(%rbp)
jb 0x1038a
movl $0x1c00, %eax           # imm = 0x1C00
btl %ecx, %eax
jae 0x1039b
movq %r10, -0x48(%rbp)
movq %r8, %rdi
leaq -0x80(%rbp), %rsi
movq %r8, %r14
callq 0x6120
movq -0x80(%rbp), %rbx
cmpq %r14, %rbx
je 0x10470
movq %r12, %rdi
movsd %xmm0, -0x70(%rbp)
callq 0xae58
movq %rax, %r13
leaq 0x25fcc(%rip), %rax     # 0x36330
movq %rax, 0x8(%r13)
movq $0x0, (%r13)
movsd -0x70(%rbp), %xmm0
movsd %xmm0, 0x18(%r13)
movq -0x58(%rbp), %rcx
subq %r14, %rcx
addq %rbx, %rcx
jmp 0x1047f
cmpl $0x6f, %eax
je 0x103e0
cmpl $0x78, %eax
jne 0x103e7
movl $0x10, %edx
jmp 0x103f7
movl $0x1000001, %eax        # imm = 0x1000001
btl %ecx, %eax
jae 0x10491
movq %r10, %r14
movq (%r10), %rsi
movq %r12, %rdi
movq %r8, %rdx
callq 0x1b61a
movq %rax, %r13
cmpq $0x0, (%rax)
jne 0x103cd
movq 0x8(%r13), %rax
movq %r13, %rdi
callq *0x18(%rax)
movl 0x14(%r13), %eax
movq -0x58(%rbp), %rcx
addq %rax, %rcx
movq %r14, %r10
jmp 0x10466
movl $0x8, %edx
jmp 0x103f7
cmpl $0x69, %eax
movl $0xa, %edx
movl $0x0, %eax
cmovel %eax, %edx
movq %r10, -0x48(%rbp)
movq %r8, %rdi
leaq -0x80(%rbp), %rsi
movq %r8, %r13
testl %edx, %edx
je 0x10410
callq 0x6460
jmp 0x10415
callq 0xd4a4
cmpq %r13, -0x80(%rbp)
je 0x10452
movq %r12, %rdi
movq %r13, -0x70(%rbp)
movq %rax, %r14
callq 0xae58
movq %rax, %r13
leaq 0x25eac(%rip), %rax     # 0x362e0
movq %rax, 0x8(%r13)
movq $0x0, (%r13)
movq %r14, 0x18(%r13)
movq -0x58(%rbp), %rcx
subq -0x70(%rbp), %rcx
addq -0x80(%rbp), %rcx
jmp 0x10462
cmpb $0x1, (%r13)
movl $0x0, %ecx
sbbq %rcx, %rcx
xorl %r13d, %r13d
movq -0x48(%rbp), %r10
movq -0x38(%rbp), %rdi
movq -0x68(%rbp), %rsi
jmp 0x10498
cmpb $0x1, (%r14)
movl $0x0, %ecx
sbbq %rcx, %rcx
xorl %r13d, %r13d
movq -0x40(%rbp), %rbx
movq -0x38(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x48(%rbp), %r10
jmp 0x10498
xorl %r13d, %r13d
movq -0x58(%rbp), %rcx
testq %rsi, %rsi
je 0x104bd
movq %rdi, %rbx
movq %r12, %rdi
movq %rcx, -0x58(%rbp)
movq %r10, %r14
callq 0x759a
movq %rbx, %rdi
movq -0x40(%rbp), %rbx
movq %r14, %r10
movq -0x58(%rbp), %rcx
movl -0x2c(%rbp), %r9d
jmp 0x10135
movq -0x88(%rbp), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x104e3
movq %r12, %rdi
callq 0x759a
movq -0x78(%rbp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0xa, %eax
je 0x10530
cmpl $0xb, %eax
jne 0x1052e
movq -0x88(%rbp), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1051d
movq %r12, %rdi
callq 0x759a
movq %r12, %rdi
movq -0x78(%rbp), %rsi
callq 0x759a
jmp 0xfe3c
jmp 0x104e7
movq -0x88(%rbp), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1054d
movq %r12, %rdi
callq 0x759a
movq %r12, %rdi
movq -0x78(%rbp), %rsi
callq 0x759a
movq $-0x1, %rax
jmp 0x104e7