	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sun8i_ui_scaler_setup          ## -- Begin function sun8i_ui_scaler_setup
	.p2align	4, 0x90
_sun8i_ui_scaler_setup:                 ## @sun8i_ui_scaler_setup
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r14d
	movl	%r8d, %r15d
	movl	%ecx, %r12d
	movl	%edx, %r13d
	movl	%esi, %ebx
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	xorl	%edi, %edi
	cmpl	%esi, (%rax)
	setg	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	jne	LBB0_4
## %bb.1:
	movl	%r15d, -60(%rbp)                ## 4-byte Spill
	movl	40(%rbp), %r15d
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movl	32(%rbp), %r13d
	movl	24(%rbp), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
	movl	16(%rbp), %r12d
	movl	%r14d, -56(%rbp)                ## 4-byte Spill
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_sun8i_ui_scaler_base
	movq	_SUN8I_UI_SCALER_PHASE_FRAC@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	addb	$-16, %cl
	shll	%cl, %r13d
	movl	%r13d, -68(%rbp)                ## 4-byte Spill
	shll	%cl, %r15d
	movl	%r15d, -72(%rbp)                ## 4-byte Spill
	movq	_SUN8I_UI_SCALER_SCALE_FRAC@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	addb	$-16, %cl
	shll	%cl, %r12d
	movl	%r12d, -64(%rbp)                ## 4-byte Spill
	movl	%eax, %r12d
	shll	%cl, -44(%rbp)                  ## 4-byte Folded Spill
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_SUN8I_UI_SCALER_SIZE
	movl	%eax, %r15d
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	callq	_SUN8I_UI_SCALER_SIZE
	movl	%eax, %r13d
	movl	(%r14), %ebx
	movl	%r12d, %edi
	callq	_SUN8I_SCALER_GSU_OUTSIZE
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	%r13d, %edx
	callq	_regmap_write
	movl	(%r14), %ebx
	movl	%r12d, %edi
	callq	_SUN8I_SCALER_GSU_INSIZE
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	%r15d, %edx
	callq	_regmap_write
	movl	(%r14), %ebx
	movl	%r12d, %edi
	callq	_SUN8I_SCALER_GSU_HSTEP
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	-64(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edx
	callq	_regmap_write
	movl	(%r14), %ebx
	movl	%r12d, %edi
	callq	_SUN8I_SCALER_GSU_VSTEP
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_regmap_write
	movl	(%r14), %ebx
	movl	%r12d, %edi
	callq	_SUN8I_SCALER_GSU_HPHASE
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	callq	_regmap_write
	movl	(%r14), %ebx
	movl	%r12d, %edi
	callq	_SUN8I_SCALER_GSU_VPHASE
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	-72(%rbp), %edx                 ## 4-byte Reload
	callq	_regmap_write
	movl	%r15d, %edi
	callq	_sun8i_ui_scaler_coef_index
	movq	_SUN8I_UI_SCALER_COEFF_COUNT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ecx
	testl	%ecx, %ecx
	jle	LBB0_4
## %bb.2:
	imull	%eax, %ecx
	movslq	%ecx, %r14
	shlq	$2, %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r15d
	movl	%r12d, %edi
	movl	%ebx, %esi
	movl	%r12d, %r13d
	movq	%rdx, %r12
	callq	_SUN8I_SCALER_GSU_HCOEFF
	movq	_lan2coefftab16@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	%r14, %rcx
	movl	(%rcx,%rbx,4), %edx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_regmap_write
	movq	%r12, %rdx
	movl	%r13d, %r12d
	incq	%rbx
	movslq	(%rdx), %rax
	cmpq	%rax, %rbx
	jl	LBB0_3
LBB0_4:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SUN8I_UI_SCALER_PHASE_FRAC,4,2 ## @SUN8I_UI_SCALER_PHASE_FRAC
	.comm	_SUN8I_UI_SCALER_SCALE_FRAC,4,2 ## @SUN8I_UI_SCALER_SCALE_FRAC
	.comm	_SUN8I_UI_SCALER_COEFF_COUNT,4,2 ## @SUN8I_UI_SCALER_COEFF_COUNT
	.comm	_lan2coefftab16,8,3             ## @lan2coefftab16
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sun8i_ui_scaler_setup          ; -- Begin function sun8i_ui_scaler_setup
	.p2align	2
_sun8i_ui_scaler_setup:                 ; @sun8i_ui_scaler_setup
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x22, x6
	mov	x24, x5
	mov	x25, x4
	mov	x27, x3
	mov	x28, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
	cmp	w8, w1
	cset	w0, gt
	bl	_WARN_ON
	cbnz	x0, LBB0_4
; %bb.1:
	ldp	w23, w21, [x29, #16]
	mov	x0, x19
	mov	x1, x20
	bl	_sun8i_ui_scaler_base
	mov	x20, x0
Lloh0:
	adrp	x8, _SUN8I_UI_SCALER_PHASE_FRAC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SUN8I_UI_SCALER_PHASE_FRAC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sub	w8, w8, #16
	lsl	w23, w23, w8
	lsl	w21, w21, w8
Lloh3:
	adrp	x8, _SUN8I_UI_SCALER_SCALE_FRAC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SUN8I_UI_SCALER_SCALE_FRAC@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	sub	w8, w8, #16
	lsl	w22, w22, w8
	lsl	w26, w26, w8
	mov	x0, x28
	mov	x1, x27
	bl	_SUN8I_UI_SCALER_SIZE
	mov	x27, x0
	mov	x0, x25
	mov	x1, x24
	bl	_SUN8I_UI_SCALER_SIZE
	mov	x24, x0
	ldr	w25, [x19]
	mov	x0, x20
	bl	_SUN8I_SCALER_GSU_OUTSIZE
	mov	x1, x0
	mov	x0, x25
	mov	x2, x24
	bl	_regmap_write
	ldr	w24, [x19]
	mov	x0, x20
	bl	_SUN8I_SCALER_GSU_INSIZE
	mov	x1, x0
	mov	x0, x24
	mov	x2, x27
	bl	_regmap_write
	ldr	w24, [x19]
	mov	x0, x20
	bl	_SUN8I_SCALER_GSU_HSTEP
	mov	x1, x0
	mov	x0, x24
	mov	x2, x22
	bl	_regmap_write
	ldr	w24, [x19]
	mov	x0, x20
	bl	_SUN8I_SCALER_GSU_VSTEP
	mov	x1, x0
	mov	x0, x24
	mov	x2, x26
	bl	_regmap_write
	ldr	w24, [x19]
	mov	x0, x20
	bl	_SUN8I_SCALER_GSU_HPHASE
	mov	x1, x0
	mov	x0, x24
	mov	x2, x23
	bl	_regmap_write
	ldr	w23, [x19]
	mov	x0, x20
	bl	_SUN8I_SCALER_GSU_VPHASE
	mov	x1, x0
	mov	x0, x23
	mov	x2, x21
	bl	_regmap_write
	mov	x0, x22
	bl	_sun8i_ui_scaler_coef_index
Lloh6:
	adrp	x23, _SUN8I_UI_SCALER_COEFF_COUNT@GOTPAGE
Lloh7:
	ldr	x23, [x23, _SUN8I_UI_SCALER_COEFF_COUNT@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x21, #0
	mul	w8, w8, w0
	sbfiz	x24, x8, #2, #32
Lloh8:
	adrp	x25, _lan2coefftab16@GOTPAGE
Lloh9:
	ldr	x25, [x25, _lan2coefftab16@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w22, [x19]
	mov	x0, x20
	mov	x1, x21
	bl	_SUN8I_SCALER_GSU_HCOEFF
	mov	x1, x0
	ldr	x8, [x25]
	add	x8, x8, x24
	ldr	w2, [x8, x21, lsl #2]
	mov	x0, x22
	bl	_regmap_write
	add	x21, x21, #1
	ldrsw	x8, [x23]
	cmp	x21, x8
	b.lt	LBB0_3
LBB0_4:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_SUN8I_UI_SCALER_PHASE_FRAC,4,2 ; @SUN8I_UI_SCALER_PHASE_FRAC
	.comm	_SUN8I_UI_SCALER_SCALE_FRAC,4,2 ; @SUN8I_UI_SCALER_SCALE_FRAC
	.comm	_SUN8I_UI_SCALER_COEFF_COUNT,4,2 ; @SUN8I_UI_SCALER_COEFF_COUNT
	.comm	_lan2coefftab16,8,3             ; @lan2coefftab16
.subsections_via_symbols
