	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_gpio_detach
_tegra_gpio_detach:                     ## @tegra_gpio_detach
	.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
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %r12
	leaq	32(%rax), %rdi
	callq	_mtx_initialized
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_KASSERT
	movq	_GPIO_NUM_BANKS@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r12), %rcx
	movq	(%rcx,%rbx,8), %rdx
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r12), %rax
	movq	(%rax,%rbx,8), %rsi
	movl	%r14d, %edi
	callq	_bus_teardown_intr
	movl	(%r15), %eax
	jmp	LBB0_4
LBB0_5:
	cmpq	$0, 16(%r12)
	je	LBB0_7
## %bb.6:
	movq	%r12, %rdi
	callq	_tegra_gpio_pic_detach
LBB0_7:
	movl	%r14d, %edi
	callq	_gpiobus_detach_bus
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_12
## %bb.8:
	xorl	%ebx, %ebx
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %r13
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_12
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rcx
	movq	(%rcx,%rbx,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r13), %esi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
	movl	(%r15), %eax
	jmp	LBB0_11
LBB0_12:
	movq	(%r12), %rcx
	testq	%rcx, %rcx
	je	LBB0_14
## %bb.13:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
LBB0_14:
	movq	%r12, %rdi
	callq	_GPIO_LOCK_DESTROY
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gpio mutex not initialized"

	.comm	_GPIO_NUM_BANKS,4,2             ## @GPIO_NUM_BANKS
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.no_dead_strip	_tegra_gpio_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_gpio_detach
_tegra_gpio_detach:                     ; @tegra_gpio_detach
	.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, x0
	bl	_device_get_softc
	mov	x19, x0
	add	x0, x0, #32
	bl	_mtx_initialized
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
Lloh2:
	adrp	x21, _GPIO_NUM_BANKS@GOTPAGE
Lloh3:
	ldr	x21, [x21, _GPIO_NUM_BANKS@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x22, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x22, x22, #1
	cmp	x22, w8, sxtw
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #24]
	ldr	x2, [x9, x22, lsl #3]
	cbz	x2, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #8]
	ldr	x1, [x8, x22, lsl #3]
	mov	x0, x20
	bl	_bus_teardown_intr
	ldr	w8, [x21]
	b	LBB0_2
LBB0_5:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_tegra_gpio_pic_detach
LBB0_7:
	mov	x0, x20
	bl	_gpiobus_detach_bus
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.8:
	mov	x22, #0
Lloh4:
	adrp	x23, _SYS_RES_IRQ@GOTPAGE
Lloh5:
	ldr	x23, [x23, _SYS_RES_IRQ@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x22, x22, #1
	cmp	x22, w8, sxtw
	b.ge	LBB0_12
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #8]
	ldr	x3, [x9, x22, lsl #3]
	cbz	x3, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w1, [x23]
	mov	x0, x20
	mov	w2, #0
	bl	_bus_release_resource
	ldr	w8, [x21]
	b	LBB0_9
LBB0_12:
	ldr	x3, [x19]
	cbz	x3, LBB0_14
; %bb.13:
Lloh6:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_bus_release_resource
LBB0_14:
	mov	x0, x19
	bl	_GPIO_LOCK_DESTROY
	mov	w0, #0
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gpio mutex not initialized"

	.comm	_GPIO_NUM_BANKS,4,2             ; @GPIO_NUM_BANKS
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.no_dead_strip	_tegra_gpio_detach
.subsections_via_symbols
