	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _citrus_UES_wcrtomb_priv
__citrus_UES_wcrtomb_priv:              ## @_citrus_UES_wcrtomb_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%r8)
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_22:
	movl	(%rax), %eax
	jmp	LBB0_23
LBB0_2:
	movq	%r8, %r12
	movq	%rcx, %r15
	movq	%rdx, %rbx
	movl	(%rdi), %r13d
	movq	_MODE_C99@GOTPCREL(%rip), %r14
	testl	%r13d, (%r14)
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.3:
	movq	%r15, %rdi
	callq	_is_basic
	testl	%eax, %eax
	je	LBB0_4
LBB0_9:
	testq	%rbx, %rbx
	je	LBB0_21
## %bb.10:
	movq	8(%r12), %r13
	movb	%r15b, (%r13)
	movl	$1, %ebx
	jmp	LBB0_15
LBB0_8:
	cmpl	$127, %r15d
	jle	LBB0_9
LBB0_4:
	movq	_BMP_MAX@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jge	LBB0_5
## %bb.11:
	movl	(%r14), %eax
	testl	%r13d, %eax
	jne	LBB0_16
## %bb.12:
	movq	_UCS2_MAX@GOTPCREL(%rip), %rcx
	cmpl	%r15d, (%rcx)
	jl	LBB0_16
## %bb.13:
	cmpq	$12, %rbx
	jb	LBB0_21
## %bb.14:
	leaq	-72(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	movq	%r15, %rdi
	callq	_ucs_to_surrogate
	movq	8(%r12), %r13
	movq	-72(%rbp), %rsi
	movq	_UCS2_BIT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r13, %rdi
	callq	_to_str
	movq	%rax, %r15
	leaq	6(%r13), %rdi
	movq	-64(%rbp), %rsi
	movl	(%rbx), %edx
	callq	_to_str
	movq	%rax, %rbx
	addq	%r15, %rbx
	jmp	LBB0_15
LBB0_5:
	cmpq	$6, %rbx
	jb	LBB0_21
## %bb.6:
	movq	8(%r12), %r13
	movq	_UCS2_BIT@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_16:
	testl	%r13d, %eax
	je	LBB0_20
## %bb.17:
	movq	_UCS4_MAX@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jl	LBB0_20
## %bb.18:
	cmpq	$10, %rbx
	jae	LBB0_19
LBB0_21:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	$-1, (%rax)
	movq	_E2BIG@GOTPCREL(%rip), %rax
	jmp	LBB0_22
LBB0_20:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	$-1, (%rax)
	movq	_EILSEQ@GOTPCREL(%rip), %rax
	jmp	LBB0_22
LBB0_19:
	movq	8(%r12), %r13
	movq	_UCS4_BIT@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_to_str
	movq	%rax, %rbx
LBB0_15:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_memcpy
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
	movq	$0, (%r12)
	xorl	%eax, %eax
LBB0_23:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MODE_C99,4,2                   ## @MODE_C99
	.comm	_BMP_MAX,4,2                    ## @BMP_MAX
	.comm	_UCS2_BIT,4,2                   ## @UCS2_BIT
	.comm	_UCS2_MAX,4,2                   ## @UCS2_MAX
	.comm	_UCS4_MAX,4,2                   ## @UCS4_MAX
	.comm	_UCS4_BIT,4,2                   ## @UCS4_BIT
	.comm	_EILSEQ,4,2                     ## @EILSEQ
	.comm	_E2BIG,4,2                      ## @E2BIG
	.no_dead_strip	__citrus_UES_wcrtomb_priv
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _citrus_UES_wcrtomb_priv
__citrus_UES_wcrtomb_priv:              ; @_citrus_UES_wcrtomb_priv
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	ldr	x8, [x4]
	cbz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w0, [x8]
	b	LBB0_21
LBB0_3:
	mov	x19, x5
	mov	x20, x4
	mov	x22, x3
	mov	x23, x2
	mov	x21, x1
	ldr	w24, [x0]
Lloh2:
	adrp	x25, _MODE_C99@GOTPAGE
Lloh3:
	ldr	x25, [x25, _MODE_C99@GOTPAGEOFF]
	ldr	w8, [x25]
	tst	w8, w24
	b.eq	LBB0_7
; %bb.4:
	mov	x0, x22
	bl	_is_basic
	cbz	w0, LBB0_8
LBB0_5:
	cbz	x23, LBB0_17
; %bb.6:
	ldr	x23, [x20, #8]
	strb	w22, [x23]
	mov	w22, #1
	b	LBB0_20
LBB0_7:
	cmp	w22, #127
	b.le	LBB0_5
LBB0_8:
Lloh4:
	adrp	x8, _BMP_MAX@GOTPAGE
Lloh5:
	ldr	x8, [x8, _BMP_MAX@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ge	LBB0_12
; %bb.9:
	ldr	w8, [x25]
	and	w8, w8, w24
Lloh7:
	adrp	x9, _UCS2_MAX@GOTPAGE
Lloh8:
	ldr	x9, [x9, _UCS2_MAX@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w8, #0
	ccmp	w9, w22, #8, eq
	b.ge	LBB0_14
; %bb.10:
Lloh10:
	adrp	x9, _UCS4_MAX@GOTPAGE
Lloh11:
	ldr	x9, [x9, _UCS4_MAX@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	cmp	w8, #0
	ccmp	w9, w22, #8, ne
	b.ge	LBB0_16
; %bb.11:
	mov	x8, #-1
	str	x8, [x19]
Lloh13:
	adrp	x8, _EILSEQ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EILSEQ@GOTPAGEOFF]
	b	LBB0_2
LBB0_12:
	cmp	x23, #6
	b.lo	LBB0_17
; %bb.13:
	ldr	x23, [x20, #8]
Lloh15:
	adrp	x8, _UCS2_BIT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _UCS2_BIT@GOTPAGEOFF]
	b	LBB0_19
LBB0_14:
	cmp	x23, #12
	b.lo	LBB0_17
; %bb.15:
	add	x1, sp, #8
	mov	x2, sp
	mov	x0, x22
	bl	_ucs_to_surrogate
	ldr	x23, [x20, #8]
	ldr	x1, [sp, #8]
Lloh17:
	adrp	x24, _UCS2_BIT@GOTPAGE
Lloh18:
	ldr	x24, [x24, _UCS2_BIT@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x0, x23
	bl	_to_str
	mov	x22, x0
	add	x0, x23, #6
	ldr	x1, [sp]
	ldr	w2, [x24]
	bl	_to_str
	add	x22, x0, x22
	b	LBB0_20
LBB0_16:
	cmp	x23, #10
	b.hs	LBB0_18
LBB0_17:
	mov	x8, #-1
	str	x8, [x19]
Lloh19:
	adrp	x8, _E2BIG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _E2BIG@GOTPAGEOFF]
	b	LBB0_2
LBB0_18:
	ldr	x23, [x20, #8]
Lloh21:
	adrp	x8, _UCS4_BIT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _UCS4_BIT@GOTPAGEOFF]
LBB0_19:
	ldr	w2, [x8]
	mov	x0, x23
	mov	x1, x22
	bl	_to_str
	mov	x22, x0
LBB0_20:
	mov	x0, x21
	mov	x1, x23
	mov	x2, x22
	bl	_memcpy
	mov	w0, #0
	str	x22, [x19]
	str	xzr, [x20]
LBB0_21:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MODE_C99,4,2                   ; @MODE_C99
	.comm	_BMP_MAX,4,2                    ; @BMP_MAX
	.comm	_UCS2_BIT,4,2                   ; @UCS2_BIT
	.comm	_UCS2_MAX,4,2                   ; @UCS2_MAX
	.comm	_UCS4_MAX,4,2                   ; @UCS4_MAX
	.comm	_UCS4_BIT,4,2                   ; @UCS4_BIT
	.comm	_EILSEQ,4,2                     ; @EILSEQ
	.comm	_E2BIG,4,2                      ; @E2BIG
	.no_dead_strip	__citrus_UES_wcrtomb_priv
.subsections_via_symbols
