	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function convert_to_utf8
_convert_to_utf8:                       ## @convert_to_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdx, %rdx
	je	LBB0_6
## %bb.1:
	movq	%rdi, %r15
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.2:
	movq	%rdx, %rbx
	cmpb	$0, (%rdx)
	je	LBB0_6
## %bb.3:
	movq	%rsi, %r14
	movq	%rbx, %rsi
	callq	_same_encoding
	testq	%rax, %rax
	jne	LBB0_6
## %bb.4:
	movl	(%r14), %edi
	movq	(%r15), %rsi
	movq	%rbx, %rdx
	callq	_reencode_string
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_strlen
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_strlen
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_strbuf_attach
LBB0_6:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	$-1, 8(%r15)
	movq	(%r15), %rdx
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_error                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot convert from %s to %s"

	.no_dead_strip	_convert_to_utf8
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function convert_to_utf8
_convert_to_utf8:                       ; @convert_to_utf8
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	x2, LBB0_6
; %bb.1:
	mov	x21, x0
	ldr	x0, [x0]
	cbz	x0, LBB0_6
; %bb.2:
	mov	x20, x2
	ldrb	w8, [x2]
	cbz	w8, LBB0_6
; %bb.3:
	mov	x19, x1
	mov	x1, x20
	bl	_same_encoding
	cbnz	x0, LBB0_6
; %bb.4:
	ldr	w0, [x19]
	ldr	x1, [x21]
	mov	x2, x20
	bl	_reencode_string
	cbz	x0, LBB0_7
; %bb.5:
	mov	x22, x0
	bl	_strlen
	mov	x20, x0
	mov	x0, x22
	bl	_strlen
	mov	x3, x0
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_strbuf_attach
LBB0_6:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	w8, #-1
	str	w8, [x21, #8]
	ldr	x2, [x21]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_error
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot convert from %s to %s"

	.no_dead_strip	_convert_to_utf8
.subsections_via_symbols
