// File: /workspace/github_c_makefile_star2_O3/ArtifexSoftware[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
movl %r8d, %r15d
movq %rcx, 0x20(%rsp)
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3fd2
movl 0x140(%rbx), %eax
testl %eax, %eax
jle 0x225da
decl %eax
movq 0x148(%rbx), %rsi
shlq $0x4, %rax
cmpb $0x7, 0xf(%rsi,%rax)
jne 0x22683
addq %rax, %rsi
jmp 0x225ee
cmpb $0x7, 0x1de26(%rip)     # 0x40407
jne 0x22683
leaq 0x1de0a(%rip), %rsi     # 0x403f8
movq %rbx, %rdi
callq 0x14fb2
leaq 0x10b49(%rip), %rdx     # 0x33146
movq %rbx, %rdi
movq %rax, %rsi
callq 0x162b5
testl %eax, %eax
je 0x22683
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x14940
testl %eax, %eax
je 0x22666
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x13c1a
movq %rbx, %rdi
movq %r13, %rsi
callq 0x13215
movq %rbx, %rdi
movl $0x1, %esi
callq 0x16762
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 0x22683
movl 0x140(%rbx), %ecx
movl 0x144(%rbx), %eax
leal -0x1(%rcx), %edx
movl %edx, 0x140(%rbx)
cmpl %eax, %ecx
jle 0x2301e
movq %rbx, %rdi
movl $0x2, %esi
callq 0x14940
testl %eax, %eax
movq %r14, (%rsp)
je 0x22706
movq %rbx, %rdi
movl $0x2, %esi
callq 0x13c1a
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x13c1a
movq %rbx, %rdi
movq %r13, %rsi
callq 0x13215
movq %rbx, %rdi
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x13c1a
movq %rbx, %rdi
movl $0x2, %esi
callq 0x16762
movq 0x148(%rbx), %rax
movslq 0x140(%rbx), %rcx
shlq $0x4, %rcx
movups -0x10(%rax,%rcx), %xmm0
movups %xmm0, -0x20(%rax,%rcx)
movl 0x140(%rbx), %r14d
decl %r14d
movl %r14d, 0x140(%rbx)
jmp 0x2270d
movl 0x140(%rbx), %r14d
leal -0x1(%r14), %ebp
movl %ebp, %r13d
testl %r14d, %r14d
jle 0x22729
movq %r13, %rax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
jmp 0x22730
leaq 0x1dcc8(%rip), %rax     # 0x403f8
cmpb $0x7, 0xf(%rax)
jne 0x2274b
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x14940
testl %eax, %eax
je 0x2280c
testl %r14d, %r14d
jle 0x22776
movq 0x148(%rbx), %rsi
movq %r13, %rcx
shlq $0x4, %rcx
movzbl 0xf(%rsi,%rcx), %eax
cmpl $0x4, %eax
je 0x22823
cmpl $0x3, %eax
jne 0x22792
addq %rcx, %rsi
jmp 0x227c4
movzbl 0x1dc8a(%rip), %eax     # 0x40407
leaq 0x1dc74(%rip), %rsi     # 0x403f8
cmpl $0x3, %eax
je 0x227c4
cmpl $0x4, %eax
je 0x22826
cmpb $0x6, %al
ja 0x22a78
movzbl %al, %eax
movl $0x61, %ecx
btl %eax, %ecx
jae 0x22a78
testl %r14d, %r14d
jle 0x2283f
shlq $0x4, %r13
addq 0x148(%rbx), %r13
jmp 0x22846
callq 0x14be9
testl %eax, %eax
leaq 0x112fc(%rip), %rax     # 0x33ace
leaq 0x112f0(%rip), %r14     # 0x33ac9
cmoveq %rax, %r14
movb (%r14), %al
testb %al, %al
movq (%rsp), %r15
je 0x22fb6
incq %r14
movsbl %al, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdda1
movb (%r14), %al
incq %r14
testb %al, %al
jne 0x227ef
jmp 0x22fb6
testl %r14d, %r14d
movq %r15, 0x18(%rsp)
jle 0x22868
shlq $0x4, %r13
addq 0x148(%rbx), %r13
jmp 0x2286f
addq %rcx, %rsi
movq %rbx, %rdi
callq 0x14c75
movq %rbx, %rdi
movq (%rsp), %rsi
callq 0x23026
jmp 0x22fb6
leaq 0x1dbb2(%rip), %r13     # 0x403f8
movq (%rsp), %r14
movq %rbx, %rdi
movq %r13, %rsi
callq 0x14e64
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x23120
jmp 0x22fb6
leaq 0x1db89(%rip), %r13     # 0x403f8
movq (%rsp), %rbp
movq %rbx, %rdi
movq %r13, %rsi
callq 0x14fb2
movl (%rax), %ecx
decl %ecx
cmpl $0x7, %ecx
ja 0x22af1
leaq 0x92d2(%rip), %rdx      # 0x2bb64
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 0x22948
subl %eax, %r14d
movl $0x4, %r15d
leaq 0x1db30(%rip), %r13     # 0x403f8
movl 0x144(%rbx), %ecx
addl %r15d, %ecx
movq %r13, %rax
js 0x228ee
movq %r13, %rax
cmpl 0x140(%rbx), %ecx
jge 0x228ee
movl %ecx, %eax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
cmpb $0x7, 0xf(%rax)
jne 0x22935
movq %rbx, %rdi
movl %r15d, %esi
callq 0x1189f
movq %rax, %r12
movslq 0x140(%rbx), %rax
movq %r13, %rsi
testq %rax, %rax
jle 0x22924
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
callq 0x14fb2
cmpq %rax, %r12
je 0x2300d
leal (%r14,%r15), %eax
incl %eax
movl %r15d, %ecx
incl %ecx
movl %ecx, %r15d
cmpl $-0x1, %eax
jne 0x228c8
movq %rbx, %rdi
movq %rbp, %rsi
movl $0x5b, %edx
callq 0xdda1
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3f6c
movl %eax, 0x10(%rsp)
testl %eax, %eax
jle 0x22a41
movq 0x18(%rsp), %rax
incl %eax
movl %eax, 0xc(%rsp)
xorl %r15d, %r15d
leaq 0x12225(%rip), %r14     # 0x34bab
testl %r15d, %r15d
movq 0x20(%rsp), %r12
je 0x229a0
movq %rbx, %rdi
movq %rbp, %rsi
movl $0x2c, %edx
callq 0xdda1
testq %r12, %r12
je 0x229dd
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl 0xc(%rsp), %r13d
movl %r13d, %ecx
callq 0x233d7
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
movl %r15d, %esi
callq 0x1289d
movq %rbx, %rdi
movq (%rsp), %rsi
movq %rbp, %rdx
movq %r12, %rcx
movl %r13d, %r8d
jmp 0x229fd
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movl %r15d, %esi
callq 0x1289d
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
movl 0xc(%rsp), %r8d
callq 0x2258a
testl %eax, %eax
movq (%rsp), %r13
jne 0x22a30
movb $0x6e, %al
xorl %r12d, %r12d
leaq 0x1(%r12), %rbp
movsbl %al, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xdda1
movb 0x1(%r12,%r14), %al
movq %rbp, %r12
cmpq $0x4, %rbp
jne 0x22a0f
incl %r15d
cmpl 0x10(%rsp), %r15d
movq %r13, %rbp
jne 0x22986
movq 0x20(%rsp), %rdx
testq %rdx, %rdx
sete %al
cmpl $0x0, 0x10(%rsp)
sete %cl
orb %al, %cl
jne 0x22a68
movq %rbx, %rdi
movq %rbp, %rsi
movq 0x18(%rsp), %rcx
callq 0x233d7
movq %rbx, %rdi
movq %rbp, %rsi
movl $0x5d, %edx
jmp 0x22f71
testl %r14d, %r14d
jle 0x22f78
shlq $0x4, %r13
addq 0x148(%rbx), %r13
jmp 0x22f7f
movsd 0x20(%rax), %xmm0
movq %rbx, %rdi
movq %rbp, %rsi
jmp 0x22835
cmpl $0x0, 0x20(%rax)
leaq 0x11022(%rip), %rax     # 0x33ace
leaq 0x11016(%rip), %r14     # 0x33ac9
cmoveq %rax, %r14
movb (%r14), %al
testb %al, %al
je 0x22fb6
incq %r14
movsbl %al, %edx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xdda1
movb (%r14), %al
incq %r14
testb %al, %al
jne 0x22ac5
jmp 0x22fb6
movq 0x28(%rax), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
jmp 0x2285e
movl 0x140(%rbx), %eax
movl 0x144(%rbx), %r14d
movl %r14d, %ecx
notl %ecx
addl %eax, %ecx
cmpl $0x5, %ecx
jl 0x22b9e
subl %eax, %r14d
movl $0x4, %r15d
leaq 0x1d8da(%rip), %r13     # 0x403f8
movl 0x144(%rbx), %ecx
addl %r15d, %ecx
movq %r13, %rax
js 0x22b44
movq %r13, %rax
cmpl 0x140(%rbx), %ecx
jge 0x22b44
movl %ecx, %eax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
cmpb $0x7, 0xf(%rax)
jne 0x22b8b
movq %rbx, %rdi
movl %r15d, %esi
callq 0x1189f
movq %rax, %r12
movslq 0x140(%rbx), %rax
movq %r13, %rsi
testq %rax, %rax
jle 0x22b7a
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
callq 0x14fb2
cmpq %rax, %r12
je 0x2300d
leal (%r14,%r15), %eax
incl %eax
movl %r15d, %ecx
incl %ecx
movl %ecx, %r15d
cmpl $-0x1, %eax
jne 0x22b1e
movq %rbx, %rdi
movq %rbp, %rsi
movl $0x7b, %edx
callq 0xdda1
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
callq 0x166db
movq 0x18(%rsp), %rax
incl %eax
movl %eax, 0xc(%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x1d81d(%rip), %r12     # 0x403f8
movl $0x61, %r15d
movslq 0x140(%rbx), %rax
movq %r12, %rsi
testq %rax, %rax
jle 0x22c03
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
callq 0x14fb2
movq %rbx, %rdi
movq %rax, %rsi
callq 0x12827
testq %rax, %rax
je 0x22f1b
movq %rax, %r13
movl 0x144(%rbx), %ecx
movq %r12, %rax
cmpl $-0x2, %ecx
jl 0x22c4b
addl $0x2, %ecx
movq %r12, %rax
cmpl 0x140(%rbx), %ecx
jge 0x22c4b
movl %ecx, %eax
shlq $0x4, %rax
addq 0x148(%rbx), %rax
cmpb $0x7, 0xf(%rax)
jne 0x22d7c
movq (%rax), %rax
cmpl $0x1, (%rax)
jne 0x22d7c
movq %rbx, %rdi
movl $0x2, %esi
callq 0x3f6c
testl %eax, %eax
jle 0x22be1
movl %eax, %ebp
movl $0x1, %r14d
leal -0x1(%r14), %edx
movq %rbx, %rdi
movl $0x2, %esi
callq 0x16538
movl 0x140(%rbx), %ecx
leal -0x1(%rcx), %eax
movq %r12, %rdx
testl %ecx, %ecx
jle 0x22cac
movl %eax, %edx
shlq $0x4, %rdx
addq 0x148(%rbx), %rdx
movzbl 0xf(%rdx), %edx
cmpl $0x6, %edx
ja 0x22d28
btl %edx, %r15d
jae 0x22d28
movslq 0x140(%rbx), %rax
movq %r12, %rsi
testq %rax, %rax
jle 0x22cdd
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
movq %rbx, %rdi
callq 0x14e64
movq %r13, %rdi
movq %rax, %rsi
callq 0x32f0
testl %eax, %eax
setne %al
movl 0x140(%rbx), %edx
movl 0x144(%rbx), %ecx
leal -0x1(%rdx), %esi
movl %esi, 0x140(%rbx)
cmpl %ecx, %edx
jle 0x22ff6
cmpl %ebp, %r14d
setl %cl
andb %al, %cl
incl %r14d
cmpb $0x1, %cl
je 0x22c7e
jmp 0x22d74
movq %r12, %rdx
testl %ecx, %ecx
jle 0x22d3c
movl %eax, %edx
shlq $0x4, %rdx
addq 0x148(%rbx), %rdx
cmpb $0x4, 0xf(%rdx)
je 0x22cbb
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x118da
testl %eax, %eax
jne 0x22cbb
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1181d
testl %eax, %eax
jne 0x22cbb
movb $0x1, %al
jmp 0x22cf5
testb %al, %al
jne 0x22be1
movq (%rsp), %rsi
movq (%rsi), %rax
movl (%rax), %eax
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x10(%rsp)
je 0x22d9d
movq %rbx, %rdi
movl $0x2c, %edx
callq 0xdda1
movq 0x20(%rsp), %rbp
movq %rbx, %rdi
testq %rbp, %rbp
je 0x22e3f
movq (%rsp), %r14
movq %r14, %rsi
movq %rbp, %rdx
movl 0xc(%rsp), %ecx
callq 0x233d7
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x23120
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3a, %edx
callq 0xdda1
movq %rbx, %rdi
movq %r14, %rsi
movl $0x20, %edx
callq 0xdda1
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 %rbp, %rcx
jmp 0x22eab
movq (%rsp), %r14
movq %r14, %rsi
movq %r13, %rdx
callq 0x23120
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3a, %edx
callq 0xdda1
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
xorl %ecx, %ecx
movl 0xc(%rsp), %r8d
callq 0x2258a
testl %eax, %eax
je 0x22ec7
movq 0x10(%rsp), %rax
incl %eax
movq %rax, 0x10(%rsp)
jmp 0x22ed4
movq (%rsp), %rax
movq (%rax), %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 0x22be1
movl 0x140(%rbx), %ecx
movl 0x144(%rbx), %eax
leal -0x1(%rcx), %edx
movl %edx, 0x140(%rbx)
cmpl %eax, %ecx
movq (%rsp), %r14
jle 0x2301e
movq 0x20(%rsp), %rdx
testq %rdx, %rdx
setne %al
cmpl $0x0, 0x10(%rsp)
setne %cl
andb %al, %cl
cmpb $0x1, %cl
movq 0x18(%rsp), %rcx
jne 0x22f66
movq %rbx, %rdi
movq %r14, %rsi
callq 0x233d7
movq %rbx, %rdi
movq %r14, %rsi
movl $0x7d, %edx
callq 0xdda1
jmp 0x22fb6
leaq 0x1d479(%rip), %r13     # 0x403f8
cmpb $0x2, 0xf(%r13)
jne 0x22fe3
movb $0x6e, %al
xorl %r15d, %r15d
leaq 0x11c19(%rip), %r14     # 0x34bab
movq (%rsp), %r13
leaq 0x1(%r15), %r12
movsbl %al, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xdda1
movb 0x1(%r15,%r14), %al
movq %r12, %r15
cmpq $0x4, %r12
jne 0x22f96
movl 0x140(%rbx), %edx
movl 0x144(%rbx), %ecx
leal -0x1(%rdx), %eax
movl %eax, 0x140(%rbx)
movl $0x1, %eax
cmpl %ecx, %edx
jle 0x22ff6
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 0x22fd4
movl %ecx, 0x140(%rbx)
leaq 0x1079b(%rip), %rsi     # 0x3379e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xc666
leaq 0x11c67(%rip), %rsi     # 0x34c7b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xca10
movl %eax, 0x140(%rbx)
jmp 0x22ffc