// File: /workspace/github_c_makefile_star2_O3/azhai[P]mlite/mlite.c
// Function: cmp
cell cmp(char *name,
	int ncmp(cell x, cell y),
	int ccmp(int x, int y),
	int scmp(char *s1, char *s2, int k),
	cell x
) {
	int	k;
	char	msg[100], *s;

	if (*name == '=' && (virtual_p(car(x)) || virtual_p(cadr(x))))
		return (car(x) == cadr(x))? TRUE: FALSE;
	if (number_p(car(x)) && number_p(cadr(x)))
		return ncmp(car(x), cadr(x))? TRUE: FALSE;
	else if (char_p(car(x)) && char_p(cadr(x)))
		return ccmp(char_value(car(x)), char_value(cadr(x)))? TRUE:
			FALSE;
	else if (string_p(car(x)) && string_p(cadr(x))) {
		k = string_len(car(x));
		if (k != string_len(cadr(x))) {
			if (scmp == str_eq || scmp == str_ieq)
				return FALSE;
			if (scmp == str_ne || scmp == str_ine)
				return TRUE;
		}
		return !scmp(string(car(x)), string(cadr(x)), k)? FALSE: TRUE;
	}
	else {
		if (*name == '=')
			s = "num/char/str/bool/unit/nil";
		else
			s = "num/char/str";
		sprintf(msg, "%s: expected tuple of %s, but got", name, s);
		error(msg, x);
		return 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %r8, %rbx
movq %rsi, %r8
movq %rdi, %rax
movb (%rdi), %r9b
movq 0xe89e(%rip), %r10      # 0x1e170
movq (%r10,%rbx,8), %rdi
cmpb $0x3d, %r9b
jne 0xf908
movq 0xecdd(%rip), %rsi      # 0x1e5c0
movq (%rsi,%rbx,8), %rsi
movq (%r10,%rsi,8), %rsi
testq %rdi, %rdi
js 0xf8f5
testq %rsi, %rsi
jns 0xf911
xorl %r14d, %r14d
cmpq %rsi, %rdi
sete %r14b
addq $-0x3, %r14
jmp 0xfa49
testq %rdi, %rdi
js 0xfa0d
movq 0xecc8(%rip), %r11      # 0x1e5e0
movb (%r11,%rdi), %r14b
testb $0x1, %r14b
je 0xf9a6
movq (%r10,%rdi,8), %rsi
cmpq $-0x18, %rsi
je 0xf936
cmpq $-0x1f, %rsi
jne 0xf969
movq 0xec83(%rip), %rsi      # 0x1e5c0
movq (%rsi,%rbx,8), %rsi
movq (%r10,%rsi,8), %rsi
testq %rsi, %rsi
js 0xf969
testb $0x1, (%r11,%rsi)
je 0xf969
movq (%r10,%rsi,8), %r15
cmpq $-0x18, %r15
je 0xf961
cmpq $-0x1f, %r15
jne 0xf969
callq *%r8
jmp 0xf9fd
cmpq $-0x16, (%r10,%rdi,8)
jne 0xf9a6
movq 0xec49(%rip), %rsi      # 0x1e5c0
movq (%rsi,%rbx,8), %r8
movq (%r10,%r8,8), %r8
testq %r8, %r8
js 0xf9a6
testb $0x1, (%r11,%r8)
je 0xf9a6
cmpq $-0x16, (%r10,%r8,8)
jne 0xf9a6
movq (%rsi,%rdi,8), %rax
movl (%r10,%rax,8), %edi
movq (%rsi,%r8,8), %rax
movl (%r10,%rax,8), %esi
callq *%rdx
jmp 0xf9fd
testb $0x10, %r14b
je 0xfa0d
cmpq $-0x21, (%r10,%rdi,8)
jne 0xfa0d
movq 0xec06(%rip), %r8       # 0x1e5c0
movq (%r8,%rbx,8), %rdx
movq (%r10,%rdx,8), %r14
testq %r14, %r14
js 0xfa0d
testb $0x10, (%r11,%r14)
je 0xfa0d
cmpq $-0x21, (%r10,%r14,8)
jne 0xfa0d
movq 0xec0c(%rip), %rax      # 0x1e5e8
movq (%r8,%rdi,8), %rsi
movq -0x8(%rax,%rsi,8), %rdx
movslq %edx, %rdi
movq (%r8,%r14,8), %r8
cmpq -0x8(%rax,%r8,8), %rdi
jne 0xfa57
leaq (%rax,%rsi,8), %rdi
leaq (%rax,%r8,8), %rsi
callq *%rcx
cmpl $0x1, %eax
movq $-0x2, %r14
sbbq $0x0, %r14
jmp 0xfa49
cmpb $0x3d, %r9b
leaq 0x726d(%rip), %rdx      # 0x16c85
leaq 0x7281(%rip), %rcx      # 0x16ca0
cmoveq %rdx, %rcx
leaq 0x7283(%rip), %rsi      # 0x16cad
xorl %r14d, %r14d
leaq -0x80(%rbp), %r15
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x31f0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x33eb
movq %r14, %rax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0x235(%rip), %rdi      # 0xf829
cmpq %rdi, %rcx
sete %dil
leaq -0x2b1(%rip), %r9       # 0xf7bb
cmpq %r9, %rcx
sete %r9b
orb %dil, %r9b
movq $-0x3, %r14
jne 0xfa49
leaq -0x246(%rip), %rdi      # 0xf840
cmpq %rdi, %rcx
sete %dil
leaq -0x2c5(%rip), %r9       # 0xf7cf
cmpq %r9, %rcx
sete %r9b
orb %dil, %r9b
movq $-0x2, %r14
je 0xf9f3
jmp 0xfa49