	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _citrus_UTF8_mbrtowc_priv
__citrus_UTF8_mbrtowc_priv:             ## @_citrus_UTF8_mbrtowc_priv
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r13
	movq	(%rdx), %r14
	testq	%r14, %r14
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r15
	cmpl	$0, (%r13)
	je	LBB0_4
## %bb.3:
	movq	8(%r13), %r8
	movl	(%r8), %edx
	jmp	LBB0_6
LBB0_1:
	movq	%r13, %rsi
	movq	%r9, %rbx
	callq	__citrus_UTF8_init_state
	movq	$0, (%rbx)
	jmp	LBB0_27
LBB0_4:
	testq	%rcx, %rcx
	je	LBB0_26
## %bb.5:
	decq	%rcx
	movsbl	(%r14), %edx
	incq	%r14
	movq	8(%r13), %r8
	movl	$1, (%r13)
	movl	%edx, (%r8)
LBB0_6:
	movq	__UTF8_count@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movzbl	%dl, %r12d
	movl	(%rax,%r12,4), %ebx
	testl	%ebx, %ebx
	jle	LBB0_25
## %bb.7:
	movl	(%r13), %eax
	cmpl	%eax, %ebx
	jge	LBB0_8
LBB0_25:
	movq	$-1, (%r9)
	movq	_EILSEQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_28
LBB0_8:
	cmpl	$1, %ebx
	jne	LBB0_9
LBB0_19:
	testq	%rsi, %rsi
	je	LBB0_21
## %bb.20:
	movl	%r12d, (%rsi)
LBB0_21:
	xorl	%eax, %eax
	testl	%r12d, %r12d
	je	LBB0_22
## %bb.23:
	movq	%r14, %rcx
	subq	(%r15), %rcx
	jmp	LBB0_24
LBB0_9:
	cmpl	%ebx, %eax
	jge	LBB0_10
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	subq	$1, %rcx
	jb	LBB0_26
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movsbl	(%r14), %edx
	incq	%r14
	leal	1(%rax), %edi
	movl	%edi, (%r13)
	cltq
	movl	%edx, (%r8,%rax,4)
	movl	(%r13), %eax
	cmpl	%ebx, %eax
	jl	LBB0_11
## %bb.13:
	movl	$127, %r12d
	movl	%ebx, %ecx
	shrl	%cl, %r12d
	andl	(%r8), %r12d
	cmpl	$2, %ebx
	jge	LBB0_14
	jmp	LBB0_17
LBB0_26:
	movq	%r14, (%r15)
	movq	$-2, (%r9)
LBB0_27:
	xorl	%eax, %eax
LBB0_28:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	$127, %eax
	movl	%ebx, %ecx
	shrl	%cl, %eax
	andl	%eax, %edx
	movl	%edx, %r12d
LBB0_14:
	movl	$1, %ecx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r8,%rcx,4), %edx
	movl	%edx, %edi
	andl	$192, %edi
	cmpl	$128, %edi
	jne	LBB0_25
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	%r12d, %eax
	shll	$6, %eax
	andl	$63, %edx
	movl	%edx, %r12d
	orl	%eax, %r12d
	incq	%rcx
	cmpq	%rcx, %rbx
	jne	LBB0_15
LBB0_17:
	movl	%r12d, %edi
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	callq	__UTF8_surrogate
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	testq	%rax, %rax
	jne	LBB0_25
## %bb.18:
	movl	%r12d, %edi
	callq	__UTF8_findlen
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	cmpl	%ebx, %eax
	jne	LBB0_25
	jmp	LBB0_19
LBB0_22:
	xorl	%ecx, %ecx
LBB0_24:
	movq	%rcx, (%r9)
	movq	%r14, (%r15)
	movl	$0, (%r13)
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.comm	__UTF8_count,8,3                ## @_UTF8_count
	.comm	_EILSEQ,4,2                     ## @EILSEQ
	.no_dead_strip	__citrus_UTF8_mbrtowc_priv
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _citrus_UTF8_mbrtowc_priv
__citrus_UTF8_mbrtowc_priv:             ; @_citrus_UTF8_mbrtowc_priv
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x5
	mov	x21, x4
	ldr	x24, [x2]
	cbz	x24, LBB0_3
; %bb.1:
	mov	x20, x2
	mov	x22, x1
	ldr	w8, [x21]
	cbz	w8, LBB0_4
; %bb.2:
	ldr	x8, [x21, #8]
	ldr	w9, [x8]
	b	LBB0_6
LBB0_3:
	mov	x1, x21
	bl	__citrus_UTF8_init_state
	mov	w0, #0
	str	xzr, [x19]
	b	LBB0_27
LBB0_4:
	cbz	x3, LBB0_18
; %bb.5:
	sub	x3, x3, #1
	ldrsb	w9, [x24], #1
	ldr	x8, [x21, #8]
	mov	w10, #1
	str	w10, [x21]
	str	w9, [x8]
LBB0_6:
Lloh0:
	adrp	x10, __UTF8_count@GOTPAGE
Lloh1:
	ldr	x10, [x10, __UTF8_count@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	and	w23, w9, #0xff
	ldr	w25, [x10, w23, uxtw #2]
	cmp	w25, #1
	b.lt	LBB0_8
; %bb.7:
	ldr	w10, [x21]
	cmp	w25, w10
	b.ge	LBB0_9
LBB0_8:
	mov	x8, #-1
	str	x8, [x19]
Lloh3:
	adrp	x8, _EILSEQ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EILSEQ@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_27
LBB0_9:
	cmp	w25, #1
	b.ne	LBB0_14
LBB0_10:
	cbz	x22, LBB0_12
; %bb.11:
	str	w23, [x22]
LBB0_12:
	cbz	w23, LBB0_25
; %bb.13:
	ldr	x8, [x20]
	sub	x8, x24, x8
	b	LBB0_26
LBB0_14:
	cmp	w10, w25
	b.ge	LBB0_19
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	cbz	x3, LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	sub	x3, x3, #1
	ldrsb	w9, [x24], #1
	add	w11, w10, #1
	str	w11, [x21]
	str	w9, [x8, w10, sxtw #2]
	ldr	w10, [x21]
	cmp	w10, w25
	b.lt	LBB0_15
; %bb.17:
	ldr	w9, [x8]
	mov	w10, #127
	lsr	w10, w10, w25
	and	w23, w9, w10
	cmp	w25, #2
	b.ge	LBB0_20
	b	LBB0_23
LBB0_18:
	mov	w0, #0
	str	x24, [x20]
	mov	x8, #-2
	str	x8, [x19]
	b	LBB0_27
LBB0_19:
	mov	w10, #127
	lsr	w10, w10, w25
	and	w23, w9, w10
LBB0_20:
	add	x8, x8, #4
	sub	x9, x25, #1
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x8]
	and	w11, w10, #0xc0
	cmp	w11, #128
	b.ne	LBB0_8
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	bfi	w10, w23, #6, #26
	mov	x23, x10
	add	x8, x8, #4
	subs	x9, x9, #1
	b.ne	LBB0_21
LBB0_23:
	mov	x0, x23
	bl	__UTF8_surrogate
	cbnz	x0, LBB0_8
; %bb.24:
	mov	x0, x23
	bl	__UTF8_findlen
	cmp	w0, w25
	b.ne	LBB0_8
	b	LBB0_10
LBB0_25:
	mov	x8, #0
LBB0_26:
	mov	w0, #0
	str	x8, [x19]
	str	x24, [x20]
	str	wzr, [x21]
LBB0_27:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	__UTF8_count,8,3                ; @_UTF8_count
	.comm	_EILSEQ,4,2                     ; @EILSEQ
	.no_dead_strip	__citrus_UTF8_mbrtowc_priv
.subsections_via_symbols
