// File: /workspace/github_c_makefile_star2_O2/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 $0x88, %rsp
movl %esi, %r14d
movl %edi, %r15d
movaps 0xc76b(%rip), %xmm0     # 0x15910
leaq -0x60(%rbp), %rax
movaps %xmm0, 0x10(%rax)
movaps 0xc74c(%rip), %xmm0     # 0x15900
movaps %xmm0, (%rax)
incl 0x134c3(%rip)           # 0x1c680
pushq $-0x1
popq %rdi
movq %rdi, %rsi
xorl %edx, %edx
callq 0x3613
movq %rax, %r12
movq 0x12f54(%rip), %rsi     # 0x1c128
movq %rax, %rdi
xorl %edx, %edx
callq 0x3613
movq %rax, 0x12f43(%rip)     # 0x1c128
pushq $-0x8
popq %rbx
pushq $0x1
popq %r13
movq %r12, -0x38(%rbp)
movl $0x0, -0x2c(%rbp)
movq %r12, -0x40(%rbp)
cmpl $0x0, 0x133b2(%rip)     # 0x1c5b4
jne 0x93d7
movl 0x134c2(%rip), %eax     # 0x1c6d0
cmpl $-0x4, %eax
jne 0x926b
cmpl $0x0, 0x1346e(%rip)     # 0x1c688
jne 0x942d
movl 0x1345e(%rip), %edx     # 0x1c684
movl %r13d, %r12d
movl %r15d, %r13d
movl %r14d, %r15d
movq %rbx, %r14
leaq -0xb0(%rbp), %rbx
movq %rbx, %rdi
leaq 0xb4d0(%rip), %rsi      # 0x14713
xorl %eax, %eax
callq 0x31f0
movq %rbx, %rdi
movq %r14, %rbx
movl %r15d, %r14d
movl %r13d, %r15d
movl %r12d, %r13d
movq -0x40(%rbp), %r12
movq %rbx, %rsi
callq 0x33e4
movl 0x13465(%rip), %eax     # 0x1c6d0
movl %eax, %ecx
andl $-0x3, %ecx
cmpl $-0x6b, %ecx
je 0x93e6
testl %r15d, %r15d
je 0x92ed
movl %r13d, %edi
callq 0x94c3
movq 0x12ee3(%rip), %rcx     # 0x1c170
movq %rax, (%rcx,%r12,8)
movq 0x13328(%rip), %rdx     # 0x1c5c0
cmpq $-0x1, (%rdx,%rax,8)
je 0x92e7
pushq $-0x1
popq %rdi
movq %rdi, %rsi
xorl %edx, %edx
callq 0x3613
movq 0x1330d(%rip), %rdx     # 0x1c5c0
movq 0x1341e(%rip), %rcx     # 0x1c6d8
movq %rax, (%rdx,%rcx,8)
movq 0x13413(%rip), %rax     # 0x1c6d8
movq (%rdx,%rax,8), %rax
movq %rax, 0x13408(%rip)     # 0x1c6d8
movq 0x12e99(%rip), %rcx     # 0x1c170
movq (%rcx,%r12,8), %rsi
movq (%rdx,%rsi,8), %rdx
movq %rdx, (%rcx,%rax,8)
movq (%rcx,%r12,8), %rax
movq (%rcx,%rax,8), %rax
jmp 0x9305
testl %r14d, %r14d
je 0x92f9
callq 0x95f5
jmp 0x92fe
callq 0x968f
movq 0x12e6b(%rip), %rcx     # 0x1c170
movq %rax, (%rcx,%r12,8)
movl 0x133c1(%rip), %eax     # 0x1c6d0
cmpl $-0x67, %eax
jne 0x93a0
callq 0x8d74
movl %eax, 0x133ad(%rip)     # 0x1c6d0
testl %r14d, %r14d
je 0x93a0
cmpl $0x0, -0x2c(%rbp)
jne 0x93a0
testl %r15d, %r15d
je 0x933a
callq 0x973d
jmp 0x933f
callq 0x9877
movq 0x1327a(%rip), %rcx     # 0x1c5c0
movq %rax, (%rcx,%r12,8)
testq %rax, %rax
js 0x9378
movq 0x1328a(%rip), %rcx     # 0x1c5e0
movb (%rcx,%rax), %cl
movl %ecx, %edx
andb $0x19, %dl
cmpb $0x8, %dl
je 0x937e
testb $0x10, %cl
je 0x938b
movq 0x12e01(%rip), %rcx     # 0x1c170
cmpq $-0x22, (%rcx,%rax,8)
je 0x937e
jmp 0x938b
cmpq $-0x1, %rax
jne 0x938b
cmpl $-0x6b, 0x1334b(%rip)   # 0x1c6d0
je 0x940e
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
callq 0x33e4
movl %r13d, -0x2c(%rbp)
jmp 0x91fb
incl -0x2c(%rbp)
cmpl $-0x64, %eax
jne 0x94b7
callq 0x8d74
movl %eax, 0x13319(%rip)     # 0x1c6d0
pushq $-0x1
popq %rdi
movq %rdi, %rsi
xorl %edx, %edx
callq 0x3613
movq 0x131f5(%rip), %rcx     # 0x1c5c0
movq %rax, (%rcx,%r12,8)
movq %rax, %r12
jmp 0x91f7
pushq $0x1
popq %rdi
callq 0x3775
pushq $-0x1
jmp 0x94a4
cmpl $0x0, -0x2c(%rbp)
je 0x9439
pushq $0x1
popq %rdi
callq 0x3775
cmpl $-0x69, 0x132d5(%rip)   # 0x1c6d0
leaq 0xb338(%rip), %rax      # 0x1473a
leaq 0xb349(%rip), %rdi      # 0x14752
jmp 0x9496
callq 0x8d74
movl %eax, 0x132b7(%rip)     # 0x1c6d0
pushq $0x1
popq %rdi
callq 0x3775
decl 0x13259(%rip)           # 0x1c680
movq -0x38(%rbp), %rax
jmp 0x94a5
pushq $0x1
popq %rdi
callq 0x3775
pushq $-0x4
jmp 0x94a4
movb $0x1, %bl
xorl %ecx, %ecx
testl %r14d, %r14d
sete %cl
addl %ecx, %ecx
orl $-0x6b, %ecx
cmpl %ecx, %eax
jne 0x947d
callq 0x8d74
movl %eax, 0x13279(%rip)     # 0x1c6d0
decl 0x13223(%rip)           # 0x1c680
pushq $0x1
popq %rdi
callq 0x3775
xorl %ecx, %ecx
negl %r14d
sbbq %rcx, %rcx
orq $-0x6, %rcx
testb %bl, %bl
movq -0x38(%rbp), %rax
cmovneq %rcx, %rax
jmp 0x94a5
pushq $0x1
popq %rdi
callq 0x3775
testl %r14d, %r14d
leaq 0xb2ee(%rip), %rax      # 0x1477d
leaq 0xb2d3(%rip), %rdi      # 0x14769
cmoveq %rax, %rdi
pushq $-0x8
popq %rsi
callq 0x33e4
pushq $-0x5
popq %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, -0x2c(%rbp)
sete %bl
jmp 0x943b