	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_convert_ucs2_to_utf8           ## -- Begin function convert_ucs2_to_utf8
	.p2align	4, 0x90
_convert_ucs2_to_utf8:                  ## @convert_ucs2_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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, -56(%rbp)
	leaq	1(,%rsi,4), %rdi
	shlq	$2, %rbx
	movl	$1, %esi
	callq	_scalloc
	movq	%rax, %r14
	movq	%rax, -48(%rbp)
	movq	%rbx, -40(%rbp)
	movq	_utf8_conversion_descriptor@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	cmpq	$-1, %rdi
	je	LBB0_1
## %bb.3:
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_iconv
	jmp	LBB0_4
LBB0_1:
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_iconv_open
	movq	%rax, (%r15)
	cmpq	$-1, %rax
	jne	LBB0_4
## %bb.2:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_err
LBB0_4:
	movq	%rbx, -32(%rbp)
	movq	(%r15), %rdi
	leaq	-56(%rbp), %rsi
	leaq	-32(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	leaq	-40(%rbp), %r8
	callq	_iconv
	cmpq	$-1, %rax
	je	LBB0_5
LBB0_6:
	movq	%r14, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leaq	L_.str.3(%rip), %rdi
	callq	_perror
	movq	%r14, %rdi
	callq	_free
	xorl	%r14d, %r14d
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_utf8_conversion_descriptor,8,3 ## @utf8_conversion_descriptor
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"UTF-8"

L_.str.1:                               ## @.str.1
	.asciz	"UCS-2BE"

	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
L_.str.2:                               ## @.str.2
	.asciz	"Error opening the conversion context"

L_.str.3:                               ## @.str.3
	.asciz	"Converting to UTF-8 failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_convert_ucs2_to_utf8           ; -- Begin function convert_ucs2_to_utf8
	.p2align	2
_convert_ucs2_to_utf8:                  ; @convert_ucs2_to_utf8
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	str	x0, [sp, #24]
	lsl	x20, x1, #2
	mov	w0, #1
	bfi	x0, x1, #2, #62
	mov	w1, #1
	bl	_scalloc
	mov	x19, x0
	stp	x20, x0, [sp, #8]
Lloh0:
	adrp	x21, _utf8_conversion_descriptor@GOTPAGE
Lloh1:
	ldr	x21, [x21, _utf8_conversion_descriptor@GOTPAGEOFF]
	ldr	x0, [x21]
	cmn	x0, #1
	b.eq	LBB0_2
; %bb.1:
	mov	x1, #0
	mov	x2, #0
	mov	x3, #0
	mov	x4, #0
	bl	_iconv
	b	LBB0_4
LBB0_2:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_iconv_open
	str	x0, [x21]
	cmn	x0, #1
	b.ne	LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_err
LBB0_4:
	str	x20, [sp]
	ldr	x0, [x21]
	add	x1, sp, #24
	mov	x2, sp
	add	x3, sp, #16
	add	x4, sp, #8
	bl	_iconv
	cmn	x0, #1
	b.eq	LBB0_6
LBB0_5:
	mov	x0, x19
	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
	add	sp, sp, #80
	ret
LBB0_6:
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_perror
	mov	x0, x19
	bl	_free
	mov	x19, #0
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_utf8_conversion_descriptor,8,3 ; @utf8_conversion_descriptor
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"UTF-8"

l_.str.1:                               ; @.str.1
	.asciz	"UCS-2BE"

	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
l_.str.2:                               ; @.str.2
	.asciz	"Error opening the conversion context"

l_.str.3:                               ; @.str.3
	.asciz	"Converting to UTF-8 failed"

.subsections_via_symbols
