	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ltdc_crtc_init
_ltdc_crtc_init:                        ## @ltdc_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	%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	%rsi, %r15
	movq	%rdi, %r12
	movq	(%rdi), %r13
	movq	_DRM_PLANE_TYPE_PRIMARY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ltdc_plane_create
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	_ltdc_crtc_funcs@GOTPCREL(%rip), %r8
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%rax, %rdx
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	callq	_drm_crtc_init_with_planes
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movl	%ebx, %r14d
LBB0_4:
	movq	%r12, %rdi
	callq	_ltdc_plane_destroy_all
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_10
LBB0_5:
	movq	_ltdc_crtc_helper_funcs@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	callq	_drm_crtc_helper_add
	movq	_CLUT_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_drm_mode_crtc_set_gamma_size
	movl	(%rbx), %ecx
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_drm_crtc_enable_color_mgmt
	movl	(%r15), %esi
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_DEBUG_DRIVER
	cmpl	$2, (%r13)
	jb	LBB0_10
## %bb.6:
	movl	$1, %ebx
	movq	_DRM_PLANE_TYPE_OVERLAY@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_ltdc_plane_create
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	incl	%ebx
	cmpl	(%r13), %ebx
	jb	LBB0_7
LBB0_10:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_PLANE_TYPE_PRIMARY,4,2     ## @DRM_PLANE_TYPE_PRIMARY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can not create primary plane\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ltdc_crtc_funcs,4,2            ## @ltdc_crtc_funcs
L_.str.1:                               ## @.str.1
	.asciz	"Can not initialize CRTC\n"

	.comm	_ltdc_crtc_helper_funcs,4,2     ## @ltdc_crtc_helper_funcs
	.comm	_CLUT_SIZE,4,2                  ## @CLUT_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"CRTC:%d created\n"

	.comm	_DRM_PLANE_TYPE_OVERLAY,4,2     ## @DRM_PLANE_TYPE_OVERLAY
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"Can not create overlay plane %d\n"

	.no_dead_strip	_ltdc_crtc_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ltdc_crtc_init
_ltdc_crtc_init:                        ; @ltdc_crtc_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x1
	mov	x19, x0
	ldr	x22, [x0]
Lloh0:
	adrp	x8, _DRM_PLANE_TYPE_PRIMARY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_PLANE_TYPE_PRIMARY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_ltdc_plane_create
	cbz	x0, LBB0_4
; %bb.1:
	mov	x2, x0
Lloh3:
	adrp	x4, _ltdc_crtc_funcs@GOTPAGE
Lloh4:
	ldr	x4, [x4, _ltdc_crtc_funcs@GOTPAGEOFF]
	mov	x0, x19
	mov	x1, x20
	mov	x3, #0
	mov	x5, #0
	bl	_drm_crtc_init_with_planes
	cbz	w0, LBB0_5
; %bb.2:
	mov	x21, x0
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_3:
	bl	_DRM_ERROR
	mov	x0, x19
	bl	_ltdc_plane_destroy_all
	b	LBB0_10
LBB0_4:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_5:
Lloh12:
	adrp	x1, _ltdc_crtc_helper_funcs@GOTPAGE
Lloh13:
	ldr	x1, [x1, _ltdc_crtc_helper_funcs@GOTPAGEOFF]
	mov	x0, x20
	bl	_drm_crtc_helper_add
Lloh14:
	adrp	x21, _CLUT_SIZE@GOTPAGE
Lloh15:
	ldr	x21, [x21, _CLUT_SIZE@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_drm_mode_crtc_set_gamma_size
	ldr	w3, [x21]
	mov	x0, x20
	mov	w1, #0
	mov	w2, #0
	bl	_drm_crtc_enable_color_mgmt
	ldr	w1, [x20]
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	mov	w21, #0
	ldr	w8, [x22]
	cmp	w8, #2
	b.lo	LBB0_10
; %bb.6:
	mov	w20, #1
Lloh18:
	adrp	x21, _DRM_PLANE_TYPE_OVERLAY@GOTPAGE
Lloh19:
	ldr	x21, [x21, _DRM_PLANE_TYPE_OVERLAY@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x19
	bl	_ltdc_plane_create
	cbz	x0, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	w20, w20, #1
	ldr	w8, [x22]
	cmp	w20, w8
	b.lo	LBB0_7
; %bb.9:
	mov	w21, #0
LBB0_10:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_11:
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w21, w8
	str	x20, [sp]
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_PLANE_TYPE_PRIMARY,4,2     ; @DRM_PLANE_TYPE_PRIMARY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can not create primary plane\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ltdc_crtc_funcs,4,2            ; @ltdc_crtc_funcs
l_.str.1:                               ; @.str.1
	.asciz	"Can not initialize CRTC\n"

	.comm	_ltdc_crtc_helper_funcs,4,2     ; @ltdc_crtc_helper_funcs
	.comm	_CLUT_SIZE,4,2                  ; @CLUT_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"CRTC:%d created\n"

	.comm	_DRM_PLANE_TYPE_OVERLAY,4,2     ; @DRM_PLANE_TYPE_OVERLAY
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"Can not create overlay plane %d\n"

	.no_dead_strip	_ltdc_crtc_init
.subsections_via_symbols
