	.file	"extr_nls_base.c_utf16s_to_utf8s.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	utf16s_to_utf8s
	.type	utf16s_to_utf8s, @function
utf16s_to_utf8s:
.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
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	QWORD PTR 24[rsp], rcx
	test	r8d, r8d
	jle	.L10
	mov	r13d, esi
	test	esi, esi
	jle	.L10
	mov	r15, rdi
	mov	r14d, edx
	mov	ebx, r8d
	mov	r12, rcx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L28:
	mov	rax, QWORD PTR SURROGATE_MASK[rip]
	and	rax, rbp
	cmp	rax, QWORD PTR SURROGATE_PAIR[rip]
	jne	.L5
	test	QWORD PTR SURROGATE_LOW[rip], rbp
	jne	.L14
	test	ecx, ecx
	je	.L15
	mov	edi, DWORD PTR 4[r15]
	mov	esi, r14d
	mov	DWORD PTR 20[rsp], ecx
	mov	QWORD PTR 8[rsp], r8
	call	get_utf16@PLT
	mov	rdx, QWORD PTR SURROGATE_MASK[rip]
	mov	r8, QWORD PTR 8[rsp]
	mov	ecx, DWORD PTR 20[rsp]
	and	rdx, rax
	cmp	rdx, QWORD PTR SURROGATE_PAIR[rip]
	jne	.L14
	test	QWORD PTR SURROGATE_LOW[rip], rax
	je	.L14
	mov	rcx, QWORD PTR SURROGATE_BITS[rip]
	mov	rdx, QWORD PTR PLANE_SIZE[rip]
	lea	r8, 8[r15]
	and	rbp, rcx
	and	rax, rcx
	lea	ecx, -2[r13]
	sal	rbp, 10
	add	rdx, rbp
	lea	rbp, [rax+rdx]
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edx, ebx
	mov	rsi, r12
	mov	rdi, rbp
	mov	DWORD PTR 20[rsp], ecx
	mov	QWORD PTR 8[rsp], r8
	call	utf32_to_utf8@PLT
	mov	r8, QWORD PTR 8[rsp]
	mov	ecx, DWORD PTR 20[rsp]
	cmp	eax, -1
	je	.L14
	movsx	rdx, eax
	sub	ebx, eax
	mov	r13d, ecx
	mov	r15, r8
	lea	r12, [r12+rdx*8]
.L6:
	test	ecx, ecx
	jle	.L15
.L29:
	test	ebx, ebx
	jle	.L15
.L8:
	mov	edi, DWORD PTR [r15]
	mov	esi, r14d
	call	get_utf16@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L15
	lea	r8, 4[r15]
	lea	ecx, -1[r13]
	cmp	rax, 127
	ja	.L28
	mov	QWORD PTR [r12], rax
	sub	ebx, 1
	add	r12, 8
	mov	r13d, ecx
	mov	r15, r8
	test	ecx, ecx
	jg	.L29
	.p2align 4,,10
	.p2align 3
.L15:
	mov	rax, r12
	sub	rax, QWORD PTR 24[rsp]
	sar	rax, 3
.L1:
	add	rsp, 40
	.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
.L14:
	.cfi_restore_state
	mov	r13d, ecx
	mov	r15, r8
	jmp	.L6
.L10:
	xor	eax, eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	utf16s_to_utf8s, .-utf16s_to_utf8s
	.comm	SURROGATE_PAIR,8,8
	.comm	SURROGATE_MASK,8,8
	.comm	SURROGATE_LOW,8,8
	.comm	SURROGATE_BITS,8,8
	.comm	PLANE_SIZE,8,8
	.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_nls_base.c_utf16s_to_utf8s.c"
	.text
	.align	2
	.global	utf16s_to_utf8s
	.syntax unified
	.arm
	.fpu softvfp
	.type	utf16s_to_utf8s, %function
utf16s_to_utf8s:
	@ args = 4, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #12
	ldr	r7, [sp, #48]
	str	r3, [sp, #4]
	cmp	r7, #0
	cmpgt	r1, #0
	movgt	ip, #1
	movle	ip, #0
	ble	.L9
	mov	r10, r0
	mov	r9, r2
	mov	r8, r1
	mov	r5, r3
	ldr	fp, .L20
	b	.L8
.L19:
	ldr	r1, .L20+4
	ldr	r2, [fp]
	ldr	r1, [r1]
	and	r2, r2, r4
	cmp	r2, r1
	bne	.L5
	ldr	r2, .L20+8
	ldr	r2, [r2]
	tst	r4, r2
	bne	.L13
	cmp	r6, #0
	beq	.L18
	mov	r1, r9
	ldr	r0, [r10, #4]
	str	r3, [sp]
	bl	get_utf16
	ldr	r3, .L20+4
	ldr	r2, [fp]
	ldr	r1, [r3]
	and	r2, r2, r0
	cmp	r2, r1
	ldr	r3, [sp]
	bne	.L13
	ldr	r2, .L20+8
	ldr	r2, [r2]
	tst	r0, r2
	beq	.L13
	ldr	r3, .L20+12
	ldr	r2, .L20+16
	ldr	r3, [r3]
	ldr	r2, [r2]
	and	r4, r4, r3
	and	r0, r0, r3
	add	r4, r2, r4, lsl #10
	add	r3, r10, #8
	sub	r6, r8, #2
	add	r4, r0, r4
.L5:
	mov	r0, r4
	mov	r2, r7
	mov	r1, r5
	str	r3, [sp]
	bl	utf32_to_utf8
	cmn	r0, #1
	ldr	r3, [sp]
	beq	.L13
	mov	r10, r3
	mov	r8, r6
	add	r5, r5, r0, lsl #2
	sub	r7, r7, r0
.L6:
	cmp	r6, #0
	cmpgt	r7, #0
	ble	.L16
.L8:
	mov	r1, r9
	ldr	r0, [r10]
	bl	get_utf16
	subs	r4, r0, #0
	beq	.L16
	cmp	r4, #127
	add	r3, r10, #4
	sub	r6, r8, #1
	bhi	.L19
	sub	r7, r7, #1
	cmp	r6, #0
	cmpgt	r7, #0
	mov	r10, r3
	mov	r8, r6
	str	r4, [r5], #4
	bgt	.L8
.L16:
	ldr	r3, [sp, #4]
	sub	r5, r5, r3
	asr	r0, r5, #2
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L13:
	mov	r10, r3
	mov	r8, r6
	b	.L6
.L18:
	ldr	r3, [sp, #4]
	sub	r0, r5, r3
	asr	r0, r0, #2
	b	.L1
.L9:
	mov	r0, ip
	b	.L1
.L21:
	.align	2
.L20:
	.word	SURROGATE_MASK
	.word	SURROGATE_PAIR
	.word	SURROGATE_LOW
	.word	SURROGATE_BITS
	.word	PLANE_SIZE
	.size	utf16s_to_utf8s, .-utf16s_to_utf8s
	.comm	SURROGATE_PAIR,4,4
	.comm	SURROGATE_MASK,4,4
	.comm	SURROGATE_LOW,4,4
	.comm	SURROGATE_BITS,4,4
	.comm	PLANE_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
