	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cmm_close
_cmm_close:                             ## @cmm_close
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_iminor
	movl	%eax, %ebx
	movq	_CM4000_MAX_DEV@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_1
## %bb.2:
	movq	_dev_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ebx, %rcx
	movq	(%rax,%rcx,8), %r12
	testq	%r12, %r12
	je	LBB0_1
## %bb.3:
	movq	8(%r12), %r14
	movq	%r15, %rdi
	callq	_imajor
	leaq	L_.str(%rip), %rdx
	xorl	%r15d, %r15d
	movl	$2, %edi
	movq	%r14, %rsi
	movl	%eax, %ecx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_DEBUGP
	movq	%r14, %rdi
	callq	_stop_monitor
	movq	%r14, %rdi
	callq	_ZERO_DEV
	movq	$0, (%r12)
	movq	%r14, %rdi
	callq	_wake_up
	leaq	L_.str.1(%rip), %rdx
	movl	$2, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_DEBUGP
	jmp	LBB0_4
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_4:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CM4000_MAX_DEV,4,2             ## @CM4000_MAX_DEV
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_dev_table,8,3                  ## @dev_table
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-> cmm_close(maj/min=%d.%d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"cmm_close\n"

	.no_dead_strip	_cmm_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cmm_close
_cmm_close:                             ; @cmm_close
	.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	x20, x0
	bl	_iminor
Lloh0:
	adrp	x8, _CM4000_MAX_DEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CM4000_MAX_DEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ge	LBB0_3
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _dev_table@GOTPAGE
Lloh4:
	ldr	x8, [x8, _dev_table@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x22, [x8, w0, sxtw #3]
	cbz	x22, LBB0_3
; %bb.2:
	ldr	x21, [x22, #8]
	mov	x0, x20
	bl	_imajor
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x0, x19, [sp]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	w0, #2
	mov	x1, x21
	bl	_DEBUGP
	mov	x0, x21
	bl	_stop_monitor
	mov	x0, x21
	bl	_ZERO_DEV
	str	xzr, [x22]
	mov	x0, x21
	bl	_wake_up
Lloh8:
	adrp	x2, l_.str.1@PAGE
Lloh9:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w0, #2
	mov	x1, x21
	bl	_DEBUGP
	mov	w0, #0
	b	LBB0_4
LBB0_3:
Lloh10:
	adrp	x8, _ENODEV@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_CM4000_MAX_DEV,4,2             ; @CM4000_MAX_DEV
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_dev_table,8,3                  ; @dev_table
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-> cmm_close(maj/min=%d.%d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"cmm_close\n"

	.no_dead_strip	_cmm_close
.subsections_via_symbols
