	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function waveartist_open
_waveartist_open:                       ## @waveartist_open
	.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
	testl	%edi, %edi
	js	LBB0_2
## %bb.1:
	movl	%edi, %ebx
	movq	_num_audiodevs@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jle	LBB0_2
## %bb.4:
	movl	%esi, %r14d
	movq	_audio_devs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%ebx, %ecx
	movq	(%rax,%rcx,8), %rax
	movq	(%rax), %r12
	movq	8(%rax), %r15
	movq	_waveartist_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	cmpl	$0, (%r12)
	jne	LBB0_6
## %bb.5:
	movl	(%r15), %eax
	testl	%r14d, %eax
	je	LBB0_7
LBB0_6:
	movq	_waveartist_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_2:
	movq	_ENXIO@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	$0, 16(%r15)
	orl	%r14d, %eax
	movl	%eax, (%r15)
	movl	%r14d, (%r12)
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_waveartist_trigger
	movq	_OPEN_READ@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_9
## %bb.8:
	movl	%ebx, 4(%r15)
LBB0_9:
	movq	_OPEN_WRITE@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_11
## %bb.10:
	movl	%ebx, 8(%r15)
LBB0_11:
	movq	_waveartist_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_num_audiodevs,4,2              ## @num_audiodevs
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_audio_devs,8,3                 ## @audio_devs
	.comm	_waveartist_lock,4,2            ## @waveartist_lock
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_OPEN_READ,4,2                  ## @OPEN_READ
	.comm	_OPEN_WRITE,4,2                 ## @OPEN_WRITE
	.no_dead_strip	_waveartist_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function waveartist_open
_waveartist_open:                       ; @waveartist_open
	.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
	tbnz	w0, #31, LBB0_5
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _num_audiodevs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _num_audiodevs@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.le	LBB0_5
; %bb.2:
	mov	x20, x1
Lloh3:
	adrp	x8, _audio_devs@GOTPAGE
Lloh4:
	ldr	x8, [x8, _audio_devs@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x8, [x8, w19, uxtw #3]
	ldp	x22, x21, [x8]
Lloh6:
	adrp	x0, _waveartist_lock@GOTPAGE
Lloh7:
	ldr	x0, [x0, _waveartist_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
	ldr	w8, [x22]
	cbnz	w8, LBB0_4
; %bb.3:
	ldr	w8, [x21]
	tst	w8, w20
	b.eq	LBB0_8
LBB0_4:
Lloh8:
	adrp	x0, _waveartist_lock@GOTPAGE
Lloh9:
	ldr	x0, [x0, _waveartist_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
Lloh10:
	adrp	x8, _EBUSY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh12:
	adrp	x8, _ENXIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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_8:
	str	xzr, [x21, #16]
	orr	w8, w8, w20
	str	w8, [x21]
	str	w20, [x22]
	mov	x0, x19
	mov	w1, #0
	bl	_waveartist_trigger
Lloh14:
	adrp	x8, _OPEN_READ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _OPEN_READ@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_10
; %bb.9:
	str	w19, [x21, #4]
LBB0_10:
Lloh17:
	adrp	x8, _OPEN_WRITE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _OPEN_WRITE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_12
; %bb.11:
	str	w19, [x21, #8]
LBB0_12:
Lloh20:
	adrp	x0, _waveartist_lock@GOTPAGE
Lloh21:
	ldr	x0, [x0, _waveartist_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_num_audiodevs,4,2              ; @num_audiodevs
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_audio_devs,8,3                 ; @audio_devs
	.comm	_waveartist_lock,4,2            ; @waveartist_lock
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_OPEN_READ,4,2                  ; @OPEN_READ
	.comm	_OPEN_WRITE,4,2                 ; @OPEN_WRITE
	.no_dead_strip	_waveartist_open
.subsections_via_symbols
