// File: /workspace/github_c_makefile_star2_O1/azhai[P]mlite/mlite.c
// Function: sf_define_type
cell sf_define_type(cell x, int *pc) {
	cell	p, t, n, a, defs, type, new;

	if (!tuple_p(cdr(x)) || !tuple_p(cddr(x)))
		return error("define_type: syntax error", x);
	if (!symbol_p(cadr(x)))
		return error("define_type: expected id, got", cadr(x));
	a = node(NIL, NIL);
	save(a);
	for (p = cddr(x); p != NIL; p = cdr(p)) {
		t = car(p);
		if (symbol_p(t)) {		/* (name 'name) */
			n = node(t, NIL);
			n = node(S_quote, n);
			n = node(n, NIL);
			n = node(t, n);
		}
		else {				/* (name (fn (x y))) */
			n = make_constructor(t);
			n = node(n, NIL);
			n = node(car(t), n);
		}
		n = node(S_define, n);
		car(a) = n;
		if (cdr(p) != NIL) {
			set(cdr(a), node(NIL, NIL));
			a = cdr(a);
		}
	}
	type = cadr(x);			/* (define T '(T cons ...)) */
	type = node(type, cddr(x));
	type = node(type, NIL);
	type = node(S_quote, type);
	type = node(type, NIL);
	type = node(cadr(x), type);
	type = node(S_define, type);
	defs = unsave(1);		/* (begin type-def cons-def ...) */
	defs = node(type, defs);
	defs = node(S_begin, defs);
	*pc = 1;
	return defs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0xf862(%rip), %rdx      # 0x1e5c0
movq (%rdx,%rdi,8), %rax
testq %rax, %rax
js 0xed74
movq 0xf872(%rip), %rcx      # 0x1e5e0
testb $0x19, (%rcx,%rax)
je 0xed99
leaq 0x7e69(%rip), %rdi      # 0x16be4
movq %r14, %rsi
callq 0x33eb
movq $-0x5, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rdx,%rax,8), %rdx
testq %rdx, %rdx
js 0xed74
testb $0x19, (%rcx,%rdx)
jne 0xed74
movq %rsi, %rbx
movq 0xf3be(%rip), %rdx      # 0x1e170
movq (%rdx,%rax,8), %rsi
testq %rsi, %rsi
js 0xef05
testb $0x10, (%rcx,%rsi)
je 0xef05
cmpq $-0x22, (%rdx,%rsi,8)
jne 0xef05
movq $-0x1, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq %rax, %r15
movq 0xf335(%rip), %rsi      # 0x1e128
movq %rax, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0xf324(%rip)      # 0x1e128
movq 0xf7b5(%rip), %rax      # 0x1e5c0
movq (%rax,%r14,8), %rcx
movq (%rax,%rcx,8), %r13
cmpq $-0x1, %r13
je 0xef11
movq 0xf34c(%rip), %rax      # 0x1e170
movq (%rax,%r13,8), %r12
testq %r12, %r12
js 0xee7a
movq 0xf7ac(%rip), %rcx      # 0x1e5e0
testb $0x10, (%rcx,%r12)
je 0xee7a
cmpq $-0x22, (%rax,%r12,8)
jne 0xee7a
movq %r12, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0xf84e(%rip), %rdi      # 0x1e6a8
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
movq %rax, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq %r12, %rdi
jmp 0xee9e
movq %r12, %rdi
callq 0xe95b
movq %rax, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0xf2d6(%rip), %rcx      # 0x1e170
movq (%rcx,%r12,8), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0xf8b1(%rip), %rdi      # 0x1e760
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0xf2b0(%rip), %rcx      # 0x1e170
movq %rax, (%rcx,%r15,8)
movq 0xf6f5(%rip), %rax      # 0x1e5c0
cmpq $-0x1, (%rax,%r13,8)
je 0xeef5
movq $-0x1, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0xf6d2(%rip), %rcx      # 0x1e5c0
movq %rax, (%rcx,%r15,8)
movq %rax, %r15
movq 0xf6c4(%rip), %rax      # 0x1e5c0
movq (%rax,%r13,8), %r13
jmp 0xee13
leaq 0x7cf2(%rip), %rdi      # 0x16bfe
jmp 0xed7e
movq 0xf258(%rip), %rax      # 0x1e170
movq 0xf6a1(%rip), %rcx      # 0x1e5c0
movq (%rcx,%r14,8), %rdx
movq (%rax,%rdx,8), %rdi
movq (%rcx,%rdx,8), %rsi
xorl %edx, %edx
callq 0x36e8
movq %rax, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0xf75e(%rip), %rdi      # 0x1e6a8
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
movq %rax, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0xf204(%rip), %rcx      # 0x1e170
movq 0xf64d(%rip), %rdx      # 0x1e5c0
movq (%rdx,%r14,8), %rdx
movq (%rcx,%rdx,8), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0xf7d4(%rip), %rdi      # 0x1e760
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
movq %rax, %r14
movl $0x1, %edi
callq 0x3851
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0xf7a1(%rip), %rdi      # 0x1e758
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
movl $0x1, (%rbx)
jmp 0xed8a