	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_device_del                ## -- Begin function nvkm_device_del
	.p2align	4, 0x90
_nvkm_device_del:                       ## @nvkm_device_del
	.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
	movq	(%rdi), %r12
	testq	%r12, %r12
	je	LBB0_9
## %bb.1:
	movq	%rdi, %r14
	movq	_nv_devices_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	$0, 32(%r12)
	movq	_NVKM_SUBDEV_NR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	jle	LBB0_4
## %bb.2:
	incl	%ebx
	leaq	-40(%rbp), %r15
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	leal	-2(%rbx), %esi
	movq	%r12, %rdi
	callq	_nvkm_device_subdev
	movq	%rax, -40(%rbp)
	movq	%r15, %rdi
	callq	_nvkm_subdev_del
	decl	%ebx
	cmpl	$1, %ebx
	ja	LBB0_3
LBB0_4:
	leaq	24(%r12), %rdi
	callq	_nvkm_event_fini
	movq	16(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.5:
	callq	_iounmap
LBB0_6:
	leaq	8(%r12), %rdi
	callq	_list_del
	movq	(%r12), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	%r12, %rdi
	callq	*%rax
	movq	%rax, (%r14)
LBB0_8:
	movq	_nv_devices_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	(%r14), %rdi
	callq	_kfree
	movq	$0, (%r14)
LBB0_9:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_nv_devices_mutex,4,2           ## @nv_devices_mutex
	.comm	_NVKM_SUBDEV_NR,4,2             ## @NVKM_SUBDEV_NR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_device_del                ; -- Begin function nvkm_device_del
	.p2align	2
_nvkm_device_del:                       ; @nvkm_device_del
	.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
	ldr	x20, [x0]
	cbz	x20, LBB0_9
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x0, _nv_devices_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _nv_devices_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	str	xzr, [x20, #32]
Lloh2:
	adrp	x8, _NVKM_SUBDEV_NR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NVKM_SUBDEV_NR@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	add	w21, w8, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	sub	w1, w21, #2
	mov	x0, x20
	bl	_nvkm_device_subdev
	str	x0, [sp, #8]
	add	x0, sp, #8
	bl	_nvkm_subdev_del
	sub	w21, w21, #1
	cmp	w21, #1
	b.hi	LBB0_3
LBB0_4:
	add	x0, x20, #24
	bl	_nvkm_event_fini
	ldr	x0, [x20, #16]
	cbz	x0, LBB0_6
; %bb.5:
	bl	_iounmap
LBB0_6:
	add	x0, x20, #8
	bl	_list_del
	ldr	x8, [x20]
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.7:
	mov	x0, x20
	blr	x8
	str	x0, [x19]
LBB0_8:
Lloh5:
	adrp	x0, _nv_devices_mutex@GOTPAGE
Lloh6:
	ldr	x0, [x0, _nv_devices_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	ldr	x0, [x19]
	bl	_kfree
	str	xzr, [x19]
LBB0_9:
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_nv_devices_mutex,4,2           ; @nv_devices_mutex
	.comm	_NVKM_SUBDEV_NR,4,2             ; @NVKM_SUBDEV_NR
.subsections_via_symbols
