	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun8i_vi_layer_update_formats
_sun8i_vi_layer_update_formats:         ## @sun8i_vi_layer_update_formats
	.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	%edx, %ebx
	movq	%rdi, %r15
	movq	(%rcx), %r13
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	callq	_sun8i_channel_base
	movl	%eax, %r12d
	movq	8(%r13), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_sun8i_mixer_format_info
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movl	%ebx, %esi
	movl	(%rax), %ebx
	movq	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_OFFSET@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movl	%r12d, %edi
	movl	(%r15), %r12d
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	callq	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR
	movq	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%r12d, %edi
	movl	%eax, %esi
	movl	%ebx, %ecx
	callq	_regmap_update_bits
	movq	8(%r14), %rdx
	movq	_SUN8I_CSC_MODE_OFF@GOTPCREL(%rip), %rcx
	movl	$0, %eax
	cmpq	(%rcx), %rdx
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_4
## %bb.3:
	movl	(%r13), %r8d
	movl	4(%r13), %ecx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_sun8i_csc_set_ccsc_coefficients
	movl	$1, %eax
LBB0_4:
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_sun8i_csc_enable_ccsc
	cmpq	$0, 16(%r14)
	movq	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR_RGB_MODE@GOTPCREL(%rip), %rax
	movl	$0, %r14d
	je	LBB0_6
## %bb.5:
	movl	(%rax), %r14d
LBB0_6:
	movl	(%r15), %ebx
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %edi
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %esi
	callq	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR
	movq	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR_RGB_MODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	%r14d, %ecx
	callq	_regmap_update_bits
	movq	8(%r15), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.7:
	movl	(%r15), %r14d
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR
	movl	%eax, %r15d
	movq	_SUN50I_MIXER_CHAN_VI_LAYER_ATTR_ALPHA_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	$255, %edi
	callq	_SUN50I_MIXER_CHAN_VI_LAYER_ATTR_ALPHA
	movl	%r14d, %edi
	movl	%r15d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_regmap_update_bits
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_DRIVER
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	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	"Invalid format\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_OFFSET,4,2 ## @SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_OFFSET
	.comm	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_MASK,4,2 ## @SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_MASK
	.comm	_SUN8I_CSC_MODE_OFF,8,3         ## @SUN8I_CSC_MODE_OFF
	.comm	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR_RGB_MODE,4,2 ## @SUN8I_MIXER_CHAN_VI_LAYER_ATTR_RGB_MODE
	.comm	_SUN50I_MIXER_CHAN_VI_LAYER_ATTR_ALPHA_MASK,4,2 ## @SUN50I_MIXER_CHAN_VI_LAYER_ATTR_ALPHA_MASK
	.no_dead_strip	_sun8i_vi_layer_update_formats
.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_formats
_sun8i_vi_layer_update_formats:         ; @sun8i_vi_layer_update_formats
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
	ldr	x26, [x3]
	bl	_sun8i_channel_base
	mov	x21, x0
	ldr	x8, [x26, #8]
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_sun8i_mixer_format_info
	cbz	x0, LBB0_3
; %bb.1:
	mov	x23, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_OFFSET@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	lsl	w24, w8, w9
	ldr	w25, [x20]
	mov	x0, x21
	mov	x1, x19
	bl	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR
	mov	x1, x0
Lloh3:
	adrp	x8, _SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x25
	mov	x3, x24
	bl	_regmap_update_bits
	ldr	x2, [x23, #8]
Lloh6:
	adrp	x8, _SUN8I_CSC_MODE_OFF@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SUN8I_CSC_MODE_OFF@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x2, x8
	b.ne	LBB0_4
; %bb.2:
	mov	w2, #0
	b	LBB0_5
LBB0_3:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_4:
	ldp	w4, w3, [x26]
	mov	x0, x20
	mov	x1, x22
	bl	_sun8i_csc_set_ccsc_coefficients
	mov	w2, #1
LBB0_5:
	mov	x0, x20
	mov	x1, x22
	bl	_sun8i_csc_enable_ccsc
	ldr	x8, [x23, #16]
Lloh14:
	adrp	x24, _SUN8I_MIXER_CHAN_VI_LAYER_ATTR_RGB_MODE@GOTPAGE
Lloh15:
	ldr	x24, [x24, _SUN8I_MIXER_CHAN_VI_LAYER_ATTR_RGB_MODE@GOTPAGEOFF]
	ldr	w9, [x24]
	cmp	x8, #0
	csel	w22, wzr, w9, eq
	ldr	w23, [x20]
	mov	x0, x21
	mov	x1, x19
	bl	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR
	mov	x1, x0
	ldr	w2, [x24]
	mov	x0, x23
	mov	x3, x22
	bl	_regmap_update_bits
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.6:
	ldr	w20, [x20]
	mov	x0, x21
	mov	x1, x19
	bl	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR
	mov	x19, x0
Lloh16:
	adrp	x8, _SUN50I_MIXER_CHAN_VI_LAYER_ATTR_ALPHA_MASK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SUN50I_MIXER_CHAN_VI_LAYER_ATTR_ALPHA_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w21, [x8]
	mov	w0, #255
	bl	_SUN50I_MIXER_CHAN_VI_LAYER_ATTR_ALPHA
	mov	x3, x0
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_regmap_update_bits
LBB0_7:
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid format\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_OFFSET,4,2 ; @SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_OFFSET
	.comm	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_MASK,4,2 ; @SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_MASK
	.comm	_SUN8I_CSC_MODE_OFF,8,3         ; @SUN8I_CSC_MODE_OFF
	.comm	_SUN8I_MIXER_CHAN_VI_LAYER_ATTR_RGB_MODE,4,2 ; @SUN8I_MIXER_CHAN_VI_LAYER_ATTR_RGB_MODE
	.comm	_SUN50I_MIXER_CHAN_VI_LAYER_ATTR_ALPHA_MASK,4,2 ; @SUN50I_MIXER_CHAN_VI_LAYER_ATTR_ALPHA_MASK
	.no_dead_strip	_sun8i_vi_layer_update_formats
.subsections_via_symbols
