	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _citrus_ISO2022_mbrtowc_priv
__citrus_ISO2022_mbrtowc_priv:          ## @_citrus_ISO2022_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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r14
	movq	%r8, %rbx
	movq	(%rdx), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rcx, %r13
	movl	(%rbx), %ecx
	cmpl	$9, %ecx
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	jb	LBB0_4
## %bb.3:
	movq	%rbx, %rsi
	callq	__citrus_ISO2022_init_state
	jmp	LBB0_24
LBB0_1:
	movq	%rbx, %rsi
	callq	__citrus_ISO2022_init_state
	movq	__ENCODING_IS_STATE_DEPENDENT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
LBB0_33:
	xorl	%eax, %eax
	jmp	LBB0_34
LBB0_4:
	movq	%rsi, -104(%rbp)                ## 8-byte Spill
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	testl	%ecx, %ecx
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_5
## %bb.11:
	cmpl	$7, %ecx
	ja	LBB0_24
## %bb.12:
	movq	8(%rbx), %r14
	xorl	%r12d, %r12d
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movslq	%edx, %rdx
	testq	%r13, %r13
	je	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	movzbl	(%rax), %r8d
	incq	%rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %rcx
	leal	1(%rdx), %esi
	movl	%esi, (%rbx)
	movb	%r8b, (%rcx,%rdx)
	decq	%r13
	movslq	(%rbx), %rdx
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
LBB0_16:                                ##   in Loop: Header=BB0_13 Depth=1
	subq	%r14, %rdx
	addq	8(%rbx), %rdx
	movq	%r14, %rsi
	leaq	-72(%rbp), %rcx
	movq	%rbx, %r8
	callq	__ISO2022_sgetwchar
	movq	%rax, %r15
	movq	-72(%rbp), %rsi
	movq	%rsi, %rcx
	subq	%r14, %rcx
	movslq	%r12d, %r12
	addq	%rcx, %r12
	movq	__ISO2022INVALID@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jne	LBB0_17
## %bb.22:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	(%rbx), %edx
	testq	%r13, %r13
	je	LBB0_25
## %bb.23:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	%rsi, %r14
	cmpl	$8, %edx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	jb	LBB0_13
	jmp	LBB0_24
LBB0_5:
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, %r14
	movq	%rax, %rsi
	movq	%r13, %rdx
	leaq	-72(%rbp), %rcx
	movq	%rbx, %r8
	callq	__ISO2022_sgetwchar
	movq	%rax, %r15
	movq	-72(%rbp), %rdx
	movq	__ISO2022INVALID@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jne	LBB0_7
## %bb.28:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rdx, %rcx
	subq	%r14, %rcx
	jbe	LBB0_30
## %bb.29:                              ##   in Loop: Header=BB0_6 Depth=1
	addl	%ecx, %r12d
	movq	%rdx, %rax
	subq	%rcx, %r13
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	jne	LBB0_6
	jmp	LBB0_32
LBB0_7:
	movl	%edx, %ecx
	subl	%r14d, %ecx
	addl	%ecx, %r12d
	xorl	%ecx, %ecx
	movq	%rdx, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	jmp	LBB0_8
LBB0_30:
	movslq	%r12d, %rax
	addq	%rax, %r13
	cmpq	$7, %r13
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	ja	LBB0_24
## %bb.31:
	movq	8(%rbx), %rdi
	subq	%rax, %r14
	movq	%r14, %rsi
	movq	%r13, %rdx
	callq	_memcpy
	movl	%r13d, (%rbx)
	movq	-72(%rbp), %rdx
	jmp	LBB0_32
LBB0_24:
	movl	$0, (%rbx)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	$-1, (%rax)
	movq	_EILSEQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_34:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movl	(%rbx), %edx
	movslq	%edx, %rax
	movslq	%r12d, %r14
	cmpq	%rax, %r14
	jae	LBB0_19
## %bb.18:
	movq	8(%rbx), %rdi
	subl	%r12d, %edx
	callq	_memmove
	movl	(%rbx), %edx
	movslq	%edx, %rax
LBB0_19:
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	xorl	%ecx, %ecx
	cmpq	%rax, %r14
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	ja	LBB0_21
## %bb.20:
	subl	%r12d, %edx
	movl	%edx, %ecx
LBB0_21:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
LBB0_8:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	%ecx, (%rax)
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	%rsi, (%rax)
	movq	-104(%rbp), %rax                ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%r15, (%rax)
LBB0_10:
	subl	%edi, %r12d
	testq	%r15, %r15
	movslq	%r12d, %rax
	cmoveq	%r15, %rax
	movq	%rax, (%rdx)
	jmp	LBB0_33
LBB0_25:
	movslq	%edx, %rax
	cmpq	%rax, %rcx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	jne	LBB0_27
## %bb.26:
	movl	$0, (%rbx)
LBB0_27:
	movq	%rax, %rdx
LBB0_32:
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	%rdx, (%rcx)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	$-2, (%rax)
	jmp	LBB0_33
	.cfi_endproc
                                        ## -- End function
	.comm	__ENCODING_IS_STATE_DEPENDENT,8,3 ## @_ENCODING_IS_STATE_DEPENDENT
	.comm	__ISO2022INVALID,8,3            ## @_ISO2022INVALID
	.comm	_EILSEQ,4,2                     ## @EILSEQ
	.no_dead_strip	__citrus_ISO2022_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_ISO2022_mbrtowc_priv
__citrus_ISO2022_mbrtowc_priv:          ; @_citrus_ISO2022_mbrtowc_priv
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x5
	mov	x20, x4
	mov	x24, x0
	ldr	x22, [x2]
	cbz	x22, LBB0_3
; %bb.1:
	ldr	w28, [x20]
	cmp	w28, #9
	b.lo	LBB0_5
; %bb.2:
	mov	x0, x24
	mov	x1, x20
	bl	__citrus_ISO2022_init_state
	b	LBB0_20
LBB0_3:
	mov	x0, x24
	mov	x1, x20
	bl	__citrus_ISO2022_init_state
	mov	w0, #0
Lloh0:
	adrp	x8, __ENCODING_IS_STATE_DEPENDENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, __ENCODING_IS_STATE_DEPENDENT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
LBB0_4:
	str	x8, [x19]
	b	LBB0_21
LBB0_5:
	mov	x25, x3
	mov	x21, x2
	str	x1, [sp]                        ; 8-byte Folded Spill
	cbz	w28, LBB0_13
; %bb.6:
	cmp	w28, #7
	b.hi	LBB0_20
; %bb.7:
	mov	x23, #0
	ldr	x27, [x20, #8]
	mov	x8, x28
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	sxtw	x8, w8
	cbz	x25, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldrb	w9, [x22], #1
	ldr	x10, [x20, #8]
	add	w11, w8, #1
	str	w11, [x20]
	strb	w9, [x10, x8]
	sub	x25, x25, #1
	ldrsw	x8, [x20]
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x9, [x20, #8]
	sub	x8, x8, x27
	add	x2, x8, x9
	add	x3, sp, #8
	mov	x0, x24
	mov	x1, x27
	mov	x4, x20
	bl	__ISO2022_sgetwchar
	ldr	x1, [sp, #8]
	sub	x9, x1, x27
	add	x23, x9, w23, sxtw
Lloh3:
	adrp	x8, __ISO2022INVALID@GOTPAGE
Lloh4:
	ldr	x8, [x8, __ISO2022INVALID@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_22
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x20]
	cbz	x25, LBB0_28
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x27, x1
	cmp	w8, #8
	b.lo	LBB0_8
	b	LBB0_20
LBB0_13:
	mov	w23, #0
Lloh6:
	adrp	x27, __ISO2022INVALID@GOTPAGE
Lloh7:
	ldr	x27, [x27, __ISO2022INVALID@GOTPAGEOFF]
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	add	x3, sp, #8
	mov	x0, x24
	mov	x1, x22
	mov	x2, x25
	mov	x4, x20
	bl	__ISO2022_sgetwchar
	ldr	x9, [x27]
	ldr	x8, [sp, #8]
	cmp	x0, x9
	b.ne	LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	subs	x9, x8, x22
	b.ls	LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	add	w23, w23, w9
	mov	x22, x8
	subs	x25, x25, x9
	b.ne	LBB0_14
	b	LBB0_31
LBB0_17:
	mov	x26, x0
	mov	w9, #0
	sub	w10, w8, w22
	add	w23, w23, w10
	mov	x22, x8
	b	LBB0_25
LBB0_18:
	sxtw	x8, w23
	add	x23, x25, x8
	cmp	x23, #7
	b.hi	LBB0_20
; %bb.19:
	ldr	x0, [x20, #8]
	sub	x1, x22, x8
	mov	x2, x23
	bl	_memcpy
	str	w23, [x20]
	ldr	x8, [sp, #8]
	b	LBB0_31
LBB0_20:
	str	wzr, [x20]
	mov	x8, #-1
	str	x8, [x19]
Lloh8:
	adrp	x8, _EILSEQ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EILSEQ@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
LBB0_21:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_22:
	mov	x26, x0
	ldr	w8, [x20]
	sxtw	x9, w8
	sxtw	x24, w23
	cmp	x24, x9
	b.hs	LBB0_24
; %bb.23:
	ldr	x0, [x20, #8]
	sub	w2, w8, w23
	bl	_memmove
	ldr	w8, [x20]
	sxtw	x9, w8
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
LBB0_24:
	sub	w8, w8, w23
	cmp	x24, x9
	csel	w9, wzr, w8, hi
LBB0_25:
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	str	w9, [x20]
	str	x22, [x21]
	cbz	x8, LBB0_27
; %bb.26:
	str	x26, [x8]
LBB0_27:
	mov	w0, #0
	sub	w8, w23, w28
	sxtw	x8, w8
	cmp	x26, #0
	csel	x8, xzr, x8, eq
	b	LBB0_4
LBB0_28:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	sxtw	x8, w8
	cmp	x9, x8
	b.ne	LBB0_30
; %bb.29:
	str	wzr, [x20]
LBB0_30:
	mov	x8, x22
LBB0_31:
	mov	w0, #0
	str	x8, [x21]
	mov	x8, #-2
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	__ENCODING_IS_STATE_DEPENDENT,8,3 ; @_ENCODING_IS_STATE_DEPENDENT
	.comm	__ISO2022INVALID,8,3            ; @_ISO2022INVALID
	.comm	_EILSEQ,4,2                     ; @EILSEQ
	.no_dead_strip	__citrus_ISO2022_mbrtowc_priv
.subsections_via_symbols
