	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dispc_ovl_calc_scaling_44xx
_dispc_ovl_calc_scaling_44xx:           ## @dispc_ovl_calc_scaling_44xx
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %eax
	movl	%r8d, %r13d
	movq	64(%rbp), %r15
	movq	72(%rbp), %rcx
	movl	(%r15), %ebx
	cltd
	idivl	(%rcx)
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	16(%rbp), %ecx
	movq	(%rdi), %rax
	movl	(%rax), %r14d
	cmpl	$0, 96(%rbp)
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	movl	4(%rax), %esi
	movl	%ecx, %r12d
	imull	%ecx, %esi
	jmp	LBB0_3
LBB0_2:
	movq	%rsi, %r12
	callq	_dispc_core_clk_rate
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r12d, %edi
	movl	16(%rbp), %esi
	movl	%esi, %r12d
	callq	_DIV_ROUND_UP
	movl	%eax, %ecx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cltd
	idivl	%ecx
	movl	%eax, %esi
LBB0_3:
	movl	%r13d, %edi
	callq	_DIV_ROUND_UP
	cmpl	%ebx, %eax
	cmovgl	%eax, %ebx
	movl	%ebx, (%r15)
	movq	48(%rbp), %r8
	cmpl	(%r8), %ebx
	jle	LBB0_4
## %bb.6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_19
LBB0_4:
	movl	%r13d, %eax
	cltd
	idivl	%ebx
	cmpl	%r14d, %eax
	setg	%cl
	jle	LBB0_5
## %bb.7:
	incl	%ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %esi
	movl	%ebx, (%r15)
	subl	$1, %esi
	jb	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	%r13d, %eax
	cltd
	idivl	%ebx
	cmpl	%r14d, %eax
	setg	%cl
	incl	%ebx
	cmpl	(%r8), %esi
	jge	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	%r14d, %eax
	jg	LBB0_8
LBB0_11:
	decl	%ebx
	testb	%cl, %cl
	jne	LBB0_13
LBB0_15:
	cmpl	$5, %ebx
	jl	LBB0_18
## %bb.16:
	movq	32(%rbp), %rcx
	movq	_DRM_FORMAT_NV12@GOTPCREL(%rip), %rdx
	cmpq	%rcx, (%rdx)
	je	LBB0_18
## %bb.17:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DSSERR
	jmp	LBB0_14
LBB0_5:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	testb	%cl, %cl
	je	LBB0_15
LBB0_13:
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DSSERR
LBB0_14:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_19
LBB0_18:
	movq	88(%rbp), %r14
	movl	24(%rbp), %r8d
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rbx
	movl	%eax, %esi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%r12d, %ecx
	movl	96(%rbp), %r9d
	callq	*8(%rbx)
	movq	%rax, (%r14)
	xorl	%r14d, %r14d
LBB0_19:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot scale width exceeds max line width\n"

	.comm	_DRM_FORMAT_NV12,8,3            ## @DRM_FORMAT_NV12
L_.str.1:                               ## @.str.1
	.asciz	"Not enough bandwidth, too much downscaling (x-decimation factor %d > 4)\n"

	.no_dead_strip	_dispc_ovl_calc_scaling_44xx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dispc_ovl_calc_scaling_44xx
_dispc_ovl_calc_scaling_44xx:           ; @dispc_ovl_calc_scaling_44xx
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x26, x7
	mov	x20, x6
	mov	x23, x5
	mov	x25, x4
	mov	x24, x1
	ldr	w21, [x29, #80]
	ldr	x28, [x29, #32]
	ldp	x19, x8, [x29, #48]
	ldr	w27, [x19]
	ldr	w8, [x8]
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	ldr	x8, [x0]
	ldr	w22, [x8]
	str	x0, [sp, #24]                   ; 8-byte Folded Spill
	cbz	w21, LBB0_2
; %bb.1:
	ldr	w8, [x8, #4]
	mul	w1, w8, w20
	b	LBB0_3
LBB0_2:
	bl	_dispc_core_clk_rate
	str	w23, [sp, #16]                  ; 4-byte Folded Spill
	mov	x23, x26
	mov	x26, x0
	mov	x0, x24
	mov	x1, x20
	bl	_DIV_ROUND_UP
	sdiv	w1, w26, w0
	mov	x26, x23
	ldr	w23, [sp, #16]                  ; 4-byte Folded Reload
LBB0_3:
	mov	x0, x25
	bl	_DIV_ROUND_UP
	cmp	w0, w27
	csel	w8, w0, w27, gt
	str	w8, [x19]
	ldr	w9, [x28]
	cmp	w8, w9
	b.gt	LBB0_16
; %bb.4:
	sdiv	w1, w25, w8
	cmp	w1, w22
	cset	w9, gt
	b.le	LBB0_10
; %bb.5:
	add	w8, w8, #1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	str	w8, [x19]
	cbz	w8, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	sub	w10, w8, #1
	ldr	w11, [x28]
	sdiv	w1, w25, w8
	cmp	w1, w22
	cset	w9, gt
	add	w8, w8, #1
	cmp	w10, w11
	b.ge	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w1, w22
	b.gt	LBB0_6
LBB0_9:
	sub	w8, w8, #1
LBB0_10:
	cbz	w9, LBB0_12
LBB0_11:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_15
LBB0_12:
	cmp	w8, #5
	b.lt	LBB0_18
; %bb.13:
	ldr	x9, [x29, #16]
Lloh2:
	adrp	x10, _DRM_FORMAT_NV12@GOTPAGE
Lloh3:
	ldr	x10, [x10, _DRM_FORMAT_NV12@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
	cmp	x10, x9
	b.eq	LBB0_18
; %bb.14:
	str	x8, [sp]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_15:
	bl	_DSSERR
LBB0_16:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_18:
	ldr	x19, [x29, #72]
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
	ldr	x8, [x8, #8]
	ldr	w9, [sp, #20]                   ; 4-byte Folded Reload
	sdiv	w2, w23, w9
	mov	x0, x24
	mov	x3, x20
	mov	x4, x26
	mov	x5, x21
	blr	x8
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19]
	b	LBB0_17
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot scale width exceeds max line width\n"

	.comm	_DRM_FORMAT_NV12,8,3            ; @DRM_FORMAT_NV12
l_.str.1:                               ; @.str.1
	.asciz	"Not enough bandwidth, too much downscaling (x-decimation factor %d > 4)\n"

	.no_dead_strip	_dispc_ovl_calc_scaling_44xx
.subsections_via_symbols
