	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sun4i_layers_init              ## -- Begin function sun4i_layers_init
	.p2align	4, 0x90
_sun4i_layers_init:                     ## @sun4i_layers_init
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_engine_to_sun4i_backend
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%r15), %edi
	movq	_SUN4I_BACKEND_NUM_LAYERS@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	incl	%esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$8, %edx
	callq	_devm_kcalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %r12
	cmpl	$0, (%r14)
	jle	LBB0_7
## %bb.2:
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_DRM_PLANE_TYPE_OVERLAY@GOTPCREL(%rip), %rax
	testq	%r13, %r13
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_DRM_PLANE_TYPE_PRIMARY@GOTPCREL(%rip), %rax
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_sun4i_layer_init_one
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r13d, (%rbx)
	addq	$4, %rbx
	movq	%rbx, (%r12,%r13,8)
	incq	%r13
	movslq	(%r14), %rax
	cmpq	%rax, %r13
	jl	LBB0_3
LBB0_7:
	movq	%r12, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_9:
	testq	%r13, %r13
	movl	(%r15), %edi
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_CAST                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SUN4I_BACKEND_NUM_LAYERS,4,2   ## @SUN4I_BACKEND_NUM_LAYERS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DRM_PLANE_TYPE_OVERLAY,4,2     ## @DRM_PLANE_TYPE_OVERLAY
	.comm	_DRM_PLANE_TYPE_PRIMARY,4,2     ## @DRM_PLANE_TYPE_PRIMARY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't initialize %s plane\n"

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

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

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sun4i_layers_init              ; -- Begin function sun4i_layers_init
	.p2align	2
_sun4i_layers_init:                     ; @sun4i_layers_init
	.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, x0
	mov	x0, x1
	bl	_engine_to_sun4i_backend
	mov	x20, x0
Lloh0:
	adrp	x23, _SUN4I_BACKEND_NUM_LAYERS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SUN4I_BACKEND_NUM_LAYERS@GOTPAGEOFF]
	ldr	w0, [x19]
	ldr	w8, [x23]
	add	w1, w8, #1
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
	mov	w2, #8
	bl	_devm_kcalloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x21, x0
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.2:
	mov	x24, #0
Lloh5:
	adrp	x25, _DRM_PLANE_TYPE_OVERLAY@GOTPAGE
Lloh6:
	ldr	x25, [x25, _DRM_PLANE_TYPE_OVERLAY@GOTPAGEOFF]
Lloh7:
	adrp	x26, _DRM_PLANE_TYPE_PRIMARY@GOTPAGE
Lloh8:
	ldr	x26, [x26, _DRM_PLANE_TYPE_PRIMARY@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x24, #0
	csel	x8, x26, x25, eq
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_sun4i_layer_init_one
	mov	x22, x0
	bl	_IS_ERR
	cbnz	x0, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	str	w24, [x22], #4
	str	x22, [x21, x24, lsl #3]
	add	x24, x24, #1
	ldrsw	x8, [x23]
	cmp	x24, x8
	b.lt	LBB0_3
LBB0_5:
	mov	x0, x21
	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
LBB0_6:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	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
	b	_ERR_PTR
LBB0_7:
	ldr	w0, [x19]
Lloh12:
	adrp	x8, l_.str.1@PAGE
Lloh13:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh14:
	adrp	x9, l_.str.2@PAGE
Lloh15:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	x24, #0
	csel	x2, x9, x8, eq
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x0, x22
	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
	b	_ERR_CAST
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SUN4I_BACKEND_NUM_LAYERS,4,2   ; @SUN4I_BACKEND_NUM_LAYERS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DRM_PLANE_TYPE_OVERLAY,4,2     ; @DRM_PLANE_TYPE_OVERLAY
	.comm	_DRM_PLANE_TYPE_PRIMARY,4,2     ; @DRM_PLANE_TYPE_PRIMARY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't initialize %s plane\n"

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

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

.subsections_via_symbols
