	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xo_buf_append_locale_from_utf8
_xo_buf_append_locale_from_utf8:        ## @xo_buf_append_locale_from_utf8
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	%rdx, %rdi
	movq	%rcx, %rsi
	callq	_xo_utf8_char
	cmpq	$-1, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	_XOF_NO_LOCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_XOF_ISSET
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_xo_buf_has_room
	testl	%eax, %eax
	je	LBB0_9
## %bb.4:
	movl	(%r14), %edi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_memcpy
	jmp	LBB0_5
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_xo_failure
LBB0_9:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_MB_LEN_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	incq	%rsi
	movq	%r14, %rdi
	callq	_xo_buf_has_room
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	movq	%r12, %rdi
	movl	$4, %esi
	callq	_bzero
	movl	(%r14), %edi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_wcrtomb
	movq	%rax, %rbx
	testq	%rax, %rax
	jle	LBB0_8
LBB0_5:
	addl	%ebx, (%r14)
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_xo_wcwidth                     ## TAILCALL
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_xo_failure
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid UTF-8 byte sequence"

	.comm	_XOF_NO_LOCALE,4,2              ## @XOF_NO_LOCALE
	.comm	_MB_LEN_MAX,8,3                 ## @MB_LEN_MAX
L_.str.1:                               ## @.str.1
	.asciz	"could not convert wide char: %lx"

	.no_dead_strip	_xo_buf_append_locale_from_utf8
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xo_buf_append_locale_from_utf8
_xo_buf_append_locale_from_utf8:        ; @xo_buf_append_locale_from_utf8
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x3
	mov	x23, x2
	mov	x19, x1
	mov	x21, x0
	mov	x0, x2
	mov	x1, x3
	bl	_xo_utf8_char
	cmn	x0, #1
	b.eq	LBB0_4
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x8, _XOF_NO_LOCALE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XOF_NO_LOCALE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_XOF_ISSET
	cbz	x0, LBB0_7
; %bb.2:
	mov	x0, x19
	mov	x1, x22
	bl	_xo_buf_has_room
	cbz	w0, LBB0_6
; %bb.3:
	ldr	w0, [x19]
	mov	x1, x23
	mov	x2, x22
	bl	_memcpy
	b	LBB0_9
LBB0_4:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
LBB0_5:
	mov	x0, x21
	bl	_xo_failure
LBB0_6:
	mov	x0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
Lloh5:
	adrp	x8, _MB_LEN_MAX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MB_LEN_MAX@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	add	x1, x8, #1
	mov	x0, x19
	bl	_xo_buf_has_room
	cbz	w0, LBB0_6
; %bb.8:
	mov	x0, x21
	mov	w1, #4
	bl	_bzero
	ldr	w0, [x19]
	mov	x1, x20
	mov	x2, x21
	bl	_wcrtomb
	mov	x22, x0
	cmp	x0, #0
	b.le	LBB0_10
LBB0_9:
	ldr	w8, [x19]
	add	w8, w8, w22
	str	w8, [x19]
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_xo_wcwidth
LBB0_10:
	str	x20, [sp]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid UTF-8 byte sequence"

	.comm	_XOF_NO_LOCALE,4,2              ; @XOF_NO_LOCALE
	.comm	_MB_LEN_MAX,8,3                 ; @MB_LEN_MAX
l_.str.1:                               ; @.str.1
	.asciz	"could not convert wide char: %lx"

	.no_dead_strip	_xo_buf_append_locale_from_utf8
.subsections_via_symbols
