// File: /workspace/github_c_makefile_star2_O0/msteveb[P]autosetup/./jimsh0.c
// Function: JimCharsetMatch
static const char *JimCharsetMatch(const char *pattern, int plen, int c, int flags)
{
    int not = 0;
    int pchar;
    int match = 0;
    int nocase = 0;
    int n;

    if (flags & JIM_NOCASE) {
        nocase++;
        c = utf8_upper(c);
    }

    if (flags & JIM_CHARSET_SCAN) {
        if (*pattern == '^') {
            not++;
            pattern++;
            plen--;
        }


        if (*pattern == ']') {
            goto first;
        }
    }

    while (plen && *pattern != ']') {

        if (pattern[0] == '\\') {
first:
            n = utf8_tounicode_case(pattern, &pchar, nocase);
            pattern += n;
            plen -= n;
        }
        else {

            int start;
            int end;

            n = utf8_tounicode_case(pattern, &start, nocase);
            pattern += n;
            plen -= n;
            if (pattern[0] == '-' && plen > 1) {

                n = 1 + utf8_tounicode_case(pattern + 1, &end, nocase);
                pattern += n;
                plen -= n;


                if ((c >= start && c <= end) || (c >= end && c <= start)) {
                    match = 1;
                }
                continue;
            }
            pchar = start;
        }

        if (pchar == c) {
            match = 1;
        }
    }
    if (not) {
        match = !match;
    }

    return match ? pattern : NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1d289
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x10(%rbp), %edi
callq 0x60f0
movl %eax, -0x10(%rbp)
movl -0x14(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1d2ce
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5e, %eax
jne 0x1d2be
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5d, %eax
jne 0x1d2cc
jmp 0x1d305
jmp 0x1d2ce
jmp 0x1d2d0
xorl %eax, %eax
cmpl $0x0, -0xc(%rbp)
movb %al, -0x31(%rbp)
je 0x1d2eb
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5d, %eax
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x1d2f7
jmp 0x1d3f6
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x1d339
jmp 0x1d305
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %edx
leaq -0x1c(%rbp), %rsi
callq 0x1d430
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl -0x28(%rbp), %ecx
movl -0xc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xc(%rbp)
jmp 0x1d3e2
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %edx
leaq -0x2c(%rbp), %rsi
callq 0x1d430
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl -0x28(%rbp), %ecx
movl -0xc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x1d3dc
cmpl $0x1, -0xc(%rbp)
jle 0x1d3dc
movq -0x8(%rbp), %rdi
addq $0x1, %rdi
movl -0x24(%rbp), %edx
leaq -0x30(%rbp), %rsi
callq 0x1d430
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl -0x28(%rbp), %ecx
movl -0xc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jl 0x1d3c0
movl -0x10(%rbp), %eax
cmpl -0x30(%rbp), %eax
jle 0x1d3d0
movl -0x10(%rbp), %eax
cmpl -0x30(%rbp), %eax
jl 0x1d3d7
movl -0x10(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jg 0x1d3d7
movl $0x1, -0x20(%rbp)
jmp 0x1d2d0
movl -0x2c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x10(%rbp), %eax
jne 0x1d3f1
movl $0x1, -0x20(%rbp)
jmp 0x1d2d0
cmpl $0x0, -0x18(%rbp)
je 0x1d40d
cmpl $0x0, -0x20(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x1d41d
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x1d425
xorl %eax, %eax
movq %rax, -0x40(%rbp)
jmp 0x1d425
movq -0x40(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop