	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipu_crtc_init
_ipu_crtc_init:                         ## @ipu_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	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	16(%rdi), %rax
	movl	(%rax), %edi
	callq	_dev_get_drvdata
	movq	%rax, %r14
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_ipu_get_resources
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r13d
	movq	16(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_21
LBB0_2:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	$0, (%rbx)
	movq	%rbx, %r13
	js	LBB0_3
## %bb.4:
	movq	_IPU_DP_FLOW_SYNC_BG@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_5
LBB0_3:
	negl	%r12d
LBB0_5:
	movq	%r14, %rbx
	movq	%rcx, %r14
	movq	8(%r13), %rax
	movl	(%rax), %edx
	movq	_DRM_PLANE_TYPE_PRIMARY@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%rcx, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %ecx
	xorl	%r8d, %r8d
	callq	_ipu_plane_init
	movq	(%r15), %rcx
	movq	%rax, (%rcx)
	movq	(%r15), %rax
	movq	(%rax), %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	(%r15), %rax
	movq	(%rax), %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_7
LBB0_8:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	leaq	24(%r15), %r12
	movl	16(%r13), %eax
	movl	%eax, 24(%r15)
	movq	_ipu_helper_funcs@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	callq	_drm_crtc_helper_add
	movq	(%r15), %rax
	movq	(%rax), %rdx
	movq	_ipu_crtc_funcs@GOTPCREL(%rip), %r8
	movq	%r14, %rdi
	movq	%r12, %rsi
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	callq	_drm_crtc_init_with_planes
	movq	(%r15), %rax
	movq	(%rax), %rdi
	callq	_ipu_plane_get_resources
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	movq	16(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_7
LBB0_10:
	cmpq	$0, (%r13)
	js	LBB0_14
## %bb.11:
	movq	8(%r13), %rax
	movl	4(%rax), %ebx
	testl	%ebx, %ebx
	jle	LBB0_14
## %bb.12:
	movq	_IPU_DP_FLOW_SYNC_FG@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r12, %rdi
	callq	_drm_crtc_mask
	movq	_DRM_PLANE_TYPE_OVERLAY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	movl	%r13d, %ecx
	movl	%eax, %r8d
	callq	_ipu_plane_init
	movq	(%r15), %rcx
	movq	%rax, 8(%rcx)
	movq	(%r15), %rax
	movq	8(%rax), %rdi
	callq	_IS_ERR
	movq	(%r15), %rcx
	testq	%rax, %rax
	je	LBB0_17
## %bb.13:
	movq	$0, 8(%rcx)
LBB0_14:
	movq	(%r15), %rax
	movq	(%rax), %rdi
	callq	_ipu_plane_irq
	movl	%eax, 8(%r15)
	movq	16(%r15), %rdi
	movq	_ipu_irq_handler@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	L_.str.3(%rip), %r8
	xorl	%r13d, %r13d
	movl	%eax, %esi
	xorl	%ecx, %ecx
	movq	%r15, %r9
	callq	_devm_request_irq
	testl	%eax, %eax
	js	LBB0_15
## %bb.20:
	movl	8(%r15), %edi
	callq	_disable_irq
	jmp	LBB0_21
LBB0_15:
	movl	%eax, %ebx
	movq	16(%r15), %rdi
	leaq	L_.str.4(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	movq	(%r15), %rax
	movq	8(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_19
## %bb.16:
	callq	_ipu_plane_put_resources
	jmp	LBB0_19
LBB0_17:
	movq	8(%rcx), %rdi
	callq	_ipu_plane_get_resources
	testl	%eax, %eax
	je	LBB0_14
## %bb.18:
	movl	%eax, %ebx
	movq	16(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
LBB0_19:
	movq	(%r15), %rax
	movq	(%rax), %rdi
	callq	_ipu_plane_put_resources
LBB0_7:
	movq	%r15, %rdi
	callq	_ipu_put_resources
	movl	%ebx, %r13d
LBB0_21:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"getting resources failed with %d.\n"

	.comm	_IPU_DP_FLOW_SYNC_BG,4,2        ## @IPU_DP_FLOW_SYNC_BG
	.comm	_DRM_PLANE_TYPE_PRIMARY,4,2     ## @DRM_PLANE_TYPE_PRIMARY
	.comm	_ipu_helper_funcs,4,2           ## @ipu_helper_funcs
	.comm	_ipu_crtc_funcs,4,2             ## @ipu_crtc_funcs
L_.str.1:                               ## @.str.1
	.asciz	"getting plane 0 resources failed with %d.\n"

	.comm	_IPU_DP_FLOW_SYNC_FG,4,2        ## @IPU_DP_FLOW_SYNC_FG
	.comm	_DRM_PLANE_TYPE_OVERLAY,4,2     ## @DRM_PLANE_TYPE_OVERLAY
L_.str.2:                               ## @.str.2
	.asciz	"getting plane 1 resources failed with %d.\n"

	.comm	_ipu_irq_handler,4,2            ## @ipu_irq_handler
L_.str.3:                               ## @.str.3
	.asciz	"imx_drm"

L_.str.4:                               ## @.str.4
	.asciz	"irq request failed with %d.\n"

	.no_dead_strip	_ipu_crtc_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipu_crtc_init
_ipu_crtc_init:                         ; @ipu_crtc_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x23, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	w0, [x8]
	bl	_dev_get_drvdata
	mov	x21, x0
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	mov	x0, x19
	mov	x1, x23
	bl	_ipu_get_resources
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
	ldr	x0, [x19, #16]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	bl	_dev_err
	b	LBB0_18
LBB0_2:
Lloh5:
	adrp	x8, _IPU_DP_FLOW_SYNC_BG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IPU_DP_FLOW_SYNC_BG@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldp	x9, x10, [x23]
	cmp	x9, #0
	csneg	w3, w8, w24, ge
	ldr	w2, [x10]
Lloh8:
	adrp	x8, _DRM_PLANE_TYPE_PRIMARY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DRM_PLANE_TYPE_PRIMARY@GOTPAGEOFF]
Lloh10:
	ldr	w5, [x8]
	mov	x0, x20
	mov	x1, x21
	mov	w4, #0
	bl	_ipu_plane_init
	ldr	x8, [x19]
	str	x0, [x8]
	ldr	x8, [x19]
	ldr	x0, [x8]
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x8, [x19]
	ldr	x0, [x8]
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_17
LBB0_4:
	add	x24, x19, #24
	ldr	w8, [x23, #16]
	str	w8, [x19, #24]
Lloh11:
	adrp	x1, _ipu_helper_funcs@GOTPAGE
Lloh12:
	ldr	x1, [x1, _ipu_helper_funcs@GOTPAGEOFF]
	mov	x0, x24
	bl	_drm_crtc_helper_add
	ldr	x8, [x19]
	ldr	x2, [x8]
Lloh13:
	adrp	x4, _ipu_crtc_funcs@GOTPAGE
Lloh14:
	ldr	x4, [x4, _ipu_crtc_funcs@GOTPAGEOFF]
	mov	x0, x20
	mov	x1, x24
	mov	x3, #0
	mov	x5, #0
	bl	_drm_crtc_init_with_planes
	ldr	x8, [x19]
	ldr	x0, [x8]
	bl	_ipu_plane_get_resources
	cbz	w0, LBB0_6
; %bb.5:
	mov	x22, x0
	ldr	x0, [x19, #16]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_dev_err
	b	LBB0_17
LBB0_6:
	ldr	x8, [x23]
	tbnz	x8, #63, LBB0_10
; %bb.7:
	ldr	x8, [x23, #8]
	ldr	w22, [x8, #4]
	cmp	w22, #1
	b.lt	LBB0_10
; %bb.8:
Lloh17:
	adrp	x8, _IPU_DP_FLOW_SYNC_FG@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IPU_DP_FLOW_SYNC_FG@GOTPAGEOFF]
Lloh19:
	ldr	w23, [x8]
	mov	x0, x24
	bl	_drm_crtc_mask
	mov	x4, x0
Lloh20:
	adrp	x8, _DRM_PLANE_TYPE_OVERLAY@GOTPAGE
Lloh21:
	ldr	x8, [x8, _DRM_PLANE_TYPE_OVERLAY@GOTPAGEOFF]
Lloh22:
	ldr	w5, [x8]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	mov	x3, x23
	bl	_ipu_plane_init
	ldr	x8, [x19]
	str	x0, [x8, #8]
	ldr	x8, [x19]
	ldr	x0, [x8, #8]
	bl	_IS_ERR
	ldr	x8, [x19]
	cbz	x0, LBB0_14
; %bb.9:
	str	xzr, [x8, #8]
LBB0_10:
	ldr	x8, [x19]
	ldr	x0, [x8]
	bl	_ipu_plane_irq
	mov	x1, x0
	str	w0, [x19, #8]
	ldr	x0, [x19, #16]
Lloh23:
	adrp	x8, _ipu_irq_handler@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ipu_irq_handler@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
Lloh26:
	adrp	x4, l_.str.3@PAGE
Lloh27:
	add	x4, x4, l_.str.3@PAGEOFF
	mov	w3, #0
	mov	x5, x19
	bl	_devm_request_irq
	tbnz	w0, #31, LBB0_12
; %bb.11:
	ldr	w0, [x19, #8]
	bl	_disable_irq
	mov	w22, #0
	b	LBB0_18
LBB0_12:
	mov	x22, x0
	ldr	x0, [x19, #16]
Lloh28:
	adrp	x1, l_.str.4@PAGE
Lloh29:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x22
	bl	_dev_err
	ldr	x8, [x19]
	ldr	x0, [x8, #8]
	cbz	x0, LBB0_16
; %bb.13:
	bl	_ipu_plane_put_resources
	b	LBB0_16
LBB0_14:
	ldr	x0, [x8, #8]
	bl	_ipu_plane_get_resources
	cbz	w0, LBB0_10
; %bb.15:
	mov	x22, x0
	ldr	x0, [x19, #16]
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x22
	bl	_dev_err
LBB0_16:
	ldr	x8, [x19]
	ldr	x0, [x8]
	bl	_ipu_plane_put_resources
LBB0_17:
	mov	x0, x19
	bl	_ipu_put_resources
LBB0_18:
	mov	x0, x22
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"getting resources failed with %d.\n"

	.comm	_IPU_DP_FLOW_SYNC_BG,4,2        ; @IPU_DP_FLOW_SYNC_BG
	.comm	_DRM_PLANE_TYPE_PRIMARY,4,2     ; @DRM_PLANE_TYPE_PRIMARY
	.comm	_ipu_helper_funcs,4,2           ; @ipu_helper_funcs
	.comm	_ipu_crtc_funcs,4,2             ; @ipu_crtc_funcs
l_.str.1:                               ; @.str.1
	.asciz	"getting plane 0 resources failed with %d.\n"

	.comm	_IPU_DP_FLOW_SYNC_FG,4,2        ; @IPU_DP_FLOW_SYNC_FG
	.comm	_DRM_PLANE_TYPE_OVERLAY,4,2     ; @DRM_PLANE_TYPE_OVERLAY
l_.str.2:                               ; @.str.2
	.asciz	"getting plane 1 resources failed with %d.\n"

	.comm	_ipu_irq_handler,4,2            ; @ipu_irq_handler
l_.str.3:                               ; @.str.3
	.asciz	"imx_drm"

l_.str.4:                               ; @.str.4
	.asciz	"irq request failed with %d.\n"

	.no_dead_strip	_ipu_crtc_init
.subsections_via_symbols
