	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_trident_codec_write
_snd_trident_codec_write:               ## @snd_trident_codec_write
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r13d
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	shll	$16, %r13d
	leaq	8(%r12), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	(%r12), %rax
	movq	_TRIDENT_DEVICE_ID_DX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.1:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	_DX_ACR0_AC97_W@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movw	$-1, %r14w
	movq	_DX_AC97_BUSY_WRITE@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_TRID_REG
	movl	%eax, %edi
	callq	_inw
	movzwl	(%rbx), %ecx
	testw	%ax, %cx
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	decw	%r14w
	jne	LBB0_2
## %bb.4:
	xorl	%r14d, %r14d
LBB0_5:
	movzbl	-44(%rbp), %eax                 ## 1-byte Folded Reload
	orl	%eax, %ecx
	movzwl	%cx, %eax
	orl	%eax, %r13d
	jmp	LBB0_19
LBB0_6:
	movq	_TRIDENT_DEVICE_ID_NX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.7:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	%r13d, %ebx
	movq	_NX_ACR1_AC97_W@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movw	$-1, %r14w
	movq	_NX_AC97_BUSY_WRITE@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_TRID_REG
	movl	%eax, %edi
	callq	_inw
	movzwl	%ax, %ecx
	movl	(%r13), %eax
	testl	%ecx, %eax
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	decw	%r14w
	jne	LBB0_8
## %bb.10:
	xorl	%r14d, %r14d
LBB0_11:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %ecx
	shll	$8, %ecx
	movzbl	-44(%rbp), %edx                 ## 1-byte Folded Reload
	movl	%ebx, %r13d
	orl	%edx, %r13d
	orl	%eax, %r13d
	orl	%ecx, %r13d
	jmp	LBB0_19
LBB0_12:
	movq	_TRIDENT_DEVICE_ID_SI7018@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_21
## %bb.13:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	%r13d, %ebx
	movq	_SI_AC97_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movw	$-1, %r14w
	movq	_SI_AC97_BUSY_WRITE@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_TRID_REG
	movl	%eax, %edi
	callq	_inw
	movzwl	(%r13), %ecx
	testw	%ax, %cx
	je	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	decw	%r14w
	jne	LBB0_14
## %bb.16:
	xorl	%r14d, %r14d
LBB0_17:
	movq	_SI_AC97_AUDIO_BUSY@GOTPCREL(%rip), %rax
	movzbl	-44(%rbp), %edx                 ## 1-byte Folded Reload
	orl	%edx, %ecx
	orw	(%rax), %cx
	movzwl	%cx, %eax
	movl	%ebx, %r13d
	orl	%eax, %r13d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	$1, (%rax)
	jne	LBB0_19
## %bb.18:
	movq	_SI_AC97_SECONDARY@GOTPCREL(%rip), %rax
	orl	(%rax), %r13d
LBB0_19:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	testw	%r14w, %r14w
	je	LBB0_21
## %bb.20:
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_TRID_REG
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_outl
LBB0_21:
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TRIDENT_DEVICE_ID_DX,8,3       ## @TRIDENT_DEVICE_ID_DX
	.comm	_DX_ACR0_AC97_W,4,2             ## @DX_ACR0_AC97_W
	.comm	_DX_AC97_BUSY_WRITE,2,1         ## @DX_AC97_BUSY_WRITE
	.comm	_TRIDENT_DEVICE_ID_NX,8,3       ## @TRIDENT_DEVICE_ID_NX
	.comm	_NX_ACR1_AC97_W,4,2             ## @NX_ACR1_AC97_W
	.comm	_NX_AC97_BUSY_WRITE,4,2         ## @NX_AC97_BUSY_WRITE
	.comm	_TRIDENT_DEVICE_ID_SI7018,8,3   ## @TRIDENT_DEVICE_ID_SI7018
	.comm	_SI_AC97_WRITE,4,2              ## @SI_AC97_WRITE
	.comm	_SI_AC97_BUSY_WRITE,2,1         ## @SI_AC97_BUSY_WRITE
	.comm	_SI_AC97_AUDIO_BUSY,2,1         ## @SI_AC97_AUDIO_BUSY
	.comm	_SI_AC97_SECONDARY,4,2          ## @SI_AC97_SECONDARY
	.no_dead_strip	_snd_trident_codec_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_trident_codec_write
_snd_trident_codec_write:               ; @snd_trident_codec_write
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x1
	mov	x23, x0
	ldr	x20, [x0, #8]
	lsl	w24, w2, #16
	add	x19, x20, #8
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _TRIDENT_DEVICE_ID_DX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TRIDENT_DEVICE_ID_DX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.1:
Lloh3:
	adrp	x8, _DX_ACR0_AC97_W@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DX_ACR0_AC97_W@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	mov	w25, #65535
Lloh6:
	adrp	x23, _DX_AC97_BUSY_WRITE@GOTPAGE
Lloh7:
	ldr	x23, [x23, _DX_AC97_BUSY_WRITE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_TRID_REG
	bl	_inw
	ldrh	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w25, w25, #1
	tst	w25, #0xffff
	b.ne	LBB0_2
; %bb.4:
	mov	w25, #0
LBB0_5:
	and	w9, w22, #0xff
	orr	w8, w8, w9
	orr	w22, w24, w8
	b	LBB0_19
LBB0_6:
Lloh8:
	adrp	x9, _TRIDENT_DEVICE_ID_NX@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TRIDENT_DEVICE_ID_NX@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.7:
Lloh11:
	adrp	x8, _NX_ACR1_AC97_W@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NX_ACR1_AC97_W@GOTPAGEOFF]
Lloh13:
	ldr	w21, [x8]
	mov	w25, #65535
Lloh14:
	adrp	x26, _NX_AC97_BUSY_WRITE@GOTPAGE
Lloh15:
	ldr	x26, [x26, _NX_AC97_BUSY_WRITE@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_TRID_REG
	bl	_inw
	ldr	w8, [x26]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	sub	w25, w25, #1
	tst	w25, #0xffff
	b.ne	LBB0_8
; %bb.10:
	mov	w25, #0
LBB0_11:
	ldr	w9, [x23]
	and	w10, w22, #0xff
	orr	w10, w24, w10
	orr	w8, w10, w8
	orr	w22, w8, w9, lsl #8
	b	LBB0_19
LBB0_12:
Lloh16:
	adrp	x9, _TRIDENT_DEVICE_ID_SI7018@GOTPAGE
Lloh17:
	ldr	x9, [x9, _TRIDENT_DEVICE_ID_SI7018@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_21
; %bb.13:
Lloh19:
	adrp	x8, _SI_AC97_WRITE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SI_AC97_WRITE@GOTPAGEOFF]
Lloh21:
	ldr	w21, [x8]
	mov	w25, #65535
Lloh22:
	adrp	x26, _SI_AC97_BUSY_WRITE@GOTPAGE
Lloh23:
	ldr	x26, [x26, _SI_AC97_BUSY_WRITE@GOTPAGEOFF]
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_TRID_REG
	bl	_inw
	ldrh	w8, [x26]
	tst	w8, w0
	b.eq	LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	sub	w25, w25, #1
	tst	w25, #0xffff
	b.ne	LBB0_14
; %bb.16:
	mov	w25, #0
LBB0_17:
Lloh24:
	adrp	x9, _SI_AC97_AUDIO_BUSY@GOTPAGE
Lloh25:
	ldr	x9, [x9, _SI_AC97_AUDIO_BUSY@GOTPAGEOFF]
	ldrh	w9, [x9]
	and	w10, w22, #0xff
	orr	w8, w8, w10
	orr	w8, w8, w9
	orr	w22, w24, w8
	ldr	w8, [x23]
	cmp	w8, #1
	b.ne	LBB0_19
; %bb.18:
Lloh26:
	adrp	x8, _SI_AC97_SECONDARY@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SI_AC97_SECONDARY@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	orr	w22, w8, w22
LBB0_19:
	tst	w25, #0xffff
	b.eq	LBB0_21
; %bb.20:
	mov	x0, x20
	mov	x1, x21
	bl	_TRID_REG
	mov	x1, x0
	mov	x0, x22
	bl	_outl
LBB0_21:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_TRIDENT_DEVICE_ID_DX,8,3       ; @TRIDENT_DEVICE_ID_DX
	.comm	_DX_ACR0_AC97_W,4,2             ; @DX_ACR0_AC97_W
	.comm	_DX_AC97_BUSY_WRITE,2,1         ; @DX_AC97_BUSY_WRITE
	.comm	_TRIDENT_DEVICE_ID_NX,8,3       ; @TRIDENT_DEVICE_ID_NX
	.comm	_NX_ACR1_AC97_W,4,2             ; @NX_ACR1_AC97_W
	.comm	_NX_AC97_BUSY_WRITE,4,2         ; @NX_AC97_BUSY_WRITE
	.comm	_TRIDENT_DEVICE_ID_SI7018,8,3   ; @TRIDENT_DEVICE_ID_SI7018
	.comm	_SI_AC97_WRITE,4,2              ; @SI_AC97_WRITE
	.comm	_SI_AC97_BUSY_WRITE,2,1         ; @SI_AC97_BUSY_WRITE
	.comm	_SI_AC97_AUDIO_BUSY,2,1         ; @SI_AC97_AUDIO_BUSY
	.comm	_SI_AC97_SECONDARY,4,2          ; @SI_AC97_SECONDARY
	.no_dead_strip	_snd_trident_codec_write
.subsections_via_symbols
