// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x15020
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15020
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x0, %eax
je 0x1c0eb
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x6, %eax
je 0x1c0eb
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x5, %eax
jne 0x1c218
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x0, %eax
je 0x1c116
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x6, %eax
je 0x1c116
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x5, %eax
jne 0x1c218
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x0, %eax
jne 0x1c12d
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x1c182
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x5, %eax
jne 0x1c147
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x1c17a
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x6, %eax
jne 0x1c165
movq -0x18(%rbp), %rax
movq (%rax), %rax
addq $0x9, %rax
movq %rax, -0x38(%rbp)
jmp 0x1c172
leaq 0x208d0(%rip), %rax     # 0x3ca3c
movq %rax, -0x38(%rbp)
jmp 0x1c172
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x0, %eax
jne 0x1c1a1
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x1c1f6
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x5, %eax
jne 0x1c1bb
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x1c1ee
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x6, %eax
jne 0x1c1d9
movq -0x20(%rbp), %rax
movq (%rax), %rax
addq $0x9, %rax
movq %rax, -0x58(%rbp)
jmp 0x1c1e6
leaq 0x2085c(%rip), %rax     # 0x3ca3c
movq %rax, -0x58(%rbp)
jmp 0x1c1e6
movq -0x58(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x32d0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x1c530
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
movq -0x20(%rbp), %rcx
movsbl 0xf(%rcx), %ecx
cmpl %ecx, %eax
jne 0x1c2f4
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x1, %eax
jne 0x1c249
movl $0x1, -0x4(%rbp)
jmp 0x1c530
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x2, %eax
jne 0x1c262
movl $0x1, -0x4(%rbp)
jmp 0x1c530
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x4, %eax
jne 0x1c294
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
movq -0x20(%rbp), %rax
ucomisd (%rax), %xmm0
sete %al
setnp %cl
andb %cl, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x1c530
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x3, %eax
jne 0x1c2bd
movq -0x18(%rbp), %rax
movl (%rax), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x1c530
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x7, %eax
jne 0x1c2e8
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x1c530
movl $0x0, -0x4(%rbp)
jmp 0x1c530
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x2, %eax
jne 0x1c31a
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x1, %eax
jne 0x1c31a
movl $0x1, -0x4(%rbp)
jmp 0x1c530
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x1, %eax
jne 0x1c340
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x2, %eax
jne 0x1c340
movl $0x1, -0x4(%rbp)
jmp 0x1c530
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x4, %eax
jne 0x1c3af
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x0, %eax
je 0x1c374
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x6, %eax
je 0x1c374
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x5, %eax
jne 0x1c3af
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x15790
movaps %xmm0, %xmm1
movsd -0x60(%rbp), %xmm0
ucomisd %xmm1, %xmm0
sete %al
setnp %cl
andb %cl, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x1c530
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x0, %eax
je 0x1c3d6
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x6, %eax
je 0x1c3d6
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x5, %eax
jne 0x1c40d
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x4, %eax
jne 0x1c40d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15790
movq -0x20(%rbp), %rax
ucomisd (%rax), %xmm0
sete %al
setnp %cl
andb %cl, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x1c530
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x3, %eax
jne 0x1c446
movq -0x18(%rbp), %rax
movb $0x4, 0xf(%rax)
movq -0x18(%rbp), %rax
movl (%rax), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
cvtsi2sd %eax, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x1c0c0
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x3, %eax
jne 0x1c47f
movq -0x20(%rbp), %rax
movb $0x4, 0xf(%rax)
movq -0x20(%rbp), %rax
movl (%rax), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
cvtsi2sd %eax, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x1c0c0
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x0, %eax
je 0x1c4b3
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x6, %eax
je 0x1c4b3
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x5, %eax
je 0x1c4b3
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x4, %eax
jne 0x1c4d4
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x7, %eax
jne 0x1c4d4
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
xorl %edx, %edx
callq 0x15dc0
jmp 0x1c0c0
movq -0x18(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x7, %eax
jne 0x1c529
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x0, %eax
je 0x1c515
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x6, %eax
je 0x1c515
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x5, %eax
je 0x1c515
movq -0x20(%rbp), %rax
movsbl 0xf(%rax), %eax
cmpl $0x4, %eax
jne 0x1c529
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %edx, %edx
callq 0x15dc0
jmp 0x1c0c0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)