	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_utf8_from_charset              ## -- Begin function utf8_from_charset
	.p2align	4, 0x90
_utf8_from_charset:                     ## @utf8_from_charset
	.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
	movl	$1, %r13d
	testl	%edx, %edx
	je	LBB0_17
## %bb.1:
	movl	%r8d, %r12d
	movq	%rcx, %r15
	movl	%edx, %ebx
	movq	%rdi, %r14
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rsi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_2
## %bb.8:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_strcmp
	testl	%eax, %eax
	jne	LBB0_17
## %bb.9:
	testl	%r12d, %r12d
	je	LBB0_10
## %bb.11:
	movl	%r12d, %ecx
	decl	%ebx
	xorl	%eax, %eax
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%r15,%rax), %edx
	testb	%dl, %dl
	je	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpq	%rbx, %rax
	jae	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movb	%dl, (%rsi,%rax)
	incq	%rax
	cmpq	%rax, %rcx
	jne	LBB0_12
## %bb.15:
	movl	%ecx, %eax
	jmp	LBB0_16
LBB0_2:
	xorl	%eax, %eax
	cmpl	$2, %r12d
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	jb	LBB0_16
## %bb.3:
	shrl	%r12d
	decl	%ebx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	(%r15,%rax), %ecx
	testb	%cl, %cl
	je	LBB0_16
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	%rbx, %rax
	jae	LBB0_16
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movb	%cl, (%rsi,%rax)
	incq	%rax
	cmpq	%rax, %r12
	jne	LBB0_4
## %bb.7:
	movl	%r12d, %eax
	jmp	LBB0_16
LBB0_10:
	xorl	%eax, %eax
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
LBB0_16:
	movl	%eax, %eax
	movb	$0, (%rsi,%rax)
	xorl	%r13d, %r13d
LBB0_17:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"UTF16-LE"

L_.str.1:                               ## @.str.1
	.asciz	"UTF8"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_utf8_from_charset              ; -- Begin function utf8_from_charset
	.p2align	2
_utf8_from_charset:                     ; @utf8_from_charset
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	cbz	w2, LBB0_3
; %bb.1:
	mov	x22, x4
	mov	x20, x3
	mov	x21, x2
	mov	x19, x1
	mov	x23, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcmp
	cbz	w0, LBB0_4
; %bb.2:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_strcmp
	cbz	w0, LBB0_8
LBB0_3:
	mov	w0, #1
	b	LBB0_16
LBB0_4:
	cmp	w22, #2
	b.lo	LBB0_13
; %bb.5:
	mov	x9, #0
	lsr	w8, w22, #1
	sub	w10, w21, #1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w11, [x20, x9]
	cmp	w11, #0
	ccmp	x9, x10, #2, ne
	b.hs	LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	strb	w11, [x19, x9]
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_6
	b	LBB0_15
LBB0_8:
	cbz	w22, LBB0_13
; %bb.9:
	mov	x8, #0
	mov	w9, w22
	sub	w10, w21, #1
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldrb	w11, [x20, x8]
	cmp	w11, #0
	ccmp	x8, x10, #2, ne
	b.hs	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	strb	w11, [x19, x8]
	add	x8, x8, #1
	cmp	x9, x8
	b.ne	LBB0_10
LBB0_12:
	mov	x8, x9
	b	LBB0_15
LBB0_13:
	mov	w8, #0
	b	LBB0_15
LBB0_14:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
LBB0_15:
	mov	w0, #0
	strb	wzr, [x19, w8, uxtw]
LBB0_16:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"UTF16-LE"

l_.str.1:                               ; @.str.1
	.asciz	"UTF8"

.subsections_via_symbols
