	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sun4i_crtc_init                ## -- Begin function sun4i_crtc_init
	.p2align	4, 0x90
_sun4i_crtc_init:                       ## @sun4i_crtc_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movl	(%rdi), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$24, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r14
	movq	%rbx, 16(%rax)
	movq	%r12, 8(%rax)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_sunxi_engine_layers_init
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	xorl	%r14d, %r14d
LBB0_20:
	movq	%r14, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	jmp	LBB0_2
LBB0_4:
	movq	(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.7:
	leaq	8(%rbx), %rax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%rsi, %rcx
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%rdx, %rsi
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%rsi, %rdx
	movq	(%rax), %rsi
	addq	$8, %rax
	testq	%rsi, %rsi
	je	LBB0_13
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rsi), %edi
	cmpl	$129, %edi
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$128, %edi
	je	LBB0_12
	jmp	LBB0_11
LBB0_5:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
LBB0_13:
	movq	_sun4i_crtc_funcs@GOTPCREL(%rip), %r8
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%r9d, %r9d
	callq	_drm_crtc_init_with_planes
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	movl	%eax, %r12d
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movl	%r12d, %edi
LBB0_2:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_15:
	movq	_sun4i_crtc_helper_funcs@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_drm_crtc_helper_add
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_of_graph_get_port_by_id
	movl	%eax, (%r14)
	cmpq	$0, (%rbx)
	je	LBB0_20
## %bb.16:
	addq	$8, %rbx
	movq	_DRM_PLANE_TYPE_OVERLAY@GOTPCREL(%rip), %r15
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_17 Depth=1
	cmpq	$0, (%rbx)
	leaq	8(%rbx), %rbx
	je	LBB0_20
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_drm_crtc_mask
	movq	-8(%rbx), %rcx
	movslq	(%rcx), %rdx
	cmpq	%rdx, (%r15)
	jne	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	movl	%eax, 4(%rcx)
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't create the planes\n"

	.comm	_sun4i_crtc_funcs,4,2           ## @sun4i_crtc_funcs
L_.str.1:                               ## @.str.1
	.asciz	"Couldn't init DRM CRTC\n"

	.comm	_sun4i_crtc_helper_funcs,4,2    ## @sun4i_crtc_helper_funcs
	.comm	_DRM_PLANE_TYPE_OVERLAY,8,3     ## @DRM_PLANE_TYPE_OVERLAY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sun4i_crtc_init                ; -- Begin function sun4i_crtc_init
	.p2align	2
_sun4i_crtc_init:                       ; @sun4i_crtc_init
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x22, x2
	mov	x21, x1
	mov	x20, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #24
	bl	_devm_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	stp	x22, x21, [x0, #8]
	mov	x0, x20
	mov	x1, x21
	bl	_sunxi_engine_layers_init
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_5
; %bb.2:
	ldr	w0, [x20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x19, #0
LBB0_3:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_4:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_5:
	ldr	x8, [x21]
	cbz	x8, LBB0_8
; %bb.6:
	mov	x2, #0
	mov	x3, #0
	add	x9, x21, #8
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x8]
	cmp	w10, #128
	csel	x11, x2, x8, ne
	cmp	w10, #129
	csel	x3, x8, x3, eq
	csel	x2, x2, x11, eq
	ldr	x8, [x9], #8
	cbnz	x8, LBB0_7
	b	LBB0_9
LBB0_8:
	mov	x3, #0
	mov	x2, #0
LBB0_9:
Lloh8:
	adrp	x4, _sun4i_crtc_funcs@GOTPAGE
Lloh9:
	ldr	x4, [x4, _sun4i_crtc_funcs@GOTPAGEOFF]
	mov	x0, x20
	mov	x1, x19
	mov	x5, #0
	bl	_drm_crtc_init_with_planes
	cbz	w0, LBB0_12
; %bb.10:
	mov	x22, x0
	ldr	w0, [x20]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	mov	x0, x22
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_12:
Lloh12:
	adrp	x1, _sun4i_crtc_helper_funcs@GOTPAGE
Lloh13:
	ldr	x1, [x1, _sun4i_crtc_helper_funcs@GOTPAGEOFF]
	mov	x0, x19
	bl	_drm_crtc_helper_add
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w0, [x8]
	mov	w1, #1
	bl	_of_graph_get_port_by_id
	str	w0, [x19]
	ldr	x8, [x21]
	cbz	x8, LBB0_3
; %bb.13:
	add	x20, x21, #8
Lloh14:
	adrp	x21, _DRM_PLANE_TYPE_OVERLAY@GOTPAGE
Lloh15:
	ldr	x21, [x21, _DRM_PLANE_TYPE_OVERLAY@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [x20], #8
	cbz	x8, LBB0_3
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_drm_crtc_mask
	ldur	x8, [x20, #-8]
	ldrsw	x9, [x8]
	ldr	x10, [x21]
	cmp	x10, x9
	b.ne	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	str	w0, [x8, #4]
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't create the planes\n"

	.comm	_sun4i_crtc_funcs,4,2           ; @sun4i_crtc_funcs
l_.str.1:                               ; @.str.1
	.asciz	"Couldn't init DRM CRTC\n"

	.comm	_sun4i_crtc_helper_funcs,4,2    ; @sun4i_crtc_helper_funcs
	.comm	_DRM_PLANE_TYPE_OVERLAY,8,3     ; @DRM_PLANE_TYPE_OVERLAY
.subsections_via_symbols
