// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/util.c
// Function: stringmatchlen
int stringmatchlen(const char *pattern, int patternLen,
        const char *string, int stringLen, int nocase)
{
    while(patternLen) {
        switch(pattern[0]) {
        case '*':
            while (pattern[1] == '*') {
                pattern++;
                patternLen--;
            }
            if (patternLen == 1)
                return 1; /* match */
            while(stringLen) {
                if (stringmatchlen(pattern+1, patternLen-1,
                            string, stringLen, nocase))
                    return 1; /* match */
                string++;
                stringLen--;
            }
            return 0; /* no match */
            break;
        case '?':
            if (stringLen == 0)
                return 0; /* no match */
            string++;
            stringLen--;
            break;
        case '[':
        {
            int not, match;

            pattern++;
            patternLen--;
            not = pattern[0] == '^';
            if (not) {
                pattern++;
                patternLen--;
            }
            match = 0;
            while(1) {
                if (pattern[0] == '\\') {
                    pattern++;
                    patternLen--;
                    if (pattern[0] == string[0])
                        match = 1;
                } else if (pattern[0] == ']') {
                    break;
                } else if (patternLen == 0) {
                    pattern--;
                    patternLen++;
                    break;
                } else if (pattern[1] == '-' && patternLen >= 3) {
                    int start = pattern[0];
                    int end = pattern[2];
                    int c = string[0];
                    if (start > end) {
                        int t = start;
                        start = end;
                        end = t;
                    }
                    if (nocase) {
                        start = tolower(start);
                        end = tolower(end);
                        c = tolower(c);
                    }
                    pattern += 2;
                    patternLen -= 2;
                    if (c >= start && c <= end)
                        match = 1;
                } else {
                    if (!nocase) {
                        if (pattern[0] == string[0])
                            match = 1;
                    } else {
                        if (tolower((int)pattern[0]) == tolower((int)string[0]))
                            match = 1;
                    }
                }
                pattern++;
                patternLen--;
            }
            if (not)
                match = !match;
            if (!match)
                return 0; /* no match */
            string++;
            stringLen--;
            break;
        }
        case '\\':
            if (patternLen >= 2) {
                pattern++;
                patternLen--;
            }
            /* fall through */
        default:
            if (!nocase) {
                if (pattern[0] != string[0])
                    return 0; /* no match */
            } else {
                if (tolower((int)pattern[0]) != tolower((int)string[0]))
                    return 0; /* no match */
            }
            string++;
            stringLen--;
            break;
        }
        pattern++;
        patternLen--;
        if (stringLen == 0) {
            while(*pattern == '*') {
                pattern++;
                patternLen--;
            }
            break;
        }
    }
    if (patternLen == 0 && stringLen == 0)
        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 0x472f6
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x44(%rbp)
subl $0x2a, %eax
je 0x46f52
jmp 0x46f25
movl -0x44(%rbp), %eax
subl $0x3f, %eax
je 0x46fe4
jmp 0x46f33
movl -0x44(%rbp), %eax
subl $0x5b, %eax
je 0x47010
jmp 0x46f41
movl -0x44(%rbp), %eax
subl $0x5c, %eax
je 0x47228
jmp 0x47245
jmp 0x46f54
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2a, %eax
jne 0x46f78
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x46f54
cmpl $0x1, -0x14(%rbp)
jne 0x46f8a
movl $0x1, -0x4(%rbp)
jmp 0x47312
jmp 0x46f8c
cmpl $0x0, -0x24(%rbp)
je 0x46fd8
movq -0x10(%rbp), %rdi
addq $0x1, %rdi
movl -0x14(%rbp), %esi
subl $0x1, %esi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
callq 0x46ef0
cmpl $0x0, %eax
je 0x46fc1
movl $0x1, -0x4(%rbp)
jmp 0x47312
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x46f8c
movl $0x0, -0x4(%rbp)
jmp 0x47312
cmpl $0x0, -0x24(%rbp)
jne 0x46ff6
movl $0x0, -0x4(%rbp)
jmp 0x47312
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x472af
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5e, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x47055
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x4709b
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x47096
movl $0x1, -0x30(%rbp)
jmp 0x471cb
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5d, %eax
jne 0x470ac
jmp 0x471e5
cmpl $0x0, -0x14(%rbp)
jne 0x470cc
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x471e5
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2d, %eax
jne 0x47175
cmpl $0x3, -0x14(%rbp)
jl 0x47175
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x2(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jle 0x47120
movl -0x34(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x47147
movl -0x34(%rbp), %edi
callq 0x26900
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %edi
callq 0x26900
movl %eax, -0x38(%rbp)
movl -0x3c(%rbp), %edi
callq 0x26900
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x14(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jl 0x47173
movl -0x3c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jg 0x47173
movl $0x1, -0x30(%rbp)
jmp 0x471c5
cmpl $0x0, -0x28(%rbp)
jne 0x47196
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x47194
movl $0x1, -0x30(%rbp)
jmp 0x471c3
movq -0x10(%rbp), %rax
movsbl (%rax), %edi
callq 0x26900
movl %eax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %edi
callq 0x26900
movl %eax, %ecx
movl -0x48(%rbp), %eax
cmpl %ecx, %eax
jne 0x471c1
movl $0x1, -0x30(%rbp)
jmp 0x471c3
jmp 0x471c5
jmp 0x471c7
jmp 0x471c9
jmp 0x471cb
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4705c
cmpl $0x0, -0x2c(%rbp)
je 0x471fc
cmpl $0x0, -0x30(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0x4720e
movl $0x0, -0x4(%rbp)
jmp 0x47312
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x472af
cmpl $0x2, -0x14(%rbp)
jl 0x47243
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x47245
cmpl $0x0, -0x28(%rbp)
jne 0x4726b
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x47269
movl $0x0, -0x4(%rbp)
jmp 0x47312
jmp 0x4729a
movq -0x10(%rbp), %rax
movsbl (%rax), %edi
callq 0x26900
movl %eax, -0x4c(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %edi
callq 0x26900
movl %eax, %ecx
movl -0x4c(%rbp), %eax
cmpl %ecx, %eax
je 0x47298
movl $0x0, -0x4(%rbp)
jmp 0x47312
jmp 0x4729a
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x472f1
jmp 0x472cc
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
jne 0x472ef
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x472cc
jmp 0x472f6
jmp 0x46f0a
cmpl $0x0, -0x14(%rbp)
jne 0x4730b
cmpl $0x0, -0x24(%rbp)
jne 0x4730b
movl $0x1, -0x4(%rbp)
jmp 0x47312
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)