	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sun4i_backend_update_layer_formats ## -- Begin function sun4i_backend_update_layer_formats
	.p2align	4, 0x90
_sun4i_backend_update_layer_formats:    ## @sun4i_backend_update_layer_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
	movq	%rdx, %r15
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	(%rdx), %r13
	movq	16(%r13), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %ebx
	movl	%esi, %edi
	callq	_SUN4I_BACKEND_ATTCTL_REG0
	movq	_SUN4I_BACKEND_ATTCTL_REG0_LAY_YUVEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%ebx, %edi
	movl	%eax, %esi
	xorl	%ecx, %ecx
	callq	_regmap_update_bits
	movq	(%r15), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	(%rax), %rax
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	(%r12), %edi
	movq	_SUN4I_BACKEND_MODCTL_REG@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	movq	_SUN4I_BACKEND_MODCTL_ITLMOD_EN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%ecx, (%rax)
	je	LBB0_2
## %bb.4:
	leaq	L_.str.1(%rip), %rbx
	movl	%edx, %ecx
	jmp	LBB0_5
LBB0_1:
	movl	(%r12), %edi
	movq	_SUN4I_BACKEND_MODCTL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SUN4I_BACKEND_MODCTL_ITLMOD_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
LBB0_2:
	xorl	%ecx, %ecx
	leaq	L_.str.2(%rip), %rbx
LBB0_5:
	callq	_regmap_update_bits
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	movl	(%r13), %edi
	sarl	$8, %edi
	callq	_SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA
	movl	%eax, %ebx
	movl	%eax, -44(%rbp)
	movl	(%r13), %eax
	movq	_DRM_BLEND_ALPHA_OPAQUE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_7
## %bb.6:
	movq	_SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, %ebx
	movl	%ebx, -44(%rbp)
LBB0_7:
	movl	(%r12), %r13d
	movl	%r14d, %edi
	callq	_SUN4I_BACKEND_ATTCTL_REG0
	movq	_SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_MASK@GOTPCREL(%rip), %rcx
	movq	_SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_EN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	%r13d, %edi
	movl	%eax, %esi
	movl	%ebx, %ecx
	callq	_regmap_update_bits
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_8
## %bb.12:
	movq	%r12, %rdi
	movl	%r14d, %esi
	movq	%r15, %rdx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sun4i_backend_update_yuv_format ## TAILCALL
LBB0_8:
	movl	(%rax), %edi
	leaq	-44(%rbp), %rsi
	callq	_sun4i_backend_drm_format_to_layer
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	jmp	LBB0_11
LBB0_10:
	movl	(%r12), %ebx
	movl	%r14d, %edi
	callq	_SUN4I_BACKEND_ATTCTL_REG1
	movq	_SUN4I_BACKEND_ATTCTL_REG1_LAY_FBFMT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	-44(%rbp), %ecx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_regmap_update_bits
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SUN4I_BACKEND_ATTCTL_REG0_LAY_YUVEN,4,2 ## @SUN4I_BACKEND_ATTCTL_REG0_LAY_YUVEN
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ## @DRM_MODE_FLAG_INTERLACE
	.comm	_SUN4I_BACKEND_MODCTL_REG,4,2   ## @SUN4I_BACKEND_MODCTL_REG
	.comm	_SUN4I_BACKEND_MODCTL_ITLMOD_EN,4,2 ## @SUN4I_BACKEND_MODCTL_ITLMOD_EN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Switching display backend interlaced mode %s\n"

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

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

	.comm	_DRM_BLEND_ALPHA_OPAQUE,4,2     ## @DRM_BLEND_ALPHA_OPAQUE
	.comm	_SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_EN,4,2 ## @SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_EN
	.comm	_SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_MASK,4,2 ## @SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_MASK
L_.str.3:                               ## @.str.3
	.asciz	"Invalid format\n"

	.comm	_SUN4I_BACKEND_ATTCTL_REG1_LAY_FBFMT,4,2 ## @SUN4I_BACKEND_ATTCTL_REG1_LAY_FBFMT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sun4i_backend_update_layer_formats ; -- Begin function sun4i_backend_update_layer_formats
	.p2align	2
_sun4i_backend_update_layer_formats:    ; @sun4i_backend_update_layer_formats
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x23, [x2]
	ldr	x24, [x23, #16]
	ldr	w22, [x0]
	mov	x0, x1
	bl	_SUN4I_BACKEND_ATTCTL_REG0
	mov	x1, x0
Lloh0:
	adrp	x8, _SUN4I_BACKEND_ATTCTL_REG0_LAY_YUVEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SUN4I_BACKEND_ATTCTL_REG0_LAY_YUVEN@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w3, #0
	bl	_regmap_update_bits
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	x8, [x8]
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _SUN4I_BACKEND_MODCTL_REG@GOTPAGE
Lloh7:
	ldr	x10, [x10, _SUN4I_BACKEND_MODCTL_REG@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh8:
	ldr	w1, [x10]
Lloh9:
	adrp	x10, _SUN4I_BACKEND_MODCTL_ITLMOD_EN@GOTPAGE
Lloh10:
	ldr	x10, [x10, _SUN4I_BACKEND_MODCTL_ITLMOD_EN@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x10]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
Lloh12:
	adrp	x22, l_.str.1@PAGE
Lloh13:
	add	x22, x22, l_.str.1@PAGEOFF
	mov	x3, x2
	b	LBB0_5
LBB0_3:
	ldr	w0, [x20]
Lloh14:
	adrp	x8, _SUN4I_BACKEND_MODCTL_REG@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SUN4I_BACKEND_MODCTL_REG@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x8, _SUN4I_BACKEND_MODCTL_ITLMOD_EN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SUN4I_BACKEND_MODCTL_ITLMOD_EN@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
LBB0_4:
	mov	w3, #0
Lloh20:
	adrp	x22, l_.str.2@PAGE
Lloh21:
	add	x22, x22, l_.str.2@PAGEOFF
LBB0_5:
	bl	_regmap_update_bits
	str	x22, [sp]
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	ldr	w8, [x23]
	asr	w0, w8, #8
	bl	_SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA
	mov	x22, x0
	str	w0, [sp, #12]
	ldr	w8, [x23]
Lloh24:
	adrp	x9, _DRM_BLEND_ALPHA_OPAQUE@GOTPAGE
Lloh25:
	ldr	x9, [x9, _DRM_BLEND_ALPHA_OPAQUE@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
Lloh27:
	adrp	x25, _SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_EN@GOTPAGE
Lloh28:
	ldr	x25, [x25, _SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_EN@GOTPAGEOFF]
	cmp	w8, w9
	b.eq	LBB0_7
; %bb.6:
	ldr	w8, [x25]
	orr	w22, w8, w22
	str	w22, [sp, #12]
LBB0_7:
	ldr	w23, [x20]
	mov	x0, x19
	bl	_SUN4I_BACKEND_ATTCTL_REG0
	mov	x1, x0
Lloh29:
	adrp	x8, _SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_MASK@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_MASK@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	ldr	w9, [x25]
	orr	w2, w9, w8
	mov	x0, x23
	mov	x3, x22
	bl	_regmap_update_bits
	ldr	x8, [x24]
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_9
; %bb.8:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	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
	add	sp, sp, #96
	b	_sun4i_backend_update_yuv_format
LBB0_9:
	ldr	w0, [x8]
	add	x1, sp, #12
	bl	_sun4i_backend_drm_format_to_layer
	mov	x21, x0
	cbz	w0, LBB0_11
; %bb.10:
Lloh32:
	adrp	x0, l_.str.3@PAGE
Lloh33:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	b	LBB0_12
LBB0_11:
	ldr	w20, [x20]
	mov	x0, x19
	bl	_SUN4I_BACKEND_ATTCTL_REG1
	mov	x1, x0
Lloh34:
	adrp	x8, _SUN4I_BACKEND_ATTCTL_REG1_LAY_FBFMT@GOTPAGE
Lloh35:
	ldr	x8, [x8, _SUN4I_BACKEND_ATTCTL_REG1_LAY_FBFMT@GOTPAGEOFF]
Lloh36:
	ldr	w2, [x8]
	ldr	w3, [sp, #12]
	mov	x0, x20
	bl	_regmap_update_bits
LBB0_12:
	mov	x0, x21
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_SUN4I_BACKEND_ATTCTL_REG0_LAY_YUVEN,4,2 ; @SUN4I_BACKEND_ATTCTL_REG0_LAY_YUVEN
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ; @DRM_MODE_FLAG_INTERLACE
	.comm	_SUN4I_BACKEND_MODCTL_REG,4,2   ; @SUN4I_BACKEND_MODCTL_REG
	.comm	_SUN4I_BACKEND_MODCTL_ITLMOD_EN,4,2 ; @SUN4I_BACKEND_MODCTL_ITLMOD_EN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Switching display backend interlaced mode %s\n"

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

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

	.comm	_DRM_BLEND_ALPHA_OPAQUE,4,2     ; @DRM_BLEND_ALPHA_OPAQUE
	.comm	_SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_EN,4,2 ; @SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_EN
	.comm	_SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_MASK,4,2 ; @SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_MASK
l_.str.3:                               ; @.str.3
	.asciz	"Invalid format\n"

	.comm	_SUN4I_BACKEND_ATTCTL_REG1_LAY_FBFMT,4,2 ; @SUN4I_BACKEND_ATTCTL_REG1_LAY_FBFMT
.subsections_via_symbols
