// File: /workspace/github_c_makefile_star2_O0/s3lase[P]v6shell/osh.c
// Function: glob2
static bool
glob2(const UChar *ename, const UChar *pattern)
{
	int cok, rok;		/* `[...]' - cok (class), rok (range) */
	UChar c, ec, pc;
	const UChar *e, *n, *p;

	e = ename;
	p = pattern;

	ec = *e++;
	switch (pc = *p++) {
	case EOS:
		return ec == EOS;

	case ASTERISK:
		/*
		 * Ignore all but the last `*' in a group of consecutive
		 * `*' characters to avoid unnecessary glob2() recursion.
		 */
		while (*p++ == ASTERISK)
			;	/* nothing */
		if (*--p == EOS)
			return true;
		e--;
		while (*e != EOS)
			if (glob2(e++, p))
				return true;
		break;

	case QUESTION:
		if (ec != EOS)
			return glob2(e, p);
		break;

	case LBRACKET:
		if (*p == EOS)
			break;
		for (c = UCHAR(EOS), cok = rok = 0, n = p + 1; ; ) {
			pc = *p++;
			if (pc == RBRACKET && p > n) {
				if (cok > 0 || rok > 0)
					return glob2(e, p);
				break;
			}
			if (*p == EOS)
				break;
			if (pc == HYPHEN && c != EOS && *p != RBRACKET) {
				if ((pc = *p++) == BQUOT)
					pc = *p++;
				if (*p == EOS)
					break;
				if (c <= ec && ec <= pc)
					rok++;
				else if (c == ec)
					cok--;
				c = UCHAR(EOS);
			} else {
				if (pc == BQUOT) {
					pc = *p++;
					if (*p == EOS)
						break;
				}
				c = pc;
				if (ec == c)
					cok++;
			}
		}
		break;

	case BQUOT:
		if (*p != EOS)
			pc = *p++;
		/*FALLTHROUGH*/

	default:
		if (pc == ec)
			return glob2(e, p);
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq %rax, %rcx
incq %rcx
movq %rcx, -0x30(%rbp)
movb (%rax), %al
movb %al, -0x22(%rbp)
movq -0x40(%rbp), %rax
movq %rax, %rcx
incq %rcx
movq %rcx, -0x40(%rbp)
movzbl (%rax), %ecx
movl %ecx, -0x44(%rbp)
movb %cl, %al
testl %ecx, %ecx
movb %al, -0x23(%rbp)
je 0x7549
jmp 0x7512
movl -0x44(%rbp), %eax
subl $0x2a, %eax
je 0x755d
jmp 0x751c
movl -0x44(%rbp), %eax
subl $0x3f, %eax
je 0x75df
jmp 0x752a
movl -0x44(%rbp), %eax
subl $0x5b, %eax
je 0x7604
jmp 0x7538
movl -0x44(%rbp), %eax
subl $0x5c, %eax
je 0x778f
jmp 0x77b1
movzbl -0x22(%rbp), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x77d7
jmp 0x755f
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movzbl (%rax), %eax
cmpl $0x2a, %eax
jne 0x7578
jmp 0x755f
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x40(%rbp)
movzbl -0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x7599
movb $0x1, -0x1(%rbp)
jmp 0x77d7
movq -0x30(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
je 0x75da
movq -0x30(%rbp), %rdi
movq %rdi, %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x40(%rbp), %rsi
callq 0x74c0
testb $0x1, %al
jne 0x75cf
jmp 0x75d8
movb $0x1, -0x1(%rbp)
jmp 0x77d7
jmp 0x75a5
jmp 0x77d3
movzbl -0x22(%rbp), %eax
cmpl $0x0, %eax
je 0x75ff
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x74c0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x77d7
jmp 0x77d3
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x7615
jmp 0x77d3
movb $0x0, -0x21(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movb (%rax), %al
movb %al, -0x23(%rbp)
movzbl -0x23(%rbp), %eax
cmpl $0x5d, %eax
jne 0x7682
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jbe 0x7682
cmpl $0x0, -0x1c(%rbp)
jg 0x7666
cmpl $0x0, -0x20(%rbp)
jle 0x767d
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x74c0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x77d7
jmp 0x778d
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x7693
jmp 0x778d
movzbl -0x23(%rbp), %eax
cmpl $0x2d, %eax
jne 0x773e
movzbl -0x21(%rbp), %eax
cmpl $0x0, %eax
je 0x773e
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x5d, %eax
je 0x773e
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movb (%rax), %al
movb %al, -0x23(%rbp)
movzbl %al, %eax
cmpl $0x5c, %eax
jne 0x76ed
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movb (%rax), %al
movb %al, -0x23(%rbp)
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x76fe
jmp 0x778d
movzbl -0x21(%rbp), %eax
movzbl -0x22(%rbp), %ecx
cmpl %ecx, %eax
jg 0x7721
movzbl -0x22(%rbp), %eax
movzbl -0x23(%rbp), %ecx
cmpl %ecx, %eax
jg 0x7721
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x7738
movzbl -0x21(%rbp), %eax
movzbl -0x22(%rbp), %ecx
cmpl %ecx, %eax
jne 0x7736
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7738
movb $0x0, -0x21(%rbp)
jmp 0x7788
movzbl -0x23(%rbp), %eax
cmpl $0x5c, %eax
jne 0x776b
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movb (%rax), %al
movb %al, -0x23(%rbp)
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x7769
jmp 0x778d
jmp 0x776b
movb -0x23(%rbp), %al
movb %al, -0x21(%rbp)
movzbl -0x22(%rbp), %eax
movzbl -0x21(%rbp), %ecx
cmpl %ecx, %eax
jne 0x7786
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7788
jmp 0x7633
jmp 0x77d3
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
je 0x77af
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movb (%rax), %al
movb %al, -0x23(%rbp)
jmp 0x77b1
movzbl -0x23(%rbp), %eax
movzbl -0x22(%rbp), %ecx
cmpl %ecx, %eax
jne 0x77d1
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x74c0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x77d7
jmp 0x77d3
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)