// File: /workspace/github_c_makefile_star2_O3/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 0xd9f9(%rip), %xmm0     # 0x17910
movaps %xmm0, -0x40(%rbp)
movaps 0xd9de(%rip), %xmm0     # 0x17900
movaps %xmm0, -0x50(%rbp)
incl 0x14754(%rip)           # 0x1e680
movq $-0x1, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0x141e0(%rip), %rsi     # 0x1e128
movq %rax, -0x30(%rbp)
movq %rax, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0x141cb(%rip)     # 0x1e128
cmpl $0x0, 0x14650(%rip)     # 0x1e5b4
je 0x9f86
movl $0x1, %edi
callq 0x384f
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
movl 0x14736(%rip), %eax     # 0x1e6d0
cmpl $-0x4, %eax
jne 0x9fd8
cmpl $0x0, 0x146e2(%rip)     # 0x1e688
jne 0xa1c8
movl 0x146d2(%rip), %edx     # 0x1e684
movq %r13, %rdi
leaq 0xc757(%rip), %rsi      # 0x16713
xorl %eax, %eax
callq 0x31f0
movq %r13, %rdi
movq $-0x8, %rsi
callq 0x33eb
movl 0x146f8(%rip), %eax     # 0x1e6d0
movl %eax, %ecx
andl $-0x3, %ecx
cmpl $-0x6b, %ecx
je 0xa17b
testl %r12d, %r12d
je 0xa064
movl $0x1, %edi
callq 0xa26c
movq 0x14174(%rip), %rcx     # 0x1e170
movq %rax, (%rcx,%r14,8)
movq 0x145b9(%rip), %rdx     # 0x1e5c0
cmpq $-0x1, (%rdx,%rax,8)
je 0xa05e
movq $-0x1, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0x14596(%rip), %rdx     # 0x1e5c0
movq 0x146a7(%rip), %rcx     # 0x1e6d8
movq %rax, (%rdx,%rcx,8)
movq 0x1469c(%rip), %rax     # 0x1e6d8
movq (%rdx,%rax,8), %rax
movq %rax, 0x14691(%rip)     # 0x1e6d8
movq 0x14122(%rip), %rcx     # 0x1e170
movq (%rcx,%r14,8), %rsi
movq (%rdx,%rsi,8), %rdx
movq %rdx, (%rcx,%rax,8)
movq (%rcx,%r14,8), %rax
movq (%rcx,%rax,8), %rax
jmp 0xa07b
testl %ebx, %ebx
je 0xa06f
callq 0xa3ad
jmp 0xa074
callq 0xa451
movq 0x140f5(%rip), %rcx     # 0x1e170
movq %rax, (%rcx,%r14,8)
movl 0x1464b(%rip), %eax     # 0x1e6d0
cmpl $-0x67, %eax
jne 0xa12f
callq 0x9ac4
movl %eax, 0x14637(%rip)     # 0x1e6d0
testl %ebx, %ebx
je 0xa12f
testl %r15d, %r15d
jne 0xa12f
testl %r12d, %r12d
je 0xa0b6
callq 0xa528
jmp 0xa0bb
callq 0xa676
movq 0x144fe(%rip), %rcx     # 0x1e5c0
movq %rax, (%rcx,%r14,8)
testq %rax, %rax
js 0xa0f4
movq 0x1450e(%rip), %rcx     # 0x1e5e0
movb (%rcx,%rax), %cl
movl %ecx, %edx
andb $0x19, %dl
cmpb $0x8, %dl
je 0xa0fa
testb $0x10, %cl
je 0xa107
movq 0x14085(%rip), %rcx     # 0x1e170
cmpq $-0x22, (%rcx,%rax,8)
je 0xa0fa
jmp 0xa107
cmpq $-0x1, %rax
jne 0xa107
cmpl $-0x6b, 0x145cf(%rip)   # 0x1e6d0
je 0xa1a4
leaq -0x50(%rbp), %rdi
movq $-0x8, %rsi
callq 0x33eb
movl $0x1, %r15d
cmpl $0x0, 0x14490(%rip)     # 0x1e5b4
je 0x9f94
jmp 0x9f66
incl %r15d
cmpl $-0x64, %eax
jne 0xa260
callq 0x9ac4
movl %eax, 0x1458a(%rip)     # 0x1e6d0
movq $-0x1, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0x1445e(%rip), %rcx     # 0x1e5c0
movq %rax, (%rcx,%r14,8)
cmpl $0x0, 0x14447(%rip)     # 0x1e5b4
movq %rax, %r14
je 0x9f94
jmp 0x9f66
testl %r15d, %r15d
je 0xa1de
movl $0x1, %edi
callq 0x384f
cmpl $-0x69, 0x1453f(%rip)   # 0x1e6d0
leaq 0xc5a2(%rip), %rax      # 0x1673a
leaq 0xc5b3(%rip), %rdi      # 0x16752
jmp 0xa244
callq 0x9ac4
movl %eax, 0x14521(%rip)     # 0x1e6d0
movl $0x1, %edi
callq 0x384f
decl 0x144c1(%rip)           # 0x1e680
movq -0x30(%rbp), %rax
jmp 0x9f77
movl $0x1, %edi
callq 0x384f
movq $-0x4, %rax
jmp 0x9f77
movb $0x1, %r14b
xorl %ecx, %ecx
testl %ebx, %ebx
sete %cl
addl %ecx, %ecx
orl $-0x6b, %ecx
cmpl %ecx, %eax
jne 0xa22a
callq 0x9ac4
movl %eax, 0x144d4(%rip)     # 0x1e6d0
decl 0x1447e(%rip)           # 0x1e680
movl $0x1, %edi
callq 0x384f
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 0x9f77
movl $0x1, %edi
callq 0x384f
testl %ebx, %ebx
leaq 0xc540(%rip), %rax      # 0x1677d
leaq 0xc525(%rip), %rdi      # 0x16769
cmoveq %rax, %rdi
movq $-0x8, %rsi
callq 0x33eb
movq $-0x5, %rax
jmp 0x9f77
testl %r15d, %r15d
sete %r14b
jmp 0xa1e1