// File: /workspace/github_c_makefile_star2_O1/ccxvii[P]mujs/./jsvalue.c
// Function: js_equal
int js_equal(js_State *J)
{
	js_Value *x = js_tovalue(J, -2);
	js_Value *y = js_tovalue(J, -1);

retry:
	if (JSV_ISSTRING(x) && JSV_ISSTRING(y))
		return !strcmp(JSV_TOSTRING(x), JSV_TOSTRING(y));
	if (x->t.type == y->t.type) {
		if (x->t.type == JS_TUNDEFINED) return 1;
		if (x->t.type == JS_TNULL) return 1;
		if (x->t.type == JS_TNUMBER) return x->u.number == y->u.number;
		if (x->t.type == JS_TBOOLEAN) return x->u.boolean == y->u.boolean;
		if (x->t.type == JS_TOBJECT) return x->u.object == y->u.object;
		return 0;
	}

	if (x->t.type == JS_TNULL && y->t.type == JS_TUNDEFINED) return 1;
	if (x->t.type == JS_TUNDEFINED && y->t.type == JS_TNULL) return 1;

	if (x->t.type == JS_TNUMBER && JSV_ISSTRING(y))
		return x->u.number == jsV_tonumber(J, y);
	if (JSV_ISSTRING(x) && y->t.type == JS_TNUMBER)
		return jsV_tonumber(J, x) == y->u.number;

	if (x->t.type == JS_TBOOLEAN) {
		x->t.type = JS_TNUMBER;
		x->u.number = x->u.boolean ? 1 : 0;
		goto retry;
	}
	if (y->t.type == JS_TBOOLEAN) {
		y->t.type = JS_TNUMBER;
		y->u.number = y->u.boolean ? 1 : 0;
		goto retry;
	}
	if ((JSV_ISSTRING(x) || x->t.type == JS_TNUMBER) && y->t.type == JS_TOBJECT) {
		jsV_toprimitive(J, y, JS_HNONE);
		goto retry;
	}
	if (x->t.type == JS_TOBJECT && (JSV_ISSTRING(y) || y->t.type == JS_TNUMBER)) {
		jsV_toprimitive(J, x, JS_HNONE);
		goto retry;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r15
movslq 0x140(%rdi), %rax
leaq 0x25301(%rip), %rbx     # 0x403f8
movq %rbx, %r14
cmpq $0x2, %rax
jl 0x1b116
movq 0x148(%r15), %rcx
movq %rax, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %r14
addq $-0x20, %r14
testl %eax, %eax
jle 0x1b12d
movq 0x148(%r15), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rbx
addq $-0x10, %rbx
movsd 0x10383(%rip), %xmm1    # 0x2b4b8
leaq 0x10770(%rip), %r12     # 0x2b8ac
movl $0x61, %ebp
movzbl 0xf(%r14), %eax
cmpl $0x6, %eax
ja 0x1b162
btl %eax, %ebp
jae 0x1b162
movzbl 0xf(%rbx), %ecx
cmpl $0x6, %ecx
ja 0x1b162
btl %ecx, %ebp
jb 0x1b25a
movzbl 0xf(%rbx), %ecx
cmpb %cl, %al
je 0x1b26d
movb $0x1, %dl
cmpl $0x2, %eax
jne 0x1b17e
cmpb $0x1, %cl
je 0x1b322
cmpl $0x1, %eax
jne 0x1b18c
cmpb $0x2, %cl
je 0x1b322
cmpl $0x6, %eax
ja 0x1b1e6
movl %eax, %edx
movslq (%r12,%rdx,4), %rdx
addq %r12, %rdx
jmpq *%rdx
cmpl $0x4, %ecx
je 0x1b2d4
cmpl $0x3, %eax
jne 0x1b1e6
movb $0x4, 0xf(%r14)
cmpl $0x0, (%r14)
movapd %xmm1, %xmm0
jne 0x1b1bd
xorpd %xmm0, %xmm0
movsd %xmm0, (%r14)
jmp 0x1b141
cmpl $0x6, %ecx
ja 0x1b1d5
btl %ecx, %ebp
jb 0x1b2e6
leal -0x5(%rax), %edx
cmpl $0x2, %edx
jb 0x1b19c
cmpl $0x3, %eax
je 0x1b1aa
testl %eax, %eax
je 0x1b19c
cmpl $0x3, %ecx
jne 0x1b205
movb $0x4, 0xf(%rbx)
cmpl $0x0, (%rbx)
movapd %xmm1, %xmm0
jne 0x1b1fc
xorpd %xmm0, %xmm0
movsd %xmm0, (%rbx)
jmp 0x1b141
leal -0x4(%rax), %edx
cmpl $0x3, %edx
jb 0x1b21a
cmpl $0x7, %eax
je 0x1b230
testl %eax, %eax
jne 0x1b305
cmpl $0x7, %ecx
jne 0x1b227
movq %r15, %rdi
movq %rbx, %rsi
jmp 0x1b246
cmpl $0x7, %eax
jne 0x1b305
leal -0x4(%rcx), %eax
cmpl $0x3, %eax
jb 0x1b240
testl %ecx, %ecx
jne 0x1b305
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x15634
movsd 0x10263(%rip), %xmm1    # 0x2b4b8
jmp 0x1b141
testl %eax, %eax
je 0x1b29f
cmpl $0x6, %eax
je 0x1b28f
cmpl $0x5, %eax
jne 0x1b298
movq (%r14), %r14
jmp 0x1b29f
decl %eax
cmpl $0x6, %eax
ja 0x1b305
leaq 0x10649(%rip), %rcx     # 0x2b8c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x1, %dl
jmp 0x1b322
movq (%r14), %r14
addq $0x9, %r14
jmp 0x1b29f
leaq 0x190e7(%rip), %r14     # 0x34386
testl %ecx, %ecx
je 0x1b2c2
cmpl $0x6, %ecx
je 0x1b2b2
cmpl $0x5, %ecx
jne 0x1b2bb
movq (%rbx), %rbx
jmp 0x1b2c2
movq (%rbx), %rbx
addq $0x9, %rbx
jmp 0x1b2c2
leaq 0x190c4(%rip), %rbx     # 0x34386
movq %r14, %rdi
movq %rbx, %rsi
callq 0x32f0
testl %eax, %eax
sete %dl
jmp 0x1b322
movq %r15, %rdi
movq %r14, %rsi
callq 0x1514c
cmpeqsd (%rbx), %xmm0
jmp 0x1b31a
movsd (%r14), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1514c
cmpeqsd 0x8(%rsp), %xmm0
jmp 0x1b31a
xorl %edx, %edx
jmp 0x1b322
movl (%r14), %eax
cmpl (%rbx), %eax
jmp 0x1b2cf
movsd (%rbx), %xmm0
cmpeqsd (%r14), %xmm0
movq %xmm0, %rdx
andl $0x1, %edx
movzbl %dl, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rax
cmpq (%rbx), %rax
jmp 0x1b2cf