	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad1848_open
_ad1848_open:                           ## @ad1848_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	%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
	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, -44(%rbp)                 ## 4-byte Spill
	movq	_audio_devs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%ebx, %r14d
	movq	(%rax,%r14,8), %rax
	movq	8(%rax), %r13
	movq	16(%rax), %r12
	leaq	16(%r12), %r15
	movq	%r15, %rdi
	callq	_spin_lock
	cmpl	$0, (%r13)
	jne	LBB0_6
## %bb.5:
	movl	(%r12), %eax
	testl	%eax, -44(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_7
LBB0_6:
	movq	%r15, %rdi
	callq	_spin_unlock
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_2:
	movq	_ENXIO@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	$0, 4(%r12)
	movq	_audio_devs@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%r14,8), %rcx
	movq	_DMA_DUPLEX@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%rcx)
	je	LBB0_9
## %bb.8:
	movl	$1, 4(%r12)
LBB0_9:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	orl	%r14d, %eax
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%r12)
	movl	%eax, (%r12)
	movl	%r14d, (%r13)
	movq	%r15, %rdi
	callq	_spin_unlock
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_ad1848_trigger
	movq	_OPEN_READ@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_11
## %bb.10:
	movl	%ebx, 8(%r12)
LBB0_11:
	movq	_OPEN_WRITE@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_13
## %bb.12:
	movl	%ebx, 12(%r12)
LBB0_13:
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	%r12, %rdi
	callq	_ad_mute
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_num_audiodevs,4,2              ## @num_audiodevs
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_audio_devs,8,3                 ## @audio_devs
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_DMA_DUPLEX,4,2                 ## @DMA_DUPLEX
	.comm	_OPEN_READ,4,2                  ## @OPEN_READ
	.comm	_OPEN_WRITE,4,2                 ## @OPEN_WRITE
	.no_dead_strip	_ad1848_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ad1848_open
_ad1848_open:                           ; @ad1848_open
	.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
	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	x21, x1
Lloh3:
	adrp	x24, _audio_devs@GOTPAGE
Lloh4:
	ldr	x24, [x24, _audio_devs@GOTPAGEOFF]
	ldr	x8, [x24]
	ldr	x8, [x8, w19, uxtw #3]
	ldp	x23, x22, [x8, #8]
	add	x20, x22, #16
	mov	x0, x20
	bl	_spin_lock
	ldr	w8, [x23]
	cbnz	w8, LBB0_4
; %bb.3:
	ldr	w8, [x22]
	tst	w8, w21
	b.eq	LBB0_8
LBB0_4:
	mov	x0, x20
	bl	_spin_unlock
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh7:
	adrp	x8, _ENXIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
LBB0_8:
	mov	w9, w19
	ldr	x10, [x24]
	ldr	x9, [x10, x9, lsl #3]
	str	wzr, [x22, #4]
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _DMA_DUPLEX@GOTPAGE
Lloh10:
	ldr	x10, [x10, _DMA_DUPLEX@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_10
; %bb.9:
	mov	w9, #1
	str	w9, [x22, #4]
LBB0_10:
	orr	w8, w8, w21
	stp	xzr, xzr, [x22, #24]
	str	w8, [x22]
	str	w21, [x23]
	mov	x0, x20
	bl	_spin_unlock
	mov	x0, x19
	mov	w1, #0
	bl	_ad1848_trigger
Lloh12:
	adrp	x8, _OPEN_READ@GOTPAGE
Lloh13:
	ldr	x8, [x8, _OPEN_READ@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_12
; %bb.11:
	str	w19, [x22, #8]
LBB0_12:
Lloh15:
	adrp	x8, _OPEN_WRITE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _OPEN_WRITE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_14
; %bb.13:
	str	w19, [x22, #12]
LBB0_14:
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x22
	bl	_ad_mute
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_num_audiodevs,4,2              ; @num_audiodevs
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_audio_devs,8,3                 ; @audio_devs
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_DMA_DUPLEX,4,2                 ; @DMA_DUPLEX
	.comm	_OPEN_READ,4,2                  ; @OPEN_READ
	.comm	_OPEN_WRITE,4,2                 ; @OPEN_WRITE
	.no_dead_strip	_ad1848_open
.subsections_via_symbols
