	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_dc_add_planes
_tegra_dc_add_planes:                   ## @tegra_dc_add_planes
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	callq	_tegra_primary_plane_create
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	(%r12), %rax
	cmpq	$1, (%rax)
	movl	$2, %r14d
	sbbq	$0, %r14
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%r13, %r14
	je	LBB0_9
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	1(%r13), %r15
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	%r15d, %edx
	xorl	%ecx, %ecx
	callq	_tegra_dc_overlay_plane_create
	movq	%rax, %rbx
	movq	%rax, -64(%rbp,%r13,8)
	movq	%rax, %rdi
	callq	_IS_ERR
	movq	%r15, %r13
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	%rbx, %rdi
	callq	_PTR_ERR
	movl	%eax, %r14d
	cmpl	$1, %r15d
	je	LBB0_7
## %bb.5:
	movq	_tegra_plane_funcs@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	-80(%rbp,%r15,8), %rdi
	callq	*(%rbx)
	decq	%r15
	cmpq	$1, %r15
	jne	LBB0_6
LBB0_7:
	movq	_tegra_plane_funcs@GOTPCREL(%rip), %rax
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	*(%rax)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.8:
	movl	%r14d, %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_tegra_plane_funcs,8,3          ## @tegra_plane_funcs
	.no_dead_strip	_tegra_dc_add_planes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_dc_add_planes
_tegra_dc_add_planes:                   ; @tegra_dc_add_planes
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	bl	_tegra_primary_plane_create
	mov	x19, x0
	bl	_IS_ERR
	cbz	x0, LBB0_3
LBB0_1:
	ldr	x8, [sp, #24]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.2:
	mov	x0, x19
	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
	add	sp, sp, #96
	ret
LBB0_3:
	ldr	x8, [x21]
	ldr	x24, [x8]
	mov	x0, x22
	mov	x1, x21
	mov	w2, #1
	mov	w3, #0
	bl	_tegra_dc_overlay_plane_create
	mov	x23, x0
	str	x0, [sp, #8]
	bl	_IS_ERR
	mov	x20, x0
	cbz	x0, LBB0_11
; %bb.4:
	mov	w24, #0
	mov	x22, #-1
LBB0_5:
	mov	x0, x23
	bl	_PTR_ERR
	mov	x21, x0
Lloh6:
	adrp	x23, _tegra_plane_funcs@GOTPAGE
Lloh7:
	ldr	x23, [x23, _tegra_plane_funcs@GOTPAGEOFF]
	cbnz	x20, LBB0_9
; %bb.6:
	ldr	x8, [x23]
	add	x20, sp, #8
	ldr	x0, [x20, x22, lsl #3]
	blr	x8
	tbnz	w24, #0, LBB0_9
; %bb.7:
	sub	x24, x22, #1
	ldr	x8, [x23]
	ldr	x0, [x20, x24, lsl #3]
	blr	x8
	cbz	x24, LBB0_9
; %bb.8:
	ldr	x8, [x23]
	add	x9, sp, #8
	add	x9, x9, x22, lsl #3
	ldur	x0, [x9, #-16]
	blr	x8
LBB0_9:
	ldr	x8, [x23]
	mov	x0, x19
	blr	x8
	ldr	x8, [sp, #24]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.10:
	mov	x0, x21
	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
	add	sp, sp, #96
	b	_ERR_PTR
LBB0_11:
	cbz	x24, LBB0_1
; %bb.12:
	mov	x0, x22
	mov	x1, x21
	mov	w2, #2
	mov	w3, #0
	bl	_tegra_dc_overlay_plane_create
	mov	x23, x0
	str	x0, [sp, #16]
	bl	_IS_ERR
	cbz	x0, LBB0_14
; %bb.13:
	mov	x22, #0
	mov	w24, #1
	b	LBB0_5
LBB0_14:
	cbnz	x24, LBB0_1
; %bb.15:
	mov	x0, x22
	mov	x1, x21
	mov	w2, #3
	mov	w3, #0
	bl	_tegra_dc_overlay_plane_create
	mov	x23, x0
	str	x0, [sp, #24]
	bl	_IS_ERR
	cbz	x0, LBB0_17
; %bb.16:
	mov	w24, #0
	mov	w22, #1
	b	LBB0_5
LBB0_17:
	mov	x0, x22
	mov	x1, x21
	mov	w2, #4
	mov	w3, #0
	bl	_tegra_dc_overlay_plane_create
	mov	x23, x0
	str	x0, [sp, #32]
	bl	_IS_ERR
	mov	w24, #0
	mov	w22, #2
	b	LBB0_5
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_tegra_plane_funcs,8,3          ; @tegra_plane_funcs
	.no_dead_strip	_tegra_dc_add_planes
.subsections_via_symbols
