	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dc_attach
_dc_attach:                             ## @dc_attach
	.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	%rdi, %r14
	callq	_device_get_softc
	movq	%rax, %rbx
	movq	%r14, 56(%rax)
	movq	%r14, 64(%rax)
	movq	%r14, %rdi
	callq	_ofw_bus_get_node
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_LOCK_INIT
	movl	$0, -44(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_bus_alloc_resource_any
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	$0, -44(%rbp)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %ecx
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_bus_alloc_resource_any
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_get_fdt_resources
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_10
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_10
LBB0_6:
	movq	%rbx, %rdi
	callq	_enable_fdt_resources
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_10
LBB0_8:
	movl	$256, (%rbx)                    ## imm = 0x100
	movq	56(%rbx), %rdi
	callq	_device_get_parent
	movq	56(%rbx), %rsi
	movl	%eax, %edi
	callq	_TEGRA_DRM_REGISTER_CLIENT
	testl	%eax, %eax
	je	LBB0_24
## %bb.9:
	leaq	L_.str.4(%rip), %rsi
LBB0_10:
	movq	%r14, %rdi
	callq	_device_printf
	movq	56(%rbx), %rdi
	callq	_device_get_parent
	movq	56(%rbx), %rsi
	movl	%eax, %edi
	callq	_TEGRA_DRM_DEREGISTER_CLIENT
	movq	48(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.11:
	movq	16(%rbx), %rsi
	movq	%r14, %rdi
	callq	_bus_teardown_intr
LBB0_12:
	movq	40(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.13:
	callq	_clk_release
LBB0_14:
	movq	32(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_16
## %bb.15:
	callq	_clk_release
LBB0_16:
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_18
## %bb.17:
	callq	_hwreset_release
LBB0_18:
	movq	16(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_20
## %bb.19:
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_bus_release_resource
LBB0_20:
	movq	8(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_22
## %bb.21:
	movl	(%r12), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_bus_release_resource
LBB0_22:
	movq	%rbx, %rdi
	callq	_LOCK_DESTROY
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_23:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	movq	%r14, %rdi
	callq	_bus_generic_attach
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot allocate memory resources\n"

	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
L_.str.1:                               ## @.str.1
	.asciz	"Cannot allocate IRQ resources\n"

L_.str.2:                               ## @.str.2
	.asciz	"Cannot parse FDT resources\n"

L_.str.3:                               ## @.str.3
	.asciz	"Cannot enable FDT resources\n"

L_.str.4:                               ## @.str.4
	.asciz	"Cannot register DRM device\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_dc_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dc_attach
_dc_attach:                             ; @dc_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x0
	bl	_device_get_softc
	mov	x19, x0
	stp	x20, x20, [x0, #56]
	mov	x0, x20
	bl	_ofw_bus_get_node
	mov	x21, x0
	mov	x0, x19
	bl	_LOCK_INIT
	str	wzr, [sp, #12]
Lloh0:
	adrp	x22, _SYS_RES_MEMORY@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x24, _RF_ACTIVE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w3, [x24]
	add	x2, sp, #12
	mov	x0, x20
	bl	_bus_alloc_resource_any
	str	x0, [x19, #8]
Lloh4:
	adrp	x23, _SYS_RES_IRQ@GOTPAGE
Lloh5:
	ldr	x23, [x23, _SYS_RES_IRQ@GOTPAGEOFF]
	cbz	x0, LBB0_4
; %bb.1:
	str	wzr, [sp, #12]
	ldr	w1, [x23]
	ldr	w3, [x24]
	add	x2, sp, #12
	mov	x0, x20
	bl	_bus_alloc_resource_any
	str	x0, [x19, #16]
	cbz	x0, LBB0_5
; %bb.2:
	mov	x0, x19
	mov	x1, x21
	bl	_get_fdt_resources
	cbz	w0, LBB0_6
; %bb.3:
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_10
LBB0_4:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_10
LBB0_5:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_6:
	mov	x0, x19
	bl	_enable_fdt_resources
	cbz	w0, LBB0_8
; %bb.7:
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_10
LBB0_8:
	mov	w8, #256
	str	w8, [x19]
	ldr	x0, [x19, #56]
	bl	_device_get_parent
	ldr	x1, [x19, #56]
	bl	_TEGRA_DRM_REGISTER_CLIENT
	cbz	w0, LBB0_24
; %bb.9:
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_10:
	mov	x0, x20
	bl	_device_printf
	ldr	x0, [x19, #56]
	bl	_device_get_parent
	ldr	x1, [x19, #56]
	bl	_TEGRA_DRM_DEREGISTER_CLIENT
	ldr	x2, [x19, #48]
	cbz	x2, LBB0_12
; %bb.11:
	ldr	x1, [x19, #16]
	mov	x0, x20
	bl	_bus_teardown_intr
LBB0_12:
	ldr	x0, [x19, #40]
	cbz	x0, LBB0_14
; %bb.13:
	bl	_clk_release
LBB0_14:
	ldr	x0, [x19, #32]
	cbz	x0, LBB0_16
; %bb.15:
	bl	_clk_release
LBB0_16:
	ldr	x0, [x19, #24]
	cbz	x0, LBB0_18
; %bb.17:
	bl	_hwreset_release
LBB0_18:
	ldr	x3, [x19, #16]
	cbz	x3, LBB0_20
; %bb.19:
	ldr	w1, [x23]
	mov	x0, x20
	mov	w2, #0
	bl	_bus_release_resource
LBB0_20:
	ldr	x3, [x19, #8]
	cbz	x3, LBB0_22
; %bb.21:
	ldr	w1, [x22]
	mov	x0, x20
	mov	w2, #0
	bl	_bus_release_resource
LBB0_22:
	mov	x0, x19
	bl	_LOCK_DESTROY
Lloh16:
	adrp	x8, _ENXIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
LBB0_23:
	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
	add	sp, sp, #80
	ret
LBB0_24:
	mov	x0, x20
	bl	_bus_generic_attach
	b	LBB0_23
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot allocate memory resources\n"

	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
l_.str.1:                               ; @.str.1
	.asciz	"Cannot allocate IRQ resources\n"

l_.str.2:                               ; @.str.2
	.asciz	"Cannot parse FDT resources\n"

l_.str.3:                               ; @.str.3
	.asciz	"Cannot enable FDT resources\n"

l_.str.4:                               ; @.str.4
	.asciz	"Cannot register DRM device\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_dc_attach
.subsections_via_symbols
