	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _UTF8_mbrtowc
__UTF8_mbrtowc:                         ## @_UTF8_mbrtowc
	.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
	movl	(%rcx), %r8d
	cmpl	$7, %r8d
	jb	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	movq	%rdx, %rbx
	testq	%rsi, %rsi
	movl	$1, %edx
	cmoveq	%rdx, %rbx
	leaq	L_.str(%rip), %r14
	cmovneq	%rsi, %r14
	cmoveq	%rsi, %rdi
	movq	$-2, %rax
	testq	%rbx, %rbx
	je	LBB0_29
## %bb.4:
	testl	%r8d, %r8d
	je	LBB0_5
## %bb.16:
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	4(%rcx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	8(%rcx), %r15d
	movl	%r8d, %r13d
	jmp	LBB0_17
LBB0_5:
	movzbl	(%r14), %esi
	testb	$-128, %sil
	jne	LBB0_9
## %bb.6:
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.7:
	movl	%esi, (%rdi)
LBB0_8:
	xorl	%eax, %eax
	testl	%esi, %esi
	setne	%al
	jmp	LBB0_29
LBB0_9:
	movl	%esi, %edx
	andl	$-32, %edx
	cmpl	$192, %edx
	jne	LBB0_11
## %bb.10:
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	$128, -44(%rbp)                 ## 4-byte Folded Spill
	movl	$2, %r13d
	movl	$31, %r15d
	jmp	LBB0_15
LBB0_11:
	movl	%esi, %edx
	andl	$-16, %edx
	cmpl	$224, %edx
	jne	LBB0_13
## %bb.12:
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	$2048, -44(%rbp)                ## 4-byte Folded Spill
                                        ## imm = 0x800
	movl	$3, %r13d
	movl	$15, %r15d
	jmp	LBB0_15
LBB0_13:
	movl	%esi, %edx
	andl	$-8, %edx
	cmpl	$240, %edx
	jne	LBB0_25
## %bb.14:
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	$65536, -44(%rbp)               ## 4-byte Folded Spill
                                        ## imm = 0x10000
	movl	$4, %r13d
	movl	$7, %r15d
LBB0_15:
	incq	%r14
	andl	%esi, %r15d
LBB0_17:
	xorl	%r12d, %r12d
	testl	%r8d, %r8d
	sete	%r12b
	movl	%r13d, %edi
	movq	%rbx, %rsi
	callq	_MIN
	cmpl	%r12d, %eax
	jle	LBB0_20
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%r14), %eax
	movl	%eax, %ecx
	andl	$-64, %ecx
	cmpl	$128, %ecx
	jne	LBB0_25
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	shll	$6, %r15d
	incq	%r14
	andl	$63, %eax
	orl	%eax, %r15d
	incl	%r12d
	movl	%r13d, %edi
	movq	%rbx, %rsi
	callq	_MIN
	cmpl	%eax, %r12d
	jl	LBB0_18
LBB0_20:
	movl	%r13d, %eax
	subl	%r12d, %eax
	jle	LBB0_22
## %bb.21:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%rcx)
	movl	%r15d, 8(%rcx)
	movq	$-2, %rax
	jmp	LBB0_29
LBB0_22:
	cmpl	-44(%rbp), %r15d                ## 4-byte Folded Reload
	jge	LBB0_23
LBB0_25:
	movq	_EILSEQ@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	$-1, %rax
LBB0_29:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	cmpl	$1114111, %r15d                 ## imm = 0x10FFFF
	jg	LBB0_25
## %bb.24:
	movl	%r15d, %eax
	andl	$-2048, %eax                    ## imm = 0xF800
	cmpl	$55296, %eax                    ## imm = 0xD800
	je	LBB0_25
## %bb.26:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_28
## %bb.27:
	movl	%r15d, (%rax)
LBB0_28:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	testl	%r15d, %r15d
	cmovel	%r15d, %r13d
	movslq	%r13d, %rax
	jmp	LBB0_29
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

	.comm	_EILSEQ,4,2                     ## @EILSEQ
	.no_dead_strip	__UTF8_mbrtowc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _UTF8_mbrtowc
__UTF8_mbrtowc:                         ; @_UTF8_mbrtowc
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	w8, [x3]
	cmp	w8, #7
	b.lo	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_25
LBB0_2:
Lloh2:
	adrp	x9, l_.str@PAGE
Lloh3:
	add	x9, x9, l_.str@PAGEOFF
	cmp	x1, #0
	csel	x23, x9, x1, eq
	csinc	x20, x2, xzr, ne
	csel	x22, xzr, x0, eq
	cbz	x20, LBB0_5
; %bb.3:
	mov	x19, x3
	cbz	w8, LBB0_6
; %bb.4:
	ldp	w24, w26, [x19, #4]
	mov	x21, x8
	b	LBB0_17
LBB0_5:
	mov	x0, #-2
	b	LBB0_26
LBB0_6:
	ldrb	w9, [x23]
	tbnz	w9, #7, LBB0_10
; %bb.7:
	cbz	x22, LBB0_9
; %bb.8:
	str	w9, [x22]
LBB0_9:
	cmp	w9, #0
	cset	w0, ne
	b	LBB0_26
LBB0_10:
	and	w10, w9, #0xe0
	cmp	w10, #192
	b.ne	LBB0_12
; %bb.11:
	mov	w24, #128
	mov	w21, #2
	mov	w10, #31
	b	LBB0_16
LBB0_12:
	and	w10, w9, #0xf0
	cmp	w10, #224
	b.ne	LBB0_14
; %bb.13:
	mov	w24, #2048
	mov	w21, #3
	mov	w10, #15
	b	LBB0_16
LBB0_14:
	and	w10, w9, #0xf8
	cmp	w10, #240
	b.ne	LBB0_24
; %bb.15:
	mov	w24, #65536
	mov	w21, #4
	mov	w10, #7
LBB0_16:
	add	x23, x23, #1
	and	w26, w10, w9
LBB0_17:
	cmp	w8, #0
	cset	w27, eq
	mov	x0, x21
	mov	x1, x20
	bl	_MIN
	cmp	w0, w27
	b.le	LBB0_22
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldrb	w25, [x23]
	and	w8, w25, #0xc0
	cmp	w8, #128
	b.ne	LBB0_24
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	add	x23, x23, #1
	bfi	w25, w26, #6, #26
	add	w27, w27, #1
	mov	x0, x21
	mov	x1, x20
	bl	_MIN
	mov	x26, x25
	cmp	w27, w0
	b.lt	LBB0_18
; %bb.20:
	subs	w8, w21, w27
	b.le	LBB0_23
LBB0_21:
	stp	w8, w24, [x19]
	mov	x0, #-2
	str	w25, [x19, #8]
	b	LBB0_26
LBB0_22:
	mov	x25, x26
	subs	w8, w21, w27
	b.gt	LBB0_21
LBB0_23:
	cmp	w25, w24
	b.ge	LBB0_27
LBB0_24:
Lloh4:
	adrp	x8, _EILSEQ@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EILSEQ@GOTPAGEOFF]
LBB0_25:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _errno@GOTPAGE
Lloh7:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh8:
	str	w8, [x9]
	mov	x0, #-1
LBB0_26:
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_27:
	cmp	w25, #272, lsl #12              ; =1114112
	b.ge	LBB0_24
; %bb.28:
	and	w8, w25, #0xfffff800
	mov	w9, #55296
	cmp	w8, w9
	b.eq	LBB0_24
; %bb.29:
	cbz	x22, LBB0_31
; %bb.30:
	str	w25, [x22]
LBB0_31:
	str	wzr, [x19]
	cmp	w25, #0
	csel	w8, wzr, w21, eq
	sxtw	x0, w8
	b	LBB0_26
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

	.comm	_EILSEQ,4,2                     ; @EILSEQ
	.no_dead_strip	__UTF8_mbrtowc
.subsections_via_symbols
