	.file	"extr_display_mode_vba_20v2.c_TruncToValidBPP.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	TruncToValidBPP, @function
TruncToValidBPP:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	DWORD PTR dm_hdmi[rip], esi
	mov	eax, DWORD PTR dm_420[rip]
	je	.L47
	test	edi, edi
	je	.L7
	cmp	edx, eax
	je	.L48
	cmp	DWORD PTR dm_n422[rip], edx
	je	.L49
	movsd	xmm1, QWORD PTR .LC11[rip]
	comisd	xmm1, xmm0
	ja	.L6
	lea	edx, [rcx+rcx*2]
	pxor	xmm1, xmm1
	cvtsi2sd	xmm1, rdx
	mov	rax, rdx
	comisd	xmm0, xmm1
	jb	.L11
.L44:
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	cmp	edx, eax
	je	.L50
	cmp	DWORD PTR dm_s422[rip], edx
	je	.L19
	cmp	DWORD PTR dm_n422[rip], edx
	je	.L19
	comisd	xmm0, QWORD PTR .LC3[rip]
	mov	eax, 36
	jnb	.L44
	comisd	xmm0, QWORD PTR .LC4[rip]
	mov	eax, 30
	jnb	.L44
	comisd	xmm0, QWORD PTR .LC5[rip]
	mov	eax, 24
	jnb	.L51
.L21:
	comisd	xmm0, QWORD PTR .LC0[rip]
	mov	eax, 18
	jb	.L6
	ret
	.p2align 4,,10
	.p2align 3
.L47:
	cmp	edx, eax
	je	.L52
	cmp	DWORD PTR dm_444[rip], edx
	je	.L53
	divsd	xmm0, QWORD PTR .LC6[rip]
	comisd	xmm0, QWORD PTR .LC5[rip]
	mov	eax, 24
	jnb	.L44
	comisd	xmm0, QWORD PTR .LC7[rip]
	mov	eax, 20
	jnb	.L44
	comisd	xmm0, QWORD PTR .LC8[rip]
	mov	eax, 16
	jnb	.L54
.L6:
	mov	eax, DWORD PTR BPP_INVALID[rip]
	ret
	.p2align 4,,10
	.p2align 3
.L53:
	comisd	xmm0, QWORD PTR .LC3[rip]
	mov	eax, 36
	jnb	.L44
	comisd	xmm0, QWORD PTR .LC4[rip]
	mov	eax, 30
	jnb	.L44
	comisd	xmm0, QWORD PTR .LC5[rip]
	mov	eax, 24
	jb	.L21
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L19:
	comisd	xmm0, QWORD PTR .LC5[rip]
	mov	eax, 24
	jnb	.L44
	comisd	xmm0, QWORD PTR .LC7[rip]
	mov	eax, 20
	jnb	.L44
	comisd	xmm0, QWORD PTR .LC8[rip]
	mov	eax, 16
	jb	.L6
	ret
	.p2align 4,,10
	.p2align 3
.L49:
	movsd	xmm1, QWORD PTR .LC10[rip]
	comisd	xmm1, xmm0
	ja	.L6
	lea	edx, [rcx+rcx]
	pxor	xmm1, xmm1
	cvtsi2sd	xmm1, rdx
	mov	rax, rdx
	comisd	xmm0, xmm1
	jnb	.L44
.L11:
	sub	rsp, 8
	.cfi_def_cfa_offset 16
	mov	esi, 1
	mulsd	xmm0, QWORD PTR .LC8[rip]
	cvttsd2si	edi, xmm0
	call	dml_floor@PLT
	mov	edx, eax
	lea	eax, 15[rax]
	test	edx, edx
	cmovns	eax, edx
	add	rsp, 8
	.cfi_def_cfa_offset 8
	sar	eax, 4
	ret
	.p2align 4,,10
	.p2align 3
.L52:
	comisd	xmm0, QWORD PTR .LC0[rip]
	mov	eax, 18
	jnb	.L44
	comisd	xmm0, QWORD PTR .LC1[rip]
	mov	eax, 15
	jnb	.L44
	comisd	xmm0, QWORD PTR .LC2[rip]
	mov	eax, 12
	jb	.L6
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L48:
	movsd	xmm1, QWORD PTR .LC9[rip]
	comisd	xmm1, xmm0
	ja	.L6
	mov	ecx, ecx
	pxor	xmm1, xmm1
	cvtsi2sd	xmm1, rcx
	mulsd	xmm1, QWORD PTR .LC6[rip]
	comisd	xmm0, xmm1
	jb	.L11
	cvttsd2si	rax, xmm1
	ret
	.p2align 4,,10
	.p2align 3
.L50:
	comisd	xmm0, QWORD PTR .LC0[rip]
	mov	eax, 18
	jnb	.L44
	comisd	xmm0, QWORD PTR .LC1[rip]
	mov	eax, 15
	jnb	.L44
	comisd	xmm0, QWORD PTR .LC2[rip]
	mov	eax, 12
	jb	.L6
	ret
	.p2align 4,,10
	.p2align 3
.L51:
	ret
	.p2align 4,,10
	.p2align 3
.L54:
	ret
	.cfi_endproc
.LFE0:
	.size	TruncToValidBPP, .-TruncToValidBPP
	.comm	dm_s422,4,4
	.comm	dm_n422,4,4
	.comm	dm_hdmi,4,4
	.comm	dm_444,4,4
	.comm	dm_420,4,4
	.comm	BPP_INVALID,4,4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1077018624
	.align 8
.LC1:
	.long	0
	.long	1076756480
	.align 8
.LC2:
	.long	0
	.long	1076363264
	.align 8
.LC3:
	.long	0
	.long	1078067200
	.align 8
.LC4:
	.long	0
	.long	1077805056
	.align 8
.LC5:
	.long	0
	.long	1077411840
	.align 8
.LC6:
	.long	0
	.long	1073217536
	.align 8
.LC7:
	.long	0
	.long	1077149696
	.align 8
.LC8:
	.long	0
	.long	1076887552
	.align 8
.LC9:
	.long	0
	.long	1075314688
	.align 8
.LC10:
	.long	0
	.long	1075576832
	.align 8
.LC11:
	.long	0
	.long	1075838976
	.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_display_mode_vba_20v2.c_TruncToValidBPP.c"
	.text
	.global	__aeabi_dcmpge
	.global	__aeabi_ddiv
	.global	__aeabi_dcmplt
	.global	__aeabi_ui2d
	.global	__aeabi_dmul
	.global	__aeabi_dcmple
	.global	__aeabi_d2uiz
	.global	__aeabi_d2iz
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	TruncToValidBPP, %function
TruncToValidBPP:
	@ args = 8, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	ip, .L56
	push	{r4, r5, r6, r7, r8, lr}
	ldr	lr, [ip]
	ldr	ip, .L56+4
	cmp	lr, r3
	mov	r4, r0
	mov	r5, r1
	ldr	ip, [ip]
	ldr	r3, [sp, #24]
	beq	.L53
	cmp	r2, #0
	beq	.L7
	cmp	r3, ip
	beq	.L54
	ldr	r2, .L56+8
	ldr	r2, [r2]
	cmp	r2, r3
	mov	r2, #0
	beq	.L55
	ldr	r3, .L56+12
	bl	__aeabi_dcmplt
	cmp	r0, #0
	bne	.L6
	ldr	r3, [sp, #28]
	add	r6, r3, r3, lsl #1
.L39:
	mov	r0, r6
	bl	__aeabi_ui2d
	mov	r2, r4
	mov	r3, r5
	bl	__aeabi_dcmple
	cmp	r0, #0
	bne	.L1
.L9:
	mov	r2, #0
	ldr	r3, .L56+16
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_dmul
	bl	__aeabi_d2iz
	mov	r1, #1
	bl	dml_floor
	add	r6, r0, #15
	cmp	r0, #0
	movlt	r0, r6
	asr	r6, r0, #4
	b	.L1
.L7:
	cmp	r3, ip
	beq	.L47
	ldr	r2, .L56+20
	ldr	r2, [r2]
	cmp	r2, r3
	beq	.L13
	ldr	r2, .L56+8
	ldr	r2, [r2]
	cmp	r2, r3
	movne	r2, #0
	beq	.L13
.L51:
	ldr	r3, .L56+24
	bl	__aeabi_dcmpge
	cmp	r0, #0
	movne	r6, #36
	bne	.L1
	mov	r2, #0
	mov	r0, r4
	mov	r1, r5
	ldr	r3, .L56+28
	bl	__aeabi_dcmpge
	cmp	r0, #0
	movne	r6, #30
	bne	.L1
	mov	r2, #0
	mov	r0, r4
	mov	r1, r5
	ldr	r3, .L56+32
	bl	__aeabi_dcmpge
	cmp	r0, #0
	bne	.L30
	mov	r0, r4
	mov	r1, r5
	mov	r2, #0
	ldr	r3, .L56+36
	bl	__aeabi_dcmpge
	cmp	r0, #0
	beq	.L6
.L27:
	mov	r6, #18
	b	.L1
.L53:
	cmp	r3, ip
	beq	.L47
	ldr	r2, .L56+40
	ldr	r2, [r2]
	cmp	r2, r3
	mov	r2, #0
	beq	.L51
	ldr	r3, .L56+44
	bl	__aeabi_ddiv
	mov	r2, #0
	ldr	r3, .L56+32
	mov	r4, r0
	mov	r5, r1
	bl	__aeabi_dcmpge
	cmp	r0, #0
	bne	.L30
.L49:
	mov	r2, #0
	mov	r0, r4
	mov	r1, r5
	ldr	r3, .L56+48
	bl	__aeabi_dcmpge
	cmp	r0, #0
	movne	r6, #20
	bne	.L1
	mov	r0, r4
	mov	r1, r5
	mov	r2, #0
	ldr	r3, .L56+16
	bl	__aeabi_dcmpge
	cmp	r0, #0
	beq	.L6
	mov	r6, #16
	b	.L1
.L47:
	mov	r2, #0
	ldr	r3, .L56+36
	bl	__aeabi_dcmpge
	cmp	r0, #0
	bne	.L27
	mov	r2, #0
	mov	r0, r4
	mov	r1, r5
	ldr	r3, .L56+52
	bl	__aeabi_dcmpge
	cmp	r0, #0
	movne	r6, #15
	bne	.L1
	mov	r0, r4
	mov	r1, r5
	mov	r2, #0
	ldr	r3, .L56+56
	bl	__aeabi_dcmpge
	cmp	r0, #0
	movne	r6, #12
	bne	.L1
.L6:
	ldr	r3, .L56+60
	ldr	r6, [r3]
.L1:
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, pc}
.L13:
	mov	r2, #0
	mov	r0, r4
	mov	r1, r5
	ldr	r3, .L56+32
	bl	__aeabi_dcmpge
	cmp	r0, #0
	beq	.L49
.L30:
	mov	r6, #24
	b	.L1
.L55:
	ldr	r3, .L56+64
	bl	__aeabi_dcmplt
	cmp	r0, #0
	bne	.L6
	ldr	r3, [sp, #28]
	lsl	r6, r3, #1
	b	.L39
.L54:
	mov	r2, #0
	ldr	r3, .L56+68
	bl	__aeabi_dcmplt
	cmp	r0, #0
	bne	.L6
	ldr	r0, [sp, #28]
	bl	__aeabi_ui2d
	mov	r2, #0
	ldr	r3, .L56+44
	bl	__aeabi_dmul
	mov	r2, r4
	mov	r3, r5
	mov	r6, r0
	mov	r7, r1
	bl	__aeabi_dcmple
	cmp	r0, #0
	beq	.L9
	mov	r0, r6
	mov	r1, r7
	bl	__aeabi_d2uiz
	mov	r6, r0
	b	.L1
.L57:
	.align	2
.L56:
	.word	dm_hdmi
	.word	dm_420
	.word	dm_n422
	.word	1075838976
	.word	1076887552
	.word	dm_s422
	.word	1078067200
	.word	1077805056
	.word	1077411840
	.word	1077018624
	.word	dm_444
	.word	1073217536
	.word	1077149696
	.word	1076756480
	.word	1076363264
	.word	BPP_INVALID
	.word	1075576832
	.word	1075314688
	.size	TruncToValidBPP, .-TruncToValidBPP
	.comm	dm_s422,4,4
	.comm	dm_n422,4,4
	.comm	dm_hdmi,4,4
	.comm	dm_444,4,4
	.comm	dm_420,4,4
	.comm	BPP_INVALID,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
