	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun8i_ui_layer_enable
_sun8i_ui_layer_enable:                 ## @sun8i_ui_layer_enable
	.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, -52(%rbp)                 ## 4-byte Spill
	movl	%r8d, -64(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r15d
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	%rdi, %r13
	callq	_sun8i_blender_base
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_sun8i_channel_base
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%r15d, %r15d
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rsi
	cmoveq	%rax, %rsi
	leaq	L_.str(%rip), %rdi
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edx
	movl	%r14d, %ecx
	callq	_DRM_DEBUG_DRIVER
	movq	_SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN@GOTPCREL(%rip), %rax
	movl	%r15d, %ebx
	testl	%r15d, %r15d
	je	LBB0_2
## %bb.1:
	movl	(%rax), %ebx
LBB0_2:
	movl	(%r13), %r12d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%r14d, %esi
	movq	%rax, %r14
	callq	_SUN8I_MIXER_CHAN_UI_LAYER_ATTR
	movl	(%r14), %edx
	movl	%r12d, %edi
	movl	%eax, %esi
	movl	%ebx, %ecx
	callq	_regmap_update_bits
	testl	%r15d, %r15d
	movl	-64(%rbp), %r12d                ## 4-byte Reload
	je	LBB0_4
## %bb.3:
	cmpl	-52(%rbp), %r12d                ## 4-byte Folded Reload
	jne	LBB0_4
## %bb.5:
	testl	%r15d, %r15d
	je	LBB0_6
LBB0_7:
	movl	%r12d, %edi
	callq	_SUN8I_MIXER_BLEND_PIPE_CTL_EN
	movl	%eax, %ebx
	movl	(%r13), %r14d
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edi
	callq	_SUN8I_MIXER_BLEND_PIPE_CTL
	movl	%r14d, %edi
	movl	%eax, %esi
	movl	%ebx, %edx
	movl	%ebx, %ecx
	callq	_regmap_update_bits
	movl	%r12d, %edi
	callq	_SUN8I_MIXER_BLEND_ROUTE_PIPE_SHIFT
	movl	%eax, %ecx
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	shll	%cl, %ebx
	movl	(%r13), %r14d
	movl	%r15d, %edi
	callq	_SUN8I_MIXER_BLEND_ROUTE
	movl	%eax, %r15d
	movl	%r12d, %edi
	callq	_SUN8I_MIXER_BLEND_ROUTE_PIPE_MSK
	movl	%r14d, %edi
	movl	%r15d, %esi
	movl	%eax, %edx
	movl	%ebx, %ecx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_regmap_update_bits             ## TAILCALL
LBB0_4:
	movl	(%r13), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edi
	callq	_SUN8I_MIXER_BLEND_PIPE_CTL
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_SUN8I_MIXER_BLEND_PIPE_CTL_EN
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_regmap_update_bits
	movl	(%r13), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r14d, %edi
	callq	_SUN8I_MIXER_BLEND_ROUTE
	movl	%eax, %r14d
	movl	%ebx, %edi
	callq	_SUN8I_MIXER_BLEND_ROUTE_PIPE_MSK
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%r14d, %esi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_regmap_update_bits
	testl	%r15d, %r15d
	jne	LBB0_7
LBB0_6:
	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	"%sabling channel %d overlay %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"En"

L_.str.2:                               ## @.str.2
	.asciz	"Dis"

	.comm	_SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN,4,2 ## @SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN
	.no_dead_strip	_sun8i_ui_layer_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun8i_ui_layer_enable
_sun8i_ui_layer_enable:                 ; @sun8i_ui_layer_enable
	.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, x5
	mov	x19, x4
	mov	x23, x3
	mov	x25, x2
	mov	x21, x1
	mov	x20, x0
	bl	_sun8i_blender_base
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
	mov	x0, x20
	mov	x1, x21
	bl	_sun8i_channel_base
	mov	x26, x0
Lloh0:
	adrp	x8, l_.str.1@PAGE
Lloh1:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh2:
	adrp	x9, l_.str.2@PAGE
Lloh3:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	w23, #0
	csel	x1, x9, x8, eq
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x25
	bl	_DRM_DEBUG_DRIVER
Lloh6:
	adrp	x22, _SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN@GOTPAGE
Lloh7:
	ldr	x22, [x22, _SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w23, #0
	csel	w27, wzr, w8, eq
	ldr	w28, [x20]
	mov	x0, x26
	mov	x1, x25
	bl	_SUN8I_MIXER_CHAN_UI_LAYER_ATTR
	mov	x1, x0
	ldr	w2, [x22]
	mov	x0, x28
	mov	x3, x27
	bl	_regmap_update_bits
	cbz	w23, LBB0_4
; %bb.1:
	cmp	w19, w24
	b.ne	LBB0_4
; %bb.2:
	cbz	w23, LBB0_5
LBB0_3:
	mov	x0, x19
	bl	_SUN8I_MIXER_BLEND_PIPE_CTL_EN
	mov	x23, x0
	ldr	w24, [x20]
	ldr	w22, [sp, #12]                  ; 4-byte Folded Reload
	mov	x0, x22
	bl	_SUN8I_MIXER_BLEND_PIPE_CTL
	mov	x1, x0
	mov	x0, x24
	mov	x2, x23
	mov	x3, x23
	bl	_regmap_update_bits
	mov	x0, x19
	bl	_SUN8I_MIXER_BLEND_ROUTE_PIPE_SHIFT
	lsl	w21, w21, w0
	ldr	w20, [x20]
	mov	x0, x22
	bl	_SUN8I_MIXER_BLEND_ROUTE
	mov	x22, x0
	mov	x0, x19
	bl	_SUN8I_MIXER_BLEND_ROUTE_PIPE_MSK
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	mov	x3, x21
	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	_regmap_update_bits
LBB0_4:
	ldr	w25, [x20]
	ldr	w22, [sp, #12]                  ; 4-byte Folded Reload
	mov	x0, x22
	bl	_SUN8I_MIXER_BLEND_PIPE_CTL
	mov	x26, x0
	mov	x0, x24
	bl	_SUN8I_MIXER_BLEND_PIPE_CTL_EN
	mov	x2, x0
	mov	x0, x25
	mov	x1, x26
	mov	w3, #0
	bl	_regmap_update_bits
	ldr	w25, [x20]
	mov	x0, x22
	bl	_SUN8I_MIXER_BLEND_ROUTE
	mov	x26, x0
	mov	x0, x24
	bl	_SUN8I_MIXER_BLEND_ROUTE_PIPE_MSK
	mov	x2, x0
	mov	x0, x25
	mov	x1, x26
	mov	w3, #0
	bl	_regmap_update_bits
	cbnz	w23, LBB0_3
LBB0_5:
	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
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%sabling channel %d overlay %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"En"

l_.str.2:                               ; @.str.2
	.asciz	"Dis"

	.comm	_SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN,4,2 ; @SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN
	.no_dead_strip	_sun8i_ui_layer_enable
.subsections_via_symbols
