// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x8(%rsp)
movq %rdi, %rbx
xorl %r14d, %r14d
movl %r14d, %eax
movq %rax, (%rsp)
pushq $0x3
popq %rsi
callq 0xf8f4
testl %eax, %eax
jne 0xd608
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0xd456
testl %eax, %eax
je 0xd71f
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x3f23
movl %eax, %ebp
testl %eax, %eax
cmovgl %eax, %r14d
cmpl $0xa, %r14d
pushq $0xa
popq %rax
cmovll %r14d, %eax
movl %eax, %r15d
leaq 0x14(%rsp), %r14
pushq $0x20
popq %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x3060
movb $0x0, 0x14(%rsp,%r15)
testl %ebp, %ebp
jle 0xd64a
movq %r14, (%rsp)
movq %rbx, %rdi
callq 0xee71
movq %rax, %rdi
callq 0x3100
testl %eax, %eax
jne 0xd783
movq %rbx, %rdi
callq 0x13813
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xeee2
leaq 0x1bd15(%rip), %r14     # 0x29391
pushq $-0x2
popq %rsi
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x5963
movq (%rsp), %rcx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movl %ebp, %r8d
callq 0x19b5b
testl %eax, %eax
je 0xd6f5
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xa986
movq (%r15), %rax
leaq 0x8(%rax), %rsi
testq %rax, %rax
cmoveq %r14, %rsi
movq %rbx, %rdi
callq 0xe7f7
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 0xd6fd
movq %rbx, %rdi
callq 0x7336
movq %rbx, %rdi
callq 0xf5a7
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
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0xf907
testl %eax, %eax
jne 0xd741
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0xd4b1
testl %eax, %eax
je 0xd64a
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0xf64d
movq %rax, %r15
movq %rax, %rdi
callq 0x3200
movl %eax, %ebp
cmpl $0xa, %eax
pushq $0xa
popq %rax
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 0xd642
movq (%rbx), %rdi
xorl %edx, %edx
movl %edx, %esi
callq *0x10(%rbx)
movq %rbx, %rdi
callq 0x7714