	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function patch_ad1881
_patch_ad1881:                          ## @patch_ad1881
	.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
	movq	%rdi, %rbx
	movq	_AC97_AD_SERIAL_CFG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_snd_ac97_read
	movl	(%r12), %esi
	movzwl	%ax, %edx
	movq	%rbx, %rdi
	callq	_snd_ac97_write_cache
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_patch_ad1881_unchained
	movl	%eax, %r15d
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	$16384, %edx                    ## imm = 0x4000
	callq	_patch_ad1881_unchained
	movl	%eax, %r14d
	movq	%rbx, %rdi
	movl	$2, %esi
	movl	$8192, %edx                     ## imm = 0x2000
	callq	_patch_ad1881_unchained
	testw	%r15w, %r15w
	jne	LBB0_3
## %bb.1:
	testw	%r14w, %r14w
	jne	LBB0_3
## %bb.2:
	testw	%ax, %ax
	je	LBB0_13
LBB0_3:
	movq	32(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$2, %edx
	movl	$1, %ecx
	callq	_patch_ad1881_chained
	movq	32(%rbx), %rax
LBB0_5:
	cmpq	$0, 8(%rax)
	je	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	movl	$2, %ecx
	callq	_patch_ad1881_chained
	movq	32(%rbx), %rax
LBB0_7:
	cmpq	$0, 16(%rax)
	je	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	movl	$2, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	_patch_ad1881_chained
LBB0_9:
	movq	16(%rbx), %rax
	cmpl	$0, 4(%rax)
	je	LBB0_11
## %bb.10:
	movq	_AC97_AD_MULTI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 52(%rbx)
	movq	_AC97_SCAP_SURROUND_DAC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 48(%rbx)
LBB0_11:
	cmpl	$0, 8(%rax)
	je	LBB0_13
## %bb.12:
	movq	_AC97_AD_MULTI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 52(%rbx)
	movq	_AC97_SCAP_CENTER_LFE_DAC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 48(%rbx)
LBB0_13:
	movl	(%r12), %esi
	movq	%rbx, %rdi
	movl	$28672, %edx                    ## imm = 0x7000
	movl	$28672, %ecx                    ## imm = 0x7000
	callq	_snd_ac97_update_bits
	movq	16(%rbx), %rax
	xorl	%ecx, %ecx
	cmpl	$0, (%rax)
	setne	%cl
	cmpl	$1, 4(%rax)
	sbbl	$-1, %ecx
	cmpl	$1, 8(%rax)
	sbbl	$-1, %ecx
	cmpl	$1, %ecx
	jne	LBB0_15
## %bb.14:
	movq	_AC97_AD_CODEC_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_snd_ac97_write_cache
	movq	24(%rbx), %rax
	movl	$0, 8(%rax)
	movq	$0, (%rax)
LBB0_15:
	movq	_AC97_EXTENDED_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_snd_ac97_read
	movq	%rax, 40(%rbx)
	movq	16(%rbx), %rax
	cmpl	$0, (%rax)
	je	LBB0_17
## %bb.16:
	movzwl	2(%rbx), %ecx
	shll	$16, %ecx
	movl	%ecx, (%rbx)
	orl	(%rax), %ecx
	movl	%ecx, (%rbx)
LBB0_17:
	movq	_patch_ad1881_build_ops@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rbx)
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AC97_AD_SERIAL_CFG,4,2         ## @AC97_AD_SERIAL_CFG
	.comm	_AC97_AD_MULTI,4,2              ## @AC97_AD_MULTI
	.comm	_AC97_SCAP_SURROUND_DAC,4,2     ## @AC97_SCAP_SURROUND_DAC
	.comm	_AC97_SCAP_CENTER_LFE_DAC,4,2   ## @AC97_SCAP_CENTER_LFE_DAC
	.comm	_AC97_AD_CODEC_CFG,4,2          ## @AC97_AD_CODEC_CFG
	.comm	_AC97_EXTENDED_ID,4,2           ## @AC97_EXTENDED_ID
	.comm	_patch_ad1881_build_ops,4,2     ## @patch_ad1881_build_ops
	.no_dead_strip	_patch_ad1881
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function patch_ad1881
_patch_ad1881:                          ; @patch_ad1881
	.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
	mov	x19, x0
Lloh0:
	adrp	x22, _AC97_AD_SERIAL_CFG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _AC97_AD_SERIAL_CFG@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_snd_ac97_read
	ldr	w1, [x22]
	and	w2, w0, #0xffff
	mov	x0, x19
	bl	_snd_ac97_write_cache
	mov	x0, x19
	mov	w1, #0
	mov	w2, #4096
	bl	_patch_ad1881_unchained
	mov	x21, x0
	mov	x0, x19
	mov	w1, #1
	mov	w2, #16384
	bl	_patch_ad1881_unchained
	mov	x20, x0
	mov	x0, x19
	mov	w1, #2
	mov	w2, #8192
	bl	_patch_ad1881_unchained
	cbnz	w21, LBB0_3
; %bb.1:
	cbnz	w20, LBB0_3
; %bb.2:
	cbz	w0, LBB0_13
LBB0_3:
	ldr	x8, [x19, #32]
	ldr	x9, [x8]
	cbz	x9, LBB0_5
; %bb.4:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #2
	mov	w3, #1
	bl	_patch_ad1881_chained
	ldr	x8, [x19, #32]
LBB0_5:
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_7
; %bb.6:
	mov	x0, x19
	mov	w1, #1
	mov	w2, #0
	mov	w3, #2
	bl	_patch_ad1881_chained
	ldr	x8, [x19, #32]
LBB0_7:
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, x19
	mov	w1, #2
	mov	w2, #0
	mov	w3, #1
	bl	_patch_ad1881_chained
LBB0_9:
	ldr	x9, [x19, #16]
	ldr	w10, [x9, #4]
Lloh2:
	adrp	x8, _AC97_AD_MULTI@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AC97_AD_MULTI@GOTPAGEOFF]
	cbz	w10, LBB0_11
; %bb.10:
	ldr	w10, [x8]
	ldp	w12, w11, [x19, #48]
	orr	w10, w11, w10
Lloh4:
	adrp	x11, _AC97_SCAP_SURROUND_DAC@GOTPAGE
Lloh5:
	ldr	x11, [x11, _AC97_SCAP_SURROUND_DAC@GOTPAGEOFF]
Lloh6:
	ldr	w11, [x11]
	orr	w11, w12, w11
	stp	w11, w10, [x19, #48]
LBB0_11:
	ldr	w9, [x9, #8]
	cbz	w9, LBB0_13
; %bb.12:
	ldr	w8, [x8]
	ldp	w10, w9, [x19, #48]
	orr	w8, w9, w8
Lloh7:
	adrp	x9, _AC97_SCAP_CENTER_LFE_DAC@GOTPAGE
Lloh8:
	ldr	x9, [x9, _AC97_SCAP_CENTER_LFE_DAC@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w9, w10, w9
	stp	w9, w8, [x19, #48]
LBB0_13:
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #28672
	mov	w3, #28672
	bl	_snd_ac97_update_bits
	ldr	x8, [x19, #16]
	ldp	w9, w10, [x8]
	cmp	w10, #0
	cset	w10, ne
	cmp	w9, #0
	cinc	w9, w10, ne
	ldr	w8, [x8, #8]
	cmp	w8, #0
	cinc	w8, w9, ne
	cmp	w8, #1
	b.ne	LBB0_15
; %bb.14:
Lloh10:
	adrp	x8, _AC97_AD_CODEC_CFG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AC97_AD_CODEC_CFG@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_snd_ac97_write_cache
	ldr	x8, [x19, #24]
	str	wzr, [x8, #8]
	str	xzr, [x8]
LBB0_15:
Lloh13:
	adrp	x8, _AC97_EXTENDED_ID@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AC97_EXTENDED_ID@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_snd_ac97_read
	str	x0, [x19, #40]
	ldr	x8, [x19, #16]
	ldr	w9, [x8]
	cbz	w9, LBB0_17
; %bb.16:
	ldrh	w9, [x19, #2]
	lsl	w9, w9, #16
	str	w9, [x19]
	ldr	w8, [x8]
	orr	w8, w8, w9
	str	w8, [x19]
LBB0_17:
Lloh16:
	adrp	x8, _patch_ad1881_build_ops@GOTPAGE
Lloh17:
	ldr	x8, [x8, _patch_ad1881_build_ops@GOTPAGEOFF]
	str	x8, [x19, #8]
	mov	w0, #0
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_AC97_AD_SERIAL_CFG,4,2         ; @AC97_AD_SERIAL_CFG
	.comm	_AC97_AD_MULTI,4,2              ; @AC97_AD_MULTI
	.comm	_AC97_SCAP_SURROUND_DAC,4,2     ; @AC97_SCAP_SURROUND_DAC
	.comm	_AC97_SCAP_CENTER_LFE_DAC,4,2   ; @AC97_SCAP_CENTER_LFE_DAC
	.comm	_AC97_AD_CODEC_CFG,4,2          ; @AC97_AD_CODEC_CFG
	.comm	_AC97_EXTENDED_ID,4,2           ; @AC97_EXTENDED_ID
	.comm	_patch_ad1881_build_ops,4,2     ; @patch_ad1881_build_ops
	.no_dead_strip	_patch_ad1881
.subsections_via_symbols
