	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function find_invalid_utf8
_find_invalid_utf8:                     ## @find_invalid_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $esi killed $esi def $rsi
	testl	%esi, %esi
	je	LBB0_19
## %bb.1:
	xorl	%eax, %eax
	leaq	_find_invalid_utf8.max_codepoint(%rip), %r8
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
                                        ##     Child Loop BB0_10 Depth 2
	movb	(%rdi), %bl
	incq	%rdi
	leal	-1(%rsi), %r15d
	testb	%bl, %bl
	js	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%eax
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	testb	$64, %bl
	je	LBB0_20
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	addb	%bl, %bl
	incq	%rcx
	testb	$64, %bl
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	-1(%rcx), %edx
	cmpl	$2, %edx
	ja	LBB0_20
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%ecx, %esi
	jle	LBB0_20
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movzbl	%bl, %esi
	andl	$126, %esi
	shrl	%cl, %esi
	movl	-4(%r8,%rcx,4), %r14d
	movl	(%r8,%rcx,4), %r11d
	incl	%r14d
	movl	%eax, %edx
	leaq	(%rdx,%rcx), %r9
	incq	%r9
	movl	%r15d, %r15d
	subq	%rcx, %r15
	leaq	(%rdi,%rcx), %r10
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%esi, %r12d
	movzbl	(%rdi,%rdx), %ebx
	movl	%ebx, %esi
	andl	$-64, %esi
	cmpl	$128, %esi
	jne	LBB0_20
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	andl	$63, %ebx
	movl	%r12d, %esi
	shll	$6, %esi
	orl	%ebx, %esi
	incq	%rdx
	cmpl	%edx, %ecx
	jne	LBB0_10
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%r14d, %esi
	jb	LBB0_20
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%r11d, %esi
	ja	LBB0_20
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	andl	$32736, %r12d                   ## imm = 0x7FE0
	cmpl	$864, %r12d                     ## imm = 0x360
	je	LBB0_20
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%esi, %ecx
	andl	$65534, %ecx                    ## imm = 0xFFFE
	cmpl	$65534, %ecx                    ## imm = 0xFFFE
	je	LBB0_20
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	addl	$-64976, %esi                   ## imm = 0xFFFF0230
	cmpl	$32, %esi
	jb	LBB0_20
## %bb.17:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%r9d, %eax
	movq	%r10, %rdi
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%r15d, %esi
	testl	%r15d, %r15d
	jne	LBB0_2
LBB0_19:
	movl	$-1, %eax
LBB0_20:
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @find_invalid_utf8.max_codepoint
_find_invalid_utf8.max_codepoint:
	.long	127                             ## 0x7f
	.long	2047                            ## 0x7ff
	.long	65535                           ## 0xffff
	.long	1114111                         ## 0x10ffff

	.no_dead_strip	_find_invalid_utf8
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function find_invalid_utf8
_find_invalid_utf8:                     ; @find_invalid_utf8
	.cfi_startproc
; %bb.0:
                                        ; kill: def $w1 killed $w1 def $x1
	cbz	w1, LBB0_17
; %bb.1:
	mov	x8, x0
	mov	w0, #0
	mov	w9, #-64976
	mov	w10, #65534
Lloh0:
	adrp	x11, _find_invalid_utf8.max_codepoint@PAGE
Lloh1:
	add	x11, x11, _find_invalid_utf8.max_codepoint@PAGEOFF
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
                                        ;     Child Loop BB0_10 Depth 2
	ldrsb	w14, [x8], #1
	sub	w13, w1, #1
	tbnz	w14, #31, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w0, w0, #1
	mov	x1, x13
	cbnz	w1, LBB0_2
	b	LBB0_17
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	tbz	w14, #6, LBB0_18
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x12, #0
	mov	x2, x11
LBB0_6:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	w14, w14, #1
	add	x12, x12, #1
	add	x2, x2, #4
	tbnz	w14, #6, LBB0_6
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w15, w12, #1
	cmp	w15, #2
	b.hi	LBB0_18
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w1, w12
	b.le	LBB0_18
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x16, #0
	and	w14, w14, #0xfe
	and	w14, w14, #0x7e
	lsr	w15, w14, w12
	ldp	w14, w2, [x2, #-4]
	add	w17, w14, #1
	add	x14, x12, w0, uxtw
	add	x14, x14, #1
	sub	x1, x13, x12
	add	x13, x8, x12
LBB0_10:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x3, x15
	ldrb	w15, [x8, x16]
	and	w4, w15, #0xc0
	cmp	w4, #128
	b.ne	LBB0_18
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	bfi	w15, w3, #6, #26
	add	x16, x16, #1
	cmp	w12, w16
	b.ne	LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_2 Depth=1
	cmp	w15, w17
	ccmp	w15, w2, #2, hs
	b.hi	LBB0_18
; %bb.13:                               ;   in Loop: Header=BB0_2 Depth=1
	and	w8, w3, #0x7fe0
	cmp	w8, #864
	b.eq	LBB0_18
; %bb.14:                               ;   in Loop: Header=BB0_2 Depth=1
	and	w8, w15, #0xfffe
	cmp	w8, w10
	b.eq	LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_2 Depth=1
	add	w8, w15, w9
	cmp	w8, #32
	b.lo	LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x14
	mov	x8, x13
	cbnz	w1, LBB0_2
LBB0_17:
	mov	w0, #-1
LBB0_18:
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @find_invalid_utf8.max_codepoint
_find_invalid_utf8.max_codepoint:
	.long	127                             ; 0x7f
	.long	2047                            ; 0x7ff
	.long	65535                           ; 0xffff
	.long	1114111                         ; 0x10ffff

	.no_dead_strip	_find_invalid_utf8
.subsections_via_symbols
