	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_abpmisc_attach
_tegra_abpmisc_attach:                  ## @tegra_abpmisc_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	%r14d, 16(%rax)
	movl	$0, -36(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %r12
	movq	_RF_SHAREABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	orl	(%r12), %ecx
	leaq	-36(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.7:
	movl	$1, -36(%rbp)
	movl	(%r15), %esi
	movl	(%r12), %ecx
	leaq	-36(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rbx, %rdi
	callq	_tegra_abpmisc_read_revision
	movq	8(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_11
## %bb.10:
	movl	(%r15), %esi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
	movq	$0, 8(%rbx)
LBB0_11:
	movq	_dev_sc@GOTPCREL(%rip), %rax
	movq	%rbx, (%rax)
	movl	%r14d, %edi
	callq	_bus_generic_attach
	jmp	LBB0_12
LBB0_1:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movl	%r14d, %edi
	callq	_device_printf
	movq	8(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_4
## %bb.3:
	movl	(%r15), %esi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
LBB0_4:
	movq	(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.5:
	movl	(%r15), %esi
	movl	%r14d, %edi
	movl	$1, %edx
	callq	_bus_release_resource
LBB0_6:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_12:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.comm	_RF_SHAREABLE,4,2               ## @RF_SHAREABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot map ABP misc registers.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Cannot map strapping options registers.\n"

	.comm	_dev_sc,8,3                     ## @dev_sc
	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_tegra_abpmisc_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_abpmisc_attach
_tegra_abpmisc_attach:                  ; @tegra_abpmisc_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	str	w19, [x0, #16]
	str	wzr, [sp, #12]
Lloh0:
	adrp	x21, _SYS_RES_MEMORY@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh2:
	adrp	x22, _RF_ACTIVE@GOTPAGE
Lloh3:
	ldr	x22, [x22, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w1, [x21]
	ldr	w8, [x22]
Lloh4:
	adrp	x9, _RF_SHAREABLE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _RF_SHAREABLE@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	orr	w3, w9, w8
	add	x2, sp, #12
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20, #8]
	cbz	x0, LBB0_5
; %bb.1:
	mov	w8, #1
	str	w8, [sp, #12]
	ldr	w1, [x21]
	ldr	w3, [x22]
	add	x2, sp, #12
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20]
	cbz	x0, LBB0_6
; %bb.2:
	mov	x0, x20
	bl	_tegra_abpmisc_read_revision
	ldr	x3, [x20, #8]
	cbz	x3, LBB0_4
; %bb.3:
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
	str	xzr, [x20, #8]
LBB0_4:
Lloh7:
	adrp	x8, _dev_sc@GOTPAGE
Lloh8:
	ldr	x8, [x8, _dev_sc@GOTPAGEOFF]
Lloh9:
	str	x20, [x8]
	mov	x0, x19
	bl	_bus_generic_attach
	b	LBB0_12
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
	ldr	x3, [x20, #8]
	cbz	x3, LBB0_9
; %bb.8:
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
LBB0_9:
	ldr	x3, [x20]
	cbz	x3, LBB0_11
; %bb.10:
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #1
	bl	_bus_release_resource
LBB0_11:
Lloh14:
	adrp	x8, _ENXIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
LBB0_12:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.comm	_RF_SHAREABLE,4,2               ; @RF_SHAREABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot map ABP misc registers.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Cannot map strapping options registers.\n"

	.comm	_dev_sc,8,3                     ; @dev_sc
	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_tegra_abpmisc_attach
.subsections_via_symbols
