	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_mc_attach
_tegra_mc_attach:                       ## @tegra_mc_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	%r14d, 32(%rax)
	movq	%rax, %rdi
	callq	_LOCK_INIT
	movl	$0, -44(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	leaq	-44(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movl	$0, -44(%rbp)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %ecx
	leaq	-44(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	leaq	24(%rbx), %r12
	leaq	L_.str.2(%rip), %rdx
	movl	%r14d, %edi
	xorl	%esi, %esi
	movq	%r12, %rcx
	callq	_clk_get_by_ofw_name
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %r15d
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_12
LBB0_8:
	movq	(%r12), %rdi
	callq	_clk_enable
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %r15d
	leaq	L_.str.4(%rip), %rsi
LBB0_7:
	movl	%r14d, %edi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_device_printf
LBB0_12:
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.13:
	callq	_clk_release
LBB0_14:
	movq	16(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_16
## %bb.15:
	movq	8(%rbx), %rsi
	movl	%r14d, %edi
	callq	_bus_teardown_intr
LBB0_16:
	movq	8(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_18
## %bb.17:
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
LBB0_18:
	movq	(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_20
## %bb.19:
	movl	(%r13), %esi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
LBB0_20:
	movq	%rbx, %rdi
	callq	_LOCK_DESTROY
LBB0_21:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	%rbx, %rdi
	callq	_tegra_mc_init_hw
	movq	_INTR_TYPE_MISC@GOTPCREL(%rip), %rax
	movq	_INTR_MPSAFE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	8(%rbx), %rsi
	movq	_tegra_mc_intr@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%rbx, %rax
	addq	$16, %rax
	movq	%rax, (%rsp)
	movl	%r14d, %edi
	xorl	%ecx, %ecx
	movq	%rbx, %r9
	callq	_bus_setup_intr
	testl	%eax, %eax
	je	LBB0_22
## %bb.11:
	movl	%eax, %r15d
	leaq	L_.str.5(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_12
LBB0_22:
	movq	_MC_INTMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MC_INT_INT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_WR4
	movl	%r14d, %edi
	callq	_bus_generic_attach
	movl	%eax, %r15d
	jmp	LBB0_21
	.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 map registers.\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
L_.str.1:                               ## @.str.1
	.asciz	"Cannot allocate interrupt.\n"

L_.str.2:                               ## @.str.2
	.asciz	"mc"

L_.str.3:                               ## @.str.3
	.asciz	"Cannot get mc clock: %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"Cannot enable clock: %d\n"

	.comm	_INTR_TYPE_MISC,4,2             ## @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ## @INTR_MPSAFE
	.comm	_tegra_mc_intr,4,2              ## @tegra_mc_intr
L_.str.5:                               ## @.str.5
	.asciz	"Cannot setup interrupt.\n"

	.comm	_MC_INTMASK,4,2                 ## @MC_INTMASK
	.comm	_MC_INT_INT_MASK,4,2            ## @MC_INT_INT_MASK
	.no_dead_strip	_tegra_mc_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_mc_attach
_tegra_mc_attach:                       ; @tegra_mc_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	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	str	w19, [x0, #32]
	bl	_LOCK_INIT
	str	wzr, [sp, #12]
Lloh0:
	adrp	x23, _SYS_RES_MEMORY@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh2:
	adrp	x21, _RF_ACTIVE@GOTPAGE
Lloh3:
	ldr	x21, [x21, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w3, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20]
Lloh4:
	adrp	x24, _SYS_RES_IRQ@GOTPAGE
Lloh5:
	ldr	x24, [x24, _SYS_RES_IRQ@GOTPAGEOFF]
	cbz	x0, LBB0_5
; %bb.1:
	str	wzr, [sp, #12]
	ldr	w1, [x24]
	ldr	w3, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20, #8]
	cbz	x0, LBB0_6
; %bb.2:
	add	x22, x20, #24
Lloh6:
	adrp	x2, l_.str.2@PAGE
Lloh7:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	mov	x3, x22
	bl	_clk_get_by_ofw_name
	cbz	w0, LBB0_17
; %bb.3:
	mov	x21, x0
	str	x21, [sp]
Lloh8:
	adrp	x1, l_.str.3@PAGE
Lloh9:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_4:
	mov	x0, x19
	bl	_device_printf
	ldr	x0, [x20, #24]
	cbnz	x0, LBB0_8
	b	LBB0_9
LBB0_5:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	mov	x0, x19
	bl	_device_printf
Lloh14:
	adrp	x8, _ENXIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh16:
	ldr	w21, [x8]
	ldr	x0, [x20, #24]
	cbz	x0, LBB0_9
LBB0_8:
	bl	_clk_release
LBB0_9:
	ldr	x2, [x20, #16]
	cbz	x2, LBB0_11
; %bb.10:
	ldr	x1, [x20, #8]
	mov	x0, x19
	bl	_bus_teardown_intr
LBB0_11:
	ldr	x3, [x20, #8]
	cbz	x3, LBB0_13
; %bb.12:
	ldr	w1, [x24]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
LBB0_13:
	ldr	x3, [x20]
	cbz	x3, LBB0_15
; %bb.14:
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
LBB0_15:
	mov	x0, x20
	bl	_LOCK_DESTROY
LBB0_16:
	mov	x0, x21
	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_17:
	ldr	x0, [x22]
	bl	_clk_enable
	cbz	w0, LBB0_19
; %bb.18:
	mov	x21, x0
	str	x21, [sp]
Lloh17:
	adrp	x1, l_.str.4@PAGE
Lloh18:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_device_printf
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	ldr	x0, [x20, #24]
	cbnz	x0, LBB0_8
	b	LBB0_9
LBB0_19:
	mov	x0, x20
	bl	_tegra_mc_init_hw
	ldr	x1, [x20, #8]
Lloh19:
	adrp	x8, _INTR_TYPE_MISC@GOTPAGE
Lloh20:
	ldr	x8, [x8, _INTR_TYPE_MISC@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	adrp	x9, _INTR_MPSAFE@GOTPAGE
Lloh23:
	ldr	x9, [x9, _INTR_MPSAFE@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh25:
	adrp	x8, _tegra_mc_intr@GOTPAGE
Lloh26:
	ldr	x8, [x8, _tegra_mc_intr@GOTPAGEOFF]
Lloh27:
	ldr	w4, [x8]
	add	x6, x20, #16
	mov	x0, x19
	mov	x3, #0
	mov	x5, x20
	bl	_bus_setup_intr
	cbz	w0, LBB0_21
; %bb.20:
	mov	x21, x0
Lloh28:
	adrp	x1, l_.str.5@PAGE
Lloh29:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_4
LBB0_21:
Lloh30:
	adrp	x8, _MC_INTMASK@GOTPAGE
Lloh31:
	ldr	x8, [x8, _MC_INTMASK@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
Lloh33:
	adrp	x8, _MC_INT_INT_MASK@GOTPAGE
Lloh34:
	ldr	x8, [x8, _MC_INT_INT_MASK@GOTPAGEOFF]
Lloh35:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_WR4
	mov	x0, x19
	bl	_bus_generic_attach
	mov	x21, x0
	b	LBB0_16
	.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 AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.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 map registers.\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
l_.str.1:                               ; @.str.1
	.asciz	"Cannot allocate interrupt.\n"

l_.str.2:                               ; @.str.2
	.asciz	"mc"

l_.str.3:                               ; @.str.3
	.asciz	"Cannot get mc clock: %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"Cannot enable clock: %d\n"

	.comm	_INTR_TYPE_MISC,4,2             ; @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ; @INTR_MPSAFE
	.comm	_tegra_mc_intr,4,2              ; @tegra_mc_intr
l_.str.5:                               ; @.str.5
	.asciz	"Cannot setup interrupt.\n"

	.comm	_MC_INTMASK,4,2                 ; @MC_INTMASK
	.comm	_MC_INT_INT_MASK,4,2            ; @MC_INT_INT_MASK
	.no_dead_strip	_tegra_mc_attach
.subsections_via_symbols
