// File: /workspace/github_c_makefile_star2_O1/ccxvii[P]mujs/./json.c
// Function: fmtvalue
static int fmtvalue(js_State *J, js_Buffer **sb, const char *key, const char *gap, int level)
{
	/* replacer/property-list is in 2 */
	/* holder is in -1 */

	js_getproperty(J, -1, key);

	if (js_isobject(J, -1)) {
		if (js_hasproperty(J, -1, "toJSON")) {
			if (js_iscallable(J, -1)) {
				js_copy(J, -2);
				js_pushstring(J, key);
				js_call(J, 1);
				js_rot2pop1(J);
			} else {
				js_pop(J, 1);
			}
		}
	}

	if (js_iscallable(J, 2)) {
		js_copy(J, 2); /* replacer function */
		js_copy(J, -3); /* holder as this */
		js_pushstring(J, key); /* name */
		js_copy(J, -4); /* old value */
		js_call(J, 2);
		js_rot2pop1(J); /* pop old value, leave new value on stack */
	}

	if (js_isobject(J, -1) && !js_iscallable(J, -1)) {
		js_Object *obj = js_toobject(J, -1);
		switch (obj->type) {
		case JS_CNUMBER: fmtnum(J, sb, obj->u.number); break;
		case JS_CSTRING: fmtstr(J, sb, obj->u.s.string); break;
		case JS_CBOOLEAN: js_puts(J, sb, obj->u.boolean ? "true" : "false"); break;
		case JS_CARRAY: fmtarray(J, sb, gap, level); break;
		default: fmtobject(J, sb, obj, gap, level); break;
		}
	}
	else if (js_isboolean(J, -1))
		js_puts(J, sb, js_toboolean(J, -1) ? "true" : "false");
	else if (js_isnumber(J, -1))
		fmtnum(J, sb, js_tonumber(J, -1));
	else if (js_isstring(J, -1))
		fmtstr(J, sb, js_tostring(J, -1));
	else if (js_isnull(J, -1))
		js_puts(J, sb, "null");
	else {
		js_pop(J, 1);
		return 0;
	}

	js_pop(J, 1);
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, 0x18(%rsp)
movq %rcx, 0x20(%rsp)
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4032
movl 0x140(%rbx), %ecx
leal -0x1(%rcx), %eax
testl %ecx, %ecx
jle 0x22907
movl %eax, %edx
shlq $0x4, %rdx
addq 0x148(%rbx), %rdx
jmp 0x2290e
leaq 0x1daea(%rip), %rdx     # 0x403f8
cmpb $0x7, 0xf(%rdx)
jne 0x229c7
testl %ecx, %ecx
jle 0x2292b
movl %eax, %esi
shlq $0x4, %rsi
addq 0x148(%rbx), %rsi
jmp 0x22932
leaq 0x1dac6(%rip), %rsi     # 0x403f8
movq %rbx, %rdi
callq 0x15489
leaq 0x107d5(%rip), %rdx     # 0x33116
movq %rbx, %rdi
movq %rax, %rsi
callq 0x16778
testl %eax, %eax
je 0x229c7
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x14e17
testl %eax, %eax
je 0x229aa
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x14073
movq %rbx, %rdi
movq %r13, %rsi
callq 0x13665
movq %rbx, %rdi
movl $0x1, %esi
callq 0x16c25
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 0x229c7
movl 0x140(%rbx), %ecx
movl 0x144(%rbx), %eax
leal -0x1(%rcx), %edx
movl %edx, 0x140(%rbx)
cmpl %eax, %ecx
jle 0x2330b
movq %r14, 0x8(%rsp)
movq %rbx, %rdi
movl $0x2, %esi
callq 0x14e17
testl %eax, %eax
je 0x22a3e
movq %rbx, %rdi
movl $0x2, %esi
callq 0x14073
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x14073
movq %rbx, %rdi
movq %r13, %rsi
callq 0x13665
movq %rbx, %rdi
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x14073
movq %rbx, %rdi
movl $0x2, %esi
callq 0x16c25
movq 0x148(%rbx), %rax
movslq 0x140(%rbx), %rcx
shlq $0x4, %rcx
movups -0x10(%rax,%rcx), %xmm0
movups %xmm0, -0x20(%rax,%rcx)
decl 0x140(%rbx)
movl 0x140(%rbx), %r14d
leal -0x1(%r14), %ebp
movl %ebp, %r13d
testl %r14d, %r14d
jle 0x22a61
movq %r13, %rax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
jmp 0x22a68
leaq 0x1d990(%rip), %rax     # 0x403f8
cmpb $0x7, 0xf(%rax)
jne 0x22a7f
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x14e17
testl %eax, %eax
je 0x22ac8
testl %r14d, %r14d
jle 0x22a94
movq %r13, %rax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
jmp 0x22a9b
leaq 0x1d95d(%rip), %rax     # 0x403f8
cmpb $0x3, 0xf(%rax)
jne 0x22ab3
testl %r14d, %r14d
jle 0x22ae1
shlq $0x4, %r13
addq 0x148(%rbx), %r13
jmp 0x22ae8
testl %r14d, %r14d
jle 0x22b34
movq %r13, %rax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
jmp 0x22b3b
testl %r14d, %r14d
jle 0x22bca
shlq $0x4, %r13
addq 0x148(%rbx), %r13
jmp 0x22bd1
leaq 0x1d910(%rip), %r13     # 0x403f8
movq 0x8(%rsp), %r15
movq %r13, %rsi
callq 0x150c0
testl %eax, %eax
leaq 0x10fa0(%rip), %rax     # 0x33a9e
leaq 0x10f94(%rip), %r14     # 0x33a99
cmoveq %rax, %r14
movb (%r14), %al
testb %al, %al
je 0x232c3
incq %r14
movsbl %al, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe0bc
movb (%r14), %al
incq %r14
testb %al, %al
jne 0x22b17
jmp 0x232c3
leaq 0x1d8bd(%rip), %rax     # 0x403f8
cmpb $0x4, 0xf(%rax)
jne 0x22b53
testl %r14d, %r14d
jle 0x22b68
shlq $0x4, %r13
addq 0x148(%rbx), %r13
jmp 0x22b6f
testl %r14d, %r14d
jle 0x22b8f
movq %r13, %rax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
jmp 0x22b96
leaq 0x1d889(%rip), %r13     # 0x403f8
movq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1514c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x23333
jmp 0x232c3
leaq 0x1d862(%rip), %rax     # 0x403f8
movzbl 0xf(%rax), %eax
cmpl $0x6, %eax
ja 0x22de7
movl $0x61, %ecx
btl %eax, %ecx
jae 0x22de7
testl %r14d, %r14d
jle 0x22dbd
shlq $0x4, %r13
addq 0x148(%rbx), %r13
jmp 0x22dc4
leaq 0x1d827(%rip), %r13     # 0x403f8
movq 0x8(%rsp), %rbp
movq %rbx, %rdi
movq %r13, %rsi
callq 0x15489
movl (%rax), %ecx
decl %ecx
cmpl $0x7, %ecx
ja 0x22e5d
leaq 0x8f2f(%rip), %rdx      # 0x2bb24
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl 0x140(%rbx), %eax
movl 0x144(%rbx), %r14d
movl %r14d, %ecx
notl %ecx
addl %eax, %ecx
cmpl $0x5, %ecx
jl 0x22cab
subl %eax, %r14d
movl $0x4, %r15d
leaq 0x1d7cd(%rip), %r13     # 0x403f8
movl 0x144(%rbx), %ecx
addl %r15d, %ecx
movq %r13, %rax
js 0x22c51
movq %r13, %rax
cmpl 0x140(%rbx), %ecx
jge 0x22c51
movl %ecx, %eax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
cmpb $0x7, 0xf(%rax)
jne 0x22c98
movq %rbx, %rdi
movl %r15d, %esi
callq 0x11c37
movq %rax, %r12
movslq 0x140(%rbx), %rax
movq %r13, %rsi
testq %rax, %rax
jle 0x22c87
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
callq 0x15489
cmpq %rax, %r12
je 0x23322
leal (%r14,%r15), %eax
incl %eax
movl %r15d, %ecx
incl %ecx
movl %ecx, %r15d
cmpl $-0x1, %eax
jne 0x22c2b
movq %rbx, %rdi
movq %rbp, %rsi
movl $0x5b, %edx
callq 0xe0bc
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3fcc
movl %eax, 0x8(%rsp)
testl %eax, %eax
jle 0x22d86
movq 0x18(%rsp), %rax
leal 0x1(%rax), %r13d
xorl %r15d, %r15d
movl %r13d, 0x10(%rsp)
testl %r15d, %r15d
movq 0x20(%rsp), %r12
je 0x22cff
movq %rbx, %rdi
movq %rbp, %rsi
movl $0x2c, %edx
callq 0xe0bc
testq %r12, %r12
je 0x22d15
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl %r13d, %ecx
callq 0x236e4
movq %rbp, %r14
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
movl %r15d, %esi
callq 0x12cc2
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %r12, %rcx
movl %r13d, %r8d
callq 0x228c0
testl %eax, %eax
movq %r14, %r13
leaq 0x11e33(%rip), %r14     # 0x34b7b
jne 0x22d70
movb $0x6e, %al
xorl %r12d, %r12d
leaq 0x1(%r12), %rbp
movsbl %al, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe0bc
movb 0x1(%r12,%r14), %al
movq %rbp, %r12
cmpq $0x4, %rbp
jne 0x22d4f
incl %r15d
cmpl 0x8(%rsp), %r15d
movq %r13, %rbp
movl 0x10(%rsp), %r13d
jne 0x22ce5
movq 0x20(%rsp), %rdx
testq %rdx, %rdx
sete %al
cmpl $0x0, 0x8(%rsp)
sete %cl
orb %al, %cl
jne 0x22dad
movq %rbx, %rdi
movq %rbp, %rsi
movq 0x18(%rsp), %rcx
callq 0x236e4
movq %rbx, %rdi
movq %rbp, %rsi
movl $0x5d, %edx
jmp 0x2327d
leaq 0x1d634(%rip), %r13     # 0x403f8
movq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1533b
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2342d
jmp 0x232c3
testl %r14d, %r14d
jle 0x23284
shlq $0x4, %r13
addq 0x148(%rbx), %r13
jmp 0x2328b
movsd 0x20(%rax), %xmm0
movq %rbx, %rdi
movq %rbp, %rsi
jmp 0x22b85
cmpl $0x0, 0x20(%rax)
leaq 0x10c83(%rip), %rax     # 0x33a9e
leaq 0x10c77(%rip), %r14     # 0x33a99
cmoveq %rax, %r14
movb (%r14), %al
testb %al, %al
je 0x232c3
incq %r14
movsbl %al, %edx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xe0bc
movb (%r14), %al
incq %r14
testb %al, %al
jne 0x22e34
jmp 0x232c3
movq 0x28(%rax), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
jmp 0x22ddd
movl 0x140(%rbx), %eax
movl 0x144(%rbx), %r14d
movl %r14d, %ecx
notl %ecx
addl %eax, %ecx
cmpl $0x5, %ecx
jl 0x22f0a
subl %eax, %r14d
movl $0x4, %r15d
leaq 0x1d56e(%rip), %r13     # 0x403f8
movl 0x144(%rbx), %ecx
addl %r15d, %ecx
movq %r13, %rax
js 0x22eb0
movq %r13, %rax
cmpl 0x140(%rbx), %ecx
jge 0x22eb0
movl %ecx, %eax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
cmpb $0x7, 0xf(%rax)
jne 0x22ef7
movq %rbx, %rdi
movl %r15d, %esi
callq 0x11c37
movq %rax, %r12
movslq 0x140(%rbx), %rax
movq %r13, %rsi
testq %rax, %rax
jle 0x22ee6
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
callq 0x15489
cmpq %rax, %r12
je 0x23322
leal (%r14,%r15), %eax
incl %eax
movl %r15d, %ecx
incl %ecx
movl %ecx, %r15d
cmpl $-0x1, %eax
jne 0x22e8a
movq %rbx, %rdi
movq %rbp, %rsi
movl $0x7b, %edx
callq 0xe0bc
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
callq 0x16b9e
movq 0x18(%rsp), %rax
incl %eax
movl %eax, 0x14(%rsp)
movl $0x0, 0x10(%rsp)
leaq 0x1d4b2(%rip), %r12     # 0x403f8
movslq 0x140(%rbx), %rax
movq %r12, %rsi
testq %rax, %rax
jle 0x22f68
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
callq 0x15489
movq %rbx, %rdi
movq %rax, %rsi
callq 0x12c41
testq %rax, %rax
je 0x23226
movq %rax, %r13
movl 0x144(%rbx), %ecx
movq %r12, %rax
cmpl $-0x2, %ecx
jl 0x22fb0
addl $0x2, %ecx
movq %r12, %rax
cmpl 0x140(%rbx), %ecx
jge 0x22fb0
movl %ecx, %eax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
cmpb $0x7, 0xf(%rax)
jne 0x230e8
movq (%rax), %rax
cmpl $0x1, (%rax)
jne 0x230e8
movq %rbx, %rdi
movl $0x2, %esi
callq 0x3fcc
testl %eax, %eax
jle 0x22f46
movl %eax, %ebp
xorl %r15d, %r15d
movl $0x1, %r14d
leal -0x1(%r14), %edx
movq %rbx, %rdi
movl $0x2, %esi
callq 0x169fb
movl 0x140(%rbx), %ecx
leal -0x1(%rcx), %eax
movq %r12, %rdx
testl %ecx, %ecx
jle 0x23014
movl %eax, %edx
shlq $0x4, %rdx
addq 0x148(%rbx), %rdx
movzbl 0xf(%rdx), %edx
cmpl $0x6, %edx
ja 0x23095
movl $0x61, %esi
btl %edx, %esi
jae 0x23095
movslq 0x140(%rbx), %rax
movq %r12, %rsi
testq %rax, %rax
jle 0x23049
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
callq 0x1533b
movq %r13, %rdi
movq %rax, %rsi
callq 0x32f0
xorl %r15d, %r15d
testl %eax, %eax
sete %r15b
movl 0x140(%rbx), %ecx
movl 0x144(%rbx), %eax
leal -0x1(%rcx), %edx
movl %edx, 0x140(%rbx)
cmpl %eax, %ecx
jle 0x2330b
cmpl %ebp, %r14d
jge 0x230df
incl %r14d
testl %r15d, %r15d
je 0x22fe6
jmp 0x230df
movq %r12, %rdx
testl %ecx, %ecx
jle 0x230a9
movl %eax, %edx
shlq $0x4, %rdx
addq 0x148(%rbx), %rdx
cmpb $0x4, 0xf(%rdx)
je 0x23027
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x11c72
testl %eax, %eax
jne 0x23027
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x11bb5
testl %eax, %eax
jne 0x23027
jmp 0x23065
testl %r15d, %r15d
je 0x22f46
movq 0x8(%rsp), %rsi
movq (%rsi), %rax
movl (%rax), %eax
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x10(%rsp)
je 0x2310a
movq %rbx, %rdi
movl $0x2c, %edx
callq 0xe0bc
movq 0x20(%rsp), %r15
movq %rbx, %rdi
testq %r15, %r15
je 0x23152
movq 0x8(%rsp), %r14
movq %r14, %rsi
movq %r15, %rdx
movl 0x14(%rsp), %ebp
movl %ebp, %ecx
callq 0x236e4
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x2342d
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3a, %edx
callq 0xe0bc
movl $0x20, %edx
jmp 0x2316b
movq 0x8(%rsp), %r14
movq %r14, %rsi
movq %r13, %rdx
callq 0x2342d
movl $0x3a, %edx
movl 0x14(%rsp), %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe0bc
movq 0x148(%rbx), %rax
movslq 0x140(%rbx), %rcx
shlq $0x4, %rcx
movups -0x10(%rax,%rcx), %xmm0
movaps %xmm0, 0x30(%rsp)
movups -0x20(%rax,%rcx), %xmm0
movups %xmm0, -0x10(%rax,%rcx)
movq 0x148(%rbx), %rax
movslq 0x140(%rbx), %rcx
shlq $0x4, %rcx
movaps 0x30(%rsp), %xmm0
movups %xmm0, -0x20(%rax,%rcx)
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r15, %rcx
movl %ebp, %r8d
callq 0x228c0
testl %eax, %eax
je 0x231d6
incl 0x10(%rsp)
jmp 0x231df
movq (%r14), %rax
movl 0x2c(%rsp), %ecx
movl %ecx, (%rax)
movq 0x148(%rbx), %rax
movslq 0x140(%rbx), %rcx
shlq $0x4, %rcx
movups -0x10(%rax,%rcx), %xmm0
movaps %xmm0, 0x30(%rsp)
movups -0x20(%rax,%rcx), %xmm0
movups %xmm0, -0x10(%rax,%rcx)
movq 0x148(%rbx), %rax
movslq 0x140(%rbx), %rcx
shlq $0x4, %rcx
movaps 0x30(%rsp), %xmm0
movups %xmm0, -0x20(%rax,%rcx)
jmp 0x22f46
movl 0x140(%rbx), %ecx
movl 0x144(%rbx), %eax
leal -0x1(%rcx), %edx
movl %edx, 0x140(%rbx)
cmpl %eax, %ecx
movq 0x8(%rsp), %r14
jle 0x2330b
movq 0x20(%rsp), %rdx
testq %rdx, %rdx
setne %al
cmpl $0x0, 0x10(%rsp)
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x23272
movq %rbx, %rdi
movq %r14, %rsi
movq 0x18(%rsp), %rcx
callq 0x236e4
movq %rbx, %rdi
movq %r14, %rsi
movl $0x7d, %edx
callq 0xe0bc
jmp 0x232c3
leaq 0x1d16d(%rip), %r13     # 0x403f8
cmpb $0x2, 0xf(%r13)
jne 0x232f0
movb $0x6e, %al
xorl %r15d, %r15d
leaq 0x118dd(%rip), %r14     # 0x34b7b
movq 0x8(%rsp), %r13
leaq 0x1(%r15), %r12
movsbl %al, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe0bc
movb 0x1(%r15,%r14), %al
movq %r12, %r15
cmpq $0x4, %r12
jne 0x232a3
movl 0x140(%rbx), %edx
movl 0x144(%rbx), %ecx
leal -0x1(%rdx), %eax
movl %eax, 0x140(%rbx)
movl $0x1, %eax
cmpl %ecx, %edx
jle 0x23303
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, 0x140(%rbx)
movl 0x144(%rbx), %ecx
xorl %eax, %eax
cmpl %ecx, %r14d
jg 0x232e1
movl %ecx, 0x140(%rbx)
jmp 0x23311
movl %eax, 0x140(%rbx)
leaq 0x10456(%rip), %rsi     # 0x3376e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xc939
leaq 0x11922(%rip), %rsi     # 0x34c4b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xcce3