	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function patch_ad1881_chained1
_patch_ad1881_chained1:                 ## @patch_ad1881_chained1
	.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
	movl	%edx, %r14d
	movq	%rdi, %rbx
	movq	_AC97_AD_SERIAL_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movslq	%esi, %r13
	leaq	_patch_ad1881_chained1.cfg_bits(%rip), %rcx
	movl	(%rcx,%r13,4), %r15d
	movl	%eax, %esi
	movl	$28672, %edx                    ## imm = 0x7000
	movl	%r15d, %ecx
	callq	_snd_ac97_update_bits
	movq	_AC97_AD_CODEC_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_snd_ac97_write_cache
	movq	_AC97_VENDOR_ID2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_snd_ac97_read
	movl	%eax, %r12d
	movl	%r12d, %ecx
	andl	$65344, %ecx                    ## imm = 0xFF40
	xorl	%eax, %eax
	cmpl	$21312, %ecx                    ## imm = 0x5340
	jne	LBB0_5
## %bb.1:
	testw	%r14w, %r14w
	je	LBB0_2
## %bb.3:
	movq	_AC97_AD_CODEC_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzwl	%r14w, %edx
	movq	%rbx, %rdi
	callq	_snd_ac97_write_cache
	jmp	LBB0_4
LBB0_2:
	movw	$4, %r14w
LBB0_4:
	movq	(%rbx), %rax
	movl	%r15d, (%rax,%r13,4)
	movq	8(%rbx), %rax
	movw	%r12w, (%rax,%r13,2)
	movq	16(%rbx), %rax
	movw	%r14w, (%rax,%r13,2)
	movl	$1, %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	2                               ## @patch_ad1881_chained1.cfg_bits
_patch_ad1881_chained1.cfg_bits:
	.long	4096                            ## 0x1000
	.long	16384                           ## 0x4000
	.long	8192                            ## 0x2000

	.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_chained1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function patch_ad1881_chained1
_patch_ad1881_chained1:                 ; @patch_ad1881_chained1
	.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
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _AC97_AD_SERIAL_CFG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AC97_AD_SERIAL_CFG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _patch_ad1881_chained1.cfg_bits@PAGE
Lloh4:
	add	x8, x8, _patch_ad1881_chained1.cfg_bits@PAGEOFF
	ldr	w21, [x8, w22, sxtw #2]
	mov	w2, #28672
	mov	x3, x21
	bl	_snd_ac97_update_bits
Lloh5:
	adrp	x24, _AC97_AD_CODEC_CFG@GOTPAGE
Lloh6:
	ldr	x24, [x24, _AC97_AD_CODEC_CFG@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x20
	mov	w2, #4
	bl	_snd_ac97_write_cache
Lloh7:
	adrp	x8, _AC97_VENDOR_ID2@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AC97_VENDOR_ID2@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_snd_ac97_read
	mov	w8, #65344
	and	w8, w0, w8
	mov	w9, #21312
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.1:
	mov	x23, x0
	sxtw	x22, w22
	cbz	w19, LBB0_4
; %bb.2:
	ldr	w1, [x24]
	mov	x0, x20
	mov	x2, x19
	bl	_snd_ac97_write_cache
	b	LBB0_5
LBB0_3:
	mov	w0, #0
	b	LBB0_6
LBB0_4:
	mov	w19, #4
LBB0_5:
	ldp	x8, x9, [x20]
	str	w21, [x8, x22, lsl #2]
	lsl	x8, x22, #1
	strh	w23, [x9, x8]
	ldr	x9, [x20, #16]
	strh	w19, [x9, x8]
	mov	w0, #1
LBB0_6:
	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
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @patch_ad1881_chained1.cfg_bits
_patch_ad1881_chained1.cfg_bits:
	.long	4096                            ; 0x1000
	.long	16384                           ; 0x4000
	.long	8192                            ; 0x2000

	.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_chained1
.subsections_via_symbols
