	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function close_device_check
_close_device_check:                    ## @close_device_check
	.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	%esi, %r12d
	movq	%rdi, %r15
	movq	_CM_OPEN_CH_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	andl	%esi, %ebx
	movslq	%ebx, %r13
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	(%r15), %rcx
	cmpl	%r12d, (%rcx,%r13,4)
	jne	LBB0_5
## %bb.1:
	movq	16(%r15), %rax
	leaq	(,%r13,2), %r12
	addq	%r13, %r12
	cmpq	$0, 8(%rax,%r12,8)
	je	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_snd_cmipci_ch_reset
	movq	16(%r15), %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rax,%r12,8)
	movq	(%r15), %rcx
LBB0_3:
	movl	$0, (%rcx,%r13,4)
	cmpl	$0, (%rax,%r12,8)
	jne	LBB0_5
## %bb.4:
	leaq	(%rax,%r12,8), %rax
	movl	$1, (%rax)
	leaq	12(%r15), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irq
	movq	_CM_REG_MISC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CM_ENDBDAC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_snd_cmipci_set_bit
	movq	%rbx, %rdi
	callq	_spin_unlock_irq
LBB0_5:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CM_OPEN_CH_MASK,4,2            ## @CM_OPEN_CH_MASK
	.comm	_CM_REG_MISC_CTRL,4,2           ## @CM_REG_MISC_CTRL
	.comm	_CM_ENDBDAC,4,2                 ## @CM_ENDBDAC
	.no_dead_strip	_close_device_check
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function close_device_check
_close_device_check:                    ; @close_device_check
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _CM_OPEN_CH_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CM_OPEN_CH_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w22, w8, w1
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	x9, [x20]
	ldr	w8, [x9, w22, sxtw #2]
	cmp	w8, w21
	b.ne	LBB0_5
; %bb.1:
	sxtw	x21, w22
	ldr	x8, [x20, #16]
	mov	w10, #24
	madd	x10, x21, x10, x8
	ldr	x10, [x10, #8]
	cbz	x10, LBB0_3
; %bb.2:
	mov	x0, x20
	mov	x1, x21
	bl	_snd_cmipci_ch_reset
	ldr	x8, [x20, #16]
	mov	w9, #24
	madd	x9, x21, x9, x8
	stp	xzr, xzr, [x9, #8]
	ldr	x9, [x20]
LBB0_3:
	str	wzr, [x9, x21, lsl #2]
	mov	w9, #24
	madd	x8, x21, x9, x8
	ldr	w9, [x8]
	cbnz	w9, LBB0_5
; %bb.4:
	mov	w9, #1
	str	w9, [x8]
	add	x21, x20, #12
	mov	x0, x21
	bl	_spin_lock_irq
Lloh3:
	adrp	x8, _CM_REG_MISC_CTRL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CM_REG_MISC_CTRL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _CM_ENDBDAC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CM_ENDBDAC@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_snd_cmipci_set_bit
	mov	x0, x21
	bl	_spin_unlock_irq
LBB0_5:
	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	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_CM_OPEN_CH_MASK,4,2            ; @CM_OPEN_CH_MASK
	.comm	_CM_REG_MISC_CTRL,4,2           ; @CM_REG_MISC_CTRL
	.comm	_CM_ENDBDAC,4,2                 ; @CM_ENDBDAC
	.no_dead_strip	_close_device_check
.subsections_via_symbols
