	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_ice1712_ac97_write
_snd_ice1712_ac97_write:                ## @snd_ice1712_ac97_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	(%rdi), %r15
	xorl	%r12d, %r12d
	movq	_ICE1712_AC97_WRITE@GOTPCREL(%rip), %r14
	movq	_ICE1712_AC97_READ@GOTPCREL(%rip), %r13
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$65534, %r12d                   ## imm = 0xFFFE
	ja	LBB0_4
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	incl	%r12d
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_AC97_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ICEREG
	movl	%eax, %edi
	callq	_inb
	movl	%eax, %ebx
	movzbl	(%r13), %eax
	orb	(%r14), %al
	testb	%bl, %al
	jne	LBB0_8
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_ICE1712_AC97_READY@GOTPCREL(%rip), %rax
	testb	%bl, (%rax)
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$65535, %r12d                   ## imm = 0xFFFF
	jb	LBB0_9
LBB0_4:
	movq	_AC97_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ICEREG
	movzbl	-44(%rbp), %edi                 ## 1-byte Folded Reload
	movl	%eax, %esi
	callq	_outb
	movq	_AC97_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ICEREG
	movzwl	-48(%rbp), %edi                 ## 2-byte Folded Reload
	movl	%eax, %esi
	callq	_outw
	movq	_ICE1712_AC97_PBK_VSR@GOTPCREL(%rip), %rax
	movq	_ICE1712_AC97_CAP_VSR@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	orb	(%rax), %cl
	notb	%cl
	andb	%cl, %bl
	orb	(%r14), %bl
	movq	_AC97_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ICEREG
	movzbl	%bl, %edi
	movl	%eax, %esi
	callq	_outb
	movl	$65535, %ebx                    ## imm = 0xFFFF
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_AC97_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ICEREG
	movl	%eax, %edi
	callq	_inb
	subl	$1, %ebx
	setb	%cl
	testb	%al, (%r14)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	testb	%cl, %cl
	je	LBB0_5
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AC97_CMD,4,2                   ## @AC97_CMD
	.comm	_ICE1712_AC97_WRITE,1,0         ## @ICE1712_AC97_WRITE
	.comm	_ICE1712_AC97_READ,1,0          ## @ICE1712_AC97_READ
	.comm	_ICE1712_AC97_READY,1,0         ## @ICE1712_AC97_READY
	.comm	_AC97_INDEX,4,2                 ## @AC97_INDEX
	.comm	_AC97_DATA,4,2                  ## @AC97_DATA
	.comm	_ICE1712_AC97_PBK_VSR,1,0       ## @ICE1712_AC97_PBK_VSR
	.comm	_ICE1712_AC97_CAP_VSR,1,0       ## @ICE1712_AC97_CAP_VSR
	.no_dead_strip	_snd_ice1712_ac97_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_ice1712_ac97_write
_snd_ice1712_ac97_write:                ; @snd_ice1712_ac97_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	w2, [sp, #12]                   ; 4-byte Folded Spill
	mov	x21, x1
	mov	w25, #0
	ldr	x19, [x0]
Lloh0:
	adrp	x23, _AC97_CMD@GOTPAGE
Lloh1:
	ldr	x23, [x23, _AC97_CMD@GOTPAGEOFF]
Lloh2:
	adrp	x24, _ICE1712_AC97_WRITE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _ICE1712_AC97_WRITE@GOTPAGEOFF]
Lloh4:
	adrp	x26, _ICE1712_AC97_READ@GOTPAGE
Lloh5:
	ldr	x26, [x26, _ICE1712_AC97_READ@GOTPAGEOFF]
	mov	w27, #65535
Lloh6:
	adrp	x28, _ICE1712_AC97_READY@GOTPAGE
Lloh7:
	ldr	x28, [x28, _ICE1712_AC97_READY@GOTPAGEOFF]
	mov	w20, #65534
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldrb	w8, [x28]
	and	w8, w8, w22
	cmp	w8, #0
	ccmp	w25, w27, #2, eq
	b.hs	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w25, w25, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x19
	bl	_ICEREG
	bl	_inb
	mov	x22, x0
	ldrb	w8, [x24]
	ldrb	w9, [x26]
	orr	w8, w9, w8
	tst	w8, w0
	b.eq	LBB0_1
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w25, w20
	b.ls	LBB0_2
LBB0_5:
Lloh8:
	adrp	x8, _AC97_INDEX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AC97_INDEX@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ICEREG
	mov	x1, x0
	and	w0, w21, #0xff
	bl	_outb
Lloh11:
	adrp	x8, _AC97_DATA@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AC97_DATA@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ICEREG
	mov	x1, x0
	ldr	w0, [sp, #12]                   ; 4-byte Folded Reload
	bl	_outw
Lloh14:
	adrp	x8, _ICE1712_AC97_PBK_VSR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ICE1712_AC97_PBK_VSR@GOTPAGEOFF]
	ldrb	w8, [x8]
Lloh16:
	adrp	x9, _ICE1712_AC97_CAP_VSR@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ICE1712_AC97_CAP_VSR@GOTPAGEOFF]
	ldrb	w9, [x9]
	orr	w8, w9, w8
	eor	w8, w8, #0xff
	and	w8, w22, w8
	ldrb	w9, [x24]
	orr	w20, w8, w9
	ldr	w1, [x23]
	mov	x0, x19
	bl	_ICEREG
	mov	x1, x0
	mov	x0, x20
	bl	_outb
	mov	w20, #65535
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x19
	bl	_ICEREG
	bl	_inb
	ldrb	w8, [x24]
	and	w8, w8, w0
	cmp	w8, #0
	ccmp	w20, #0, #4, ne
	sub	w20, w20, #1
	b.ne	LBB0_6
; %bb.7:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AC97_CMD,4,2                   ; @AC97_CMD
	.comm	_ICE1712_AC97_WRITE,1,0         ; @ICE1712_AC97_WRITE
	.comm	_ICE1712_AC97_READ,1,0          ; @ICE1712_AC97_READ
	.comm	_ICE1712_AC97_READY,1,0         ; @ICE1712_AC97_READY
	.comm	_AC97_INDEX,4,2                 ; @AC97_INDEX
	.comm	_AC97_DATA,4,2                  ; @AC97_DATA
	.comm	_ICE1712_AC97_PBK_VSR,1,0       ; @ICE1712_AC97_PBK_VSR
	.comm	_ICE1712_AC97_CAP_VSR,1,0       ; @ICE1712_AC97_CAP_VSR
	.no_dead_strip	_snd_ice1712_ac97_write
.subsections_via_symbols
