	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_utf8
_read_utf8:                             ## @read_utf8
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r12
	movl	%esi, %edi
	callq	_utf8_seq_length
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movl	%eax, %r14d
	movb	%r15b, -36(%rbp)
	cmpl	$2, %eax
	jl	LBB0_6
## %bb.4:
	movl	%r14d, %r15d
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	*(%r12)
	movb	%al, -36(%rbp,%rbx)
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_5
LBB0_6:
	leaq	-36(%rbp), %rdi
	movl	%r14d, %esi
	callq	_is_legal_utf8
	testl	%eax, %eax
	je	LBB0_15
## %bb.7:
	testl	%r14d, %r14d
	jle	LBB0_8
## %bb.9:
	movsbl	-36(%rbp), %esi
	movq	%r12, %rdi
	callq	_pushchar
	movq	%rax, %rcx
	movl	$-1, %eax
	testq	%rcx, %rcx
	jne	LBB0_14
## %bb.10:
	movl	%r14d, %r14d
	movl	$1, %ecx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %rbx
	cmpq	%rcx, %r14
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movsbl	-36(%rbp,%rbx), %esi
	movq	%r12, %rdi
	callq	_pushchar
	leaq	1(%rbx), %rcx
	testq	%rax, %rax
	je	LBB0_11
LBB0_13:
	xorl	%eax, %eax
	cmpq	%r14, %rbx
	sbbl	%eax, %eax
	jmp	LBB0_14
LBB0_1:
	leaq	L_.str(%rip), %rsi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_2
LBB0_15:
	leaq	L_.str(%rip), %rsi
	leaq	L_.str.2(%rip), %rdx
LBB0_2:
	movq	%r12, %rdi
	callq	_json_error
	movl	$-1, %eax
LBB0_14:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

L_.str.1:                               ## @.str.1
	.asciz	"Bad character."

L_.str.2:                               ## @.str.2
	.asciz	"No legal UTF8 found"

	.no_dead_strip	_read_utf8
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_utf8
_read_utf8:                             ; @read_utf8
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x1
	mov	x19, x0
	mov	x0, x1
	bl	_utf8_seq_length
	cbz	w0, LBB0_11
; %bb.1:
	mov	x20, x0
	strb	w21, [sp, #12]
	cmp	w0, #2
	b.lt	LBB0_4
; %bb.2:
	mov	w8, w20
	add	x9, sp, #12
	add	x21, x9, #1
	sub	x22, x8, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	mov	x0, x19
	blr	x8
	strb	w0, [x21], #1
	subs	x22, x22, #1
	b.ne	LBB0_3
LBB0_4:
	add	x0, sp, #12
	mov	x1, x20
	bl	_is_legal_utf8
	cbz	w0, LBB0_12
; %bb.5:
	cmp	w20, #1
	b.lt	LBB0_16
; %bb.6:
	ldrsb	w1, [sp, #12]
	mov	x0, x19
	bl	_pushchar
	cbnz	x0, LBB0_14
; %bb.7:
	mov	w20, w20
	mov	w8, #1
	add	x21, sp, #12
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x22, x8
	cmp	x20, x8
	b.eq	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldrsb	w1, [x21, x22]
	mov	x0, x19
	bl	_pushchar
	add	x8, x22, #1
	cbz	x0, LBB0_8
LBB0_10:
	cmp	x22, x20
	csetm	w0, lo
	b	LBB0_15
LBB0_11:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
Lloh2:
	adrp	x2, l_.str.1@PAGE
Lloh3:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_12:
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
Lloh6:
	adrp	x2, l_.str.2@PAGE
Lloh7:
	add	x2, x2, l_.str.2@PAGEOFF
LBB0_13:
	mov	x0, x19
	bl	_json_error
LBB0_14:
	mov	w0, #-1
LBB0_15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_16:
	mov	w0, #0
	b	LBB0_15
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

l_.str.1:                               ; @.str.1
	.asciz	"Bad character."

l_.str.2:                               ; @.str.2
	.asciz	"No legal UTF8 found"

	.no_dead_strip	_read_utf8
.subsections_via_symbols
