// File: /workspace/github_c_makefile_star2_O1/azhai[P]mlite/mlite.c
// Function: fnmatch
cell fnmatch(cell n, int *ps) {
	cell	c, cas, p, a, v, rib, g;
	cell	new;

	save(Environment);
	p = car(n);
	Environment = cadr(p);
	if (cdr(n) != NIL && cddr(n) == NIL)
		a = cadr(n);
	else
		a = cdr(n);
	c = rib = UNDEFINED;
	for (cas = cdddr(p); cas != NIL; cas = cdr(cas)) {
		c = car(cas);
		v = car(c);
		g = 0;
		if (tuple_p(v) && car(v) == GUARD) {
			v = cadr(v);
			g =  1;
		}
		if ((rib = destructuring_bind(v, a)) == UNDEFINED)
			continue;
		if (!g)
			break;
		Environment = make_env(rib, Environment);
		save(n);
		set(car(Stack), next_case(n, cas));
		*ps = EV_GUARD;
		return cddar(c);
	}
	*ps = EV_BETA;
	if (rib == UNDEFINED)
		return error("no match", n);
	Environment = make_env(rib, Environment);
	return cadr(c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r13
movq 0xa0a6(%rip), %rdi      # 0x1e108
movq 0xa0bf(%rip), %rsi      # 0x1e128
xorl %edx, %edx
callq 0x36e8
movq %rax, 0xa0b1(%rip)      # 0x1e128
movq 0xa0f2(%rip), %rsi      # 0x1e170
movq (%rsi,%r13,8), %rdx
movq 0xa537(%rip), %rcx      # 0x1e5c0
movq (%rcx,%rdx,8), %rax
movq (%rsi,%rax,8), %rax
movq %rax, 0xa070(%rip)      # 0x1e108
leaq (%rcx,%r13,8), %rax
movq (%rax), %rdi
cmpq $-0x1, %rdi
je 0x140b2
cmpq $-0x1, (%rcx,%rdi,8)
leaq (%rsi,%rdi,8), %rsi
cmoveq %rsi, %rax
movq (%rcx,%rdx,8), %rdx
movq (%rcx,%rdx,8), %rdx
movq (%rcx,%rdx,8), %r15
movq $-0x5, %r12
cmpq $-0x1, %r15
je 0x14134
movq %r13, -0x30(%rbp)
movq %r14, -0x38(%rbp)
movq (%rax), %r13
movq 0xa093(%rip), %rax      # 0x1e170
movq (%rax,%r15,8), %rbx
movq (%rax,%rbx,8), %rdi
movb $0x1, %r14b
testq %rdi, %rdi
js 0x14113
movq 0xa4ec(%rip), %rcx      # 0x1e5e0
testb $0x19, (%rcx,%rdi)
jne 0x14113
cmpq $-0x9, (%rax,%rdi,8)
jne 0x14113
movq 0xa4b8(%rip), %rcx      # 0x1e5c0
movq (%rcx,%rdi,8), %rcx
movq (%rax,%rcx,8), %rdi
xorl %r14d, %r14d
movq %r13, %rsi
callq 0x13d4e
cmpq $-0x5, %rax
jne 0x1413d
movq 0xa498(%rip), %rax      # 0x1e5c0
movq (%rax,%r15,8), %r15
cmpq $-0x1, %r15
jne 0x140d6
jmp 0x14145
movq $-0x5, %rbx
jmp 0x1414d
testb %r14b, %r14b
je 0x1419f
movq %rax, %r12
movq -0x38(%rbp), %r14
movq -0x30(%rbp), %r13
movl $0x2, (%r14)
cmpq $-0x5, %r12
jne 0x14175
leaq 0x2fe8(%rip), %rdi      # 0x17149
movq %r13, %rsi
callq 0x33eb
movq $-0x5, %rax
jmp 0x1420b
movq 0x9f8c(%rip), %rsi      # 0x1e108
movq %r12, %rdi
callq 0xdbf0
movq %rax, 0x9f7d(%rip)      # 0x1e108
movq 0x9fde(%rip), %rax      # 0x1e170
movq 0xa427(%rip), %rcx      # 0x1e5c0
movq (%rcx,%rbx,8), %rcx
jmp 0x14207
movq 0x9f62(%rip), %rsi      # 0x1e108
movq %rax, %rdi
callq 0xdbf0
movq %rax, 0x9f53(%rip)      # 0x1e108
movq 0x9f6c(%rip), %rsi      # 0x1e128
movq -0x30(%rbp), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x9f57(%rip)      # 0x1e128
movq %r14, %rdi
movq %r15, %rsi
callq 0x13fc8
movq 0x9f8d(%rip), %rcx      # 0x1e170
movq 0x9f3e(%rip), %rdx      # 0x1e128
movq %rax, (%rcx,%rdx,8)
movq -0x38(%rbp), %rax
movl $0x3, (%rax)
movq 0xa3c1(%rip), %rax      # 0x1e5c0
movq (%rcx,%rbx,8), %rcx
movq (%rax,%rcx,8), %rcx
movq (%rax,%rcx,8), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq