// File: /workspace/github_c_makefile_star2_O1/msteveb[P]autosetup/./jimsh0.c
// Function: JimGlobMatch
static int JimGlobMatch(const char *pattern, int plen, const char *string, int slen, int nocase)
{
    int c;
    int pchar;
    int n;
    const char *p;
    while (plen) {
        switch (pattern[0]) {
            case '*':
                while (pattern[1] == '*' && plen) {
                    pattern++;
                    plen--;
                }
                pattern++;
                plen--;
                if (!plen) {
                    return 1;
                }
                while (slen) {

                    if (JimGlobMatch(pattern, plen, string, slen, nocase))
                        return 1;
                    n = utf8_tounicode(string, &c);
                    string += n;
                    slen -= n;
                }
                return 0;

            case '?':
                n = utf8_tounicode(string, &c);
                string += n;
                slen -= n;
                break;

            case '[': {
                    n = utf8_tounicode(string, &c);
                    string += n;
                    slen -= n;
                    p = JimCharsetMatch(pattern + 1, plen - 1, c, nocase ? JIM_NOCASE : 0);
                    if (!p) {
                        return 0;
                    }
                    plen -= p - pattern;
                    pattern = p;

                    if (!plen) {

                        continue;
                    }
                    break;
                }
            case '\\':
                if (pattern[1]) {
                    pattern++;
                    plen--;
                }

            default:
                n = utf8_tounicode_case(string, &c, nocase);
                string += n;
                slen -= n;
                utf8_tounicode_case(pattern, &pchar, nocase);
                if (pchar != c) {
                    return 0;
                }
                break;
        }
        n = utf8_tounicode_case(pattern, &pchar, nocase);
        pattern += n;
        plen -= n;
        if (!slen) {
            while (*pattern == '*' && plen) {
                pattern++;
                plen--;
            }
            break;
        }
    }
    if (!plen && !slen) {
        return 1;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
testl %esi, %esi
je 0xb2b8
movq %rdx, %r12
movl %esi, %r14d
movq %rdi, %r13
xorl %eax, %eax
movl %r8d, -0x2c(%rbp)
testl %r8d, %r8d
setne %al
movl %eax, -0x30(%rbp)
movzbl (%r13), %eax
cmpl $0x5a, %eax
jle 0xb1d6
cmpl $0x5b, %eax
je 0xb23b
cmpl $0x5c, %eax
jne 0xb1e4
leaq 0x1(%r13), %rax
xorl %ecx, %ecx
cmpb $0x0, 0x1(%r13)
setne %cl
cmovneq %rax, %r13
subl %ecx, %r14d
jmp 0xb1e4
cmpl $0x3f, %eax
je 0xb216
cmpl $0x2a, %eax
je 0xb26f
movl -0x2c(%rbp), %eax
movzbl (%r12), %r15d
testl %eax, %eax
je 0xb1fb
movl %r15d, %edi
callq 0x60e0
movl %eax, %r15d
movzbl (%r13), %eax
cmpl $0x0, -0x2c(%rbp)
je 0xb20d
movl %eax, %edi
callq 0x60e0
cmpl %r15d, %eax
jne 0xb2b3
incq %r12
decl %ebx
leaq 0x1(%r13), %rax
leal -0x1(%r14), %ecx
testl %ebx, %ebx
je 0xb2d5
movq %rax, %r13
movl %ecx, %r14d
testl %ecx, %ecx
jne 0xb1a7
jmp 0xb2b8
movzbl (%r12), %edx
leaq 0x1(%r13), %rdi
leal -0x1(%r14), %esi
movl -0x30(%rbp), %ecx
callq 0x17e06
testq %rax, %rax
je 0xb2b3
decl %ebx
incq %r12
subl %eax, %r13d
addl %r13d, %r14d
je 0xb267
movq %rax, %r13
jmp 0xb21b
xorl %ecx, %ecx
jmp 0xb22b
testb %al, %al
je 0xb281
addl $-0x1, %r14d
setb %al
cmpb $0x2a, 0x1(%r13)
leaq 0x1(%r13), %r13
je 0xb26b
movl $0x1, %r15d
testl %r14d, %r14d
movl -0x2c(%rbp), %r8d
je 0xb2c3
testl %ebx, %ebx
je 0xb2b3
movq %r13, %rdi
movl %r14d, %esi
movq %r12, %rdx
movl %ebx, %ecx
callq 0xb177
testl %eax, %eax
jne 0xb2c3
incq %r12
decl %ebx
movl -0x2c(%rbp), %r8d
jne 0xb294
xorl %r15d, %r15d
jmp 0xb2c3
xorl %edx, %edx
xorl %r15d, %r15d
orl %ebx, %edx
sete %r15b
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x2a, (%rax)
jne 0xb2fe
testl %ecx, %ecx
je 0xb2fe
leal -0x2(%r14), %eax
xorl %ecx, %ecx
leaq 0x1(%rcx), %rdx
cmpb $0x2a, 0x2(%r13,%rcx)
jne 0xb2f7
cmpl %ecx, %eax
movq %rdx, %rcx
jne 0xb2e4
notl %edx
addl %r14d, %edx
jmp 0xb2ba
movl %ecx, %edx
jmp 0xb2ba