// File: /workspace/github_c_makefile_star2_O0/azhai[P]mlite/mlite.c
// Function: match
cell match(int curry) {
	cell	p, x, n, m, new, curried, npat;

	m = node(NIL, NIL);
	save(m);
	curried = NIL;
	npat = 0;
	save(curried);
	for (;;) {
		p = pattern();
		npat++;
		while (	curry &&
			Token != TOK_WHERE &&
			!(Token == TOK_ID && Attr == S_equal) &&
			!Error_flag
		) {
			set(car(Stack), node(p, car(Stack)));
			p = pattern();
		}
		if (Token == TOK_WHERE) {
			save(p);
			Token = scan();
			x = logop(TOK_OR, 0);
			if (tuple_p(p) && car(p) == GUARD)
				error("implicit guard conflicts with `where'",
					NOEXPR);
			p = node(unsave(1), x);
			p = node(GUARD, p);
		}
		if (Token != TOK_ID || Attr != S_equal) {
			unsave(2);
			return error("missing '=' in match", NOEXPR);
		}
		save(p);
		Token = scan();
		x = expr();
		n = node(x, NIL);
		set(car(m), node(unsave(1), n));
		if (Token != TOK_PIPE)
			break;
		Token = scan();
		set(cdr(m), node(NIL, NIL));
		m = cdr(m);
	}
	curried = unsave(1);
	if (curried != NIL && npat > 1) {
		unsave(1);
		return error("currying cannot be combined with `|'", NOEXPR);
	}
	Tmp = n = unsave(1);
	save(curried);
	Tmp = NIL;
	while (curried != NIL) {
		n = node(S_fn, n);
		n = node(n, NIL);
		n = node(car(curried), n);
		n = node(n, NIL);
		curried = cdr(curried);
	}
	unsave(1);
	return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0xc(%rbp)
movq $-0x1, %rsi
xorl %edx, %edx
movq %rsi, %rdi
callq 0x3780
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq 0x18ffd(%rip), %rsi     # 0x28138
xorl %edx, %edx
callq 0x3780
movq %rax, 0x18fef(%rip)     # 0x28138
movq $-0x1, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq 0x18fd4(%rip), %rsi     # 0x28138
xorl %edx, %edx
callq 0x3780
movq %rax, 0x18fc6(%rip)     # 0x28138
callq 0xf080
movq %rax, -0x18(%rbp)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
xorl %eax, %eax
cmpl $0x0, -0xc(%rbp)
movb %al, -0x49(%rbp)
je 0xf1d5
xorl %eax, %eax
cmpl $0xffffff1d, 0x19542(%rip) # imm = 0xFFFFFF1D
movb %al, -0x49(%rbp)
je 0xf1d5
cmpl $0xfffffed1, 0x19533(%rip) # imm = 0xFFFFFED1
jne 0xf1c4
movq 0x18fb2(%rip), %rcx     # 0x28168
xorl %eax, %eax
cmpq 0x19549(%rip), %rcx     # 0x28708
movb %al, -0x49(%rbp)
je 0xf1d5
movl 0x193fa(%rip), %eax     # 0x285c4
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0xf1de
jmp 0xf223
movq -0x18(%rbp), %rdi
movq 0x18f97(%rip), %rax     # 0x28180
movq 0x18f48(%rip), %rcx     # 0x28138
movq (%rax,%rcx,8), %rsi
xorl %edx, %edx
callq 0x3780
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdx
movq 0x18f76(%rip), %rax     # 0x28180
movq 0x18f27(%rip), %rcx     # 0x28138
movq %rdx, (%rax,%rcx,8)
callq 0xf080
movq %rax, -0x18(%rbp)
jmp 0xf187
cmpl $0xffffff1d, 0x194b3(%rip) # imm = 0xFFFFFF1D
jne 0xf30a
movq -0x18(%rbp), %rdi
movq 0x18efa(%rip), %rsi     # 0x28138
xorl %edx, %edx
callq 0x3780
movq %rax, 0x18eec(%rip)     # 0x28138
callq 0xcc90
movl %eax, 0x19489(%rip)     # 0x286e0
movl $0xffffff23, %edi       # imm = 0xFFFFFF23
xorl %esi, %esi
callq 0xf530
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
jl 0xf2d8
movq 0x1937b(%rip), %rax     # 0x285f0
movq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xf2d8
movq 0x19364(%rip), %rax     # 0x285f0
movq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0xf2d8
movq 0x1934d(%rip), %rax     # 0x285f0
movq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0xf2d8
movq 0x18ec6(%rip), %rax     # 0x28180
movq -0x18(%rbp), %rcx
cmpq $-0x9, (%rax,%rcx,8)
jne 0xf2d8
leaq 0x115a1(%rip), %rdi     # 0x2086d
movq $-0x8, %rsi
callq 0x34b0
movl $0x1, %edi
callq 0x3950
movq %rax, %rdi
movq -0x20(%rbp), %rsi
xorl %edx, %edx
callq 0x3780
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
movq $-0x9, %rdi
xorl %edx, %edx
callq 0x3780
movq %rax, -0x18(%rbp)
cmpl $0xfffffed1, 0x193cc(%rip) # imm = 0xFFFFFED1
jne 0xf326
movq 0x18e4b(%rip), %rax     # 0x28168
cmpq 0x193e4(%rip), %rax     # 0x28708
je 0xf34c
movl $0x2, %edi
callq 0x3950
leaq 0x1155c(%rip), %rdi     # 0x20893
movq $-0x8, %rsi
callq 0x34b0
movq %rax, -0x8(%rbp)
jmp 0xf51d
movq -0x18(%rbp), %rdi
movq 0x18de1(%rip), %rsi     # 0x28138
xorl %edx, %edx
callq 0x3780
movq %rax, 0x18dd3(%rip)     # 0x28138
callq 0xcc90
movl %eax, 0x19370(%rip)     # 0x286e0
callq 0xd930
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x3780
movq %rax, -0x28(%rbp)
movl $0x1, %edi
callq 0x3950
movq %rax, %rdi
movq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0x3780
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdx
movq 0x18dca(%rip), %rax     # 0x28180
movq -0x30(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
cmpl $-0x66, 0x1931b(%rip)   # 0x286e0
je 0xf3c9
jmp 0xf414
callq 0xcc90
movl %eax, 0x1930c(%rip)     # 0x286e0
movq $-0x1, %rsi
xorl %edx, %edx
movq %rsi, %rdi
callq 0x3780
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdx
movq 0x191dc(%rip), %rax     # 0x285d0
movq -0x30(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x191cd(%rip), %rax     # 0x285d0
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
jmp 0xf172
movl $0x1, %edi
callq 0x3950
movq %rax, -0x40(%rbp)
cmpq $-0x1, -0x40(%rbp)
je 0xf456
cmpq $0x1, -0x48(%rbp)
jle 0xf456
movl $0x1, %edi
callq 0x3950
leaq 0x11467(%rip), %rdi     # 0x208a8
movq $-0x8, %rsi
callq 0x34b0
movq %rax, -0x8(%rbp)
jmp 0xf51d
movl $0x1, %edi
callq 0x3950
movq %rax, -0x28(%rbp)
movq %rax, 0x18cb5(%rip)     # 0x28120
movq -0x40(%rbp), %rdi
movq 0x18cc2(%rip), %rsi     # 0x28138
xorl %edx, %edx
callq 0x3780
movq %rax, 0x18cb4(%rip)     # 0x28138
movq $-0x1, 0x18c91(%rip) # 0x28120
cmpq $-0x1, -0x40(%rbp)
je 0xf50b
movq 0x1927b(%rip), %rdi     # 0x28718
movq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0x3780
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x3780
movq %rax, -0x28(%rbp)
movq 0x18cb7(%rip), %rax     # 0x28180
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0x3780
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x3780
movq %rax, -0x28(%rbp)
movq 0x190d3(%rip), %rax     # 0x285d0
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
jmp 0xf48f
movl $0x1, %edi
callq 0x3950
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)