	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ad1848_control                 ## -- Begin function ad1848_control
	.p2align	4, 0x90
_ad1848_control:                        ## @ad1848_control
	.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
	movq	_nr_ad1848_devs@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_1
## %bb.3:
	movl	%esi, %edx
	movq	_adev_info@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r15
	decl	%eax
	leaq	(%rax,%rax,2), %r12
	leaq	(%r15,%r12,8), %r14
	xorl	%ebx, %ebx
	cmpl	$129, %edi
	je	LBB0_9
## %bb.4:
	cmpl	$128, %edi
	jne	LBB0_20
## %bb.5:
	movl	20(%r15,%r12,8), %eax
	movq	_MD_1845@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_8
## %bb.6:
	movq	_MD_1845_SSCAPE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_7
LBB0_8:
	leaq	(%r15,%r12,8), %r15
	addq	$16, %r15
	movq	%r15, %rdi
	movl	%edx, %r12d
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	callq	_ad_enter_MCE
	movq	%r14, %rdi
	movl	$29, %esi
	callq	_ad_read
	andl	$31, %eax
	shll	$5, %r12d
	orl	%eax, %r12d
	movq	%r14, %rdi
	movl	$29, %esi
	movl	%r12d, %edx
	callq	_ad_write
	movq	%r14, %rdi
	callq	_ad_leave_MCE
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_20
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_9:
	movzbl	%dh, %ecx
	movq	_SOUND_MIXER_NRDEVICES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jge	LBB0_7
## %bb.10:
	movl	%edx, %edi
	movl	(%r14), %edx
	movl	$1, %r13d
	shll	%cl, %r13d
	btl	%ecx, %edx
	jb	LBB0_12
## %bb.11:
	testl	%r13d, 4(%r15,%r12,8)
	je	LBB0_7
LBB0_12:
	movl	%edi, %edx
	movzbl	%dl, %edx
	movq	_SOUND_MIXER_NONE@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	jne	LBB0_14
## %bb.13:
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	%ecx, %esi
	xorl	%edx, %edx
	callq	_ad1848_mixer_set
	notl	%r13d
	andl	%r13d, (%r14)
	andl	%r13d, 4(%r15,%r12,8)
	jmp	LBB0_20
LBB0_14:
	cmpl	%eax, %edx
	jge	LBB0_7
## %bb.15:
	movq	8(%r15,%r12,8), %rax
	movl	%edx, %edx
	movl	%ecx, (%rax,%rdx,4)
	movl	(%r14), %eax
	testl	%r13d, %eax
	je	LBB0_17
## %bb.16:
	movl	%edi, %ecx
	btsl	%edi, %eax
	movl	%eax, (%r14)
LBB0_17:
	leaq	(%r15,%r12,8), %rcx
	addq	$4, %rcx
	movl	4(%r15,%r12,8), %edx
	testl	%r13d, %edx
	je	LBB0_19
## %bb.18:
	btsl	%edi, %edx
	movl	%edx, (%rcx)
LBB0_19:
	notl	%r13d
	andl	%r13d, %eax
	movl	%eax, (%r14)
	andl	%edx, %r13d
	movl	%r13d, (%rcx)
	jmp	LBB0_20
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_nr_ad1848_devs,4,2             ## @nr_ad1848_devs
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_adev_info,8,3                  ## @adev_info
	.comm	_MD_1845,4,2                    ## @MD_1845
	.comm	_MD_1845_SSCAPE,4,2             ## @MD_1845_SSCAPE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SOUND_MIXER_NRDEVICES,4,2      ## @SOUND_MIXER_NRDEVICES
	.comm	_SOUND_MIXER_NONE,4,2           ## @SOUND_MIXER_NONE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ad1848_control                 ; -- Begin function ad1848_control
	.p2align	2
_ad1848_control:                        ; @ad1848_control
	.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
Lloh0:
	adrp	x8, _nr_ad1848_devs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _nr_ad1848_devs@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	cmp	w9, #0
	b.le	LBB0_5
; %bb.1:
	mov	x20, x1
Lloh3:
	adrp	x8, _adev_info@GOTPAGE
Lloh4:
	ldr	x8, [x8, _adev_info@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	sub	w9, w9, #1
	mov	w10, #24
	umaddl	x19, w9, w10, x8
	cmp	w0, #129
	b.eq	LBB0_6
; %bb.2:
	cmp	w0, #128
	b.ne	LBB0_11
; %bb.3:
	mov	w10, #24
	madd	x10, x9, x10, x8
	ldr	w10, [x10, #20]
Lloh6:
	adrp	x11, _MD_1845@GOTPAGE
Lloh7:
	ldr	x11, [x11, _MD_1845@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
Lloh9:
	adrp	x12, _MD_1845_SSCAPE@GOTPAGE
Lloh10:
	ldr	x12, [x12, _MD_1845_SSCAPE@GOTPAGEOFF]
Lloh11:
	ldr	w12, [x12]
	cmp	w10, w11
	ccmp	w10, w12, #4, ne
	b.ne	LBB0_18
; %bb.4:
	mov	w10, #24
	madd	x8, x9, x10, x8
	add	x21, x8, #16
	mov	x0, x21
	bl	_spin_lock_irqsave
	mov	x0, x19
	bl	_ad_enter_MCE
	mov	x0, x19
	mov	w1, #29
	bl	_ad_read
	mov	x2, x0
	bfi	w2, w20, #5, #27
	mov	x0, x19
	mov	w1, #29
	bl	_ad_write
	mov	x0, x19
	bl	_ad_leave_MCE
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	b	LBB0_20
LBB0_5:
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_19
LBB0_6:
	ubfx	w1, w20, #8, #8
Lloh14:
	adrp	x10, _SOUND_MIXER_NRDEVICES@GOTPAGE
Lloh15:
	ldr	x10, [x10, _SOUND_MIXER_NRDEVICES@GOTPAGEOFF]
Lloh16:
	ldr	w11, [x10]
	cmp	w1, w11
	b.ge	LBB0_18
; %bb.7:
	ldr	w10, [x19]
	mov	w12, #1
	lsl	w21, w12, w1
	tst	w10, w21
	b.ne	LBB0_9
; %bb.8:
	mov	w10, #24
	madd	x10, x9, x10, x8
	ldr	w10, [x10, #4]
	tst	w10, w21
	b.eq	LBB0_18
LBB0_9:
	and	w10, w20, #0xff
Lloh17:
	adrp	x12, _SOUND_MIXER_NONE@GOTPAGE
Lloh18:
	ldr	x12, [x12, _SOUND_MIXER_NONE@GOTPAGEOFF]
Lloh19:
	ldr	w12, [x12]
	cmp	w10, w12
	b.ne	LBB0_12
; %bb.10:
	mov	x0, x19
	mov	w2, #0
	bl	_ad1848_mixer_set
	mov	w0, #0
	mvn	w8, w21
	ldr	d0, [x19]
	dup.2s	v1, w8
	and.8b	v0, v0, v1
	str	d0, [x19]
	b	LBB0_20
LBB0_11:
	mov	w0, #0
	b	LBB0_20
LBB0_12:
	cmp	w10, w11
	b.ge	LBB0_18
; %bb.13:
	mov	w11, #24
	madd	x11, x9, x11, x8
	ldr	x11, [x11, #8]
	str	w1, [x11, w10, uxtw #2]
	ldr	w11, [x19]
	tst	w11, w21
	b.eq	LBB0_15
; %bb.14:
	mov	w12, #1
	lsl	w12, w12, w10
	orr	w11, w11, w12
	str	w11, [x19]
LBB0_15:
	mov	w12, #24
	madd	x8, x9, x12, x8
	ldr	w9, [x8, #4]!
	tst	w9, w21
	b.eq	LBB0_17
; %bb.16:
	mov	w12, #1
	lsl	w10, w12, w10
	orr	w9, w9, w10
	str	w9, [x8]
LBB0_17:
	mov	w0, #0
	bic	w10, w11, w21
	str	w10, [x19]
	bic	w9, w9, w21
	str	w9, [x8]
	b	LBB0_20
LBB0_18:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_20:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_nr_ad1848_devs,4,2             ; @nr_ad1848_devs
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_adev_info,8,3                  ; @adev_info
	.comm	_MD_1845,4,2                    ; @MD_1845
	.comm	_MD_1845_SSCAPE,4,2             ; @MD_1845_SSCAPE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SOUND_MIXER_NRDEVICES,4,2      ; @SOUND_MIXER_NRDEVICES
	.comm	_SOUND_MIXER_NONE,4,2           ; @SOUND_MIXER_NONE
.subsections_via_symbols
