// File: /workspace/github_c_makefile_star2_O1/ccxvii[P]mujs/./jsvalue.c
// Function: js_concat
void js_concat(js_State *J)
{
	js_toprimitive(J, -2, JS_HNONE);
	js_toprimitive(J, -1, JS_HNONE);

	if (js_isstring(J, -2) || js_isstring(J, -1)) {
		const char *sa = js_tostring(J, -2);
		const char *sb = js_tostring(J, -1);
		char * volatile sab = NULL;
		/* TODO: create js_String directly */
		if (js_try(J)) {
			js_free(J, sab);
			js_throw(J);
		}
		sab = js_malloc(J, strlen(sa) + strlen(sb) + 1);
		strcpy(sab, sa);
		strcat(sab, sb);
		js_pop(J, 2);
		js_pushstring(J, sab);
		js_endtry(J);
		js_free(J, sab);
	} else {
		double x = js_tonumber(J, -2);
		double y = js_tonumber(J, -1);
		js_pop(J, 2);
		js_pushnumber(J, x + y);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movslq 0x140(%rdi), %rax
leaq 0x25799(%rip), %r14     # 0x403f8
movq %r14, %rsi
cmpq $0x2, %rax
jl 0x1ac7b
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x20, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x15634
movslq 0x140(%rbx), %rax
movq %r14, %rsi
testq %rax, %rax
jle 0x1aca7
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x15634
movslq 0x140(%rbx), %rcx
movl %ecx, %eax
addl $-0x2, %eax
cmpq $0x2, %rcx
jl 0x1acd3
movl %eax, %edx
shlq $0x4, %rdx
addq 0x148(%rbx), %rdx
movq %rdx, %r14
movzbl 0xf(%r14), %edx
cmpl $0x6, %edx
ja 0x1ae05
movl $0x61, %esi
btl %edx, %esi
jae 0x1ae05
leaq 0x25702(%rip), %r15     # 0x403f8
movq %r15, %rsi
cmpl $0x2, %ecx
jl 0x1ad0e
movl %eax, %eax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
movq %rax, %rsi
movq %rbx, %rdi
callq 0x1533b
movq %rax, %r12
movslq 0x140(%rbx), %rax
movq %r15, %rsi
testq %rax, %rax
jle 0x1ad3b
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
callq 0x1533b
movq %rax, %r15
movq $0x0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x13fbb
movq %rax, %rdi
callq 0x3100
testl %eax, %eax
jne 0x1aed8
movq %r15, %r14
movq %r12, %rdi
callq 0x3200
movq %rax, %r15
movq %r14, %rdi
callq 0x3200
movl %r15d, %ecx
leal (%rax,%rcx), %esi
incl %esi
movq %rbx, %rdi
callq 0xe119
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x3310
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x3270
movl 0x140(%rbx), %ecx
movl 0x144(%rbx), %eax
addl $-0x2, %ecx
movl %ecx, 0x140(%rbx)
cmpl %eax, %ecx
jl 0x1aec9
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x13665
movl 0x8198(%rbx), %eax
testl %eax, %eax
je 0x1aeed
decl %eax
movl %eax, 0x8198(%rbx)
movq 0x8(%rsp), %rsi
movq (%rbx), %rdi
xorl %edx, %edx
callq *0x10(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
testl %ecx, %ecx
jle 0x1ae20
movq 0x148(%rbx), %rdx
movq %rcx, %rsi
shlq $0x4, %rsi
addq %rsi, %rdx
addq $-0x10, %rdx
jmp 0x1ae27
leaq 0x255d1(%rip), %rdx     # 0x403f8
movzbl 0xf(%rdx), %edx
cmpl $0x6, %edx
ja 0x1ae3e
movl $0x61, %esi
btl %edx, %esi
jb 0x1acef
leaq 0x255b3(%rip), %r14     # 0x403f8
movq %r14, %rsi
cmpl $0x2, %ecx
jl 0x1ae5d
movl %eax, %eax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
movq %rax, %rsi
movq %rbx, %rdi
callq 0x1514c
movsd %xmm0, 0x10(%rsp)
movslq 0x140(%rbx), %rax
movq %r14, %rsi
testq %rax, %rax
jle 0x1ae8d
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
callq 0x1514c
movl 0x140(%rbx), %ecx
movl 0x144(%rbx), %eax
addl $-0x2, %ecx
movl %ecx, 0x140(%rbx)
cmpl %eax, %ecx
jl 0x1aec9
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movq %rbx, %rdi
movapd %xmm1, %xmm0
callq 0x4184
jmp 0x1adf9
movl %eax, 0x140(%rbx)
leaq 0x18898(%rip), %rsi     # 0x3376e
jmp 0x1aef4
movq 0x8(%rsp), %rsi
movq (%rbx), %rdi
xorl %edx, %edx
callq *0x10(%rbx)
movq %rbx, %rdi
callq 0x8ec6
leaq 0x18915(%rip), %rsi     # 0x33809
xorl %eax, %eax
movq %rbx, %rdi
callq 0xc939