	.file	"extr_vpbe_display.c_vpbe_disp_calculate_scale_factor.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"crop display xsize = %d, ysize = %d\n"
	.text
	.p2align 4
	.type	vpbe_disp_calculate_scale_factor, @function
vpbe_disp_calculate_scale_factor:
.LFB0:
	.cfi_startproc
	endbr64
	mov	r10, QWORD PTR [rdi]
	mov	rax, QWORD PTR ZOOM_X1[rip]
	mov	r9d, ecx
	mov	r8d, edx
	mov	ecx, DWORD PTR 44[rsi]
	mov	edi, DWORD PTR 40[rsi]
	mov	r11d, DWORD PTR 4[r10]
	mov	QWORD PTR 24[rsi], rax
	mov	QWORD PTR 8[rsi], rax
	mov	eax, DWORD PTR H_EXP_OFF[rip]
	mov	DWORD PTR 36[rsi], ecx
	mov	DWORD PTR 16[rsi], eax
	mov	eax, DWORD PTR V_EXP_OFF[rip]
	mov	DWORD PTR [rsi], eax
	cmp	edi, edx
	jge	.L2
	mov	eax, DWORD PTR 8[r10]
	cdq
	idiv	edi
	cmp	eax, 1
	jle	.L3
	cmp	eax, 3
	jle	.L50
	sal	edi, 2
	mov	DWORD PTR 32[rsi], edi
	cmp	r8d, edi
	jg	.L51
.L9:
	mov	rax, QWORD PTR ZOOM_X4[rip]
	mov	QWORD PTR 24[rsi], rax
	cmp	ecx, r9d
	jl	.L52
	.p2align 4,,10
	.p2align 3
.L11:
	mov	DWORD PTR 36[rsi], r9d
.L16:
	mov	r8d, DWORD PTR 32[rsi]
	mov	esi, DWORD PTR debug[rip]
	mov	rdx, r10
	lea	rcx, .LC0[rip]
	mov	edi, 1
	jmp	v4l2_dbg@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	mov	DWORD PTR 32[rsi], edx
.L10:
	cmp	ecx, r9d
	jge	.L11
.L52:
	mov	eax, r9d
	cdq
	idiv	ecx
	cmp	eax, 1
	jle	.L12
	cmp	eax, 3
	jle	.L53
	sal	ecx, 2
	mov	DWORD PTR 36[rsi], ecx
	cmp	r9d, ecx
	jg	.L54
.L43:
	mov	rax, QWORD PTR ZOOM_X4[rip]
	mov	r9d, ecx
	mov	QWORD PTR 8[rsi], rax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L12:
	test	DWORD PTR V4L2_STD_625_50[rip], r11d
	je	.L55
	mov	edi, 1
.L15:
	mov	eax, DWORD PTR VPBE_DISPLAY_V_EXP_RATIO_N[rip]
	imul	eax, ecx
	cdq
	idiv	DWORD PTR VPBE_DISPLAY_V_EXP_RATIO_D[rip]
	cmp	r9d, eax
	jl	.L56
	mov	DWORD PTR 36[rsi], eax
	cmp	edi, 2
	je	.L57
	cmp	edi, 4
	je	.L27
.L47:
	mov	r9d, eax
.L19:
	mov	eax, DWORD PTR V_EXP_6_OVER_5[rip]
	mov	DWORD PTR [rsi], eax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L3:
	mov	eax, DWORD PTR V4L2_STD_525_60[rip]
	or	eax, DWORD PTR V4L2_STD_625_50[rip]
	mov	DWORD PTR 32[rsi], edi
	test	eax, r11d
	je	.L10
	mov	eax, DWORD PTR VPBE_DISPLAY_H_EXP_RATIO_N[rip]
	imul	eax, edi
	cdq
	idiv	DWORD PTR VPBE_DISPLAY_H_EXP_RATIO_D[rip]
	cmp	eax, r8d
	jg	.L10
	mov	DWORD PTR 32[rsi], eax
.L36:
	mov	eax, DWORD PTR H_EXP_9_OVER_8[rip]
	mov	DWORD PTR 16[rsi], eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L50:
	add	edi, edi
	mov	DWORD PTR 32[rsi], edi
	cmp	r8d, edi
	jg	.L25
.L46:
	mov	rax, QWORD PTR ZOOM_X2[rip]
	mov	QWORD PTR 24[rsi], rax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L53:
	add	ecx, ecx
	mov	DWORD PTR 36[rsi], ecx
	cmp	r9d, ecx
	jg	.L22
.L48:
	mov	rax, QWORD PTR ZOOM_X2[rip]
	mov	r9d, ecx
	mov	QWORD PTR 8[rsi], rax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L55:
	mov	r9d, DWORD PTR 36[rsi]
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L56:
	mov	r9d, DWORD PTR 36[rsi]
	cmp	edi, 4
	jne	.L16
	mov	rax, QWORD PTR ZOOM_X4[rip]
	mov	QWORD PTR 8[rsi], rax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L54:
	test	DWORD PTR V4L2_STD_625_50[rip], r11d
	je	.L43
	mov	edi, 4
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L22:
	test	DWORD PTR V4L2_STD_625_50[rip], r11d
	je	.L48
	mov	eax, DWORD PTR VPBE_DISPLAY_V_EXP_RATIO_N[rip]
	imul	eax, ecx
	cdq
	idiv	DWORD PTR VPBE_DISPLAY_V_EXP_RATIO_D[rip]
	cmp	r9d, eax
	jl	.L48
	mov	DWORD PTR 36[rsi], eax
	mov	r9d, eax
.L31:
	mov	rax, QWORD PTR ZOOM_X2[rip]
	mov	QWORD PTR 8[rsi], rax
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L51:
	mov	eax, DWORD PTR V4L2_STD_625_50[rip]
	or	eax, DWORD PTR V4L2_STD_525_60[rip]
	test	eax, r11d
	je	.L9
	imul	edi, DWORD PTR VPBE_DISPLAY_H_EXP_RATIO_N[rip]
	mov	eax, edi
	cdq
	idiv	DWORD PTR VPBE_DISPLAY_H_EXP_RATIO_D[rip]
	mov	edi, eax
	cmp	r8d, eax
	jl	.L9
	mov	rax, QWORD PTR ZOOM_X4[rip]
	mov	DWORD PTR 32[rsi], edi
	mov	QWORD PTR 24[rsi], rax
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L25:
	mov	eax, DWORD PTR V4L2_STD_625_50[rip]
	or	eax, DWORD PTR V4L2_STD_525_60[rip]
	test	eax, r11d
	je	.L46
	mov	eax, DWORD PTR VPBE_DISPLAY_H_EXP_RATIO_N[rip]
	imul	eax, edi
	cdq
	idiv	DWORD PTR VPBE_DISPLAY_H_EXP_RATIO_D[rip]
	cmp	eax, r8d
	jg	.L46
	mov	DWORD PTR 32[rsi], eax
	mov	rax, QWORD PTR ZOOM_X2[rip]
	mov	QWORD PTR 24[rsi], rax
	jmp	.L36
.L57:
	mov	r9d, eax
	jmp	.L31
.L27:
	mov	rdx, QWORD PTR ZOOM_X4[rip]
	mov	QWORD PTR 8[rsi], rdx
	jmp	.L47
	.cfi_endproc
.LFE0:
	.size	vpbe_disp_calculate_scale_factor, .-vpbe_disp_calculate_scale_factor
	.comm	debug,4,4
	.comm	ZOOM_X4,8,8
	.comm	ZOOM_X2,8,8
	.comm	ZOOM_X1,8,8
	.comm	V_EXP_OFF,4,4
	.comm	V_EXP_6_OVER_5,4,4
	.comm	VPBE_DISPLAY_V_EXP_RATIO_N,4,4
	.comm	VPBE_DISPLAY_V_EXP_RATIO_D,4,4
	.comm	VPBE_DISPLAY_H_EXP_RATIO_N,4,4
	.comm	VPBE_DISPLAY_H_EXP_RATIO_D,4,4
	.comm	V4L2_STD_625_50,4,4
	.comm	V4L2_STD_525_60,4,4
	.comm	H_EXP_OFF,4,4
	.comm	H_EXP_9_OVER_8,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_vpbe_display.c_vpbe_disp_calculate_scale_factor.c"
	.text
	.global	__aeabi_idiv
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"crop display xsize = %d, ysize = %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	vpbe_disp_calculate_scale_factor, %function
vpbe_disp_calculate_scale_factor:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r1
	mov	r7, r2
	ldr	ip, .L57
	ldr	r2, .L57+4
	ldr	r1, .L57+8
	ldr	r8, [r4, #24]
	ldr	r9, [r0]
	ldr	r2, [r2]
	ldr	r0, [ip]
	ldr	r1, [r1]
	ldr	r6, [r4, #28]
	cmp	r8, r7
	ldr	r10, [r9, #4]
	mov	r5, r3
	sub	sp, sp, #8
	str	r0, [r4, #8]
	str	r2, [r4, #12]
	str	r2, [r4, #4]
	str	r1, [r4]
	str	r6, [r4, #20]
	strge	r7, [r4, #16]
	bge	.L10
	mov	r1, r8
	ldr	r0, [r9, #8]
	bl	__aeabi_idiv
	cmp	r0, #1
	ble	.L3
	cmp	r0, #3
	ble	.L51
	lsl	r8, r8, #2
	cmp	r7, r8
	str	r8, [r4, #16]
	bgt	.L52
.L9:
	ldr	r3, .L57+12
	ldr	r3, [r3]
	str	r3, [r4, #12]
.L10:
	cmp	r6, r5
	strge	r5, [r4, #20]
	bge	.L16
	mov	r1, r6
	mov	r0, r5
	bl	__aeabi_idiv
	cmp	r0, #1
	ble	.L12
	cmp	r0, #3
	ble	.L53
	lsl	r6, r6, #2
	cmp	r5, r6
	str	r6, [r4, #20]
	bgt	.L54
.L44:
	mov	r5, r6
	ldr	r3, .L57+12
	ldr	r3, [r3]
	str	r3, [r4, #4]
.L16:
	ldr	r2, [r4, #16]
	ldr	r3, .L57+16
	stm	sp, {r2, r5}
	mov	r0, #1
	ldr	r1, [r3]
	mov	r2, r9
	ldr	r3, .L57+20
	bl	v4l2_dbg
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L12:
	ldr	r3, .L57+24
	ldr	r3, [r3]
	tst	r10, r3
	beq	.L55
	mov	r7, #1
.L15:
	ldr	r2, .L57+28
	ldr	r3, .L57+32
	ldr	r0, [r2]
	ldr	r1, [r3]
	mul	r0, r6, r0
	bl	__aeabi_idiv
	cmp	r5, r0
	blt	.L56
	cmp	r7, #2
	mov	r5, r0
	str	r0, [r4, #20]
	beq	.L31
	cmp	r7, #4
	beq	.L27
.L19:
	ldr	r3, .L57+36
	ldr	r3, [r3]
	str	r3, [r4]
	b	.L16
.L3:
	ldr	r3, .L57+40
	ldr	r2, .L57+24
	ldr	r3, [r3]
	ldr	r2, [r2]
	str	r8, [r4, #16]
	orr	r3, r3, r2
	tst	r3, r10
	beq	.L10
	ldr	r2, .L57+44
	ldr	r3, .L57+48
	ldr	r0, [r2]
	ldr	r1, [r3]
	mul	r0, r8, r0
	bl	__aeabi_idiv
	cmp	r0, r7
	strle	r0, [r4, #16]
	bgt	.L10
.L36:
	ldr	r3, .L57+52
	ldr	r3, [r3]
	str	r3, [r4, #8]
	b	.L10
.L51:
	lsl	r8, r8, #1
	cmp	r7, r8
	str	r8, [r4, #16]
	bgt	.L25
.L48:
	ldr	r3, .L57+56
	ldr	r3, [r3]
	str	r3, [r4, #12]
	b	.L10
.L53:
	lsl	r6, r6, #1
	cmp	r5, r6
	str	r6, [r4, #20]
	bgt	.L22
.L49:
	ldr	r3, .L57+56
	mov	r5, r6
	ldr	r3, [r3]
	str	r3, [r4, #4]
	b	.L16
.L55:
	ldr	r5, [r4, #20]
	b	.L16
.L56:
	cmp	r7, #4
	ldr	r5, [r4, #20]
	ldreq	r3, .L57+12
	ldreq	r3, [r3]
	streq	r3, [r4, #4]
	b	.L16
.L54:
	ldr	r3, .L57+24
	ldr	r3, [r3]
	tst	r10, r3
	beq	.L44
	mov	r7, #4
	b	.L15
.L22:
	ldr	r3, .L57+24
	ldr	r3, [r3]
	tst	r10, r3
	beq	.L49
	ldr	r2, .L57+28
	ldr	r3, .L57+32
	ldr	r0, [r2]
	ldr	r1, [r3]
	mul	r0, r6, r0
	bl	__aeabi_idiv
	cmp	r5, r0
	blt	.L49
	mov	r5, r0
	str	r0, [r4, #20]
.L31:
	ldr	r3, .L57+56
	ldr	r3, [r3]
	str	r3, [r4, #4]
	b	.L19
.L52:
	ldr	r3, .L57+24
	ldr	r2, .L57+40
	ldr	r3, [r3]
	ldr	r2, [r2]
	orr	r3, r3, r2
	tst	r3, r10
	beq	.L9
	ldr	r2, .L57+44
	ldr	r3, .L57+48
	ldr	r0, [r2]
	ldr	r1, [r3]
	mul	r0, r8, r0
	bl	__aeabi_idiv
	cmp	r7, r0
	blt	.L9
	ldr	r3, .L57+12
	str	r0, [r4, #16]
	ldr	r3, [r3]
	str	r3, [r4, #12]
	b	.L36
.L25:
	ldr	r3, .L57+24
	ldr	r2, .L57+40
	ldr	r3, [r3]
	ldr	r2, [r2]
	orr	r3, r3, r2
	tst	r3, r10
	beq	.L48
	ldr	r2, .L57+44
	ldr	r3, .L57+48
	ldr	r0, [r2]
	ldr	r1, [r3]
	mul	r0, r8, r0
	bl	__aeabi_idiv
	cmp	r0, r7
	bgt	.L48
	ldr	r3, .L57+56
	str	r0, [r4, #16]
	ldr	r3, [r3]
	str	r3, [r4, #12]
	b	.L36
.L27:
	ldr	r3, .L57+12
	ldr	r3, [r3]
	str	r3, [r4, #4]
	b	.L19
.L58:
	.align	2
.L57:
	.word	H_EXP_OFF
	.word	ZOOM_X1
	.word	V_EXP_OFF
	.word	ZOOM_X4
	.word	debug
	.word	.LC0
	.word	V4L2_STD_625_50
	.word	VPBE_DISPLAY_V_EXP_RATIO_N
	.word	VPBE_DISPLAY_V_EXP_RATIO_D
	.word	V_EXP_6_OVER_5
	.word	V4L2_STD_525_60
	.word	VPBE_DISPLAY_H_EXP_RATIO_N
	.word	VPBE_DISPLAY_H_EXP_RATIO_D
	.word	H_EXP_9_OVER_8
	.word	ZOOM_X2
	.size	vpbe_disp_calculate_scale_factor, .-vpbe_disp_calculate_scale_factor
	.comm	debug,4,4
	.comm	ZOOM_X4,4,4
	.comm	ZOOM_X2,4,4
	.comm	ZOOM_X1,4,4
	.comm	V_EXP_OFF,4,4
	.comm	V_EXP_6_OVER_5,4,4
	.comm	VPBE_DISPLAY_V_EXP_RATIO_N,4,4
	.comm	VPBE_DISPLAY_V_EXP_RATIO_D,4,4
	.comm	VPBE_DISPLAY_H_EXP_RATIO_N,4,4
	.comm	VPBE_DISPLAY_H_EXP_RATIO_D,4,4
	.comm	V4L2_STD_625_50,4,4
	.comm	V4L2_STD_525_60,4,4
	.comm	H_EXP_OFF,4,4
	.comm	H_EXP_9_OVER_8,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
