	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wind_ucs2read                  ## -- Begin function wind_ucs2read
	.p2align	4, 0x90
_wind_ucs2read:                         ## @wind_ucs2read
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	testb	$1, %sil
	jne	LBB0_3
## %bb.4:
	movl	(%rdx), %r10d
	movq	_WIND_RW_LE@GOTPCREL(%rip), %r11
	movl	(%r11), %r14d
	movl	%r14d, %r13d
	andl	%r10d, %r13d
	movq	(%r8), %r9
	movq	_WIND_RW_BOM@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r12d
	testl	%r10d, %r12d
	je	LBB0_11
## %bb.5:
	movzwl	(%rdi), %ebx
	rolw	$8, %bx
	movzwl	%bx, %r15d
	cmpw	$-2, %r15w
	je	LBB0_7
## %bb.6:
	cmpl	$65279, %r15d                   ## imm = 0xFEFF
	jne	LBB0_14
LBB0_7:
	xorl	%r13d, %r13d
	cmpl	$65534, %r15d                   ## imm = 0xFFFE
	sete	%r13b
	addq	$2, %rdi
	addq	$-2, %rsi
	movq	_WIND_RW_BE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r15d
	jmp	LBB0_8
LBB0_1:
	movq	$0, (%r8)
	jmp	LBB0_18
LBB0_3:
	movq	_WIND_ERR_LENGTH_NOT_MOD2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_19
LBB0_14:
	movq	_WIND_RW_BE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r15d
	movl	%r15d, %ebx
	orl	%r14d, %ebx
	testl	%r10d, %ebx
	je	LBB0_15
LBB0_8:
	orl	%r14d, %r12d
	orl	%r15d, %r12d
	notl	%r12d
	andl	%r12d, %r10d
	movl	%r10d, (%rdx)
	testl	%r13d, %r13d
	jne	LBB0_10
## %bb.9:
	movq	_WIND_RW_BE@GOTPCREL(%rip), %r11
LBB0_10:
	orl	(%r11), %r10d
	movl	%r10d, (%rdx)
	movq	%r9, %r10
	testq	%rsi, %rsi
	je	LBB0_17
LBB0_11:
	xorl	%ebx, %ebx
	movq	%r9, %r10
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	subq	$1, %r10
	jb	LBB0_13
## %bb.16:                              ##   in Loop: Header=BB0_12 Depth=1
	leaq	1(%rdi), %rax
	testl	%r13d, %r13d
	movq	%rdi, %rdx
	cmoveq	%rax, %rdx
	cmoveq	%rdi, %rax
	movzbl	(%rax), %eax
	shll	$8, %eax
	movzbl	(%rdx), %edx
	orl	%eax, %edx
	movl	%edx, (%rcx,%rbx,2)
	addq	$2, %rdi
	addq	$2, %rbx
	cmpq	%rbx, %rsi
	jne	LBB0_12
LBB0_17:
	subq	%r10, %r9
	movq	%r9, (%r8)
LBB0_18:
	xorl	%eax, %eax
LBB0_19:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	_WIND_ERR_OVERRUN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_19
LBB0_15:
	movq	_WIND_ERR_NO_BOM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_WIND_RW_LE,4,2                 ## @WIND_RW_LE
	.comm	_WIND_ERR_LENGTH_NOT_MOD2,4,2   ## @WIND_ERR_LENGTH_NOT_MOD2
	.comm	_WIND_RW_BOM,4,2                ## @WIND_RW_BOM
	.comm	_WIND_RW_BE,4,2                 ## @WIND_RW_BE
	.comm	_WIND_ERR_NO_BOM,4,2            ## @WIND_ERR_NO_BOM
	.comm	_WIND_ERR_OVERRUN,4,2           ## @WIND_ERR_OVERRUN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wind_ucs2read                  ; -- Begin function wind_ucs2read
	.p2align	2
_wind_ucs2read:                         ; @wind_ucs2read
	.cfi_startproc
; %bb.0:
	cbz	x1, LBB0_5
; %bb.1:
	tbnz	w1, #0, LBB0_6
; %bb.2:
	ldr	w11, [x2]
Lloh0:
	adrp	x10, _WIND_RW_LE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _WIND_RW_LE@GOTPAGEOFF]
	ldr	w12, [x10]
	and	w9, w12, w11
	ldr	x8, [x4]
Lloh2:
	adrp	x13, _WIND_RW_BOM@GOTPAGE
Lloh3:
	ldr	x13, [x13, _WIND_RW_BOM@GOTPAGEOFF]
Lloh4:
	ldr	w13, [x13]
	tst	w13, w11
	b.eq	LBB0_9
; %bb.3:
	ldrh	w14, [x0]
	rev16	w15, w14
	mov	w16, #65534
	cmp	w15, w16
	mov	w14, #65279
	ccmp	w15, w14, #4, ne
Lloh5:
	adrp	x14, _WIND_RW_BE@GOTPAGE
Lloh6:
	ldr	x14, [x14, _WIND_RW_BE@GOTPAGEOFF]
	b.ne	LBB0_7
; %bb.4:
	cmp	w15, w16
	cset	w9, eq
	add	x0, x0, #2
	sub	x1, x1, #2
	ldr	w15, [x14]
	b	LBB0_8
LBB0_5:
	mov	w0, #0
	str	xzr, [x4]
	ret
LBB0_6:
Lloh7:
	adrp	x8, _WIND_ERR_LENGTH_NOT_MOD2@GOTPAGE
Lloh8:
	ldr	x8, [x8, _WIND_ERR_LENGTH_NOT_MOD2@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	ret
LBB0_7:
	ldr	w15, [x14]
	orr	w16, w15, w12
	tst	w16, w11
	b.eq	LBB0_15
LBB0_8:
	orr	w12, w13, w12
	orr	w12, w12, w15
	bic	w11, w11, w12
	str	w11, [x2]
	cmp	w9, #0
	csel	x10, x14, x10, eq
	ldr	w10, [x10]
	orr	w10, w10, w11
	str	w10, [x2]
	cbz	x1, LBB0_13
LBB0_9:
	mov	x10, x8
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	cbz	x10, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	cmp	w9, #0
	cinc	x11, x0, eq
	cinc	x12, x0, ne
	ldrb	w12, [x12]
	ldrb	w11, [x11]
	bfi	w11, w12, #8, #8
	str	w11, [x3], #4
	add	x0, x0, #2
	sub	x10, x10, #1
	sub	x1, x1, #2
	cbnz	x1, LBB0_10
	b	LBB0_14
LBB0_12:
Lloh10:
	adrp	x8, _WIND_ERR_OVERRUN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WIND_ERR_OVERRUN@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	ret
LBB0_13:
	mov	x10, x8
LBB0_14:
	mov	w0, #0
	sub	x8, x8, x10
	str	x8, [x4]
	ret
LBB0_15:
Lloh13:
	adrp	x8, _WIND_ERR_NO_BOM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _WIND_ERR_NO_BOM@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_WIND_RW_LE,4,2                 ; @WIND_RW_LE
	.comm	_WIND_ERR_LENGTH_NOT_MOD2,4,2   ; @WIND_ERR_LENGTH_NOT_MOD2
	.comm	_WIND_RW_BOM,4,2                ; @WIND_RW_BOM
	.comm	_WIND_RW_BE,4,2                 ; @WIND_RW_BE
	.comm	_WIND_ERR_NO_BOM,4,2            ; @WIND_ERR_NO_BOM
	.comm	_WIND_ERR_OVERRUN,4,2           ; @WIND_ERR_OVERRUN
.subsections_via_symbols
