	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stac9766_ac97_write
_stac9766_ac97_write:                   ## @stac9766_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, %r12d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	_AC97_STAC_PAGE0@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%esi, %eax
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jae	LBB0_4
## %bb.1:
	movq	_AC97_INT_PAGING@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_stac9766_ac97_write
	movq	_soc_ac97_ops@GOTPCREL(%rip), %r14
	movl	8(%r15), %edi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	*(%r14)
	movl	(%r13), %ebx
	movl	$1, %r12d
	movq	_AC97_STAC_PAGE0@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	jae	LBB0_4
## %bb.2:
	movl	$1, %r12d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_stac9766_ac97_write
	movl	8(%r15), %edi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	*(%r14)
	movl	(%r13), %ebx
	movq	_AC97_STAC_PAGE0@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	jb	LBB0_3
LBB0_4:
	movq	(%r15), %r14
	movl	%ebx, %r13d
	shrl	%r13d
	movq	_stac9766_reg@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ARRAY_SIZE
	cmpl	%eax, %r13d
	jae	LBB0_5
## %bb.6:
	movq	_soc_ac97_ops@GOTPCREL(%rip), %rax
	movl	8(%r15), %edi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	*(%rax)
	movl	%r13d, %eax
	movl	%r12d, (%r14,%rax,4)
	xorl	%ecx, %ecx
	jmp	LBB0_7
LBB0_5:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
LBB0_7:
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%eax, %eax
	cmpl	%edx, %esi
	cmovael	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AC97_STAC_PAGE0,4,2            ## @AC97_STAC_PAGE0
	.comm	_AC97_INT_PAGING,4,2            ## @AC97_INT_PAGING
	.comm	_soc_ac97_ops,8,3               ## @soc_ac97_ops
	.comm	_stac9766_reg,4,2               ## @stac9766_reg
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_stac9766_ac97_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stac9766_ac97_write
_stac9766_ac97_write:                   ; @stac9766_ac97_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	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x25, _AC97_STAC_PAGE0@GOTPAGE
Lloh1:
	ldr	x25, [x25, _AC97_STAC_PAGE0@GOTPAGEOFF]
	ldr	w23, [x25]
Lloh2:
	adrp	x24, _soc_ac97_ops@GOTPAGE
Lloh3:
	ldr	x24, [x24, _soc_ac97_ops@GOTPAGEOFF]
	cmp	w23, w1
	b.hs	LBB0_3
; %bb.1:
Lloh4:
	adrp	x26, _AC97_INT_PAGING@GOTPAGE
Lloh5:
	ldr	x26, [x26, _AC97_INT_PAGING@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x20
	mov	w2, #0
	bl	_stac9766_ac97_write
	ldr	x8, [x24]
	ldr	w0, [x20, #8]
	mov	x1, x19
	mov	x2, x21
	blr	x8
	ldr	w22, [x26]
	ldr	w8, [x25]
	mov	w21, #1
	cmp	w8, w22
	b.hs	LBB0_4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	mov	w2, #0
	bl	_stac9766_ac97_write
	ldr	x8, [x24]
	ldr	w0, [x20, #8]
	mov	x1, x22
	mov	w2, #1
	blr	x8
	ldr	w22, [x26]
	ldr	w8, [x25]
	cmp	w8, w22
	b.lo	LBB0_2
	b	LBB0_4
LBB0_3:
	mov	x22, x19
LBB0_4:
	ldr	x25, [x20]
	lsr	w26, w22, #1
Lloh6:
	adrp	x8, _stac9766_reg@GOTPAGE
Lloh7:
	ldr	x8, [x8, _stac9766_reg@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_ARRAY_SIZE
	cmp	w26, w0
	b.hs	LBB0_6
; %bb.5:
	ldr	x8, [x24]
	ldr	w0, [x20, #8]
	mov	x1, x22
	mov	x2, x21
	blr	x8
	mov	w8, #0
	str	w21, [x25, w26, uxtw #2]
	b	LBB0_7
LBB0_6:
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w8, w8
LBB0_7:
	cmp	w23, w19
	csel	w0, wzr, w8, lo
	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
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_AC97_STAC_PAGE0,4,2            ; @AC97_STAC_PAGE0
	.comm	_AC97_INT_PAGING,4,2            ; @AC97_INT_PAGING
	.comm	_soc_ac97_ops,8,3               ; @soc_ac97_ops
	.comm	_stac9766_reg,4,2               ; @stac9766_reg
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_stac9766_ac97_write
.subsections_via_symbols
