	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dispc_ovl_set_scaling_common
_dispc_ovl_set_scaling_common:          ## @dispc_ovl_set_scaling_common
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	cmpq	%r9, %rcx
	setne	%r12b
	xorl	%r13d, %r13d
	cmpq	%r8, %rdx
	setne	%r13b
	movl	24(%rbp), %ebx
	xorl	%r14d, %r14d
	testl	%ebx, %ebx
	setne	%r14b
	movl	32(%rbp), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	16(%rbp), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_DISPC_COLOR_COMPONENT_RGB_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	48(%rbp), %r10d
	subq	$8, %rsp
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%r8, -88(%rbp)                  ## 8-byte Spill
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	pushq	%rax
	pushq	%r10
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	pushq	%rbx
	callq	_dispc_ovl_set_scale_param
	addq	$32, %rsp
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	movl	%r15d, %edi
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	callq	_DISPC_OVL_ATTRIBUTES
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_dispc_read_reg
	andl	$-2097249, %eax                 ## imm = 0xFFDFFF9F
	shll	$5, %r13d
	shll	$6, %r12d
	orl	%r13d, %r12d
	shll	$21, %r14d
	orl	%r12d, %r14d
	orl	%eax, %r14d
	movq	_FEAT_RESIZECONF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_dispc_has_feature
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	andl	$-385, %r14d                    ## imm = 0xFE7F
	xorl	%eax, %eax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	cmpq	-88(%rbp), %rcx                 ## 8-byte Folded Reload
	setg	%al
	shll	$7, %eax
	xorl	%ecx, %ecx
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	cmpq	%r12, %r13
	setg	%cl
	shll	$8, %ecx
	orl	%eax, %ecx
	orl	%ecx, %r14d
	jmp	LBB0_3
LBB0_1:
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	-64(%rbp), %r13                 ## 8-byte Reload
LBB0_3:
	xorl	%ebx, %ebx
	cmpl	$0, -104(%rbp)                  ## 4-byte Folded Reload
	setne	%bl
	movq	_FEAT_LINEBUFFERSPLIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_dispc_has_feature
	movl	%r14d, %ecx
	andl	$-4194305, %ecx                 ## imm = 0xFFBFFFFF
	shll	$22, %ebx
	orl	%ecx, %ebx
	testq	%rax, %rax
	cmovel	%r14d, %ebx
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edi
	callq	_DISPC_OVL_ATTRIBUTES
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_dispc_write_reg
	xorl	%ecx, %ecx
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_4
## %bb.5:
	movl	$0, %ebx
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_10
## %bb.6:
	shlq	$10, %r13
	movq	%r13, %rax
	orq	%r12, %rax
	shrq	$32, %rax
	je	LBB0_7
## %bb.8:
	movq	%r13, %rax
	cqto
	idivq	%r12
	jmp	LBB0_9
LBB0_4:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_7:
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%r12d
                                        ## kill: def $eax killed $eax def $rax
LBB0_9:
	movq	%rax, %rdx
	shrq	$63, %rdx
	addl	%eax, %edx
	shrl	%edx
	andl	$1023, %edx                     ## imm = 0x3FF
	leal	-512(%rdx), %ecx
	xorl	%ebx, %ebx
	cmpl	$512, %edx                      ## imm = 0x200
	setae	%bl
	cmovbl	%edx, %ecx
	shll	$9, %ebx
LBB0_10:
	movq	%r15, %rdi
	movl	%r14d, %esi
	xorl	%edx, %edx
	callq	_dispc_ovl_set_vid_accu0
	movq	%r15, %rdi
	movl	%r14d, %esi
	xorl	%edx, %edx
	movl	%ebx, %ecx
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dispc_ovl_set_vid_accu1        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DISPC_COLOR_COMPONENT_RGB_Y,4,2 ## @DISPC_COLOR_COMPONENT_RGB_Y
	.comm	_FEAT_RESIZECONF,4,2            ## @FEAT_RESIZECONF
	.comm	_FEAT_LINEBUFFERSPLIT,4,2       ## @FEAT_LINEBUFFERSPLIT
	.no_dead_strip	_dispc_ovl_set_scaling_common
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dispc_ovl_set_scaling_common
_dispc_ovl_set_scaling_common:          ; @dispc_ovl_set_scaling_common
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x7
	str	w6, [sp, #12]                   ; 4-byte Folded Spill
	mov	x21, x5
	mov	x25, x4
	mov	x22, x3
	mov	x26, x2
	mov	x19, x1
	mov	x20, x0
	cmp	x3, x5
	cset	w28, ne
	cmp	x2, x4
	cset	w27, ne
	cmp	w7, #0
	cset	w23, ne
	ldr	w8, [x29, #16]
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
	ldr	w7, [x29, #24]
Lloh0:
	adrp	x8, _DISPC_COLOR_COMPONENT_RGB_Y@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DISPC_COLOR_COMPONENT_RGB_Y@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp]
	mov	x6, x24
	bl	_dispc_ovl_set_scale_param
	mov	x0, x19
	bl	_DISPC_OVL_ATTRIBUTES
	mov	x1, x0
	mov	x0, x20
	bl	_dispc_read_reg
	mov	w8, #65439
	movk	w8, #65503, lsl #16
	and	w8, w0, w8
	lsl	w9, w27, #5
	bfi	w9, w28, #6, #1
	bfi	w9, w23, #21, #1
	orr	w23, w9, w8
Lloh3:
	adrp	x8, _FEAT_RESIZECONF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FEAT_RESIZECONF@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_dispc_has_feature
	and	w8, w23, #0xfffffe7f
	cmp	x26, x25
	cset	w9, gt
	lsl	w9, w9, #7
	cmp	x22, x21
	cset	w10, gt
	bfi	w9, w10, #8, #1
	orr	w8, w9, w8
	cmp	x0, #0
	csel	w23, w23, w8, eq
	cmp	w24, #0
	cset	w24, ne
Lloh6:
	adrp	x8, _FEAT_LINEBUFFERSPLIT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FEAT_LINEBUFFERSPLIT@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_dispc_has_feature
	mov	x8, x23
	bfi	w8, w24, #22, #1
	cmp	x0, #0
	csel	w24, w23, w8, eq
	mov	x0, x19
	bl	_DISPC_OVL_ATTRIBUTES
	mov	x1, x0
	mov	x0, x20
	mov	x2, x24
	bl	_dispc_write_reg
	mov	w3, #0
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_3
; %bb.1:
	mov	x23, x3
	ldr	w8, [sp, #8]                    ; 4-byte Folded Reload
	cbnz	w8, LBB0_4
; %bb.2:
	lsl	x8, x22, #10
	sdiv	x8, x8, x21
	cmp	x8, #0
	cinc	x8, x8, lt
	ubfx	w8, w8, #1, #10
	sub	w9, w8, #512
	cmp	w8, #511
	csel	w3, w9, w8, hi
	cset	w8, hi
	lsl	w23, w8, #9
	b	LBB0_4
LBB0_3:
	mov	x23, x3
LBB0_4:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_dispc_ovl_set_vid_accu0
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	mov	x3, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_dispc_ovl_set_vid_accu1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DISPC_COLOR_COMPONENT_RGB_Y,4,2 ; @DISPC_COLOR_COMPONENT_RGB_Y
	.comm	_FEAT_RESIZECONF,4,2            ; @FEAT_RESIZECONF
	.comm	_FEAT_LINEBUFFERSPLIT,4,2       ; @FEAT_LINEBUFFERSPLIT
	.no_dead_strip	_dispc_ovl_set_scaling_common
.subsections_via_symbols
