	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function JSON_parse
_JSON_parse:                            ## @JSON_parse
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$1, %ecx
	jne	LBB0_1
## %bb.2:
	movq	%r9, %r14
	movq	%rdi, %r15
	movl	(%r8), %esi
	leaq	-40(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	callq	_to_flat_string
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_11
## %bb.3:
	movq	-48(%rbp), %rdi
	callq	_debugstr_w
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_TRACE
	movq	-48(%rbp), %rbx
	movq	%rbx, -56(%rbp)
	movq	-40(%rbp), %rdi
	callq	_jsstr_length
	cltq
	leaq	(%rbx,%rax,4), %rax
	movq	%rax, -64(%rbp)
	movq	%r15, -72(%rbp)
	leaq	-72(%rbp), %rdi
	leaq	-28(%rbp), %rsi
	callq	_parse_json_value
	movl	%eax, %ebx
	movq	-40(%rbp), %rdi
	callq	_jsstr_release
	movl	%ebx, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_11
## %bb.4:
	leaq	-72(%rbp), %rdi
	callq	_skip_spaces
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
	callq	_FIXME
	movl	-28(%rbp), %edi
	callq	_jsval_release
	movq	_E_FAIL@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_FIXME
	movq	_E_INVALIDARG@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	-28(%rbp), %edi
	testq	%r14, %r14
	je	LBB0_8
## %bb.7:
	movl	%edi, (%r14)
	jmp	LBB0_9
LBB0_8:
	callq	_jsval_release
LBB0_9:
	movq	_S_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported args\n"

	.comm	_E_INVALIDARG,4,2               ## @E_INVALIDARG
L_.str.1:                               ## @.str.1
	.asciz	"%s\n"

L_.str.2:                               ## @.str.2
	.asciz	"syntax error\n"

	.comm	_E_FAIL,4,2                     ## @E_FAIL
	.comm	_S_OK,4,2                       ## @S_OK
	.no_dead_strip	_JSON_parse
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function JSON_parse
_JSON_parse:                            ; @JSON_parse
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	cmp	w3, #1
	b.ne	LBB0_5
; %bb.1:
	mov	x19, x5
	mov	x20, x0
	ldr	w1, [x4]
	add	x2, sp, #8
	add	x3, sp, #16
	bl	_to_flat_string
	mov	x21, x0
	bl	_FAILED
	cbnz	x0, LBB0_7
; %bb.2:
	ldr	x0, [sp, #16]
	bl	_debugstr_w
	mov	x1, x0
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	ldp	x0, x21, [sp, #8]
	str	x21, [sp, #40]
	bl	_jsstr_length
	add	x8, x21, w0, sxtw #2
	stp	x20, x8, [sp, #24]
	add	x0, sp, #24
	add	x1, sp, #4
	bl	_parse_json_value
	mov	x21, x0
	ldr	x0, [sp, #8]
	bl	_jsstr_release
	mov	x0, x21
	bl	_FAILED
	cbnz	x0, LBB0_7
; %bb.3:
	add	x0, sp, #24
	bl	_skip_spaces
	cbz	x0, LBB0_8
; %bb.4:
Lloh2:
	adrp	x0, l_.str.2@PAGE
Lloh3:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_FIXME
	ldr	w0, [sp, #4]
	bl	_jsval_release
Lloh4:
	adrp	x8, _E_FAIL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _E_FAIL@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_FIXME
Lloh8:
	adrp	x8, _E_INVALIDARG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _E_INVALIDARG@GOTPAGEOFF]
LBB0_6:
	ldr	w21, [x8]
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_8:
	ldr	w0, [sp, #4]
	cbz	x19, LBB0_10
; %bb.9:
	str	w0, [x19]
	b	LBB0_11
LBB0_10:
	bl	_jsval_release
LBB0_11:
Lloh10:
	adrp	x8, _S_OK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _S_OK@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported args\n"

	.comm	_E_INVALIDARG,4,2               ; @E_INVALIDARG
l_.str.1:                               ; @.str.1
	.asciz	"%s\n"

l_.str.2:                               ; @.str.2
	.asciz	"syntax error\n"

	.comm	_E_FAIL,4,2                     ; @E_FAIL
	.comm	_S_OK,4,2                       ; @S_OK
	.no_dead_strip	_JSON_parse
.subsections_via_symbols
