// File: /workspace/github_c_makefile_star2_O2/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 0xdce7(%rip), %r10      # 0x1c170
movq (%r10,%rbx,8), %rdi
cmpb $0x3d, %r9b
jne 0xe4bf
movq 0xe126(%rip), %rsi      # 0x1c5c0
movq (%rsi,%rbx,8), %rsi
movq (%r10,%rsi,8), %rsi
testq %rdi, %rdi
js 0xe4ac
testq %rsi, %rsi
jns 0xe4c8
xorl %r14d, %r14d
cmpq %rsi, %rdi
sete %r14b
addq $-0x3, %r14
jmp 0xe5fd
testq %rdi, %rdi
js 0xe5c1
movq 0xe111(%rip), %r11      # 0x1c5e0
movb (%r11,%rdi), %r14b
testb $0x1, %r14b
je 0xe55d
movq (%r10,%rdi,8), %rsi
cmpq $-0x18, %rsi
je 0xe4ed
cmpq $-0x1f, %rsi
jne 0xe520
movq 0xe0cc(%rip), %rsi      # 0x1c5c0
movq (%rsi,%rbx,8), %rsi
movq (%r10,%rsi,8), %rsi
testq %rsi, %rsi
js 0xe520
testb $0x1, (%r11,%rsi)
je 0xe520
movq (%r10,%rsi,8), %r15
cmpq $-0x18, %r15
je 0xe518
cmpq $-0x1f, %r15
jne 0xe520
callq *%r8
jmp 0xe5b4
cmpq $-0x16, (%r10,%rdi,8)
jne 0xe55d
movq 0xe092(%rip), %rsi      # 0x1c5c0
movq (%rsi,%rbx,8), %r8
movq (%r10,%r8,8), %r8
testq %r8, %r8
js 0xe55d
testb $0x1, (%r11,%r8)
je 0xe55d
cmpq $-0x16, (%r10,%r8,8)
jne 0xe55d
movq (%rsi,%rdi,8), %rax
movl (%r10,%rax,8), %edi
movq (%rsi,%r8,8), %rax
movl (%r10,%rax,8), %esi
callq *%rdx
jmp 0xe5b4
testb $0x10, %r14b
je 0xe5c1
cmpq $-0x21, (%r10,%rdi,8)
jne 0xe5c1
movq 0xe04f(%rip), %r8       # 0x1c5c0
movq (%r8,%rbx,8), %rdx
movq (%r10,%rdx,8), %r14
testq %r14, %r14
js 0xe5c1
testb $0x10, (%r11,%r14)
je 0xe5c1
cmpq $-0x21, (%r10,%r14,8)
jne 0xe5c1
movq 0xe055(%rip), %rax      # 0x1c5e8
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 0xe60b
leaq (%rax,%rsi,8), %rdi
leaq (%rax,%r8,8), %rsi
callq *%rcx
cmpl $0x1, %eax
pushq $-0x2
popq %r14
sbbq $0x0, %r14
jmp 0xe5fd
cmpb $0x3d, %r9b
leaq 0x66b9(%rip), %rdx      # 0x14c85
leaq 0x66cd(%rip), %rcx      # 0x14ca0
cmoveq %rdx, %rcx
leaq 0x66cf(%rip), %rsi      # 0x14cad
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 0x33e4
movq %r14, %rax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0x22b(%rip), %rdi      # 0xe3e7
cmpq %rdi, %rcx
sete %dil
leaq -0x2a7(%rip), %r9       # 0xe379
cmpq %r9, %rcx
sete %r9b
orb %dil, %r9b
je 0xe630
pushq $-0x3
jmp 0xe657
leaq -0x239(%rip), %rdi      # 0xe3fe
cmpq %rdi, %rcx
sete %dil
leaq -0x2b8(%rip), %r9       # 0xe38d
cmpq %r9, %rcx
sete %r9b
orb %dil, %r9b
je 0xe5aa
pushq $-0x2
popq %r14
jmp 0xe5fd