	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function mtk_drm_kms_init
LCPI0_0:
	.long	64                              ## 0x40
	.long	64                              ## 0x40
	.long	4096                            ## 0x1000
	.long	4096                            ## 0x1000
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_mtk_drm_kms_init:                      ## @mtk_drm_kms_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	%rdi, %r14
	movq	40(%rdi), %r12
	movq	_platform_bus_type@GOTPCREL(%rip), %rdi
	callq	_iommu_present
	testl	%eax, %eax
	je	LBB0_14
## %bb.1:
	movq	40(%r12), %rdi
	callq	_of_find_device_by_node
	testq	%rax, %rax
	je	LBB0_15
## %bb.2:
	movq	%rax, 32(%r12)
	movq	%r14, %rdi
	callq	_drm_mode_config_init
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [64,64,4096,4096]
	movups	%xmm0, 16(%r14)
	movq	_mtk_drm_mode_config_funcs@GOTPCREL(%rip), %rax
	movq	%rax, 32(%r14)
	movq	8(%r14), %rdi
	movq	%r14, %rsi
	callq	_component_bind_all
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_25
## %bb.3:
	movq	16(%r12), %rax
	movq	(%rax), %rsi
	movl	32(%rax), %edx
	movq	%r14, %rdi
	callq	_mtk_drm_crtc_create
	testl	%eax, %eax
	js	LBB0_16
## %bb.4:
	movq	16(%r12), %rax
	movq	8(%rax), %rsi
	movl	28(%rax), %edx
	movq	%r14, %rdi
	callq	_mtk_drm_crtc_create
	testl	%eax, %eax
	js	LBB0_16
## %bb.5:
	movq	16(%r12), %rax
	movq	16(%rax), %rsi
	movl	24(%rax), %edx
	movq	%r14, %rdi
	callq	_mtk_drm_crtc_create
	testl	%eax, %eax
	js	LBB0_16
## %bb.6:
	movq	16(%r12), %rcx
	movq	24(%r12), %rax
	movq	(%rcx), %rdx
	movq	(%rdx), %rdx
	movq	(%rax,%rdx,8), %rdi
	testq	%rdi, %rdi
	jne	LBB0_8
## %bb.7:
	movq	8(%rcx), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rdi
LBB0_8:
	callq	_of_find_device_by_node
	testq	%rax, %rax
	je	LBB0_19
## %bb.9:
	movq	%rax, %r15
	movq	%rax, 8(%r12)
	cmpq	$0, (%rax)
	jne	LBB0_11
## %bb.10:
	movl	$1, (%r12)
	movq	8(%r14), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4, %esi
	callq	_devm_kzalloc
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_22
LBB0_11:
	movl	$32, %edi
	callq	_DMA_BIT_MASK
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_dma_set_max_seg_size
	testl	%eax, %eax
	je	LBB0_20
## %bb.12:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	cmpl	$0, (%r12)
	je	LBB0_24
LBB0_13:
	movq	$0, (%r15)
	jmp	LBB0_24
LBB0_14:
	movq	_EPROBE_DEFER@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_26
LBB0_15:
	movq	8(%r14), %rdi
	movq	40(%r12), %rdx
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	40(%r12), %rdi
	callq	_of_node_put
	movq	_EPROBE_DEFER@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_26
LBB0_16:
	movl	%eax, %ebx
LBB0_24:
	movq	8(%r14), %rdi
	movq	%r14, %rsi
	callq	_component_unbind_all
LBB0_25:
	movq	%r14, %rdi
	callq	_drm_mode_config_cleanup
LBB0_26:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	8(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_24
LBB0_20:
	movl	$1, (%r14)
	movq	_MAX_CRTC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_drm_vblank_init
	testl	%eax, %eax
	js	LBB0_23
## %bb.21:
	movq	%r14, %rdi
	callq	_drm_kms_helper_poll_init
	movq	%r14, %rdi
	callq	_drm_mode_config_reset
	xorl	%ebx, %ebx
	jmp	LBB0_26
LBB0_22:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_24
LBB0_23:
	movl	%eax, %ebx
	cmpl	$0, (%r12)
	jne	LBB0_13
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_platform_bus_type,4,2          ## @platform_bus_type
	.comm	_EPROBE_DEFER,4,2               ## @EPROBE_DEFER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Waiting for disp-mutex device %pOF\n"

	.comm	_mtk_drm_mode_config_funcs,4,2  ## @mtk_drm_mode_config_funcs
	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"Need at least one OVL device\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"Failed to set DMA segment size\n"

	.comm	_MAX_CRTC,4,2                   ## @MAX_CRTC
	.no_dead_strip	_mtk_drm_kms_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function mtk_drm_kms_init
lCPI0_0:
	.long	64                              ; 0x40
	.long	64                              ; 0x40
	.long	4096                            ; 0x1000
	.long	4096                            ; 0x1000
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_mtk_drm_kms_init:                      ; @mtk_drm_kms_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	x19, x0
	ldr	x22, [x0, #40]
Lloh0:
	adrp	x0, _platform_bus_type@GOTPAGE
Lloh1:
	ldr	x0, [x0, _platform_bus_type@GOTPAGEOFF]
	bl	_iommu_present
	cbz	w0, LBB0_15
; %bb.1:
	ldr	x0, [x22, #40]
	bl	_of_find_device_by_node
	cbz	x0, LBB0_14
; %bb.2:
	str	x0, [x22, #32]
	mov	x0, x19
	bl	_drm_mode_config_init
Lloh2:
	adrp	x8, lCPI0_0@PAGE
Lloh3:
	ldr	q0, [x8, lCPI0_0@PAGEOFF]
	str	q0, [x19, #16]
Lloh4:
	adrp	x8, _mtk_drm_mode_config_funcs@GOTPAGE
Lloh5:
	ldr	x8, [x8, _mtk_drm_mode_config_funcs@GOTPAGEOFF]
	str	x8, [x19, #32]
	ldr	x0, [x19, #8]
	mov	x1, x19
	bl	_component_bind_all
	mov	x20, x0
	cbnz	w0, LBB0_18
; %bb.3:
	ldr	x8, [x22, #16]
	ldr	x1, [x8]
	ldr	w2, [x8, #32]
	mov	x0, x19
	bl	_mtk_drm_crtc_create
	tbnz	w0, #31, LBB0_16
; %bb.4:
	ldr	x8, [x22, #16]
	ldr	x1, [x8, #8]
	ldr	w2, [x8, #28]
	mov	x0, x19
	bl	_mtk_drm_crtc_create
	tbnz	w0, #31, LBB0_16
; %bb.5:
	ldr	x8, [x22, #16]
	ldr	x1, [x8, #16]
	ldr	w2, [x8, #24]
	mov	x0, x19
	bl	_mtk_drm_crtc_create
	tbnz	w0, #31, LBB0_16
; %bb.6:
	ldp	x9, x8, [x22, #16]
	ldr	x10, [x9]
	ldr	x10, [x10]
	ldr	x0, [x8, x10, lsl #3]
	cbnz	x0, LBB0_8
; %bb.7:
	ldr	x9, [x9, #8]
	ldr	x9, [x9]
	ldr	x0, [x8, x9, lsl #3]
LBB0_8:
	bl	_of_find_device_by_node
	cbz	x0, LBB0_20
; %bb.9:
	mov	x21, x0
	str	x0, [x22, #8]
	ldr	x8, [x0]
	cbnz	x8, LBB0_11
; %bb.10:
	mov	w8, #1
	str	w8, [x22]
	ldr	x0, [x19, #8]
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	w1, #4
	bl	_devm_kzalloc
	str	x0, [x21]
	cbz	x0, LBB0_23
LBB0_11:
	mov	w0, #32
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x21
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_dma_set_max_seg_size
	cbz	w0, LBB0_21
; %bb.12:
	mov	x20, x0
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	ldr	w8, [x22]
	cbz	w8, LBB0_17
LBB0_13:
	str	xzr, [x21]
	b	LBB0_17
LBB0_14:
	ldr	x0, [x19, #8]
	ldr	x8, [x22, #40]
	str	x8, [sp]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	ldr	x0, [x22, #40]
	bl	_of_node_put
LBB0_15:
Lloh13:
	adrp	x8, _EPROBE_DEFER@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EPROBE_DEFER@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_19
LBB0_16:
	mov	x20, x0
LBB0_17:
	ldr	x0, [x19, #8]
	mov	x1, x19
	bl	_component_unbind_all
LBB0_18:
	mov	x0, x19
	bl	_drm_mode_config_cleanup
LBB0_19:
	mov	x0, x20
	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_20:
Lloh16:
	adrp	x8, _ENODEV@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w20, w8
	ldr	x0, [x19, #8]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_17
LBB0_21:
	mov	w8, #1
	str	w8, [x19]
Lloh21:
	adrp	x8, _MAX_CRTC@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MAX_CRTC@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_drm_vblank_init
	tbnz	w0, #31, LBB0_24
; %bb.22:
	mov	x0, x19
	bl	_drm_kms_helper_poll_init
	mov	x0, x19
	bl	_drm_mode_config_reset
	mov	w20, #0
	b	LBB0_19
LBB0_23:
Lloh24:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_17
LBB0_24:
	mov	x20, x0
	ldr	w8, [x22]
	cbnz	w8, LBB0_13
	b	LBB0_17
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdrp	Lloh2, Lloh4
	.loh AdrpLdr	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_platform_bus_type,4,2          ; @platform_bus_type
	.comm	_EPROBE_DEFER,4,2               ; @EPROBE_DEFER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Waiting for disp-mutex device %pOF\n"

	.comm	_mtk_drm_mode_config_funcs,4,2  ; @mtk_drm_mode_config_funcs
	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"Need at least one OVL device\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"Failed to set DMA segment size\n"

	.comm	_MAX_CRTC,4,2                   ; @MAX_CRTC
	.no_dead_strip	_mtk_drm_kms_init
.subsections_via_symbols
