	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_convert_utf8_to_ucs2           ## -- Begin function convert_utf8_to_ucs2
	.p2align	4, 0x90
_convert_utf8_to_ucs2:                  ## @convert_utf8_to_ucs2
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, -64(%rbp)
	callq	_strlen
	movq	%rax, %rbx
	movq	%rax, -56(%rbp)
	shlq	$2, %rbx
	movq	%rbx, %rdi
	callq	_smalloc
	movq	%rax, %r15
	movq	%rbx, -40(%rbp)
	movq	%rax, -48(%rbp)
	movq	_ucs2_conversion_descriptor@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	cmpq	$-1, %rdi
	je	LBB0_1
## %bb.4:
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_iconv
	jmp	LBB0_5
LBB0_1:
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_iconv_open
	movq	%rax, (%r12)
	cmpq	$-1, %rax
	jne	LBB0_5
## %bb.2:
	leaq	L_.str.2(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_iconv_open
	movq	%rax, (%r12)
	cmpq	$-1, %rax
	jne	LBB0_5
## %bb.3:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_err
LBB0_5:
	movq	(%r12), %rdi
	leaq	-64(%rbp), %rsi
	leaq	-56(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	leaq	-40(%rbp), %r8
	callq	_iconv
	cmpq	$-1, %rax
	je	LBB0_6
LBB0_7:
	subq	-40(%rbp), %rbx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_srealloc
	testq	%r14, %r14
	je	LBB0_9
## %bb.8:
	shrq	$2, %rbx
	movq	%rbx, (%r14)
LBB0_9:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	L_.str.4(%rip), %rdi
	callq	_perror
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_ucs2_conversion_descriptor,8,3 ## @ucs2_conversion_descriptor
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"UCS-2BE//IGNORE"

L_.str.1:                               ## @.str.1
	.asciz	"UTF-8"

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

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

L_.str.4:                               ## @.str.4
	.asciz	"Converting to UCS-2 failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_convert_utf8_to_ucs2           ; -- Begin function convert_utf8_to_ucs2
	.p2align	2
_convert_utf8_to_ucs2:                  ; @convert_utf8_to_ucs2
	.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
	mov	x19, x1
	str	x0, [sp, #24]
	bl	_strlen
	str	x0, [sp, #16]
	lsl	x20, x0, #2
	mov	x0, x20
	bl	_smalloc
	mov	x21, x0
	stp	x0, x20, [sp]
Lloh0:
	adrp	x22, _ucs2_conversion_descriptor@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ucs2_conversion_descriptor@GOTPAGEOFF]
	ldr	x0, [x22]
	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_5
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, [x22]
	cmn	x0, #1
	b.ne	LBB0_5
; %bb.3:
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_iconv_open
	str	x0, [x22]
	cmn	x0, #1
	b.ne	LBB0_5
; %bb.4:
Lloh10:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_err
LBB0_5:
	ldr	x0, [x22]
	add	x1, sp, #24
	add	x2, sp, #16
	mov	x3, sp
	add	x4, sp, #8
	bl	_iconv
	cmn	x0, #1
	b.eq	LBB0_9
LBB0_6:
	ldr	x8, [sp, #8]
	sub	x20, x20, x8
	mov	x0, x21
	mov	x1, x20
	bl	_srealloc
	cbz	x19, LBB0_8
; %bb.7:
	lsr	x8, x20, #2
	str	x8, [x19]
LBB0_8:
	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_9:
Lloh15:
	adrp	x0, l_.str.4@PAGE
Lloh16:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_perror
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_ucs2_conversion_descriptor,8,3 ; @ucs2_conversion_descriptor
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"UCS-2BE//IGNORE"

l_.str.1:                               ; @.str.1
	.asciz	"UTF-8"

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

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

l_.str.4:                               ; @.str.4
	.asciz	"Converting to UCS-2 failed"

.subsections_via_symbols
