	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _EUC_wcrtomb_impl
__EUC_wcrtomb_impl:                     ## @_EUC_wcrtomb_impl
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	.cfi_offset %rbx, -24
	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
LBB0_20:
	popq	%rbx
	popq	%rbp
	retq
LBB0_3:
	movl	$1, %eax
	testq	%rdi, %rdi
	je	LBB0_20
## %bb.4:
	movl	%esi, %ebx
	cmpl	$127, %esi
	ja	LBB0_6
## %bb.5:
	movb	%bl, (%rdi)
	jmp	LBB0_20
LBB0_6:
	movl	%ecx, %r10d
	movl	$4, %edx
	cmpl	$16777215, %ebx                 ## imm = 0xFFFFFF
	ja	LBB0_9
## %bb.7:
	movl	$3, %edx
	cmpl	$65535, %ebx                    ## imm = 0xFFFF
	ja	LBB0_9
## %bb.8:
	cmpl	$256, %ebx                      ## imm = 0x100
	movl	$1, %edx
	sbbl	$-1, %edx
LBB0_9:
	movq	_MB_CUR_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jle	LBB0_11
LBB0_10:
	movq	_EILSEQ@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_11:
	leal	-65536(%rbx), %eax
	cmpl	$-24321, %eax                   ## imm = 0xA0FF
	ja	LBB0_16
## %bb.12:
	leal	(,%rdx,8), %ecx
	addb	$-8, %cl
	movl	%ebx, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %eax
	cmpl	%r10d, %eax
	jne	LBB0_14
## %bb.13:
	cmpl	%r8d, %edx
	jne	LBB0_10
	jmp	LBB0_16
LBB0_14:
	cmpl	%r9d, %eax
	jne	LBB0_10
## %bb.15:
	cmpl	16(%rbp), %edx
	jne	LBB0_10
LBB0_16:
	movl	%edx, %eax
	leaq	-1(%rax), %rsi
	movl	%esi, %ecx
	movb	%bl, (%rdi,%rcx)
	cmpl	$2, %edx
	jb	LBB0_20
## %bb.17:
	leaq	-2(%rax), %rcx
	movl	%ecx, %edx
	movb	%bh, (%rdi,%rdx)
	cmpq	$2, %rsi
	jb	LBB0_20
## %bb.18:
	movl	%ebx, %edx
	shrl	$16, %edx
	leal	-3(%rax), %esi
	movb	%dl, (%rdi,%rsi)
	cmpq	$2, %rcx
	jb	LBB0_20
## %bb.19:
	movl	$4294967292, %ecx               ## imm = 0xFFFFFFFC
	shrl	$24, %ebx
	addl	%eax, %ecx
	movb	%bl, (%rdi,%rcx)
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_MB_CUR_MAX,4,2                 ## @MB_CUR_MAX
	.comm	_EILSEQ,4,2                     ## @EILSEQ
	.no_dead_strip	__EUC_wcrtomb_impl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _EUC_wcrtomb_impl
__EUC_wcrtomb_impl:                     ; @_EUC_wcrtomb_impl
	.cfi_startproc
; %bb.0:
	ldr	x9, [x2]
	cbz	x9, 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:
	mov	x8, x0
	cbz	x0, LBB0_6
; %bb.4:
	cmp	w1, #127
	b.hi	LBB0_7
; %bb.5:
	strb	w1, [x8]
LBB0_6:
	mov	w0, #1
	ret
LBB0_7:
	mov	w11, #4
	lsr	w9, w1, #24
	mov	w12, #3
	lsr	w10, w1, #16
	cmp	w1, #255
	mov	w13, #1
	cinc	w13, w13, hi
	cmp	w10, #0
	csel	w12, w12, w13, ne
	cmp	w9, #0
	csel	w0, w11, w12, ne
Lloh5:
	adrp	x11, _MB_CUR_MAX@GOTPAGE
Lloh6:
	ldr	x11, [x11, _MB_CUR_MAX@GOTPAGEOFF]
Lloh7:
	ldr	w11, [x11]
	cmp	w0, w11
	b.le	LBB0_9
LBB0_8:
Lloh8:
	adrp	x8, _EILSEQ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EILSEQ@GOTPAGEOFF]
	b	LBB0_2
LBB0_9:
	sub	w11, w1, #16, lsl #12           ; =65536
	mov	w12, #-24321
	cmp	w11, w12
	b.hi	LBB0_14
; %bb.10:
	lsl	w11, w0, #3
	sub	w11, w11, #8
	asr	w11, w1, w11
	cmp	w11, w3
	b.ne	LBB0_12
; %bb.11:
	cmp	w0, w4
	b.ne	LBB0_8
	b	LBB0_14
LBB0_12:
	cmp	w11, w5
	b.ne	LBB0_8
; %bb.13:
	cmp	w0, w6
	b.ne	LBB0_8
LBB0_14:
	sub	x11, x0, #1
	strb	w1, [x8, w11, uxtw]
	cmp	w0, #2
	b.lo	LBB0_18
; %bb.15:
	lsr	w13, w1, #8
	sub	x12, x0, #2
	strb	w13, [x8, w12, uxtw]
	cmp	x11, #2
	b.lo	LBB0_18
; %bb.16:
	sub	w11, w0, #3
	strb	w10, [x8, w11, uxtw]
	cmp	x12, #2
	b.lo	LBB0_18
; %bb.17:
	sub	w10, w0, #4
	strb	w9, [x8, w10, uxtw]
LBB0_18:
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_MB_CUR_MAX,4,2                 ; @MB_CUR_MAX
	.comm	_EILSEQ,4,2                     ; @EILSEQ
	.no_dead_strip	__EUC_wcrtomb_impl
.subsections_via_symbols
