	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function patch_cm9739
_patch_cm9739:                          ## @patch_cm9739
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_patch_cm9739_ops@GOTPCREL(%rip), %rax
	movq	%rax, 32(%rdi)
	movq	_AC97_HAS_NO_MASTER_VOL@GOTPCREL(%rip), %rax
	movq	_AC97_HAS_NO_PCM_VOL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	%ecx, (%rdi)
	movq	_AC97_MASTER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32768, %edx                    ## imm = 0x8000
	callq	_snd_ac97_write_cache
	movq	_AC97_PCM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$32768, %edx                    ## imm = 0x8000
	callq	_snd_ac97_write_cache
	movq	_AC97_EXTENDED_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_snd_ac97_read
	movq	_AC97_EA_SPCV@GOTPCREL(%rip), %rcx
	movzwl	(%rcx), %ecx
	testl	%ecx, %eax
	je	LBB0_2
## %bb.1:
	movq	_AC97_CM9739_SPDIF_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_snd_ac97_read
	orl	$1, %eax
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_snd_ac97_write_cache
	movq	_SNDRV_PCM_RATE_48000@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_3
LBB0_2:
	movq	_AC97_EI_SPDIF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 4(%rbx)
	xorl	%eax, %eax
LBB0_3:
	movq	24(%rbx), %rcx
	movq	_AC97_RATES_SPDIF@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	_AC97_CM9739_MULTI_CHAN@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_snd_ac97_read
                                        ## kill: def $eax killed $eax def $rax
	andl	$16, %eax
	movq	_AC97_EI_SPDIF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%edx, %edx
	andl	4(%rbx), %ecx
	sete	%dl
	shll	$14, %edx
	addl	%eax, %edx
	addl	$8200, %edx                     ## imm = 0x2008
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_snd_ac97_write_cache
	movq	%rbx, %rdi
	movl	$112, %esi
	movl	$256, %edx                      ## imm = 0x100
	callq	_snd_ac97_write_cache
	movq	%rbx, %rdi
	movl	$114, %esi
	movl	$32, %edx
	callq	_snd_ac97_write_cache
	cmpq	$0, 16(%rbx)
	je	LBB0_7
## %bb.4:
	cmpl	$4163, 8(%rbx)                  ## imm = 0x1043
	jne	LBB0_7
## %bb.5:
	cmpl	$6211, 12(%rbx)                 ## imm = 0x1843
	jne	LBB0_7
## %bb.6:
	movq	_AC97_CM9739_SPDIF_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_snd_ac97_read
	andl	$-2, %eax
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_snd_ac97_write_cache
	movl	(%r15), %r14d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_snd_ac97_read
	orl	$16384, %eax                    ## imm = 0x4000
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_snd_ac97_write_cache
LBB0_7:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_patch_cm9739_ops,4,2           ## @patch_cm9739_ops
	.comm	_AC97_HAS_NO_MASTER_VOL,4,2     ## @AC97_HAS_NO_MASTER_VOL
	.comm	_AC97_HAS_NO_PCM_VOL,4,2        ## @AC97_HAS_NO_PCM_VOL
	.comm	_AC97_MASTER,4,2                ## @AC97_MASTER
	.comm	_AC97_PCM,4,2                   ## @AC97_PCM
	.comm	_AC97_EXTENDED_STATUS,4,2       ## @AC97_EXTENDED_STATUS
	.comm	_AC97_EA_SPCV,2,1               ## @AC97_EA_SPCV
	.comm	_AC97_CM9739_SPDIF_CTRL,4,2     ## @AC97_CM9739_SPDIF_CTRL
	.comm	_SNDRV_PCM_RATE_48000,8,3       ## @SNDRV_PCM_RATE_48000
	.comm	_AC97_RATES_SPDIF,8,3           ## @AC97_RATES_SPDIF
	.comm	_AC97_EI_SPDIF,4,2              ## @AC97_EI_SPDIF
	.comm	_AC97_CM9739_MULTI_CHAN,4,2     ## @AC97_CM9739_MULTI_CHAN
	.no_dead_strip	_patch_cm9739
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function patch_cm9739
_patch_cm9739:                          ; @patch_cm9739
	.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	x8, _patch_cm9739_ops@GOTPAGE
Lloh1:
	ldr	x8, [x8, _patch_cm9739_ops@GOTPAGEOFF]
Lloh2:
	adrp	x9, _AC97_HAS_NO_MASTER_VOL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AC97_HAS_NO_MASTER_VOL@GOTPAGEOFF]
	str	x8, [x0, #32]
Lloh4:
	ldr	w8, [x9]
Lloh5:
	adrp	x9, _AC97_HAS_NO_PCM_VOL@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AC97_HAS_NO_PCM_VOL@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x0]
	orr	w8, w8, w9
	str	w8, [x0]
Lloh8:
	adrp	x8, _AC97_MASTER@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AC97_MASTER@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w2, #32768
	bl	_snd_ac97_write_cache
Lloh11:
	adrp	x8, _AC97_PCM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AC97_PCM@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #32768
	bl	_snd_ac97_write_cache
Lloh14:
	adrp	x8, _AC97_EXTENDED_STATUS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AC97_EXTENDED_STATUS@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_snd_ac97_read
Lloh17:
	adrp	x8, _AC97_EA_SPCV@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AC97_EA_SPCV@GOTPAGEOFF]
	ldrh	w8, [x8]
Lloh19:
	adrp	x22, _AC97_EI_SPDIF@GOTPAGE
Lloh20:
	ldr	x22, [x22, _AC97_EI_SPDIF@GOTPAGEOFF]
	tst	w0, w8
	b.eq	LBB0_2
; %bb.1:
Lloh21:
	adrp	x8, _AC97_CM9739_SPDIF_CTRL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AC97_CM9739_SPDIF_CTRL@GOTPAGEOFF]
Lloh23:
	ldr	w20, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_snd_ac97_read
	orr	w2, w0, #0x1
	mov	x0, x19
	mov	x1, x20
	bl	_snd_ac97_write_cache
Lloh24:
	adrp	x8, _SNDRV_PCM_RATE_48000@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SNDRV_PCM_RATE_48000@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	b	LBB0_3
LBB0_2:
	mov	x8, #0
	ldr	w9, [x22]
	ldr	w10, [x19, #4]
	bic	w9, w10, w9
	str	w9, [x19, #4]
LBB0_3:
	ldr	x9, [x19, #24]
Lloh27:
	adrp	x10, _AC97_RATES_SPDIF@GOTPAGE
Lloh28:
	ldr	x10, [x10, _AC97_RATES_SPDIF@GOTPAGEOFF]
Lloh29:
	ldr	x10, [x10]
	str	x8, [x9, x10, lsl #3]
Lloh30:
	adrp	x21, _AC97_CM9739_MULTI_CHAN@GOTPAGE
Lloh31:
	ldr	x21, [x21, _AC97_CM9739_MULTI_CHAN@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_snd_ac97_read
	and	w8, w0, #0x10
	ldr	w9, [x19, #4]
	ldr	w10, [x22]
	tst	w10, w9
	mov	w9, #8200
	mov	w10, #24584
	csel	w9, w10, w9, eq
	orr	w2, w9, w8
	ldr	w1, [x21]
	mov	x0, x19
	bl	_snd_ac97_write_cache
	mov	x0, x19
	mov	w1, #112
	mov	w2, #256
	bl	_snd_ac97_write_cache
	mov	x0, x19
	mov	w1, #114
	mov	w2, #32
	bl	_snd_ac97_write_cache
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_7
; %bb.4:
	ldr	w8, [x19, #8]
	mov	w9, #4163
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.5:
	ldr	w8, [x19, #12]
	mov	w9, #6211
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.6:
Lloh32:
	adrp	x8, _AC97_CM9739_SPDIF_CTRL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _AC97_CM9739_SPDIF_CTRL@GOTPAGEOFF]
Lloh34:
	ldr	w20, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_snd_ac97_read
	and	w2, w0, #0xfffffffe
	mov	x0, x19
	mov	x1, x20
	bl	_snd_ac97_write_cache
	ldr	w20, [x21]
	mov	x0, x19
	mov	x1, x20
	bl	_snd_ac97_read
	orr	w2, w0, #0x4000
	mov	x0, x19
	mov	x1, x20
	bl	_snd_ac97_write_cache
LBB0_7:
	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	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_patch_cm9739_ops,4,2           ; @patch_cm9739_ops
	.comm	_AC97_HAS_NO_MASTER_VOL,4,2     ; @AC97_HAS_NO_MASTER_VOL
	.comm	_AC97_HAS_NO_PCM_VOL,4,2        ; @AC97_HAS_NO_PCM_VOL
	.comm	_AC97_MASTER,4,2                ; @AC97_MASTER
	.comm	_AC97_PCM,4,2                   ; @AC97_PCM
	.comm	_AC97_EXTENDED_STATUS,4,2       ; @AC97_EXTENDED_STATUS
	.comm	_AC97_EA_SPCV,2,1               ; @AC97_EA_SPCV
	.comm	_AC97_CM9739_SPDIF_CTRL,4,2     ; @AC97_CM9739_SPDIF_CTRL
	.comm	_SNDRV_PCM_RATE_48000,8,3       ; @SNDRV_PCM_RATE_48000
	.comm	_AC97_RATES_SPDIF,8,3           ; @AC97_RATES_SPDIF
	.comm	_AC97_EI_SPDIF,4,2              ; @AC97_EI_SPDIF
	.comm	_AC97_CM9739_MULTI_CHAN,4,2     ; @AC97_CM9739_MULTI_CHAN
	.no_dead_strip	_patch_cm9739
.subsections_via_symbols
