	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cm4000_detach
_cm4000_detach:                         ## @cm4000_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	(%rdi), %r14
	movq	_CM4000_MAX_DEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_1
## %bb.4:
	movq	_dev_table@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%r15, (%rcx,%rbx,8)
	je	LBB0_2
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	cmpq	%rbx, %rax
	jne	LBB0_5
	jmp	LBB0_7
LBB0_1:
	xorl	%ebx, %ebx
LBB0_2:
	cmpl	%eax, %ebx
	jne	LBB0_3
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r14, %rdi
	callq	_stop_monitor
	movq	%r15, %rdi
	callq	_cm4000_release
	movq	_dev_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%ebx, %ecx
	movq	$0, (%rax,%rcx,8)
	movq	%r14, %rdi
	callq	_kfree
	movq	_cmm_class@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_major@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_MKDEV
	movl	%r14d, %edi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_device_destroy                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CM4000_MAX_DEV,4,2             ## @CM4000_MAX_DEV
	.comm	_dev_table,8,3                  ## @dev_table
	.comm	_cmm_class,4,2                  ## @cmm_class
	.comm	_major,4,2                      ## @major
	.no_dead_strip	_cm4000_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cm4000_detach
_cm4000_detach:                         ; @cm4000_detach
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _CM4000_MAX_DEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CM4000_MAX_DEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x20, #0
Lloh3:
	adrp	x9, _dev_table@GOTPAGE
Lloh4:
	ldr	x9, [x9, _dev_table@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9, x20, lsl #3]
	cmp	x10, x21
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x20, x20, #1
	cmp	x8, x20
	b.ne	LBB0_2
	b	LBB0_6
LBB0_4:
	mov	w20, #0
LBB0_5:
	cmp	w20, w8
	b.ne	LBB0_7
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	x0, x19
	bl	_stop_monitor
	mov	x0, x21
	bl	_cm4000_release
Lloh6:
	adrp	x8, _dev_table@GOTPAGE
Lloh7:
	ldr	x8, [x8, _dev_table@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	xzr, [x8, w20, uxtw #3]
	mov	x0, x19
	bl	_kfree
Lloh9:
	adrp	x8, _cmm_class@GOTPAGE
Lloh10:
	ldr	x8, [x8, _cmm_class@GOTPAGEOFF]
Lloh11:
	ldr	w19, [x8]
Lloh12:
	adrp	x8, _major@GOTPAGE
Lloh13:
	ldr	x8, [x8, _major@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_MKDEV
	mov	x1, x0
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_device_destroy
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_CM4000_MAX_DEV,4,2             ; @CM4000_MAX_DEV
	.comm	_dev_table,8,3                  ; @dev_table
	.comm	_cmm_class,4,2                  ; @cmm_class
	.comm	_major,4,2                      ; @major
	.no_dead_strip	_cm4000_detach
.subsections_via_symbols
