	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mdp5_kms_init                  ## -- Begin function mdp5_kms_init
	.p2align	4, 0x90
_mdp5_kms_init:                         ## @mdp5_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	%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
	movq	48(%rdi), %rax
	movq	(%rax), %r12
	testq	%r12, %r12
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r14
	movq	%r12, %rdi
	callq	_to_mdp_kms
	movl	%eax, %edi
	callq	_to_mdp5_kms
	movq	%rax, %r13
	leaq	16(%rax), %rdi
	movq	_kms_funcs@GOTPCREL(%rip), %rsi
	callq	_mdp_kms_init
	movq	8(%r13), %r15
	movl	12(%r15), %edi
	xorl	%esi, %esi
	callq	_irq_of_parse_and_map
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	%ebx, (%r12)
	movl	(%r13), %edi
	callq	_mdp5_cfg_get_config
	movq	%rax, %rbx
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_pm_runtime_get_sync
	movq	_MDP5_INTF_NUM_MAX@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_11
## %bb.6:
	xorl	%r14d, %r14d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%r14
	movslq	(%r15), %rax
	cmpq	%rax, %r14
	jge	LBB0_11
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rax
	movq	8(%rax), %rax
	movl	(%rax,%r14,4), %edi
	callq	_mdp5_cfg_intf_is_virtual
	testq	%rax, %rax
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	cmpl	$0, (%rax,%r14,4)
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	%r14d, %edi
	callq	_REG_MDP5_INTF_TIMING_ENGINE_EN
	movq	%r13, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_mdp5_write
	movl	%r14d, %edi
	callq	_REG_MDP5_INTF_FRAME_LINE_COUNT_EN
	movq	%r13, %rdi
	movl	%eax, %esi
	movl	$3, %edx
	callq	_mdp5_write
	jmp	LBB0_10
LBB0_11:
	movl	$16, %edi
	callq	_mdelay
	movq	(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_19
## %bb.12:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, 8(%rax)
	movq	%rax, %rdi
	jne	LBB0_14
## %bb.13:
	movq	(%rax), %rdi
LBB0_14:
	leaq	L_.str.1(%rip), %rdx
	callq	_msm_gem_address_space_create
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_17
## %bb.15:
	movq	%rbx, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_16
LBB0_1:
	xorl	%r12d, %r12d
LBB0_23:
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_4
LBB0_19:
	leaq	L_.str.3(%rip), %rsi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_DRM_DEV_INFO
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_20:
	movq	%r15, %rdi
	callq	_pm_runtime_put_sync
	movq	%r13, %rdi
	callq	_modeset_init
	testl	%eax, %eax
	je	LBB0_22
## %bb.21:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_4
LBB0_17:
	movq	%rbx, 8(%r12)
	movq	(%rbx), %r14
	movq	(%r14), %rax
	movq	(%rax), %r15
	movq	_iommu_ports@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %edi
	callq	_ARRAY_SIZE
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	*%r15
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	testl	%eax, %eax
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_20
## %bb.18:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
LBB0_4:
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_DRM_DEV_ERROR
LBB0_16:
	movq	%r12, %rdi
	callq	_mdp5_kms_destroy
	movl	%ebx, %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_22:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%r14)
	movabsq	$281470681808895, %rax          ## imm = 0xFFFF0000FFFF
	movq	%rax, 24(%r14)
	movq	_drm_calc_vbltimestamp_from_scanoutpos@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	16(%r14), %rcx
	movl	%eax, 8(%rcx)
	movq	_mdp5_get_scanoutpos@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rcx)
	movq	_mdp5_get_vblank_counter@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movq	$0, 8(%r14)
	movl	$1, (%r14)
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_kms_funcs,4,2                  ## @kms_funcs
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to get irq: %d\n"

	.comm	_MDP5_INTF_NUM_MAX,4,2          ## @MDP5_INTF_NUM_MAX
L_.str.1:                               ## @.str.1
	.asciz	"mdp5"

	.comm	_iommu_ports,4,2                ## @iommu_ports
L_.str.2:                               ## @.str.2
	.asciz	"failed to attach iommu: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"no iommu, fallback to phys contig buffers for scanout\n"

L_.str.4:                               ## @.str.4
	.asciz	"modeset_init failed: %d\n"

	.comm	_drm_calc_vbltimestamp_from_scanoutpos,4,2 ## @drm_calc_vbltimestamp_from_scanoutpos
	.comm	_mdp5_get_scanoutpos,4,2        ## @mdp5_get_scanoutpos
	.comm	_mdp5_get_vblank_counter,4,2    ## @mdp5_get_vblank_counter
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mdp5_kms_init                  ; -- Begin function mdp5_kms_init
	.p2align	2
_mdp5_kms_init:                         ; @mdp5_kms_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
	ldr	x8, [x0, #48]
	ldr	x19, [x8]
	cbz	x19, LBB0_22
; %bb.1:
	mov	x20, x0
	mov	x0, x19
	bl	_to_mdp_kms
	bl	_to_mdp5_kms
	mov	x22, x0
	add	x0, x0, #16
Lloh0:
	adrp	x1, _kms_funcs@GOTPAGE
Lloh1:
	ldr	x1, [x1, _kms_funcs@GOTPAGEOFF]
	bl	_mdp_kms_init
	ldr	x21, [x22, #8]
	ldr	w0, [x21, #12]
	mov	w1, #0
	bl	_irq_of_parse_and_map
	mov	x23, x0
	tbnz	w0, #31, LBB0_13
; %bb.2:
	str	w23, [x19]
	ldr	w0, [x22]
	bl	_mdp5_cfg_get_config
	mov	x23, x0
	mov	x0, x21
	bl	_pm_runtime_get_sync
Lloh2:
	adrp	x25, _MDP5_INTF_NUM_MAX@GOTPAGE
Lloh3:
	ldr	x25, [x25, _MDP5_INTF_NUM_MAX@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.3:
	mov	x24, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x25]
	cmp	x24, x8
	b.ge	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23, #8]
	ldr	x8, [x8, #8]
	ldr	w0, [x8, x24, lsl #2]
	bl	_mdp5_cfg_intf_is_virtual
	cbnz	x0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x23, #8]
	ldr	x8, [x8]
	ldr	w8, [x8, x24, lsl #2]
	cbz	w8, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	bl	_REG_MDP5_INTF_TIMING_ENGINE_EN
	mov	x1, x0
	mov	x0, x22
	mov	w2, #0
	bl	_mdp5_write
	mov	x0, x24
	bl	_REG_MDP5_INTF_FRAME_LINE_COUNT_EN
	mov	x1, x0
	mov	x0, x22
	mov	w2, #3
	bl	_mdp5_write
	b	LBB0_4
LBB0_8:
	mov	w0, #16
	bl	_mdelay
	ldr	x1, [x23]
	cbz	x1, LBB0_14
; %bb.9:
	ldr	w8, [x21, #8]
	mov	x0, x21
	cbnz	w8, LBB0_11
; %bb.10:
	ldr	x0, [x21]
LBB0_11:
Lloh4:
	adrp	x2, l_.str.1@PAGE
Lloh5:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_msm_gem_address_space_create
	mov	x23, x0
	bl	_IS_ERR
	cbz	x0, LBB0_17
; %bb.12:
	mov	x0, x23
	bl	_PTR_ERR
	mov	x23, x0
	b	LBB0_20
LBB0_13:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_19
LBB0_14:
Lloh8:
	adrp	x1, l_.str.3@PAGE
Lloh9:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_DRM_DEV_INFO
LBB0_15:
	mov	x0, x21
	bl	_pm_runtime_put_sync
	mov	x0, x22
	bl	_modeset_init
	cbz	w0, LBB0_21
; %bb.16:
	mov	x23, x0
Lloh10:
	adrp	x1, l_.str.4@PAGE
Lloh11:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_19
LBB0_17:
	str	x23, [x19, #8]
	ldr	x23, [x23]
	ldr	x8, [x23]
	ldr	x25, [x8]
Lloh12:
	adrp	x8, _iommu_ports@GOTPAGE
Lloh13:
	ldr	x8, [x8, _iommu_ports@GOTPAGEOFF]
Lloh14:
	ldr	w24, [x8]
	mov	x0, x24
	bl	_ARRAY_SIZE
	mov	x2, x0
	mov	x0, x23
	mov	x1, x24
	blr	x25
	cbz	w0, LBB0_15
; %bb.18:
	mov	x23, x0
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_19:
	mov	x0, x21
	mov	x2, x23
	bl	_DRM_DEV_ERROR
LBB0_20:
	mov	x0, x19
	bl	_mdp5_kms_destroy
	mov	x0, x23
	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_21:
	stp	xzr, xzr, [x20, #32]
	movi	d0, #0x00ffff0000ffff
	str	d0, [x20, #24]
Lloh17:
	adrp	x8, _drm_calc_vbltimestamp_from_scanoutpos@GOTPAGE
Lloh18:
	ldr	x8, [x8, _drm_calc_vbltimestamp_from_scanoutpos@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	ldr	x9, [x20, #16]
	str	w8, [x9, #8]
Lloh20:
	adrp	x8, _mdp5_get_scanoutpos@GOTPAGE
Lloh21:
	ldr	x8, [x8, _mdp5_get_scanoutpos@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
Lloh23:
	adrp	x10, _mdp5_get_vblank_counter@GOTPAGE
Lloh24:
	ldr	x10, [x10, _mdp5_get_vblank_counter@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	stp	w10, w8, [x9]
	str	xzr, [x20, #8]
	mov	w8, #1
	str	w8, [x20]
LBB0_22:
	mov	x0, x19
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_kms_funcs,4,2                  ; @kms_funcs
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to get irq: %d\n"

	.comm	_MDP5_INTF_NUM_MAX,4,2          ; @MDP5_INTF_NUM_MAX
l_.str.1:                               ; @.str.1
	.asciz	"mdp5"

	.comm	_iommu_ports,4,2                ; @iommu_ports
l_.str.2:                               ; @.str.2
	.asciz	"failed to attach iommu: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"no iommu, fallback to phys contig buffers for scanout\n"

l_.str.4:                               ; @.str.4
	.asciz	"modeset_init failed: %d\n"

	.comm	_drm_calc_vbltimestamp_from_scanoutpos,4,2 ; @drm_calc_vbltimestamp_from_scanoutpos
	.comm	_mdp5_get_scanoutpos,4,2        ; @mdp5_get_scanoutpos
	.comm	_mdp5_get_vblank_counter,4,2    ; @mdp5_get_vblank_counter
.subsections_via_symbols
