// File: /workspace/github_c_makefile_star2_O3/ArtifexSoftware[P]mujs/./json.c
// Function: JSON_stringify
static void JSON_stringify(js_State *J)
{
	js_Buffer *sb = NULL;
	char buf[12];
	/* NOTE: volatile to silence GCC warning about longjmp clobbering a variable */
	const char * volatile gap;
	const char *s;
	int n;

	gap = NULL;

	if (js_isnumber(J, 3) || js_isnumberobject(J, 3)) {
		n = js_tointeger(J, 3);
		if (n < 0) n = 0;
		if (n > 10) n = 10;
		memset(buf, ' ', n);
		buf[n] = 0;
		if (n > 0) gap = buf;
	} else if (js_isstring(J, 3) || js_isstringobject(J, 3)) {
		s = js_tostring(J, 3);
		n = strlen(s);
		if (n > 10) n = 10;
		memcpy(buf, s, n);
		buf[n] = 0;
		if (n > 0) gap = buf;
	}

	if (js_try(J)) {
		js_free(J, sb);
		js_throw(J);
	}

	js_newobject(J); /* wrapper */
	js_copy(J, 1);
	js_defproperty(J, -2, "", 0);
	if (!fmtvalue(J, &sb, "", gap, 0)) {
		js_pushundefined(J);
	} else {
		js_putc(J, &sb, 0);
		js_pushstring(J, sb ? sb->s : "");
		js_rot2pop1(J);
	}

	js_endtry(J);
	js_free(J, sb);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movq %rax, (%rsp)
movl 0x144(%rdi), %ecx
leaq 0x2e950(%rip), %rax     # 0x403f8
cmpl $-0x3, %ecx
jl 0x11ac7
addl $0x3, %ecx
cmpl 0x140(%rbx), %ecx
jge 0x11ac7
movl %ecx, %ecx
movl %ecx, %eax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
cmpb $0x4, 0xf(%rax)
je 0x11ae2
movq %rbx, %rdi
movl $0x3, %esi
callq 0x1181d
testl %eax, %eax
je 0x11c10
movq %rbx, %rdi
movl $0x3, %esi
callq 0x403b
movl %eax, %ebp
xorl %eax, %eax
testl %ebp, %ebp
cmovgl %ebp, %eax
cmpl $0xa, %eax
movl $0xa, %ecx
cmovll %eax, %ecx
movl %ecx, %r15d
leaq 0x14(%rsp), %r14
movq %r14, %rdi
movl $0x20, %esi
movq %r15, %rdx
callq 0x3060
movb $0x0, 0x14(%rsp,%r15)
testl %ebp, %ebp
jle 0x11b29
movq %r14, (%rsp)
movq %rbx, %rdi
callq 0x13b6c
movq %rax, %rdi
callq 0x3100
testl %eax, %eax
jne 0x11cdb
movq %rbx, %rdi
callq 0x19f69
movq %rbx, %rdi
movl $0x1, %esi
callq 0x13c1a
leaq 0x22859(%rip), %r14     # 0x343b6
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r14, %rdx
movl %ebp, %ecx
callq 0x662a
movq (%rsp), %rcx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movl %ebp, %r8d
callq 0x2258a
testl %eax, %eax
je 0x11bd8
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xdda1
movq (%r15), %rax
leaq 0x8(%rax), %rsi
testq %rax, %rax
cmoveq %r14, %rsi
movq %rbx, %rdi
callq 0x13215
movq 0x148(%rbx), %rax
movslq 0x140(%rbx), %rcx
shlq $0x4, %rcx
movups -0x10(%rax,%rcx), %xmm0
movups %xmm0, -0x20(%rax,%rcx)
decl 0x140(%rbx)
jmp 0x11be0
movq %rbx, %rdi
callq 0x88f1
movl 0x8198(%rbx), %eax
testl %eax, %eax
je 0x11ced
decl %eax
movl %eax, 0x8198(%rbx)
movq 0x8(%rsp), %rsi
movq (%rbx), %rdi
xorl %edx, %edx
callq *0x10(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x144(%rbx), %eax
movl %eax, %ecx
addl $0x3, %ecx
leaq 0x2e7d6(%rip), %rdx     # 0x403f8
cmpl $-0x3, %eax
jl 0x11c3c
cmpl 0x140(%rbx), %ecx
jge 0x11c3c
movl %ecx, %edx
shlq $0x4, %rdx
addq 0x148(%rbx), %rdx
movzbl 0xf(%rdx), %edx
cmpl $0x6, %edx
ja 0x11cb6
movl $0x61, %esi
btl %edx, %esi
jae 0x11cb6
leaq 0x2e7a2(%rip), %rsi     # 0x403f8
cmpl $-0x3, %eax
jl 0x11c75
movl %ecx, %eax
cmpl 0x140(%rbx), %ecx
jge 0x11c75
movl %eax, %eax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
movq %rax, %rsi
movq %rbx, %rdi
callq 0x14e64
movq %rax, %r15
movq %rax, %rdi
callq 0x3200
movl %eax, %ebp
cmpl $0xa, %eax
movl $0xa, %eax
cmovll %ebp, %eax
movslq %eax, %r12
leaq 0x14(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x33d0
movb $0x0, 0x14(%rsp,%r12)
jmp 0x11b21
movq %rbx, %rdi
movl $0x3, %esi
callq 0x118da
testl %eax, %eax
je 0x11b29
movl 0x144(%rbx), %ecx
movl %ecx, %eax
addl $0x3, %ecx
jmp 0x11c4f
movq (%rbx), %rdi
xorl %edx, %edx
movl %edx, %esi
callq *0x10(%rbx)
movq %rbx, %rdi
callq 0x8e1b
leaq 0x21b45(%rip), %rsi     # 0x33839
xorl %eax, %eax
movq %rbx, %rdi
callq 0xc666