	.file	"extr_utf8.c_wine_utf8_mbstowcs.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	wine_utf8_mbstowcs
	.type	wine_utf8_mbstowcs, @function
wine_utf8_mbstowcs:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rcx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, r8d
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	QWORD PTR 8[rsp], rsi
	test	DWORD PTR MB_COMPOSITE[rip], edi
	jne	.L27
	test	r8d, r8d
	je	.L4
	movsx	rax, r8d
	movsx	rdx, edx
	lea	r14, [rcx+rax*4]
	lea	r15, [rsi+rdx]
	cmp	rcx, r14
	jnb	.L7
	cmp	rsi, r15
	jnb	.L7
	lea	r13, 8[rsp]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L28:
	mov	DWORD PTR [r12], edi
	mov	rsi, rdx
	add	r12, 4
.L9:
	cmp	r12, r14
	jnb	.L7
.L29:
	cmp	r15, rsi
	jbe	.L24
.L5:
	lea	rdx, 1[rsi]
	mov	QWORD PTR 8[rsp], rdx
	movzx	edi, BYTE PTR [rsi]
	test	dil, dil
	jns	.L28
	mov	rdx, r15
	mov	rsi, r13
	call	decode_utf8_char@PLT
	cmp	eax, 65535
	ja	.L10
	mov	DWORD PTR [r12], eax
	add	r12, 4
	mov	rsi, QWORD PTR 8[rsp]
	cmp	r12, r14
	jb	.L29
	.p2align 4,,10
	.p2align 3
.L7:
	cmp	r15, rsi
	ja	.L14
.L24:
	sub	r14, r12
	mov	eax, ebx
	sar	r14, 2
	sub	eax, r14d
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	cmp	eax, 1114111
	ja	.L11
	lea	rdx, -4[r14]
	cmp	r12, rdx
	je	.L14
	sub	eax, 65536
	mov	rsi, QWORD PTR 8[rsp]
	add	r12, 8
	mov	edx, eax
	and	eax, 1023
	shr	edx, 10
	or	ah, -36
	or	dh, -40
	mov	DWORD PTR -4[r12], eax
	mov	DWORD PTR -8[r12], edx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L11:
	test	DWORD PTR MB_ERR_INVALID_CHARS[rip], ebp
	jne	.L15
	mov	rsi, QWORD PTR 8[rsp]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L27:
	call	utf8_mbstowcs_compose@PLT
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	mov	eax, -1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	call	get_length_mbs_utf8@PLT
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	mov	eax, -2
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	wine_utf8_mbstowcs, .-wine_utf8_mbstowcs
	.comm	MB_ERR_INVALID_CHARS,4,4
	.comm	MB_COMPOSITE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_utf8.c_wine_utf8_mbstowcs.c"
	.text
	.align	2
	.global	wine_utf8_mbstowcs
	.syntax unified
	.arm
	.fpu softvfp
	.type	wine_utf8_mbstowcs, %function
wine_utf8_mbstowcs:
	@ args = 4, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	ip, .L19
	sub	sp, sp, #16
	ldr	ip, [ip]
	ldr	r5, [sp, #48]
	tst	r0, ip
	str	r1, [sp, #12]
	bne	.L18
	cmp	r5, #0
	beq	.L4
	add	r10, r1, r2
	add	r9, r3, r5, lsl #2
	cmp	r3, r9
	cmpcc	r1, r10
	mov	r4, r3
	mov	ip, r1
	bcs	.L6
	mov	r6, r0
	ldr	r8, .L19+4
	ldr	r7, .L19+8
	b	.L5
.L8:
	cmp	r4, r9
	movcs	r3, #0
	movcc	r3, #1
	cmp	r10, ip
	movls	r3, #0
	cmp	r3, #0
	beq	.L6
.L5:
	add	r1, ip, #1
	str	r1, [sp, #12]
	ldrb	r0, [ip]	@ zero_extendqisi2
	tst	r0, #128
	moveq	ip, r1
	streq	r0, [r4], #4
	beq	.L8
	mov	r2, r10
	add	r1, sp, #12
	bl	decode_utf8_char
	cmp	r0, #65536
	ldrcc	ip, [sp, #12]
	strcc	r0, [r4], #4
	bcc	.L8
.L9:
	sub	r3, r0, #65536
	lsr	r2, r3, #10
	cmp	r0, #1114112
	and	r3, r3, r7
	sub	r1, r9, #4
	orr	r2, r2, #55296
	orr	r3, r3, #56320
	bcs	.L10
	cmp	r4, r1
	beq	.L12
	mov	r1, r4
	str	r2, [r1], #8
	ldr	ip, [sp, #12]
	str	r3, [r4, #4]
	mov	r4, r1
	b	.L8
.L10:
	ldr	r3, [r8]
	tst	r6, r3
	bne	.L13
	ldr	ip, [sp, #12]
	b	.L8
.L6:
	cmp	r10, ip
	bhi	.L12
	sub	r4, r9, r4
	sub	r0, r5, r4, asr #2
.L1:
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L18:
	str	r5, [sp]
	bl	utf8_mbstowcs_compose
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L4:
	bl	get_length_mbs_utf8
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L12:
	mvn	r0, #0
	b	.L1
.L13:
	mvn	r0, #1
	b	.L1
.L20:
	.align	2
.L19:
	.word	MB_COMPOSITE
	.word	MB_ERR_INVALID_CHARS
	.word	1023
	.size	wine_utf8_mbstowcs, .-wine_utf8_mbstowcs
	.comm	MB_ERR_INVALID_CHARS,4,4
	.comm	MB_COMPOSITE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
