// File: /workspace/github_c_makefile_star2_O3/ArtifexSoftware[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 0x25c7f(%rip), %r14     # 0x403f8
movq %r14, %rsi
cmpq $0x2, %rax
jl 0x1a795
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x20, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1515d
movslq 0x140(%rbx), %rax
movq %r14, %rsi
testq %rax, %rax
jle 0x1a7c1
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1515d
movslq 0x140(%rbx), %rcx
movl %ecx, %eax
addl $-0x2, %eax
cmpq $0x2, %rcx
jl 0x1a7ed
movl %eax, %edx
shlq $0x4, %rdx
addq 0x148(%rbx), %rdx
movq %rdx, %r14
movzbl 0xf(%r14), %edx
cmpl $0x6, %edx
ja 0x1a91f
movl $0x61, %esi
btl %edx, %esi
jae 0x1a91f
leaq 0x25be8(%rip), %r15     # 0x403f8
movq %r15, %rsi
cmpl $0x2, %ecx
jl 0x1a828
movl %eax, %eax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
movq %rax, %rsi
movq %rbx, %rdi
callq 0x14e64
movq %rax, %r12
movslq 0x140(%rbx), %rax
movq %r15, %rsi
testq %rax, %rax
jle 0x1a855
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
callq 0x14e64
movq %rax, %r15
movq $0x0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x13b6c
movq %rax, %rdi
callq 0x3100
testl %eax, %eax
jne 0x1a9f2
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 0xde05
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 0x1a9e3
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x13215
movl 0x8198(%rbx), %eax
testl %eax, %eax
je 0x1aa07
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 0x1a93a
movq 0x148(%rbx), %rdx
movq %rcx, %rsi
shlq $0x4, %rsi
addq %rsi, %rdx
addq $-0x10, %rdx
jmp 0x1a941
leaq 0x25ab7(%rip), %rdx     # 0x403f8
movzbl 0xf(%rdx), %edx
cmpl $0x6, %edx
ja 0x1a958
movl $0x61, %esi
btl %edx, %esi
jb 0x1a809
leaq 0x25a99(%rip), %r14     # 0x403f8
movq %r14, %rsi
cmpl $0x2, %ecx
jl 0x1a977
movl %eax, %eax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
movq %rax, %rsi
movq %rbx, %rdi
callq 0x14c75
movsd %xmm0, 0x10(%rsp)
movslq 0x140(%rbx), %rax
movq %r14, %rsi
testq %rax, %rax
jle 0x1a9a7
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
callq 0x14c75
movl 0x140(%rbx), %ecx
movl 0x144(%rbx), %eax
addl $-0x2, %ecx
movl %ecx, 0x140(%rbx)
cmpl %eax, %ecx
jl 0x1a9e3
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movq %rbx, %rdi
movapd %xmm1, %xmm0
callq 0x4124
jmp 0x1a913
movl %eax, 0x140(%rbx)
leaq 0x18dae(%rip), %rsi     # 0x3379e
jmp 0x1aa0e
movq 0x8(%rsp), %rsi
movq (%rbx), %rdi
xorl %edx, %edx
callq *0x10(%rbx)
movq %rbx, %rdi
callq 0x8e1b
leaq 0x18e2b(%rip), %rsi     # 0x33839
xorl %eax, %eax
movq %rbx, %rdi
callq 0xc666