// File: /workspace/github_c_makefile_star2_O0/JimKent[P]linearSat/lib/wildcmp.c
// Function: globMatch
static boolean globMatch(const char *wildCard, const char *string, char single, char multi)
/* does a case sensitive wild card match with a string.
 * * matches any string or no character.
 * ? matches any single character.
 * anything else etc must match the character exactly. */
{
boolean matchStar = 0;
int starMatchSize;
char c;

for(;;)
    {
NEXT_WILD:
    c = *wildCard;
    if (c == 0)
	{
	if(matchStar)
	    {
	    while(*string++)
		;
	    return TRUE;
	    }
	else if(*string)
	    return FALSE;
	else
	    return TRUE;
	}
    else if (c == multi)
	{
	matchStar = TRUE;
	}
    else if (c == single)
	{
	if(*string == 0)
	    return FALSE; /* out of string, no match for ? */
	++string;
	}
    else
	{
	if(matchStar)
	    {
	    for(;;)
		{
		if(*string == 0) /* if out of string no match */
		    return FALSE;

		/* note matchStar is re-used here for substring
		 * after star match length */
		if((starMatchSize = subMatch(string,wildCard,single,multi)) != 0)
		    {
		    string += starMatchSize;
		    wildCard += starMatchSize;
		    matchStar = FALSE;
		    goto NEXT_WILD;
		    }
		++string;
		}
	    }

	/* default: they must be equal or no match */
	if(toupper(*string) != toupper(*wildCard))
	    return FALSE;
	++string;
	}
    ++wildCard;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %cl, -0x19(%rbp)
movb %al, -0x1a(%rbp)
movl $0x0, -0x20(%rbp)
jmp 0x1b263
movq -0x10(%rbp), %rax
movb (%rax), %al
movb %al, -0x25(%rbp)
movsbl -0x25(%rbp), %eax
cmpl $0x0, %eax
jne 0x1b2c0
cmpl $0x0, -0x20(%rbp)
je 0x1b29f
jmp 0x1b27d
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
cmpb $0x0, (%rax)
je 0x1b293
jmp 0x1b27d
movl $0x1, -0x4(%rbp)
jmp 0x1b3d6
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x1b2b4
movl $0x0, -0x4(%rbp)
jmp 0x1b3d6
movl $0x1, -0x4(%rbp)
jmp 0x1b3d6
movsbl -0x25(%rbp), %eax
movsbl -0x1a(%rbp), %ecx
cmpl %ecx, %eax
jne 0x1b2d8
movl $0x1, -0x20(%rbp)
jmp 0x1b3c3
movsbl -0x25(%rbp), %eax
movsbl -0x19(%rbp), %ecx
cmpl %ecx, %eax
jne 0x1b30d
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1b2fc
movl $0x0, -0x4(%rbp)
jmp 0x1b3d6
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x1b3c1
cmpl $0x0, -0x20(%rbp)
je 0x1b388
jmp 0x1b315
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1b32d
movl $0x0, -0x4(%rbp)
jmp 0x1b3d6
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movb -0x19(%rbp), %al
movsbl %al, %edx
movsbl -0x1a(%rbp), %ecx
callq 0x1b410
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
je 0x1b37a
movl -0x24(%rbp), %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x20(%rbp)
jmp 0x1b263
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x1b315
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x30e0
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %edi
callq 0x30e0
movl %eax, %ecx
movl -0x2c(%rbp), %eax
cmpl %ecx, %eax
je 0x1b3b5
movl $0x0, -0x4(%rbp)
jmp 0x1b3d6
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x1b3c3
jmp 0x1b3c5
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x1b261
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop