// File: /workspace/github_c_makefile_star2_O0/ccxvii[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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x15190
cmpl $0x0, %eax
jne 0x11972
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x116e0
cmpl $0x0, %eax
je 0x119c8
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x43c0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x11990
movl $0x0, -0x34(%rbp)
cmpl $0xa, -0x34(%rbp)
jle 0x1199d
movl $0xa, -0x34(%rbp)
leaq -0x1c(%rbp), %rdi
movslq -0x34(%rbp), %rdx
movl $0x20, %esi
callq 0x3060
movslq -0x34(%rbp), %rax
movb $0x0, -0x1c(%rbp,%rax)
cmpl $0x0, -0x34(%rbp)
jle 0x119c6
leaq -0x1c(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x11a45
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x151c0
cmpl $0x0, %eax
jne 0x119ee
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x117a0
cmpl $0x0, %eax
je 0x11a43
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x14b80
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x31e0
movl %eax, -0x34(%rbp)
cmpl $0xa, -0x34(%rbp)
jle 0x11a19
movl $0xa, -0x34(%rbp)
leaq -0x1c(%rbp), %rdi
movq -0x30(%rbp), %rsi
movslq -0x34(%rbp), %rdx
callq 0x33a0
movslq -0x34(%rbp), %rax
movb $0x0, -0x1c(%rbp,%rax)
cmpl $0x0, -0x34(%rbp)
jle 0x11a41
leaq -0x1c(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x11a43
jmp 0x11a45
movq -0x8(%rbp), %rdi
callq 0x14270
movq %rax, %rdi
callq 0x30e0
cmpl $0x0, %eax
je 0x11a71
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xd710
movq -0x8(%rbp), %rdi
callq 0x8cb0
movq -0x8(%rbp), %rdi
callq 0x1b7a0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x14410
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x2afa4(%rip), %rdx     # 0x3ca3c
xorl %ecx, %ecx
callq 0x65c0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rcx
leaq -0x10(%rbp), %rsi
leaq 0x2af8a(%rip), %rdx     # 0x3ca3c
xorl %r8d, %r8d
callq 0x26b80
cmpl $0x0, %eax
jne 0x11aca
movq -0x8(%rbp), %rdi
callq 0x8640
jmp 0x11b19
movq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
xorl %edx, %edx
callq 0xd910
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x11af6
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x48(%rbp)
jmp 0x11b03
leaq 0x2af3f(%rip), %rax     # 0x3ca3c
movq %rax, -0x48(%rbp)
jmp 0x11b03
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x13880
movq -0x8(%rbp), %rdi
callq 0x16600
movq -0x8(%rbp), %rdi
callq 0x14a10
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xd710
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)