	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun8i_vi_layer_update_coord
_sun8i_vi_layer_update_coord:           ## @sun8i_vi_layer_update_coord
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -140(%rbp)                ## 4-byte Spill
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	%rcx, -120(%rbp)                ## 8-byte Spill
	movq	(%rcx), %r12
	movq	24(%r12), %rax
	movq	(%rax), %r13
	leaq	L_.str(%rip), %rdi
	movl	%edx, -96(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	movq	%rbx, %rdi
	callq	_sun8i_blender_base
	movl	%eax, -136(%rbp)                ## 4-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	%r14d, -100(%rbp)               ## 4-byte Spill
	movl	%r14d, %esi
	callq	_sun8i_channel_base
	movl	%eax, -108(%rbp)                ## 4-byte Spill
	leaq	16(%r12), %rbx
	movq	%rbx, %rdi
	callq	_drm_rect_width
	movl	%eax, %r15d
	sarl	$16, %r15d
	movq	%rbx, %rdi
	callq	_drm_rect_height
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_drm_rect_width
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	callq	_drm_rect_height
	movl	16(%r12), %ecx
	movq	%r12, -160(%rbp)                ## 8-byte Spill
	movl	20(%r12), %edi
	movzwl	%cx, %esi
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movl	(%r13), %edx
	cmpl	$2, %edx
	jl	LBB0_2
## %bb.1:
	leal	-1(%rdx), %ebx
	sarl	$16, %ecx
	andl	%ebx, %ecx
	addl	%ecx, %r15d
	negl	%edx
	andl	%r15d, %edx
	shll	$16, %ecx
	orl	%esi, %ecx
	movl	%ecx, %esi
	movl	%edx, %r15d
LBB0_2:
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	movl	%r14d, %ebx
	sarl	$16, %ebx
	movzwl	%di, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	4(%rcx), %ecx
	cmpl	$2, %ecx
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, -152(%rbp)                ## 8-byte Spill
	jl	LBB0_3
## %bb.4:
	leal	-1(%rcx), %eax
	sarl	$16, %edi
	andl	%eax, %edi
	addl	%edi, %ebx
	negl	%ecx
	andl	%ebx, %ecx
	shll	$16, %edi
	orl	%edx, %edi
	movl	%edi, %eax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	movl	%ecx, %ebx
	jmp	LBB0_5
LBB0_3:
	movq	%rdx, -128(%rbp)                ## 8-byte Spill
LBB0_5:
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_SUN8I_MIXER_SIZE
	movl	%eax, %r13d
	movl	%r12d, %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_SUN8I_MIXER_SIZE
	movl	%eax, -104(%rbp)                ## 4-byte Spill
	movq	-160(%rbp), %rcx                ## 8-byte Reload
	movswl	18(%rcx), %eax
	movl	$0, -80(%rbp)                   ## 4-byte Folded Spill
	xorl	%esi, %esi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	subl	(%r14), %esi
	andl	%eax, %esi
	movswl	22(%rcx), %eax
	xorl	%edx, %edx
	subl	4(%r14), %edx
	andl	%eax, %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	leaq	L_.str.2(%rip), %rdi
	movl	%r15d, -132(%rbp)               ## 4-byte Spill
	movl	%r15d, %esi
	movl	%ebx, -84(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movl	(%r15), %ebx
	movl	-108(%rbp), %r12d               ## 4-byte Reload
	movl	%r12d, %edi
	movl	-96(%rbp), %esi                 ## 4-byte Reload
	callq	_SUN8I_MIXER_CHAN_VI_LAYER_SIZE
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	%r13d, %edx
	callq	_regmap_write
	movl	(%r15), %ebx
	movl	%r12d, %edi
	callq	_SUN8I_MIXER_CHAN_VI_OVL_SIZE
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	%r13d, %edx
	callq	_regmap_write
	movb	$1, %dl
	cmpl	$1, (%r14)
	movq	-152(%rbp), %rcx                ## 8-byte Reload
	jg	LBB0_10
## %bb.6:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %eax
	cmpl	$2, %eax
	setge	%dl
	cmpl	-104(%rbp), %r13d               ## 4-byte Folded Reload
	jne	LBB0_10
## %bb.7:
	cmpl	$1, %eax
	jg	LBB0_10
## %bb.8:
	testl	%ecx, %ecx
	jne	LBB0_10
## %bb.9:
	cmpl	$0, -128(%rbp)                  ## 4-byte Folded Reload
	jne	LBB0_10
## %bb.19:
	leaq	L_.str.6(%rip), %rdi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	movl	$0, -80(%rbp)                   ## 4-byte Folded Spill
	xorl	%eax, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%r15, %r14
	movl	$0, -76(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -120(%rbp)                  ## 4-byte Folded Spill
	movl	-100(%rbp), %r12d               ## 4-byte Reload
	jmp	LBB0_20
LBB0_10:
	movl	%edx, %r14d
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	movq	-120(%rbp), %rax                ## 8-byte Reload
	movq	(%rax), %rax
	movq	8(%rax), %rax
	movq	(%rax), %r13
	imull	$1000, (%r13), %eax             ## imm = 0x3E8
	movl	8(%r13), %ecx
	imull	4(%r13), %ecx
	cltd
	idivl	%ecx
	movl	%eax, %ebx
	movl	16(%r15), %edi
	callq	_clk_get_rate
                                        ## kill: def $eax killed $eax def $rax
	shll	$4, %eax
	leal	(%rax,%rax,4), %r12d
	imull	12(%r13), %ebx
	movl	-132(%rbp), %r15d               ## 4-byte Reload
	movl	%r15d, %edi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	callq	_max
	imull	%eax, %ebx
	movl	%r12d, %edi
	movl	%ebx, %esi
	callq	_do_div
	movl	-84(%rbp), %r13d                ## 4-byte Reload
	imull	$100, %r13d, %eax
	cltd
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	idivl	%r9d
	cmpl	%eax, %r12d
	jae	LBB0_11
## %bb.12:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	imull	%r9d, %r12d
	movslq	%r12d, %rax
	imulq	$1374389535, %rax, %rcx         ## imm = 0x51EB851F
	movq	%rcx, %rax
	shrq	$63, %rax
	sarq	$37, %rcx
	addl	%eax, %ecx
	movl	%r13d, -80(%rbp)                ## 4-byte Spill
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movl	%ecx, %eax
	movl	%ecx, -84(%rbp)                 ## 4-byte Spill
	jmp	LBB0_13
LBB0_11:
	xorl	%eax, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
LBB0_13:
	movl	$2048, %ebx                     ## imm = 0x800
	testb	%r14b, %r14b
	movl	-60(%rbp), %r8d                 ## 4-byte Reload
	movl	-100(%rbp), %r12d               ## 4-byte Reload
	je	LBB0_15
## %bb.14:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	(%rax), %ebx
LBB0_15:
	cmpl	%ebx, %r15d
	jbe	LBB0_16
## %bb.17:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	movl	%r8d, %r14d
	callq	_DRM_DEBUG_DRIVER
	movl	%r14d, %r8d
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	movl	%r15d, -76(%rbp)                ## 4-byte Spill
	movl	%ebx, %r15d
	jmp	LBB0_18
LBB0_16:
	movl	$0, -76(%rbp)                   ## 4-byte Folded Spill
	xorl	%ebx, %ebx
LBB0_18:
	movl	%ebx, -120(%rbp)                ## 4-byte Spill
	movl	%r15d, %eax
	shll	$16, %eax
	cltd
	idivl	%r8d
	movl	%eax, %r10d
	movl	-84(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, %eax
	shll	$16, %eax
	cltd
	idivl	%r9d
                                        ## kill: def $eax killed $eax def $rax
	subq	$8, %rsp
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rdi, %r14
	movl	%r12d, %esi
	movl	%r15d, %edx
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	pushq	-128(%rbp)                      ## 8-byte Folded Reload
	pushq	-152(%rbp)                      ## 8-byte Folded Reload
	pushq	%rax
	pushq	%r10
	callq	_sun8i_vi_scaler_setup
	addq	$48, %rsp
	movl	$1, %r13d
LBB0_20:
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	%r13d, %edx
	callq	_sun8i_vi_scaler_enable
	movl	(%r14), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%r14, %r13
	movl	-108(%rbp), %r12d               ## 4-byte Reload
	movl	%r12d, %edi
	callq	_SUN8I_MIXER_CHAN_VI_HDS_Y
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movl	-120(%rbp), %r14d               ## 4-byte Reload
	movl	%r14d, %edi
	callq	_SUN8I_MIXER_CHAN_VI_DS_N
	movl	%eax, %ebx
	movl	-76(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edi
	callq	_SUN8I_MIXER_CHAN_VI_DS_M
	orl	%eax, %ebx
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	movl	-72(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	callq	_regmap_write
	movl	(%r13), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	%r12d, %edi
	callq	_SUN8I_MIXER_CHAN_VI_HDS_UV
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movl	%r14d, %edi
	callq	_SUN8I_MIXER_CHAN_VI_DS_N
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_SUN8I_MIXER_CHAN_VI_DS_M
	orl	%eax, %ebx
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	movl	-72(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	callq	_regmap_write
	movl	(%r13), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	%r12d, %edi
	callq	_SUN8I_MIXER_CHAN_VI_VDS_Y
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movq	-96(%rbp), %r14                 ## 8-byte Reload
	movl	%r14d, %edi
	callq	_SUN8I_MIXER_CHAN_VI_DS_N
	movl	%eax, %ebx
	movl	-80(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edi
	callq	_SUN8I_MIXER_CHAN_VI_DS_M
	orl	%eax, %ebx
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	movl	-72(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	callq	_regmap_write
	movl	(%r13), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	%r12d, %edi
	callq	_SUN8I_MIXER_CHAN_VI_VDS_UV
	movl	%eax, %r12d
	movl	%r14d, %edi
	callq	_SUN8I_MIXER_CHAN_VI_DS_N
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_SUN8I_MIXER_CHAN_VI_DS_M
	orl	%eax, %ebx
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	movl	%r12d, %esi
	movl	%ebx, %edx
	callq	_regmap_write
	movq	-160(%rbp), %rbx                ## 8-byte Reload
	movl	(%rbx), %esi
	movl	4(%rbx), %edx
	leaq	L_.str.7(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	leaq	L_.str.8(%rip), %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	movq	%r13, %r14
	movl	(%r13), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	-136(%rbp), %r12d               ## 4-byte Reload
	movl	%r12d, %edi
	movl	-140(%rbp), %r13d               ## 4-byte Reload
	movl	%r13d, %esi
	callq	_SUN8I_MIXER_BLEND_ATTR_COORD
	movl	%eax, %r15d
	movl	(%rbx), %edi
	movl	4(%rbx), %esi
	callq	_SUN8I_MIXER_COORD
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_regmap_write
	movl	(%r14), %r14d
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_SUN8I_MIXER_BLEND_ATTR_INSIZE
	movl	%r14d, %edi
	movl	%eax, %esi
	movl	-104(%rbp), %edx                ## 4-byte Reload
	callq	_regmap_write
	xorl	%eax, %eax
	addq	$120, %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	"Updating VI channel %d overlay %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Layer source offset X: %d Y: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Layer source size W: %d H: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"HW scaling is enabled\n"

L_.str.4:                               ## @.str.4
	.asciz	"Using vertical coarse scaling\n"

L_.str.5:                               ## @.str.5
	.asciz	"Using horizontal coarse scaling\n"

L_.str.6:                               ## @.str.6
	.asciz	"HW scaling is not needed\n"

L_.str.7:                               ## @.str.7
	.asciz	"Layer destination coordinates X: %d Y: %d\n"

L_.str.8:                               ## @.str.8
	.asciz	"Layer destination size W: %d H: %d\n"

	.no_dead_strip	_sun8i_vi_layer_update_coord
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun8i_vi_layer_update_coord
_sun8i_vi_layer_update_coord:           ; @sun8i_vi_layer_update_coord
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x23, x4
	mov	x26, x2
	mov	x19, x1
	mov	x20, x0
	str	x3, [sp, #24]                   ; 8-byte Folded Spill
	ldr	x21, [x3]
	ldr	x8, [x21, #24]
	ldr	x24, [x8]
	stp	x19, x26, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	mov	x0, x20
	bl	_sun8i_blender_base
	mov	x27, x0
	mov	x0, x20
	str	x19, [sp, #32]                  ; 8-byte Folded Spill
	mov	x1, x19
	bl	_sun8i_channel_base
	mov	x25, x0
	add	x19, x21, #16
	mov	x0, x19
	bl	_drm_rect_width
	asr	w28, w0, #16
	mov	x0, x19
	bl	_drm_rect_height
	mov	x19, x0
	mov	x0, x21
	bl	_drm_rect_width
	str	x0, [sp, #64]                   ; 8-byte Folded Spill
	mov	x0, x21
	bl	_drm_rect_height
                                        ; kill: def $w0 killed $w0 def $x0
	ldp	w9, w8, [x21, #16]
	and	w12, w9, #0xffff
	ldr	w10, [x24]
	cmp	w10, #2
	b.lt	LBB0_2
; %bb.1:
	sub	w11, w10, #1
	and	w9, w11, w9, asr #16
	add	w11, w9, w28
	neg	w10, w10
	and	w28, w11, w10
	bfi	w12, w9, #16, #16
LBB0_2:
	asr	w19, w19, #16
	and	w11, w8, #0xffff
	ldr	w9, [x24, #4]
	cmp	w9, #2
	str	x0, [sp, #72]                   ; 8-byte Folded Spill
	stp	w27, w23, [sp, #48]             ; 8-byte Folded Spill
	str	w12, [sp, #60]                  ; 4-byte Folded Spill
	b.lt	LBB0_4
; %bb.3:
	sub	w10, w9, #1
	and	w8, w10, w8, asr #16
	add	w10, w8, w19
	neg	w9, w9
	and	w19, w10, w9
	bfi	w11, w8, #16, #16
LBB0_4:
	str	w11, [sp, #56]                  ; 4-byte Folded Spill
	ldr	x27, [sp, #64]                  ; 8-byte Folded Reload
	mov	x0, x28
	mov	x1, x19
	bl	_SUN8I_MIXER_SIZE
	mov	x23, x0
	mov	x0, x27
	ldr	x1, [sp, #72]                   ; 8-byte Folded Reload
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_SUN8I_MIXER_SIZE
	mov	x22, x0
	ldrsh	w8, [x21, #18]
	ldp	w9, w10, [x24]
	neg	w9, w9
	and	w8, w8, w9
	ldrsh	w9, [x21, #22]
	neg	w10, w10
	and	w9, w9, w10
	stp	x8, x9, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	stp	x28, x19, [sp]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	ldr	w27, [x20]
	mov	x0, x25
	mov	x1, x26
	bl	_SUN8I_MIXER_CHAN_VI_LAYER_SIZE
	mov	x1, x0
	mov	x0, x27
	mov	x2, x23
	bl	_regmap_write
	ldr	w26, [x20]
	mov	x0, x25
	bl	_SUN8I_MIXER_CHAN_VI_OVL_SIZE
	mov	x1, x0
	mov	x0, x26
	mov	x2, x23
	bl	_regmap_write
	ldr	w8, [x24]
	cmp	w8, #1
	stp	w22, w25, [sp, #40]             ; 8-byte Folded Spill
	b.le	LBB0_6
; %bb.5:
	mov	w27, #1
	b	LBB0_9
LBB0_6:
	ldr	w8, [x24, #4]
	cmp	w8, #1
	cset	w27, gt
	cmp	w23, w22
	b.ne	LBB0_9
; %bb.7:
	cmp	w8, #1
	ldr	w8, [sp, #60]                   ; 4-byte Folded Reload
	ccmp	w8, #0, #0, le
	ldr	w8, [sp, #56]                   ; 4-byte Folded Reload
	ccmp	w8, #0, #0, eq
	b.ne	LBB0_9
; %bb.8:
Lloh6:
	adrp	x0, l_.str.6@PAGE
Lloh7:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	mov	w2, #0
	str	wzr, [sp, #24]                  ; 4-byte Folded Spill
	mov	w26, #0
	mov	w27, #0
	mov	w23, #0
	ldr	x22, [sp, #64]                  ; 8-byte Folded Reload
	ldr	x24, [sp, #32]                  ; 8-byte Folded Reload
	b	LBB0_17
LBB0_9:
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
	ldr	x8, [x8, #8]
	ldr	x23, [x8]
	mov	w8, #1000
	ldp	w9, w10, [x23]
	mul	w8, w9, w8
	ldr	w9, [x23, #8]
	mul	w9, w9, w10
	sdiv	w26, w8, w9
	ldr	w0, [x20, #16]
	bl	_clk_get_rate
	add	w8, w0, w0, lsl #2
	lsl	w22, w8, #4
	ldr	w8, [x23, #12]
	mul	w23, w8, w26
	mov	x0, x28
	ldr	x1, [sp, #64]                   ; 8-byte Folded Reload
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_max
	mul	w1, w23, w0
	mov	x0, x22
	bl	_do_div
	mov	w8, #100
	mul	w8, w19, w8
	ldr	x25, [sp, #72]                  ; 8-byte Folded Reload
	sdiv	w8, w8, w25
	cmp	w22, w8
	b.hs	LBB0_13
; %bb.10:
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	ldr	x25, [sp, #72]                  ; 8-byte Folded Reload
	mul	w8, w22, w25
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #37
	add	w26, w8, w9
	mov	x8, x19
	str	w19, [sp, #24]                  ; 4-byte Folded Spill
	mov	x19, x26
	cbnz	w27, LBB0_14
LBB0_11:
	mov	w23, #2048
	cmp	w28, w23
	b.hi	LBB0_15
LBB0_12:
	mov	w27, #0
	mov	w23, #0
	b	LBB0_16
LBB0_13:
	str	wzr, [sp, #24]                  ; 4-byte Folded Spill
	mov	w26, #0
	cbz	w27, LBB0_11
LBB0_14:
	ldr	x8, [x20, #8]
	ldr	w23, [x8]
	cmp	w28, w23
	b.ls	LBB0_12
LBB0_15:
Lloh12:
	adrp	x0, l_.str.5@PAGE
Lloh13:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	ldr	x25, [sp, #72]                  ; 8-byte Folded Reload
	mov	x27, x28
	mov	x28, x23
LBB0_16:
	ldp	w10, w9, [sp, #56]              ; 8-byte Folded Reload
	lsl	w8, w28, #16
	ldr	x22, [sp, #64]                  ; 8-byte Folded Reload
	sdiv	w6, w8, w22
	lsl	w8, w19, #16
	sdiv	w7, w8, w25
	str	x24, [sp, #8]
	stp	w9, w10, [sp]
	mov	x0, x20
	ldr	x24, [sp, #32]                  ; 8-byte Folded Reload
	mov	x1, x24
	mov	x2, x28
	mov	x3, x19
	mov	x4, x22
	mov	x5, x25
                                        ; kill: def $w5 killed $w5 killed $x5
	bl	_sun8i_vi_scaler_setup
	mov	w2, #1
LBB0_17:
	mov	x0, x20
	mov	x1, x24
	bl	_sun8i_vi_scaler_enable
	ldr	w19, [x20]
	ldr	w25, [sp, #44]                  ; 4-byte Folded Reload
	mov	x0, x25
	bl	_SUN8I_MIXER_CHAN_VI_HDS_Y
	mov	x28, x0
	mov	x0, x23
	bl	_SUN8I_MIXER_CHAN_VI_DS_N
	mov	x24, x0
	mov	x0, x27
	bl	_SUN8I_MIXER_CHAN_VI_DS_M
	orr	w2, w0, w24
	mov	x0, x19
	mov	x1, x28
	bl	_regmap_write
	ldr	w19, [x20]
	mov	x0, x25
	bl	_SUN8I_MIXER_CHAN_VI_HDS_UV
	mov	x24, x0
	mov	x0, x23
	bl	_SUN8I_MIXER_CHAN_VI_DS_N
	mov	x23, x0
	mov	x0, x27
	bl	_SUN8I_MIXER_CHAN_VI_DS_M
	orr	w2, w0, w23
	mov	x0, x19
	mov	x1, x24
	bl	_regmap_write
	ldr	w19, [x20]
	mov	x0, x25
	bl	_SUN8I_MIXER_CHAN_VI_VDS_Y
	mov	x23, x0
	mov	x0, x26
	bl	_SUN8I_MIXER_CHAN_VI_DS_N
	mov	x24, x0
	ldr	w27, [sp, #24]                  ; 4-byte Folded Reload
	mov	x0, x27
	bl	_SUN8I_MIXER_CHAN_VI_DS_M
	orr	w2, w0, w24
	mov	x0, x19
	mov	x1, x23
	bl	_regmap_write
	ldr	w19, [x20]
	mov	x0, x25
	bl	_SUN8I_MIXER_CHAN_VI_VDS_UV
	mov	x23, x0
	mov	x0, x26
	bl	_SUN8I_MIXER_CHAN_VI_DS_N
	mov	x24, x0
	mov	x0, x27
	bl	_SUN8I_MIXER_CHAN_VI_DS_M
	orr	w2, w0, w24
	mov	x0, x19
	mov	x1, x23
	bl	_regmap_write
	ldp	w8, w9, [x21]
	stp	x8, x9, [sp]
Lloh14:
	adrp	x0, l_.str.7@PAGE
Lloh15:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	ldr	x8, [sp, #72]                   ; 8-byte Folded Reload
	stp	x22, x8, [sp]
Lloh16:
	adrp	x0, l_.str.8@PAGE
Lloh17:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	ldr	w19, [x20]
	ldp	w24, w23, [sp, #48]             ; 8-byte Folded Reload
	mov	x0, x24
	mov	x1, x23
	bl	_SUN8I_MIXER_BLEND_ATTR_COORD
	mov	x22, x0
	ldp	w0, w1, [x21]
	bl	_SUN8I_MIXER_COORD
	mov	x2, x0
	mov	x0, x19
	mov	x1, x22
	bl	_regmap_write
	ldr	w19, [x20]
	mov	x0, x24
	mov	x1, x23
	bl	_SUN8I_MIXER_BLEND_ATTR_INSIZE
	mov	x1, x0
	mov	x0, x19
	ldr	w2, [sp, #40]                   ; 4-byte Folded Reload
	bl	_regmap_write
	mov	w0, #0
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Updating VI channel %d overlay %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Layer source offset X: %d Y: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Layer source size W: %d H: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"HW scaling is enabled\n"

l_.str.4:                               ; @.str.4
	.asciz	"Using vertical coarse scaling\n"

l_.str.5:                               ; @.str.5
	.asciz	"Using horizontal coarse scaling\n"

l_.str.6:                               ; @.str.6
	.asciz	"HW scaling is not needed\n"

l_.str.7:                               ; @.str.7
	.asciz	"Layer destination coordinates X: %d Y: %d\n"

l_.str.8:                               ; @.str.8
	.asciz	"Layer destination size W: %d H: %d\n"

	.no_dead_strip	_sun8i_vi_layer_update_coord
.subsections_via_symbols
