	.file	"extr_format.c_S32toS16.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	S32toS16, @function
S32toS16:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rsi
	call	VLC_UNUSED@PLT
	mov	esi, DWORD PTR [r12]
	mov	rdx, QWORD PTR 8[r12]
	test	esi, esi
	lea	ecx, 3[rsi]
	cmovns	ecx, esi
	sar	ecx, 2
	movsx	rcx, ecx
	test	rcx, rcx
	je	.L2
	lea	rax, -1[rcx]
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rcx, rdx
	sub	rax, 1
	add	rdx, 4
	sar	DWORD PTR [rcx], 16
	cmp	rax, -1
	jne	.L3
	mov	esi, DWORD PTR [r12]
.L2:
	mov	eax, esi
	shr	eax, 31
	add	esi, eax
	mov	rax, r12
	sar	esi
	mov	DWORD PTR [r12], esi
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	S32toS16, .-S32toS16
	.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_format.c_S32toS16.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	S32toS16, %function
S32toS16:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, lr}
	mov	r4, r1
	bl	VLC_UNUSED
	ldm	r4, {r0, r2}
	cmp	r0, #0
	add	r3, r0, #3
	movge	r3, r0
	asr	r3, r3, #2
	cmp	r3, #0
	beq	.L2
	sub	r3, r3, #1
.L3:
	mov	r0, r2
	ldrsh	ip, [r2, #2]
	sub	r3, r3, #1
	cmn	r3, #1
	add	r2, r2, #4
	str	ip, [r0]
	bne	.L3
	ldr	r0, [r4]
.L2:
	add	r0, r0, r0, lsr #31
	asr	r0, r0, #1
	str	r0, [r4]
	mov	r0, r4
	pop	{r4, pc}
	.size	S32toS16, .-S32toS16
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
