	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function patch_ad1881_unchained
_patch_ad1881_unchained:                ## @patch_ad1881_unchained
	.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	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	_AC97_AD_SERIAL_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$28672, %edx                    ## imm = 0x7000
	movl	%r14d, %ecx
	callq	_snd_ac97_update_bits
	movq	_AC97_AD_CODEC_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_snd_ac97_write_cache
	movq	_AC97_VENDOR_ID2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_snd_ac97_read
                                        ## kill: def $ax killed $ax def $eax
	movl	%eax, %ecx
	andl	$65344, %ecx                    ## imm = 0xFF40
	cmpl	$21312, %ecx                    ## imm = 0x5340
	jne	LBB0_2
## %bb.1:
	movq	(%rbx), %rcx
	movslq	%r15d, %rdx
	movw	%r14w, (%rcx,%rdx,2)
	movq	8(%rbx), %rcx
	movw	%ax, (%rcx,%rdx,2)
	movq	16(%rbx), %rax
	movl	$0, (%rax,%rdx,4)
	movl	%r14d, %r12d
LBB0_2:
	movzwl	%r12w, %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_CODEC_CFG,4,2          ## @AC97_AD_CODEC_CFG
	.comm	_AC97_VENDOR_ID2,4,2            ## @AC97_VENDOR_ID2
	.no_dead_strip	_patch_ad1881_unchained
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function patch_ad1881_unchained
_patch_ad1881_unchained:                ; @patch_ad1881_unchained
	.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, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _AC97_AD_SERIAL_CFG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AC97_AD_SERIAL_CFG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #28672
	mov	x3, x19
	bl	_snd_ac97_update_bits
Lloh3:
	adrp	x8, _AC97_AD_CODEC_CFG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AC97_AD_CODEC_CFG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #0
	bl	_snd_ac97_write_cache
Lloh6:
	adrp	x8, _AC97_VENDOR_ID2@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AC97_VENDOR_ID2@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_snd_ac97_read
	mov	w1, #0
	mov	w8, #65344
	and	w8, w0, w8
	mov	w9, #21312
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	sbfiz	x8, x20, #1, #32
	ldp	x9, x10, [x21]
	strh	w19, [x9, x8]
	strh	w0, [x10, x8]
	ldr	x8, [x21, #16]
	str	wzr, [x8, w20, sxtw #2]
	mov	x1, x19
LBB0_2:
	mov	x0, x1
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AC97_AD_SERIAL_CFG,4,2         ; @AC97_AD_SERIAL_CFG
	.comm	_AC97_AD_CODEC_CFG,4,2          ; @AC97_AD_CODEC_CFG
	.comm	_AC97_VENDOR_ID2,4,2            ; @AC97_VENDOR_ID2
	.no_dead_strip	_patch_ad1881_unchained
.subsections_via_symbols
