// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0xcf19
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x44(%rbp)
subl $0x2a, %eax
je 0xcc92
jmp 0xcc65
movl -0x44(%rbp), %eax
subl $0x3f, %eax
je 0xcd62
jmp 0xcc73
movl -0x44(%rbp), %eax
subl $0x5b, %eax
je 0xcd94
jmp 0xcc81
movl -0x44(%rbp), %eax
subl $0x5c, %eax
je 0xce2a
jmp 0xce4b
jmp 0xcc94
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %ecx
xorl %eax, %eax
cmpl $0x2a, %ecx
movb %al, -0x45(%rbp)
jne 0xccb0
cmpl $0x0, -0x14(%rbp)
setne %al
movb %al, -0x45(%rbp)
movb -0x45(%rbp), %al
testb $0x1, %al
jne 0xccb9
jmp 0xccd0
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xcc94
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0xccf7
movl $0x1, -0x4(%rbp)
jmp 0xcf35
jmp 0xccf9
cmpl $0x0, -0x24(%rbp)
je 0xcd56
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
callq 0xcc30
cmpl $0x0, %eax
je 0xcd27
movl $0x1, -0x4(%rbp)
jmp 0xcf35
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0x34(%rbp), %ecx
movl -0x24(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x24(%rbp)
jmp 0xccf9
movl $0x0, -0x4(%rbp)
jmp 0xcf35
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0x34(%rbp), %ecx
movl -0x24(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x24(%rbp)
jmp 0xcea0
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0x34(%rbp), %ecx
movl -0x24(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
addq $0x1, %rdi
movl -0x14(%rbp), %esi
subl $0x1, %esi
movl -0x2c(%rbp), %edx
movl -0x28(%rbp), %r8d
xorl %ecx, %ecx
movl $0x1, %eax
cmpl $0x0, %r8d
cmovnel %eax, %ecx
callq 0x1d240
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0xce00
movl $0x0, -0x4(%rbp)
jmp 0xcf35
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
subq %rax, %rcx
movslq -0x14(%rbp), %rax
subq %rcx, %rax
movl %eax, -0x14(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0xce28
jmp 0xcc4a
jmp 0xcea0
movq -0x10(%rbp), %rax
cmpb $0x0, 0x1(%rax)
je 0xce49
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xce4b
movq -0x20(%rbp), %rdi
movl -0x28(%rbp), %edx
leaq -0x2c(%rbp), %rsi
callq 0x1d430
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0x34(%rbp), %ecx
movl -0x24(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %edx
leaq -0x30(%rbp), %rsi
callq 0x1d430
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
je 0xce9e
movl $0x0, -0x4(%rbp)
jmp 0xcf35
jmp 0xcea0
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %edx
leaq -0x30(%rbp), %rsi
callq 0x1d430
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl -0x34(%rbp), %ecx
movl -0x14(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0xcf14
jmp 0xced7
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x2a, %ecx
movb %al, -0x46(%rbp)
jne 0xcef2
cmpl $0x0, -0x14(%rbp)
setne %al
movb %al, -0x46(%rbp)
movb -0x46(%rbp), %al
testb $0x1, %al
jne 0xcefb
jmp 0xcf12
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xced7
jmp 0xcf19
jmp 0xcc4a
cmpl $0x0, -0x14(%rbp)
jne 0xcf2e
cmpl $0x0, -0x24(%rbp)
jne 0xcf2e
movl $0x1, -0x4(%rbp)
jmp 0xcf35
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop