	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_misc_deregister                ## -- Begin function misc_deregister
	.p2align	4, 0x90
_misc_deregister:                       ## @misc_deregister
	.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, %r14
	movl	(%rdi), %r15d
	leaq	4(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_list_empty
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_2:
	movq	_misc_mtx@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_list_del
	movq	_misc_class@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_MISC_MAJOR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r14), %esi
	callq	_MKDEV
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_device_destroy
	testl	%r15d, %r15d
	jle	LBB0_5
## %bb.3:
	movq	_DYNAMIC_MINORS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jge	LBB0_5
## %bb.4:
	movb	(%r14), %cl
	andb	$7, %cl
	movl	$-2, %eax
	roll	%cl, %eax
	movq	_misc_minors@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	shrq	$3, %r15
	andl	%eax, (%rcx,%r15,4)
LBB0_5:
	movq	_misc_mtx@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_misc_mtx,4,2                   ## @misc_mtx
	.comm	_misc_class,4,2                 ## @misc_class
	.comm	_MISC_MAJOR,4,2                 ## @MISC_MAJOR
	.comm	_DYNAMIC_MINORS,4,2             ## @DYNAMIC_MINORS
	.comm	_misc_minors,8,3                ## @misc_minors
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_misc_deregister                ; -- Begin function misc_deregister
	.p2align	2
_misc_deregister:                       ; @misc_deregister
	.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	x19, x0
	mov	x20, x0
	ldr	w21, [x20], #4
	mov	x0, x20
	bl	_list_empty
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_2:
Lloh3:
	adrp	x0, _misc_mtx@GOTPAGE
Lloh4:
	ldr	x0, [x0, _misc_mtx@GOTPAGEOFF]
	bl	_mutex_lock
	mov	x0, x20
	bl	_list_del
Lloh5:
	adrp	x8, _misc_class@GOTPAGE
Lloh6:
	ldr	x8, [x8, _misc_class@GOTPAGEOFF]
Lloh7:
	ldr	w20, [x8]
Lloh8:
	adrp	x8, _MISC_MAJOR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MISC_MAJOR@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldr	w1, [x19]
	bl	_MKDEV
	mov	x1, x0
	mov	x0, x20
	bl	_device_destroy
	cmp	w21, #1
	b.lt	LBB0_5
; %bb.3:
Lloh11:
	adrp	x8, _DYNAMIC_MINORS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DYNAMIC_MINORS@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w21, w8
	b.ge	LBB0_5
; %bb.4:
	ldr	w8, [x19]
	and	x8, x8, #0x7
	mov	w9, #1
	lsl	w8, w9, w8
Lloh14:
	adrp	x9, _misc_minors@GOTPAGE
Lloh15:
	ldr	x9, [x9, _misc_minors@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	lsr	x10, x21, #1
	and	x10, x10, #0x7ffffffc
	ldr	w11, [x9, x10]
	bic	w8, w11, w8
	str	w8, [x9, x10]
LBB0_5:
Lloh17:
	adrp	x0, _misc_mtx@GOTPAGE
Lloh18:
	ldr	x0, [x0, _misc_mtx@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	w0, #0
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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_misc_mtx,4,2                   ; @misc_mtx
	.comm	_misc_class,4,2                 ; @misc_class
	.comm	_MISC_MAJOR,4,2                 ; @MISC_MAJOR
	.comm	_DYNAMIC_MINORS,4,2             ; @DYNAMIC_MINORS
	.comm	_misc_minors,8,3                ; @misc_minors
.subsections_via_symbols
