	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm2835_audio_detach
_bcm2835_audio_detach:                  ## @bcm2835_audio_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	%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	%edi, %r15d
	callq	_pcm_getdevinfo
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_BCM2835_AUDIO_LOCK
	movq	_WORKER_STOPPING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r12)
	leaq	8(%r12), %r14
	movq	%r14, %rdi
	callq	_cv_signal
	movq	(%r12), %rax
	movq	_WORKER_STOPPED@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	je	LBB0_3
## %bb.1:
	leaq	12(%r12), %rbx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_cv_wait_sig
	movq	(%r12), %rax
	cmpq	(%r13), %rax
	jne	LBB0_2
LBB0_3:
	movq	%r12, %rdi
	callq	_BCM2835_AUDIO_UNLOCK
	movl	%r15d, %edi
	callq	_pcm_unregister
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	%r12, %rdi
	addq	$12, %rdi
	callq	_mtx_destroy
	movq	%r14, %rdi
	callq	_cv_destroy
	movq	%r12, %rdi
	callq	_bcm2835_audio_release
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_free
LBB0_5:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WORKER_STOPPING,8,3            ## @WORKER_STOPPING
	.comm	_WORKER_STOPPED,8,3             ## @WORKER_STOPPED
	.comm	_M_DEVBUF,4,2                   ## @M_DEVBUF
	.no_dead_strip	_bcm2835_audio_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm2835_audio_detach
_bcm2835_audio_detach:                  ; @bcm2835_audio_detach
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x0
	bl	_pcm_getdevinfo
	mov	x19, x0
	bl	_BCM2835_AUDIO_LOCK
Lloh0:
	adrp	x8, _WORKER_STOPPING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WORKER_STOPPING@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [x19]
	add	x20, x19, #8
	mov	x0, x20
	bl	_cv_signal
	ldr	x8, [x19]
Lloh3:
	adrp	x23, _WORKER_STOPPED@GOTPAGE
Lloh4:
	ldr	x23, [x23, _WORKER_STOPPED@GOTPAGEOFF]
	ldr	x9, [x23]
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.1:
	add	x22, x19, #12
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_cv_wait_sig
	ldr	x8, [x19]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_2
LBB0_3:
	mov	x0, x19
	bl	_BCM2835_AUDIO_UNLOCK
	mov	x0, x21
	bl	_pcm_unregister
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.4:
	add	x0, x19, #12
	bl	_mtx_destroy
	mov	x0, x20
	bl	_cv_destroy
	mov	x0, x19
	bl	_bcm2835_audio_release
Lloh5:
	adrp	x8, _M_DEVBUF@GOTPAGE
Lloh6:
	ldr	x8, [x8, _M_DEVBUF@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_free
LBB0_5:
	mov	x0, x21
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_WORKER_STOPPING,8,3            ; @WORKER_STOPPING
	.comm	_WORKER_STOPPED,8,3             ; @WORKER_STOPPED
	.comm	_M_DEVBUF,4,2                   ; @M_DEVBUF
	.no_dead_strip	_bcm2835_audio_detach
.subsections_via_symbols
