	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_drm_crtc_create            ## -- Begin function mtk_drm_crtc_create
	.p2align	4, 0x90
_mtk_drm_crtc_create:                   ## @mtk_drm_crtc_create
	.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
	testq	%rsi, %rsi
	je	LBB0_13
## %bb.1:
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	(%rdi), %r13
	movq	8(%rdi), %r15
	movl	(%r15), %edx
	testl	%r14d, %r14d
	je	LBB0_5
## %bb.2:
	movq	16(%r15), %rax
	movl	%r14d, %ebx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12,%rsi,4), %ecx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_12
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rsi
	cmpq	%rsi, %rbx
	jne	LBB0_3
LBB0_5:
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r13, %rdi
	movl	$40, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.6:
	movq	%r13, %rdi
	movq	%rax, %r13
	movl	28(%r15), %eax
	movl	%eax, 36(%r13)
	movl	%r14d, (%r13)
	movl	(%rbx), %ecx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, %esi
	movl	$8, %edx
	callq	_devm_kmalloc_array
	movq	%rax, 24(%r13)
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:
	movl	24(%r15), %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_mtk_disp_mutex_get
	movl	%eax, 32(%r13)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_15
## %bb.8:
	movl	32(%r13), %edi
	callq	_PTR_ERR
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_14
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_11:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_12:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_dev_info
LBB0_13:
	xorl	%ebx, %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movl	(%r13), %eax
	testq	%rax, %rax
	je	LBB0_19
## %bb.16:
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r12,%rcx,4), %edx
	movq	8(%r15), %rsi
	movq	(%rsi,%rdx,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_28
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	24(%r13), %rdx
	movq	%rsi, (%rdx,%rcx,8)
	incq	%rcx
	cmpq	%rcx, %rax
	jne	LBB0_17
LBB0_19:
	movq	24(%r13), %rax
	movq	(%rax), %rdi
	callq	_mtk_ddp_comp_layer_nr
	movl	%eax, 4(%r13)
	movl	(%rbx), %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	movl	$4, %edx
	callq	_devm_kcalloc
	movq	%rax, 16(%r13)
	cmpl	$0, 4(%r13)
	je	LBB0_29
## %bb.20:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	testq	%r12, %r12
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	je	LBB0_24
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=1
	movq	_DRM_PLANE_TYPE_OVERLAY@GOTPCREL(%rip), %rax
	cmpq	$4, %r12
	jne	LBB0_25
## %bb.23:                              ##   in Loop: Header=BB0_21 Depth=1
	movq	_DRM_PLANE_TYPE_CURSOR@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_24:                                ##   in Loop: Header=BB0_21 Depth=1
	movq	_DRM_PLANE_TYPE_PRIMARY@GOTPCREL(%rip), %rax
LBB0_25:                                ##   in Loop: Header=BB0_21 Depth=1
	movl	(%rax), %r14d
	movq	16(%r13), %rbx
	addq	%r12, %rbx
	callq	_BIT
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	%eax, %edx
	movl	%r14d, %ecx
	callq	_mtk_plane_init
	testl	%eax, %eax
	jne	LBB0_33
## %bb.26:                              ##   in Loop: Header=BB0_21 Depth=1
	incq	%r15
	movl	4(%r13), %edx
	addq	$4, %r12
	cmpq	%rdx, %r15
	jb	LBB0_21
## %bb.27:
	movq	16(%r13), %rax
	leaq	4(%rax), %rsi
	xorl	%ecx, %ecx
	cmpl	$2, %edx
	cmovaeq	%rsi, %rcx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_30
LBB0_28:
	movq	16(%r15), %rax
	movl	(%rax,%rdx,8), %edx
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_29:
	xorl	%ecx, %ecx
LBB0_30:
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%rax, %rdx
	callq	_mtk_drm_crtc_init
	testl	%eax, %eax
	js	LBB0_33
## %bb.31:
	addq	$8, %r13
	movq	_MTK_LUT_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_drm_mode_crtc_set_gamma_size
	movl	(%rbx), %ecx
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_drm_crtc_enable_color_mgmt
	incl	(%r15)
	jmp	LBB0_14
LBB0_33:
	movl	%eax, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Not creating crtc %d because component %d is disabled or missing\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"Failed to get mutex: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Component %pOF not initialized\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_DRM_PLANE_TYPE_PRIMARY,4,2     ## @DRM_PLANE_TYPE_PRIMARY
	.comm	_DRM_PLANE_TYPE_CURSOR,4,2      ## @DRM_PLANE_TYPE_CURSOR
	.comm	_DRM_PLANE_TYPE_OVERLAY,4,2     ## @DRM_PLANE_TYPE_OVERLAY
	.comm	_MTK_LUT_SIZE,4,2               ## @MTK_LUT_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_drm_crtc_create            ; -- Begin function mtk_drm_crtc_create
	.p2align	2
_mtk_drm_crtc_create:                   ; @mtk_drm_crtc_create
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x1
	cbz	x1, LBB0_12
; %bb.1:
	mov	x24, x2
	mov	x20, x0
	ldp	x22, x25, [x0]
	ldr	w19, [x25]
	cbz	w2, LBB0_5
; %bb.2:
	ldr	x8, [x25, #16]
	mov	w9, w24
	mov	x10, x23
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w3, [x10]
	ldr	x11, [x8, x3, lsl #3]
	cbz	x11, LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x10, x10, #4
	subs	x9, x9, #1
	b.ne	LBB0_3
LBB0_5:
Lloh0:
	adrp	x26, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x26, [x26, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	x0, x22
	mov	w1, #40
	bl	_devm_kzalloc
	cbz	x0, LBB0_9
; %bb.6:
	mov	x21, x0
	ldr	w8, [x25, #28]
	str	w8, [x0, #36]
	str	w24, [x0]
	ldr	w3, [x26]
	mov	x0, x22
	mov	x1, x24
	mov	w2, #8
	bl	_devm_kmalloc_array
	str	x0, [x21, #24]
	cbz	x0, LBB0_9
; %bb.7:
	ldr	w0, [x25, #24]
	mov	x1, x19
	bl	_mtk_disp_mutex_get
	str	w0, [x21, #32]
	bl	_IS_ERR
	cbz	x0, LBB0_13
; %bb.8:
	ldr	w0, [x21, #32]
	bl	_PTR_ERR
	mov	x23, x0
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x23
	bl	_dev_err
	b	LBB0_12
LBB0_9:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_12
LBB0_11:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x19
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_dev_info
	mov	w23, #0
LBB0_12:
	mov	x0, x23
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_13:
	ldr	w8, [x21]
	cbz	w8, LBB0_17
; %bb.14:
	mov	x9, #0
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x23, x9, lsl #2]
	ldr	x11, [x25, #8]
	ldr	x11, [x11, x10, lsl #3]
	cbz	x11, LBB0_25
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	x10, [x21, #24]
	str	x11, [x10, x9, lsl #3]
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_15
LBB0_17:
	ldr	x8, [x21, #24]
	ldr	x0, [x8]
	bl	_mtk_ddp_comp_layer_nr
	mov	x1, x0
	str	w0, [x21, #4]
	ldr	w3, [x26]
	mov	x0, x22
	mov	w2, #4
	bl	_devm_kcalloc
	str	x0, [x21, #16]
	ldr	w8, [x21, #4]
	cbz	w8, LBB0_26
; %bb.18:
	mov	x24, #0
	mov	x26, #0
Lloh8:
	adrp	x28, _DRM_PLANE_TYPE_CURSOR@GOTPAGE
Lloh9:
	ldr	x28, [x28, _DRM_PLANE_TYPE_CURSOR@GOTPAGEOFF]
Lloh10:
	adrp	x27, _DRM_PLANE_TYPE_OVERLAY@GOTPAGE
Lloh11:
	ldr	x27, [x27, _DRM_PLANE_TYPE_OVERLAY@GOTPAGEOFF]
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	cbz	x24, LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	cmp	x24, #4
	csel	x8, x28, x27, eq
	b	LBB0_22
LBB0_21:                                ;   in Loop: Header=BB0_19 Depth=1
Lloh12:
	adrp	x8, _DRM_PLANE_TYPE_PRIMARY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DRM_PLANE_TYPE_PRIMARY@GOTPAGEOFF]
LBB0_22:                                ;   in Loop: Header=BB0_19 Depth=1
	ldr	w22, [x8]
	ldr	x8, [x21, #16]
	add	x23, x8, x24
	mov	x0, x19
	bl	_BIT
	mov	x2, x0
	mov	x0, x20
	mov	x1, x23
	mov	x3, x22
	bl	_mtk_plane_init
	cbnz	w0, LBB0_29
; %bb.23:                               ;   in Loop: Header=BB0_19 Depth=1
	add	x26, x26, #1
	ldr	w8, [x21, #4]
	add	x24, x24, #4
	cmp	x26, x8
	b.lo	LBB0_19
; %bb.24:
	ldr	x2, [x21, #16]
	add	x9, x2, #4
	cmp	w8, #1
	csel	x3, x9, xzr, hi
	b	LBB0_27
LBB0_25:
	ldr	x8, [x25, #16]
	ldr	x2, [x8, x10, lsl #3]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_dev_err
Lloh16:
	adrp	x8, _ENODEV@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_10
LBB0_26:
	mov	x2, x0
	mov	x3, #0
LBB0_27:
	mov	x0, x20
	mov	x1, x21
	mov	x4, x19
	bl	_mtk_drm_crtc_init
	tbnz	w0, #31, LBB0_29
; %bb.28:
	add	x19, x21, #8
Lloh18:
	adrp	x20, _MTK_LUT_SIZE@GOTPAGE
Lloh19:
	ldr	x20, [x20, _MTK_LUT_SIZE@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_drm_mode_crtc_set_gamma_size
	ldr	w3, [x20]
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	bl	_drm_crtc_enable_color_mgmt
	mov	w23, #0
	ldr	w8, [x25]
	add	w8, w8, #1
	str	w8, [x25]
	b	LBB0_12
LBB0_29:
	mov	x23, x0
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Not creating crtc %d because component %d is disabled or missing\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"Failed to get mutex: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Component %pOF not initialized\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_DRM_PLANE_TYPE_PRIMARY,4,2     ; @DRM_PLANE_TYPE_PRIMARY
	.comm	_DRM_PLANE_TYPE_CURSOR,4,2      ; @DRM_PLANE_TYPE_CURSOR
	.comm	_DRM_PLANE_TYPE_OVERLAY,4,2     ; @DRM_PLANE_TYPE_OVERLAY
	.comm	_MTK_LUT_SIZE,4,2               ; @MTK_LUT_SIZE
.subsections_via_symbols
