	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _UTF8_wcrtomb
__UTF8_wcrtomb:                         ## @_UTF8_wcrtomb
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	cmpq	$0, (%rdx)
	je	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	$-1, %rax
	popq	%rbp
	retq
LBB0_3:
	movl	$1, %eax
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.4:
	cmpl	$127, %esi
	ja	LBB0_6
## %bb.5:
	movb	%sil, (%rdi)
	popq	%rbp
	retq
LBB0_6:
	cmpl	$2048, %esi                     ## imm = 0x800
	jae	LBB0_8
## %bb.7:
	movl	$2, %eax
	movl	$192, %r8d
	jmp	LBB0_13
LBB0_8:
	cmpl	$65535, %esi                    ## imm = 0xFFFF
	ja	LBB0_11
## %bb.9:
	movl	%esi, %eax
	andl	$-2048, %eax                    ## imm = 0xF800
	cmpl	$55296, %eax                    ## imm = 0xD800
	je	LBB0_18
## %bb.10:
	movl	$3, %eax
	movl	$224, %r8d
	jmp	LBB0_13
LBB0_11:
	cmpl	$1114112, %esi                  ## imm = 0x110000
	jae	LBB0_18
## %bb.12:
	movl	$4, %eax
	movl	$240, %r8d
LBB0_13:
	movl	%esi, %ecx
	andb	$63, %cl
	orb	$-128, %cl
	movl	%esi, %edx
	sarl	$6, %edx
	movb	%cl, -1(%rdi,%rax)
	cmpl	$2048, %esi                     ## imm = 0x800
	jb	LBB0_16
## %bb.14:
	leaq	-1(%rax), %rcx
	andb	$63, %dl
	orb	$-128, %dl
	movb	%dl, -2(%rax,%rdi)
	movl	%esi, %edx
	sarl	$12, %edx
	cmpq	$3, %rcx
	jb	LBB0_16
## %bb.15:
	andb	$63, %dl
	orb	$-128, %dl
	movb	%dl, -3(%rax,%rdi)
	sarl	$18, %esi
	movl	%esi, %edx
LBB0_16:
	orl	%r8d, %edx
	movb	%dl, (%rdi)
LBB0_17:
	popq	%rbp
	retq
LBB0_18:
	movq	_EILSEQ@GOTPCREL(%rip), %rax
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_EILSEQ,4,2                     ## @EILSEQ
	.no_dead_strip	__UTF8_wcrtomb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _UTF8_wcrtomb
__UTF8_wcrtomb:                         ; @_UTF8_wcrtomb
	.cfi_startproc
; %bb.0:
	ldr	x8, [x2]
	cbz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
Lloh2:
	adrp	x9, _errno@GOTPAGE
Lloh3:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh4:
	str	w8, [x9]
	mov	x0, #-1
	ret
LBB0_3:
	cbz	x0, LBB0_6
; %bb.4:
	cmp	w1, #127
	b.hi	LBB0_7
; %bb.5:
	strb	w1, [x0]
LBB0_6:
	mov	w8, #1
	mov	x0, x8
	ret
LBB0_7:
	cmp	w1, #2048
	b.hs	LBB0_9
; %bb.8:
	mov	w9, #192
	mov	w8, #2
	b	LBB0_14
LBB0_9:
	lsr	w8, w1, #16
	cbnz	w8, LBB0_12
; %bb.10:
	lsr	w8, w1, #11
	cmp	w8, #27
	b.eq	LBB0_18
; %bb.11:
	mov	w9, #224
	mov	w8, #3
	b	LBB0_14
LBB0_12:
	cmp	w1, #272, lsl #12               ; =1114112
	b.hs	LBB0_18
; %bb.13:
	mov	w9, #240
	mov	w8, #4
LBB0_14:
	sub	x10, x8, #1
	mov	w12, #128
	mov	w11, #128
	bfxil	w11, w1, #0, #6
	strb	w11, [x0, x10]
	cmp	w1, #2048
	b.hs	LBB0_16
; %bb.15:
	asr	w10, w1, #6
	b	LBB0_20
LBB0_16:
	add	x11, x8, x0
	bfxil	w12, w1, #6, #6
	sturb	w12, [x11, #-2]
	cmp	x10, #3
	b.lo	LBB0_19
; %bb.17:
	mov	w10, #128
	bfxil	w10, w1, #12, #6
	sturb	w10, [x11, #-3]
	asr	w10, w1, #18
	b	LBB0_20
LBB0_18:
Lloh5:
	adrp	x8, _EILSEQ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EILSEQ@GOTPAGEOFF]
	b	LBB0_2
LBB0_19:
	asr	w10, w1, #12
LBB0_20:
	orr	w9, w10, w9
	strb	w9, [x0]
	mov	x0, x8
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_EILSEQ,4,2                     ; @EILSEQ
	.no_dead_strip	__UTF8_wcrtomb
.subsections_via_symbols
