	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dispc_ovl_calc_scaling_24xx
_dispc_ovl_calc_scaling_24xx:           ## @dispc_ovl_calc_scaling_24xx
	.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, -56(%rbp)                 ## 4-byte Spill
	movl	%r8d, -52(%rbp)                 ## 4-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	72(%rbp), %r13
	movq	64(%rbp), %r12
	movq	40(%rbp), %r14
	movl	(%r12), %edi
	movl	(%r13), %esi
	callq	_min
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	(%r15), %rbx
	movl	(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	$0, (%r14)
	movl	(%r13), %edi
	movl	(%r12), %esi
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	cltd
	idivl	%edi
	movl	%eax, %ecx
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cltd
	idivl	%esi
	movl	%eax, %r13d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	movl	%ecx, %edx
	movl	16(%rbp), %ecx
	movl	24(%rbp), %r8d
	movl	96(%rbp), %r9d
	callq	*8(%rbx)
	movq	%rax, %r14
	movq	88(%rbp), %rax
	movq	%r14, (%rax)
	cmpl	-44(%rbp), %r13d                ## 4-byte Folded Reload
	jg	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	testq	%r14, %r14
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %rdi
	callq	_dispc_core_clk_rate
	cmpq	%rax, %r14
	jbe	LBB0_4
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r12), %edi
	movq	72(%rbp), %rbx
	movl	(%rbx), %esi
	cmpl	%esi, %edi
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r12)
	movl	(%rbx), %eax
	movq	%rbx, %rdx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	callq	_swap
	movl	(%r12), %eax
	movb	$1, %cl
	movq	%r12, %rdx
	cmpl	(%rbx), %eax
	jge	LBB0_9
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	incl	%eax
	movl	%eax, (%rdx)
	movb	$1, %cl
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	xorl	%ecx, %ecx
	movq	72(%rbp), %rbx
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r12), %esi
	movq	48(%rbp), %rax
	cmpl	(%rax), %esi
	jg	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	(%rbx), %edi
	movq	56(%rbp), %rax
	cmpl	(%rax), %edi
	setg	%al
	movl	%ecx, %edx
	xorb	$1, %dl
	orb	%al, %dl
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r15), %rbx
	jmp	LBB0_1
LBB0_12:
	cmpl	-44(%rbp), %r13d                ## 4-byte Folded Reload
	setg	%dl
	orb	%cl, %dl
	xorl	%eax, %eax
	cmpb	$1, %dl
	jne	LBB0_14
## %bb.13:
	leaq	L_.str(%rip), %rax
	leaq	L_.str.1(%rip), %rdi
	testb	%cl, %cl
	cmovneq	%rax, %rdi
	callq	_DSSERR
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to find scaling settings\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Cannot scale max input width exceeded\n"

	.no_dead_strip	_dispc_ovl_calc_scaling_24xx
.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_24xx
_dispc_ovl_calc_scaling_24xx:           ; @dispc_ovl_calc_scaling_24xx
	.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
	stp	w6, w7, [sp, #24]               ; 8-byte Folded Spill
	stp	w4, w5, [sp, #16]               ; 8-byte Folded Spill
	str	x1, [sp, #8]                    ; 8-byte Folded Spill
	mov	x24, x0
	ldr	w25, [x29, #80]
	ldr	x26, [x29, #72]
	ldp	x20, x19, [x29, #48]
	ldp	x22, x21, [x29, #32]
	ldr	x27, [x29, #24]
	ldr	w0, [x20]
	ldr	w1, [x19]
	bl	_min
	str	w0, [sp, #4]                    ; 4-byte Folded Spill
	ldr	x9, [x24]
	ldr	w23, [x9]
	str	wzr, [x27]
	ldr	w10, [x19]
	ldr	w8, [x20]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w11, w3, [sp, #20]              ; 8-byte Folded Reload
	sdiv	w2, w11, w10
	ldr	x9, [x9, #8]
	ldr	w10, [sp, #16]                  ; 4-byte Folded Reload
	sdiv	w27, w10, w8
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x1, x27
	ldr	w4, [sp, #28]                   ; 4-byte Folded Reload
	mov	x5, x25
	blr	x9
	str	x0, [x26]
	cmp	w27, w23
	b.gt	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x28, x0
	cbz	x0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x24
	bl	_dispc_core_clk_rate
	cmp	x28, x0
	b.ls	LBB0_9
LBB0_4:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [x20]
	ldr	w1, [x19]
	cmp	w0, w1
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	str	w8, [x20]
	ldr	w8, [x19]
	mov	x9, x19
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_1 Depth=1
	bl	_swap
	ldr	w8, [x20]
	ldr	w10, [x19]
	mov	x9, x20
	cmp	w8, w10
	b.ge	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_1 Depth=1
	add	w8, w8, #1
	str	w8, [x9]
LBB0_8:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	w9, #1
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	w9, #0
LBB0_10:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x20]
	ldr	w10, [x22]
	cmp	w8, w10
	b.gt	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_1 Depth=1
	ldr	w10, [x19]
	ldr	w11, [x21]
	cmp	w10, w11
	cset	w11, gt
	eor	w12, w9, #0x1
	orr	w11, w12, w11
	tbnz	w11, #0, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_1 Depth=1
	ldr	x9, [x24]
	b	LBB0_1
LBB0_13:
	cmp	w27, w23
	cset	w8, gt
	orr	w8, w9, w8
	cmp	w8, #1
	b.ne	LBB0_15
; %bb.14:
Lloh0:
	adrp	x8, l_.str.1@PAGE
Lloh1:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh2:
	adrp	x10, l_.str@PAGE
Lloh3:
	add	x10, x10, l_.str@PAGEOFF
	cmp	w9, #0
	csel	x0, x10, x8, ne
	bl	_DSSERR
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_16
LBB0_15:
	mov	w0, #0
LBB0_16:
	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
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to find scaling settings\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Cannot scale max input width exceeded\n"

	.no_dead_strip	_dispc_ovl_calc_scaling_24xx
.subsections_via_symbols
