// File: /workspace/github_c_makefile_star2_O1/azhai[P]mlite/mlite.c
// Function: list
cell list(int pat, int lst) {
	cell	n, m, a, new;
	int	c;
	char	badcons[] = "malformed list constructor (::)";
	char	msg[80];

	Level++;
	a = m = node(NIL, NIL);		/* root */
	save(m);
	c = 0;
	while (1) {
		if (Error_flag) {
			unsave(1);
			return NIL;
		}
		if (Token == END_OF_FILE)  {
			if (Load_level) {
				unsave(1);
				return END_OF_FILE;
			}
			sprintf(msg, "missing ')' or ']', started in line %d",
					Opening_line);
			error(msg, NOEXPR);
		}
		if (Token == TOK_RPAREN || Token == TOK_RBRACK) {
			if (c == 0)
				break;
			unsave(1);
			return error(Token == TOK_RPAREN?
					"unexpected `)' in tuple":
					"unexpected `]' in list",
					NOEXPR);
		}
		if (pat) {
			set(car(a), x_pattern(1));
			if (opr(car(a)) != NIL) {
				set(cdr(Guard_ops), node(NIL, NIL));
				Guard_ops = cdr(Guard_ops);
				car(Guard_ops) = opr(car(a));
			}
			car(a) = pat(car(a));
		}
		else {
			set(car(a), lst? expr(): sequence());
		}
		c++;
		if (Token == TOK_CONS) {
			Token = scan();
			if (c != 1 || lst == 0) {
				n = S_cons;
			}
			else {
				n = pat? pat_primary(1): primary();
				cdr(a) = n;
				if (	(!list_p(n) && !symbol_p(n)) ||
					Token != TOK_RBRACK) {
					error(badcons, NOEXPR);
					continue;
				}
				Token = scan();
				unsave(1);
				Level--;
				return m;
			}
		}
		if (Token != TOK_COMMA)
			break;
		Token = scan();
		set(cdr(a), node(NIL, NIL));	/* Space for next member */
		a = cdr(a);
	}
	if (	(Token != TOK_RPAREN && !lst) ||
		(Token != TOK_RBRACK && lst)
	) {
		unsave(1);
		return error(lst? "missing ']' in list":
				  "missing ')' in tuple",
					NOEXPR);
	}
	Token = scan();
	Level--;
	unsave(1);
	return c? m: lst? NIL: UNIT;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %esi, %ebx
movl %edi, %r12d
movaps 0xd8e8(%rip), %xmm0     # 0x17930
movaps %xmm0, -0x40(%rbp)
movaps 0xd8cd(%rip), %xmm0     # 0x17920
movaps %xmm0, -0x50(%rbp)
incl 0x14623(%rip)           # 0x1e680
movq $-0x1, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0x140af(%rip), %rsi     # 0x1e128
movq %rax, -0x30(%rbp)
movq %rax, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x1409a(%rip)     # 0x1e128
cmpl $0x0, 0x1451f(%rip)     # 0x1e5b4
je 0xa0b7
movl $0x1, %edi
callq 0x3851
movq $-0x1, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0xa0(%rbp), %r13
xorl %r15d, %r15d
movq -0x30(%rbp), %r14
cmpl $-0x4, 0x14604(%rip)    # 0x1e6d0
jne 0xa101
cmpl $0x0, 0x145b3(%rip)     # 0x1e688
jne 0xa314
movl 0x145a3(%rip), %edx     # 0x1e684
movq %r13, %rdi
leaq 0xc643(%rip), %rsi      # 0x1672e
xorl %eax, %eax
callq 0x31f0
movq %r13, %rdi
movq $-0x8, %rsi
callq 0x33eb
movl 0x145c9(%rip), %eax     # 0x1e6d0
andl $-0x3, %eax
cmpl $-0x6b, %eax
je 0xa2c7
testl %r12d, %r12d
je 0xa1a0
movl $0x1, %edi
callq 0xa3bc
movq 0x14043(%rip), %rcx     # 0x1e170
movq %rax, (%rcx,%r14,8)
movq 0x14488(%rip), %rcx     # 0x1e5c0
cmpq $-0x1, (%rcx,%rax,8)
je 0xa18b
movq $-0x1, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0x14465(%rip), %rcx     # 0x1e5c0
movq 0x14576(%rip), %rdx     # 0x1e6d8
movq %rax, (%rcx,%rdx,8)
movq 0x1456b(%rip), %rax     # 0x1e6d8
movq (%rcx,%rax,8), %rax
movq %rax, 0x14560(%rip)     # 0x1e6d8
movq 0x13ff1(%rip), %rdx     # 0x1e170
movq (%rdx,%r14,8), %rsi
movq (%rcx,%rsi,8), %rcx
movq %rcx, (%rdx,%rax,8)
movq 0x13fde(%rip), %rax     # 0x1e170
movq (%rax,%r14,8), %rcx
movq (%rax,%rcx,8), %rcx
movq %rcx, (%rax,%r14,8)
jmp 0xa1bb
testl %ebx, %ebx
je 0xa1ab
callq 0xa4fd
jmp 0xa1b0
callq 0xa5a1
movq 0x13fb9(%rip), %rcx     # 0x1e170
movq %rax, (%rcx,%r14,8)
cmpl $-0x67, 0x1450e(%rip)   # 0x1e6d0
jne 0xa277
callq 0x9c07
movl %eax, 0x144fd(%rip)     # 0x1e6d0
testl %ebx, %ebx
je 0xa277
testl %r15d, %r15d
jne 0xa277
testl %r12d, %r12d
je 0xa1f0
callq 0xa678
jmp 0xa1f5
callq 0xa7c6
movq 0x143c4(%rip), %rcx     # 0x1e5c0
movq %rax, (%rcx,%r14,8)
testq %rax, %rax
js 0xa215
movq 0x143d4(%rip), %rcx     # 0x1e5e0
movzbl (%rcx,%rax), %ecx
testb $0x11, %cl
je 0xa23d
cmpq $-0x1, %rax
je 0xa242
testq %rax, %rax
js 0xa24f
movq 0x143b9(%rip), %rcx     # 0x1e5e0
testb $0x10, (%rcx,%rax)
je 0xa24f
movq 0x13f3c(%rip), %rcx     # 0x1e170
cmpq $-0x22, (%rcx,%rax,8)
je 0xa242
jmp 0xa24f
testb $0x8, %cl
je 0xa21b
cmpl $-0x6b, 0x14487(%rip)   # 0x1e6d0
je 0xa2f0
leaq -0x50(%rbp), %rdi
movq $-0x8, %rsi
callq 0x33eb
movl $0x1, %r15d
cmpl $0x0, 0x14348(%rip)     # 0x1e5b4
je 0xa0c5
jmp 0xa097
incl %r15d
cmpl $-0x64, 0x1444f(%rip)   # 0x1e6d0
jne 0xa3b0
callq 0x9c07
movl %eax, 0x1443e(%rip)     # 0x1e6d0
movq $-0x1, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0x14312(%rip), %rcx     # 0x1e5c0
movq %rax, (%rcx,%r14,8)
cmpl $0x0, 0x142fb(%rip)     # 0x1e5b4
movq %rax, %r14
je 0xa0c5
jmp 0xa097
testl %r15d, %r15d
je 0xa32a
movl $0x1, %edi
callq 0x3851
cmpl $-0x69, 0x143f3(%rip)   # 0x1e6d0
leaq 0xc471(%rip), %rax      # 0x16755
leaq 0xc482(%rip), %rdi      # 0x1676d
jmp 0xa394
callq 0x9c07
movl %eax, 0x143d5(%rip)     # 0x1e6d0
movl $0x1, %edi
callq 0x3851
decl 0x14375(%rip)           # 0x1e680
movq -0x30(%rbp), %rax
jmp 0xa0a8
movl $0x1, %edi
callq 0x3851
movq $-0x4, %rax
jmp 0xa0a8
movb $0x1, %r14b
xorl %eax, %eax
testl %ebx, %ebx
sete %al
addl %eax, %eax
orl $-0x6b, %eax
cmpl %eax, 0x14391(%rip)     # 0x1e6d0
jne 0xa37a
callq 0x9c07
movl %eax, 0x14384(%rip)     # 0x1e6d0
decl 0x1432e(%rip)           # 0x1e680
movl $0x1, %edi
callq 0x3851
xorl %eax, %eax
negl %ebx
sbbq %rax, %rax
orq $-0x6, %rax
testb %r14b, %r14b
movq -0x30(%rbp), %rcx
cmovneq %rax, %rcx
movq %rcx, %rax
jmp 0xa0a8
movl $0x1, %edi
callq 0x3851
testl %ebx, %ebx
leaq 0xc40b(%rip), %rax      # 0x16798
leaq 0xc3f0(%rip), %rdi      # 0x16784
cmoveq %rax, %rdi
movq $-0x8, %rsi
callq 0x33eb
movq $-0x5, %rax
jmp 0xa0a8
testl %r15d, %r15d
sete %r14b
jmp 0xa32d