// File: FreeSlave[P]vhlt/common/cmdlinecfg.cpp
// Function: pmatch(char const*, char const*)
bool pmatch (const char *cmdlineparam, const char *param)
{
	int cl, cstart, cend, pl, pstart, pend, k;
	cl = plen (cmdlineparam);
	pl = plen (param);
	if (cl < 0 || pl < 0)
		return false;
	bool anystart = (pl > 0 && param[0] == '*');
	bool anyend = (pl > 0 && param[pl-1] == '*');
	pstart = anystart ? 1 : 0;
	pend = anyend ? pl-1 : pl;
	if (pend < pstart) pend = pstart;
	for (cstart = 0; cstart <= cl; ++cstart)
	{
		for (cend = cl; cend >= cstart; --cend)
		{
			if (cend - cstart == pend - pstart)
			{
				for (k = 0; k < cend - cstart; ++k)
					if (tolower (cmdlineparam[k+cstart]) != tolower (param[k+pstart]))
						break;
				if (k == cend - cstart)
					return true;
			}
			if (!anyend)
				break;
		}
		if (!anystart)
			break;
	}
	return false;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rdi
callq 0x9d90
movl %eax, 0x2c(%rsp)
movq 0x30(%rsp), %rdi
callq 0x9d90
movl %eax, 0x20(%rsp)
cmpl $0x0, 0x2c(%rsp)
jl 0x9e48
cmpl $0x0, 0x20(%rsp)
jge 0x9e52
movb $0x0, 0x47(%rsp)
jmp 0x9ffb
xorl %eax, %eax
cmpl $0x0, 0x20(%rsp)
movb %al, 0x11(%rsp)
jle 0x9e71
movq 0x30(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
sete %al
movb %al, 0x11(%rsp)
movb 0x11(%rsp), %al
andb $0x1, %al
movb %al, 0x13(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x20(%rsp)
movb %al, 0x10(%rsp)
jle 0x9ea5
movq 0x30(%rsp), %rax
movl 0x20(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2a, %eax
sete %al
movb %al, 0x10(%rsp)
movb 0x10(%rsp), %al
andb $0x1, %al
movb %al, 0x12(%rsp)
movb 0x13(%rsp), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, 0x1c(%rsp)
testb $0x1, 0x12(%rsp)
je 0x9ed8
movl 0x20(%rsp), %eax
subl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x9ee0
movl 0x20(%rsp), %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jge 0x9efa
movl 0x1c(%rsp), %eax
movl %eax, 0x18(%rsp)
movl $0x0, 0x28(%rsp)
movl 0x28(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jg 0x9ff6
movl 0x2c(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x28(%rsp), %eax
jl 0x9fdb
movl 0x24(%rsp), %eax
subl 0x28(%rsp), %eax
movl 0x18(%rsp), %ecx
subl 0x1c(%rsp), %ecx
cmpl %ecx, %eax
jne 0x9fc0
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movl 0x24(%rsp), %ecx
subl 0x28(%rsp), %ecx
cmpl %ecx, %eax
jge 0x9fa7
movq 0x38(%rsp), %rax
movl 0x14(%rsp), %ecx
addl 0x28(%rsp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %edi
callq 0x4570
movl %eax, 0x8(%rsp)
movq 0x30(%rsp), %rax
movl 0x14(%rsp), %ecx
addl 0x1c(%rsp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %edi
callq 0x4570
movl %eax, %ecx
movl 0x8(%rsp), %eax
cmpl %ecx, %eax
je 0x9f98
jmp 0x9fa7
jmp 0x9f9a
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x9f46
movl 0x14(%rsp), %eax
movl 0x24(%rsp), %ecx
subl 0x28(%rsp), %ecx
cmpl %ecx, %eax
jne 0x9fbe
movb $0x1, 0x47(%rsp)
jmp 0x9ffb
jmp 0x9fc0
testb $0x1, 0x12(%rsp)
jne 0x9fc9
jmp 0x9fdb
jmp 0x9fcb
movl 0x24(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x9f18
testb $0x1, 0x13(%rsp)
jne 0x9fe4
jmp 0x9ff6
jmp 0x9fe6
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x9f02
movb $0x0, 0x47(%rsp)
movb 0x47(%rsp), %al
andb $0x1, %al
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)