// File: /workspace/github_c_makefile_star2_O0/buf1024[P]mysch/util.c
// Function: match
int match(const char* text, const char* pattern)
{
    if (NULL == text || NULL == pattern) {
        return 0;
    }
    const char * retryPat;
    const char * retryText;
    int ch;
    int found;

    retryPat = NULL;
    retryText = NULL;

    while (*text || *pattern) {
        ch = *pattern++;

        switch (ch) {
        case '*':
            retryPat = pattern;
            retryText = text;
            break;

        case '[':
            found = 0;

            while ((ch = *pattern++) != ']') {
                if (ch == '\\')
                    ch = *pattern++;

                if (ch == '\0')
                    return 0;

                if (*text == ch)
                    found = 1;
            }

            if (!found) {
                pattern = retryPat;
                text = ++retryText;
            }

            if (text) {
                if (*text++ == '\0')
                    return 0;
            }

            break;

        case '?':
            if (*text++ == '\0')
                return 0;

            break;

        case '\\':
            ch = *pattern++;

            if (ch == '\0')
                return 0;

            if (*text == ch) {
                if (*text)
                    text++;
                break;
            }

            if (*text) {
                pattern = retryPat;
                text = ++retryText;
                break;
            }

            return 0;

        default:
            if (*text == ch) {
                if (*text)
                    text++;
                break;
            }

            if (*text) {
                pattern = retryPat;
                text = ++retryText;
                break;
            }

            return 0;
        }

        if (pattern == NULL)
            return 0;
    }

    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
je 0x6e9c
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
jne 0x6ea8
movl $0x0, -0x4(%rbp)
jmp 0x70ff
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x31(%rbp)
jne 0x6ed9
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x6ee5
jmp 0x70f8
movq -0x18(%rbp), %rax
movq %rax, %rcx
incq %rcx
movq %rcx, -0x18(%rbp)
movsbl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x38(%rbp)
subl $0x2a, %eax
je 0x6f2f
jmp 0x6f06
movl -0x38(%rbp), %eax
subl $0x3f, %eax
je 0x6ff6
jmp 0x6f14
movl -0x38(%rbp), %eax
subl $0x5b, %eax
je 0x6f44
jmp 0x6f1e
movl -0x38(%rbp), %eax
subl $0x5c, %eax
je 0x701e
jmp 0x7094
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x70e3
movl $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movsbl (%rax), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x5d, %eax
je 0x6fa7
cmpl $0x5c, -0x2c(%rbp)
jne 0x6f80
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movsbl (%rax), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x6f92
movl $0x0, -0x4(%rbp)
jmp 0x70ff
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl -0x2c(%rbp), %eax
jne 0x6fa5
movl $0x1, -0x30(%rbp)
jmp 0x6f4b
cmpl $0x0, -0x30(%rbp)
jne 0x6fc5
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x6ff1
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x6fef
movl $0x0, -0x4(%rbp)
jmp 0x70ff
jmp 0x6ff1
jmp 0x70e3
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x7019
movl $0x0, -0x4(%rbp)
jmp 0x70ff
jmp 0x70e3
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movsbl (%rax), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x7045
movl $0x0, -0x4(%rbp)
jmp 0x70ff
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl -0x2c(%rbp), %eax
jne 0x7068
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x7066
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x70e3
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x708b
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq %rax, -0x10(%rbp)
jmp 0x70e3
movl $0x0, -0x4(%rbp)
jmp 0x70ff
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl -0x2c(%rbp), %eax
jne 0x70b7
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x70b5
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x70e3
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x70da
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq %rax, -0x10(%rbp)
jmp 0x70e3
movl $0x0, -0x4(%rbp)
jmp 0x70ff
cmpq $0x0, -0x18(%rbp)
jne 0x70f3
movl $0x0, -0x4(%rbp)
jmp 0x70ff
jmp 0x6eb8
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)