	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vpbe_disp_calculate_scale_factor
_vpbe_disp_calculate_scale_factor:      ## @vpbe_disp_calculate_scale_factor
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r9d
	movq	(%rdi), %r10
	movl	4(%r10), %r11d
	movl	40(%rsi), %ebx
	movl	44(%rsi), %r14d
	movq	_ZOOM_X1@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%rsi)
	movq	%rax, 8(%rsi)
	movq	_H_EXP_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rsi)
	movq	_V_EXP_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsi)
	cmpl	%edx, %ebx
	jge	LBB0_13
## %bb.1:
	movl	8(%r10), %eax
	cltd
	idivl	%ebx
	xorl	%edi, %edi
	cmpl	$4, %eax
	setae	%dil
	movl	%eax, %r12d
	andl	$-2, %r12d
	cmpl	$2, %eax
	setge	%al
	leal	2(%rdi,%rdi), %edx
	movl	$1, %r8d
	cmovgel	%edx, %r8d
	andb	%al, %dil
	imull	%ebx, %r8d
	movl	%r8d, 32(%rsi)
	movb	$1, %r15b
	cmpl	%r9d, %r8d
	jge	LBB0_6
## %bb.2:
	movq	_V4L2_STD_525_60@GOTPCREL(%rip), %rax
	testl	%r11d, (%rax)
	jne	LBB0_4
## %bb.3:
	movq	_V4L2_STD_625_50@GOTPCREL(%rip), %rax
	testl	%r11d, (%rax)
	je	LBB0_6
LBB0_4:
	movq	_VPBE_DISPLAY_H_EXP_RATIO_N@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%r8d, %eax
	movq	_VPBE_DISPLAY_H_EXP_RATIO_D@GOTPCREL(%rip), %rbx
	cltd
	idivl	(%rbx)
	cmpl	%r9d, %eax
	jg	LBB0_6
## %bb.5:
	movl	%eax, 32(%rsi)
	xorl	%r15d, %r15d
	movl	%eax, %r8d
LBB0_6:
	cmpl	$2, %r12d
	sete	%al
	orb	%dil, %al
	cmpb	$1, %al
	je	LBB0_7
## %bb.11:
	testb	%r15b, %r15b
	je	LBB0_12
LBB0_14:
	cmpl	%ecx, %r14d
	jge	LBB0_26
LBB0_15:
	movl	%ecx, %eax
	cltd
	idivl	%r14d
	xorl	%ebx, %ebx
	cmpl	$4, %eax
	setae	%bl
	movl	%eax, %edi
	andl	$-2, %edi
	cmpl	$2, %eax
	setge	%al
	leal	2(%rbx,%rbx), %edx
	movl	$1, %r9d
	cmovgel	%edx, %r9d
	andb	%al, %bl
	imull	%r14d, %r9d
	movl	%r9d, 36(%rsi)
	movb	$1, %r14b
	cmpl	%ecx, %r9d
	jge	LBB0_19
## %bb.16:
	movq	_V4L2_STD_625_50@GOTPCREL(%rip), %rax
	testl	%r11d, (%rax)
	je	LBB0_19
## %bb.17:
	movq	_VPBE_DISPLAY_V_EXP_RATIO_N@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%r9d, %eax
	movq	_VPBE_DISPLAY_V_EXP_RATIO_D@GOTPCREL(%rip), %r11
	cltd
	idivl	(%r11)
	cmpl	%ecx, %eax
	jg	LBB0_19
## %bb.18:
	movl	%eax, 36(%rsi)
	xorl	%r14d, %r14d
	movl	%eax, %r9d
LBB0_19:
	cmpl	$2, %edi
	sete	%al
	orb	%bl, %al
	cmpb	$1, %al
	jne	LBB0_24
## %bb.20:
	cmpl	$2, %edi
	jne	LBB0_21
## %bb.22:
	movq	_ZOOM_X2@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_13:
	movl	%r9d, 32(%rsi)
	movl	%r9d, %r8d
	cmpl	%ecx, %r14d
	jl	LBB0_15
LBB0_26:
	movl	%ecx, 36(%rsi)
	movl	%ecx, %r9d
	jmp	LBB0_27
LBB0_7:
	cmpl	$2, %r12d
	jne	LBB0_8
## %bb.9:
	movq	_ZOOM_X2@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_21:
	movq	_ZOOM_X4@GOTPCREL(%rip), %rax
LBB0_23:
	movq	(%rax), %rax
	movq	%rax, 8(%rsi)
LBB0_24:
	testb	%r14b, %r14b
	jne	LBB0_27
## %bb.25:
	movq	_V_EXP_6_OVER_5@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsi)
LBB0_27:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%r10, %rdx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_v4l2_dbg                       ## TAILCALL
LBB0_8:
	movq	_ZOOM_X4@GOTPCREL(%rip), %rax
LBB0_10:
	movq	(%rax), %rax
	movq	%rax, 24(%rsi)
	testb	%r15b, %r15b
	jne	LBB0_14
LBB0_12:
	movq	_H_EXP_9_OVER_8@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rsi)
	cmpl	%ecx, %r14d
	jl	LBB0_15
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_ZOOM_X1,8,3                    ## @ZOOM_X1
	.comm	_H_EXP_OFF,4,2                  ## @H_EXP_OFF
	.comm	_V_EXP_OFF,4,2                  ## @V_EXP_OFF
	.comm	_V4L2_STD_525_60,4,2            ## @V4L2_STD_525_60
	.comm	_V4L2_STD_625_50,4,2            ## @V4L2_STD_625_50
	.comm	_VPBE_DISPLAY_H_EXP_RATIO_N,4,2 ## @VPBE_DISPLAY_H_EXP_RATIO_N
	.comm	_VPBE_DISPLAY_H_EXP_RATIO_D,4,2 ## @VPBE_DISPLAY_H_EXP_RATIO_D
	.comm	_ZOOM_X2,8,3                    ## @ZOOM_X2
	.comm	_ZOOM_X4,8,3                    ## @ZOOM_X4
	.comm	_H_EXP_9_OVER_8,4,2             ## @H_EXP_9_OVER_8
	.comm	_VPBE_DISPLAY_V_EXP_RATIO_N,4,2 ## @VPBE_DISPLAY_V_EXP_RATIO_N
	.comm	_VPBE_DISPLAY_V_EXP_RATIO_D,4,2 ## @VPBE_DISPLAY_V_EXP_RATIO_D
	.comm	_V_EXP_6_OVER_5,4,2             ## @V_EXP_6_OVER_5
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"crop display xsize = %d, ysize = %d\n"

	.no_dead_strip	_vpbe_disp_calculate_scale_factor
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vpbe_disp_calculate_scale_factor
_vpbe_disp_calculate_scale_factor:      ; @vpbe_disp_calculate_scale_factor
	.cfi_startproc
; %bb.0:
	mov	x8, x2
	ldr	x2, [x0]
	ldr	w9, [x2, #4]
	ldp	w13, w10, [x1, #40]
Lloh0:
	adrp	x11, _ZOOM_X1@GOTPAGE
Lloh1:
	ldr	x11, [x11, _ZOOM_X1@GOTPAGEOFF]
Lloh2:
	ldr	x11, [x11]
	str	x11, [x1, #24]
	str	x11, [x1, #8]
Lloh3:
	adrp	x11, _H_EXP_OFF@GOTPAGE
Lloh4:
	ldr	x11, [x11, _H_EXP_OFF@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	str	w11, [x1, #16]
Lloh6:
	adrp	x11, _V_EXP_OFF@GOTPAGE
Lloh7:
	ldr	x11, [x11, _V_EXP_OFF@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
	str	w11, [x1]
	cmp	w13, w8
	b.ge	LBB0_6
; %bb.1:
	ldr	w11, [x2, #8]
	sdiv	w14, w11, w13
	cmp	w14, #1
	cset	w12, gt
	mov	w11, #2
	mov	w15, #4
	cmp	w14, #3
	csel	w15, w15, w11, hi
	cset	w16, hi
	and	w11, w14, #0xfffffffe
	and	w12, w16, w12
	cmp	w14, #2
	csinc	w14, w15, wzr, ge
	mul	w4, w14, w13
	str	w4, [x1, #32]
	cmp	w4, w8
	b.ge	LBB0_5
; %bb.2:
Lloh9:
	adrp	x13, _V4L2_STD_525_60@GOTPAGE
Lloh10:
	ldr	x13, [x13, _V4L2_STD_525_60@GOTPAGEOFF]
Lloh11:
	ldr	w13, [x13]
	tst	w13, w9
	b.ne	LBB0_4
; %bb.3:
Lloh12:
	adrp	x13, _V4L2_STD_625_50@GOTPAGE
Lloh13:
	ldr	x13, [x13, _V4L2_STD_625_50@GOTPAGEOFF]
Lloh14:
	ldr	w13, [x13]
	tst	w13, w9
	b.eq	LBB0_5
LBB0_4:
Lloh15:
	adrp	x13, _VPBE_DISPLAY_H_EXP_RATIO_N@GOTPAGE
Lloh16:
	ldr	x13, [x13, _VPBE_DISPLAY_H_EXP_RATIO_N@GOTPAGEOFF]
Lloh17:
	ldr	w13, [x13]
	mul	w13, w13, w4
Lloh18:
	adrp	x14, _VPBE_DISPLAY_H_EXP_RATIO_D@GOTPAGE
Lloh19:
	ldr	x14, [x14, _VPBE_DISPLAY_H_EXP_RATIO_D@GOTPAGEOFF]
Lloh20:
	ldr	w14, [x14]
	sdiv	w13, w13, w14
	cmp	w13, w8
	b.le	LBB0_8
LBB0_5:
	mov	w8, #1
	b	LBB0_9
LBB0_6:
	str	w8, [x1, #32]
	mov	x4, x8
	cmp	w10, w3
	b.lt	LBB0_14
LBB0_7:
	str	w3, [x1, #36]
	mov	x5, x3
	b	LBB0_22
LBB0_8:
	mov	w8, #0
	str	w13, [x1, #32]
	mov	x4, x13
LBB0_9:
	cmp	w11, #2
	cset	w13, eq
	orr	w12, w13, w12
	cmp	w12, #1
	b.ne	LBB0_12
; %bb.10:
Lloh21:
	adrp	x12, _ZOOM_X2@GOTPAGE
Lloh22:
	ldr	x12, [x12, _ZOOM_X2@GOTPAGEOFF]
Lloh23:
	adrp	x13, _ZOOM_X4@GOTPAGE
Lloh24:
	ldr	x13, [x13, _ZOOM_X4@GOTPAGEOFF]
	cmp	w11, #2
	csel	x11, x12, x13, eq
	ldr	x11, [x11]
	str	x11, [x1, #24]
	tbnz	w8, #0, LBB0_13
LBB0_11:
Lloh25:
	adrp	x8, _H_EXP_9_OVER_8@GOTPAGE
Lloh26:
	ldr	x8, [x8, _H_EXP_9_OVER_8@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	str	w8, [x1, #16]
	cmp	w10, w3
	b.lt	LBB0_14
	b	LBB0_7
LBB0_12:
	tbz	w8, #0, LBB0_11
LBB0_13:
	cmp	w10, w3
	b.ge	LBB0_7
LBB0_14:
	sdiv	w12, w3, w10
	cmp	w12, #1
	cset	w11, gt
	mov	w8, #2
	mov	w13, #4
	cmp	w12, #3
	csel	w13, w13, w8, hi
	cset	w14, hi
	and	w8, w12, #0xfffffffe
	and	w11, w14, w11
	cmp	w12, #2
	csinc	w12, w13, wzr, ge
	mul	w5, w12, w10
	str	w5, [x1, #36]
	cmp	w5, w3
	b.ge	LBB0_17
; %bb.15:
Lloh28:
	adrp	x10, _V4L2_STD_625_50@GOTPAGE
Lloh29:
	ldr	x10, [x10, _V4L2_STD_625_50@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_17
; %bb.16:
Lloh31:
	adrp	x9, _VPBE_DISPLAY_V_EXP_RATIO_N@GOTPAGE
Lloh32:
	ldr	x9, [x9, _VPBE_DISPLAY_V_EXP_RATIO_N@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	mul	w9, w9, w5
Lloh34:
	adrp	x10, _VPBE_DISPLAY_V_EXP_RATIO_D@GOTPAGE
Lloh35:
	ldr	x10, [x10, _VPBE_DISPLAY_V_EXP_RATIO_D@GOTPAGEOFF]
Lloh36:
	ldr	w10, [x10]
	sdiv	w10, w9, w10
	cmp	w10, w3
	b.le	LBB0_23
LBB0_17:
	mov	w9, #1
LBB0_18:
	cmp	w8, #2
	cset	w10, eq
	orr	w10, w10, w11
	cmp	w10, #1
	b.ne	LBB0_20
; %bb.19:
Lloh37:
	adrp	x10, _ZOOM_X2@GOTPAGE
Lloh38:
	ldr	x10, [x10, _ZOOM_X2@GOTPAGEOFF]
Lloh39:
	adrp	x11, _ZOOM_X4@GOTPAGE
Lloh40:
	ldr	x11, [x11, _ZOOM_X4@GOTPAGEOFF]
	cmp	w8, #2
	csel	x8, x10, x11, eq
	ldr	x8, [x8]
	str	x8, [x1, #8]
LBB0_20:
	tbnz	w9, #0, LBB0_22
; %bb.21:
Lloh41:
	adrp	x8, _V_EXP_6_OVER_5@GOTPAGE
Lloh42:
	ldr	x8, [x8, _V_EXP_6_OVER_5@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	str	w8, [x1]
LBB0_22:
Lloh44:
	adrp	x8, _debug@GOTPAGE
Lloh45:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
Lloh47:
	adrp	x3, l_.str@PAGE
Lloh48:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	b	_v4l2_dbg
LBB0_23:
	mov	w9, #0
	str	w10, [x1, #36]
	mov	x5, x10
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_ZOOM_X1,8,3                    ; @ZOOM_X1
	.comm	_H_EXP_OFF,4,2                  ; @H_EXP_OFF
	.comm	_V_EXP_OFF,4,2                  ; @V_EXP_OFF
	.comm	_V4L2_STD_525_60,4,2            ; @V4L2_STD_525_60
	.comm	_V4L2_STD_625_50,4,2            ; @V4L2_STD_625_50
	.comm	_VPBE_DISPLAY_H_EXP_RATIO_N,4,2 ; @VPBE_DISPLAY_H_EXP_RATIO_N
	.comm	_VPBE_DISPLAY_H_EXP_RATIO_D,4,2 ; @VPBE_DISPLAY_H_EXP_RATIO_D
	.comm	_ZOOM_X2,8,3                    ; @ZOOM_X2
	.comm	_ZOOM_X4,8,3                    ; @ZOOM_X4
	.comm	_H_EXP_9_OVER_8,4,2             ; @H_EXP_9_OVER_8
	.comm	_VPBE_DISPLAY_V_EXP_RATIO_N,4,2 ; @VPBE_DISPLAY_V_EXP_RATIO_N
	.comm	_VPBE_DISPLAY_V_EXP_RATIO_D,4,2 ; @VPBE_DISPLAY_V_EXP_RATIO_D
	.comm	_V_EXP_6_OVER_5,4,2             ; @V_EXP_6_OVER_5
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"crop display xsize = %d, ysize = %d\n"

	.no_dead_strip	_vpbe_disp_calculate_scale_factor
.subsections_via_symbols
