	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad1848_output_block
_ad1848_output_block:                   ## @ad1848_output_block
	.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
	movl	%ecx, %r8d
	movq	_audio_devs@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movslq	%edi, %rsi
	movq	(%rcx,%rsi,8), %rsi
	movq	8(%rsi), %rdi
	movq	16(%rsi), %r15
	movslq	%edx, %rbx
	movl	(%rdi), %edx
	movq	_AFMT_IMA_ADPCM@GOTPCREL(%rip), %rax
	movl	$2, %ecx
	cmpl	(%rax), %edx
	je	LBB0_2
## %bb.1:
	movq	_AFMT_S16_LE@GOTPCREL(%rip), %r9
	movq	_AFMT_S16_BE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	orl	(%r9), %eax
	xorl	%ecx, %ecx
	testl	%edx, %eax
	setne	%cl
LBB0_2:
                                        ## kill: def $cl killed $cl killed $rcx
	shrq	%cl, %rbx
	cmpl	$2, 4(%rdi)
	setge	%cl
	shrq	%cl, %rbx
	decq	%rbx
	movl	(%r15), %ecx
	movq	_PCM_ENABLE_OUTPUT@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	testl	%ecx, %edx
	je	LBB0_7
## %bb.3:
	testl	%r8d, %r8d
	je	LBB0_7
## %bb.4:
	movq	_DMA_AUTOMODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rsi), %eax
	je	LBB0_7
## %bb.5:
	cmpq	8(%r15), %rbx
	jne	LBB0_7
## %bb.6:
	orl	%ecx, %edx
	movl	%edx, (%r15)
	movl	$1, 16(%r15)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	leaq	20(%r15), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movzbl	%bl, %edx
	movq	%r15, %rdi
	movl	$15, %esi
	callq	_ad_write
	movzbl	%bh, %edx
	movq	%r15, %rdi
	movl	$14, %esi
	callq	_ad_write
	movq	%rbx, 8(%r15)
	movl	(%r12), %eax
	orl	%eax, (%r15)
	movl	$1, 16(%r15)
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_audio_devs,8,3                 ## @audio_devs
	.comm	_AFMT_IMA_ADPCM,4,2             ## @AFMT_IMA_ADPCM
	.comm	_AFMT_S16_LE,4,2                ## @AFMT_S16_LE
	.comm	_AFMT_S16_BE,4,2                ## @AFMT_S16_BE
	.comm	_PCM_ENABLE_OUTPUT,4,2          ## @PCM_ENABLE_OUTPUT
	.comm	_DMA_AUTOMODE,4,2               ## @DMA_AUTOMODE
	.no_dead_strip	_ad1848_output_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ad1848_output_block
_ad1848_output_block:                   ; @ad1848_output_block
	.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
                                        ; kill: def $w2 killed $w2 def $x2
Lloh0:
	adrp	x8, _audio_devs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _audio_devs@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x8, [x8, w0, sxtw #3]
	ldp	x9, x19, [x8, #8]
	sxtw	x10, w2
	ldr	w11, [x9]
Lloh3:
	adrp	x12, _AFMT_IMA_ADPCM@GOTPAGE
Lloh4:
	ldr	x12, [x12, _AFMT_IMA_ADPCM@GOTPAGEOFF]
Lloh5:
	ldr	w12, [x12]
	cmp	w11, w12
	b.ne	LBB0_2
; %bb.1:
	mov	w11, #2
	b	LBB0_3
LBB0_2:
Lloh6:
	adrp	x12, _AFMT_S16_LE@GOTPAGE
Lloh7:
	ldr	x12, [x12, _AFMT_S16_LE@GOTPAGEOFF]
Lloh8:
	ldr	w12, [x12]
Lloh9:
	adrp	x13, _AFMT_S16_BE@GOTPAGE
Lloh10:
	ldr	x13, [x13, _AFMT_S16_BE@GOTPAGEOFF]
Lloh11:
	ldr	w13, [x13]
	orr	w12, w13, w12
	tst	w12, w11
	cset	w11, ne
LBB0_3:
	lsr	x10, x10, x11
	ldr	w9, [x9, #4]
	cmp	w9, #1
	cset	w9, gt
	lsr	x9, x10, x9
	sub	x21, x9, #1
	ldr	w9, [x19]
Lloh12:
	adrp	x22, _PCM_ENABLE_OUTPUT@GOTPAGE
Lloh13:
	ldr	x22, [x22, _PCM_ENABLE_OUTPUT@GOTPAGEOFF]
	ldr	w10, [x22]
	tst	w10, w9
	b.eq	LBB0_8
; %bb.4:
	cbz	w3, LBB0_8
; %bb.5:
	ldr	w8, [x8]
Lloh14:
	adrp	x11, _DMA_AUTOMODE@GOTPAGE
Lloh15:
	ldr	x11, [x11, _DMA_AUTOMODE@GOTPAGEOFF]
Lloh16:
	ldr	w11, [x11]
	and	w8, w11, w8
	cbz	w8, LBB0_8
; %bb.6:
	ldr	x8, [x19, #8]
	cmp	x21, x8
	b.ne	LBB0_8
; %bb.7:
	orr	w8, w10, w9
	str	w8, [x19]
	mov	w8, #1
	str	w8, [x19, #16]
	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:
	add	x20, x19, #20
	mov	x0, x20
	bl	_spin_lock_irqsave
	and	w2, w21, #0xff
	mov	x0, x19
	mov	w1, #15
	bl	_ad_write
	ubfx	w2, w21, #8, #8
	mov	x0, x19
	mov	w1, #14
	bl	_ad_write
	str	x21, [x19, #8]
	ldr	w8, [x22]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	mov	w8, #1
	str	w8, [x19, #16]
	mov	x0, x20
	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	_spin_unlock_irqrestore
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_audio_devs,8,3                 ; @audio_devs
	.comm	_AFMT_IMA_ADPCM,4,2             ; @AFMT_IMA_ADPCM
	.comm	_AFMT_S16_LE,4,2                ; @AFMT_S16_LE
	.comm	_AFMT_S16_BE,4,2                ; @AFMT_S16_BE
	.comm	_PCM_ENABLE_OUTPUT,4,2          ; @PCM_ENABLE_OUTPUT
	.comm	_DMA_AUTOMODE,4,2               ; @DMA_AUTOMODE
	.no_dead_strip	_ad1848_output_block
.subsections_via_symbols
