	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function au1xpsc_ac97_hw_params
_au1xpsc_ac97_hw_params:                ## @au1xpsc_ac97_hw_params
	.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
	movq	%rsi, %r13
	movq	_au1xpsc_ac97_workdata@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	callq	_SUBSTREAM_TYPE
	movl	%eax, %r14d
	movq	%r13, %rdi
	callq	_params_channels
	movq	%r15, %rdi
	callq	_AC97_CFG
	movl	%eax, %edi
	callq	_au_readl
	movslq	%eax, %r12
	movq	%r15, %rdi
	callq	_AC97_STAT
	movl	%eax, %edi
	callq	_au_readl
	cltq
	movq	_PSC_AC97STAT_TB@GOTPCREL(%rip), %rcx
	movq	_PSC_AC97STAT_RB@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	orq	(%rcx), %rdx
	testq	%rax, %rdx
	je	LBB0_4
## %bb.1:
	movq	%r12, %rdi
	callq	_PSC_AC97CFG_GET_LEN
	cmpq	(%r13), %rax
	jne	LBB0_3
## %bb.2:
	movq	%r13, %rdi
	movq	(%r15), %rbx
	callq	_params_rate
	xorl	%r13d, %r13d
	cmpq	%rax, %rbx
	je	LBB0_15
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_15
LBB0_4:
	movq	_PSC_AC97CFG_LEN_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	notq	%rbx
	andq	%r12, %rbx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rdi
	callq	_PSC_AC97CFG_SET_LEN
	movq	%rax, %r13
	orq	%rbx, %r13
	movq	_PCM_TX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_6
## %bb.5:
	movq	_PSC_AC97CFG_TXSLOT_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	notq	%rax
	andq	%rax, %r13
	movl	$3, %edi
	callq	_PSC_AC97CFG_TXSLOT_ENA
	movq	%rax, %r14
	movl	$4, %edi
	callq	_PSC_AC97CFG_TXSLOT_ENA
	jmp	LBB0_7
LBB0_6:
	movq	_PSC_AC97CFG_RXSLOT_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	notq	%rax
	andq	%rax, %r13
	movl	$3, %edi
	callq	_PSC_AC97CFG_RXSLOT_ENA
	movq	%rax, %r14
	movl	$4, %edi
	callq	_PSC_AC97CFG_RXSLOT_ENA
LBB0_7:
	movq	%rax, %rbx
	orq	%r14, %rbx
	orq	%r13, %rbx
	xorl	%r13d, %r13d
	cmpq	%r12, %rbx
	je	LBB0_15
## %bb.8:
	leaq	16(%r15), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	_PSC_AC97CFG_DE_ENABLE@GOTPCREL(%rip), %r12
	movq	(%r12), %r13
	notq	%r13
	andq	%rbx, %r13
	movq	%r15, %rdi
	callq	_AC97_CFG
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_au_writel
	xorl	%eax, %eax
	callq	_au_sync
	movq	%r15, %rdi
	callq	_AC97_STAT
	movl	%eax, %edi
	callq	_au_readl
	movq	_PSC_AC97STAT_DR@GOTPCREL(%rip), %r14
	testl	%eax, (%r14)
	je	LBB0_11
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	## InlineAsm Start
	nop
	## InlineAsm End
	movq	%r15, %rdi
	callq	_AC97_STAT
	movl	%eax, %edi
	callq	_au_readl
	testl	%eax, (%r14)
	jne	LBB0_9
LBB0_11:
	movq	%r15, %rdi
	callq	_AC97_CFG
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_au_writel
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_au_sync
	movq	(%r12), %r12
	orq	%rbx, %r12
	movq	%r15, %rdi
	callq	_AC97_CFG
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_au_writel
	xorl	%eax, %eax
	callq	_au_sync
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_AC97_STAT
	movl	%eax, %edi
	callq	_au_readl
	testl	%eax, (%r14)
	jne	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_13 Depth=1
	## InlineAsm Start
	nop
	## InlineAsm End
	jmp	LBB0_13
LBB0_14:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	%rbx, 8(%r15)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_params_rate
	movq	%rax, (%r15)
LBB0_15:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_au1xpsc_ac97_workdata,8,3      ## @au1xpsc_ac97_workdata
	.comm	_PSC_AC97STAT_TB,8,3            ## @PSC_AC97STAT_TB
	.comm	_PSC_AC97STAT_RB,8,3            ## @PSC_AC97STAT_RB
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PSC_AC97CFG_LEN_MASK,8,3       ## @PSC_AC97CFG_LEN_MASK
	.comm	_PCM_TX,4,2                     ## @PCM_TX
	.comm	_PSC_AC97CFG_TXSLOT_MASK,8,3    ## @PSC_AC97CFG_TXSLOT_MASK
	.comm	_PSC_AC97CFG_RXSLOT_MASK,8,3    ## @PSC_AC97CFG_RXSLOT_MASK
	.comm	_PSC_AC97CFG_DE_ENABLE,8,3      ## @PSC_AC97CFG_DE_ENABLE
	.comm	_PSC_AC97STAT_DR,4,2            ## @PSC_AC97STAT_DR
	.no_dead_strip	_au1xpsc_ac97_hw_params
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function au1xpsc_ac97_hw_params
_au1xpsc_ac97_hw_params:                ; @au1xpsc_ac97_hw_params
	.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	x19, x1
Lloh0:
	adrp	x8, _au1xpsc_ac97_workdata@GOTPAGE
Lloh1:
	ldr	x8, [x8, _au1xpsc_ac97_workdata@GOTPAGEOFF]
Lloh2:
	ldr	x20, [x8]
	bl	_SUBSTREAM_TYPE
	mov	x21, x0
	mov	x0, x19
	bl	_params_channels
	mov	x0, x20
	bl	_AC97_CFG
	bl	_au_readl
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x22, w0
	mov	x0, x20
	bl	_AC97_STAT
	bl	_au_readl
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
Lloh3:
	adrp	x9, _PSC_AC97STAT_TB@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PSC_AC97STAT_TB@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _PSC_AC97STAT_RB@GOTPAGE
Lloh7:
	ldr	x10, [x10, _PSC_AC97STAT_RB@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	orr	x9, x10, x9
	tst	x9, x8
	b.eq	LBB0_4
; %bb.1:
	mov	x0, x22
	bl	_PSC_AC97CFG_GET_LEN
	ldr	x8, [x19]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.2:
	ldr	x20, [x20]
	mov	x0, x19
	bl	_params_rate
	cmp	x20, x0
	b.eq	LBB0_8
LBB0_3:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_16
LBB0_4:
Lloh12:
	adrp	x8, _PSC_AC97CFG_LEN_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PSC_AC97CFG_LEN_MASK@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	bic	x23, x22, x8
	ldr	x0, [x19]
	bl	_PSC_AC97CFG_SET_LEN
	orr	x8, x0, x23
Lloh15:
	adrp	x9, _PCM_TX@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PCM_TX@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w21, w9
	b.ne	LBB0_6
; %bb.5:
Lloh18:
	adrp	x9, _PSC_AC97CFG_TXSLOT_MASK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PSC_AC97CFG_TXSLOT_MASK@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	bic	x21, x8, x9
	mov	w0, #3
	bl	_PSC_AC97CFG_TXSLOT_ENA
	orr	x21, x21, x0
	mov	w0, #4
	bl	_PSC_AC97CFG_TXSLOT_ENA
	b	LBB0_7
LBB0_6:
Lloh21:
	adrp	x9, _PSC_AC97CFG_RXSLOT_MASK@GOTPAGE
Lloh22:
	ldr	x9, [x9, _PSC_AC97CFG_RXSLOT_MASK@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	bic	x21, x8, x9
	mov	w0, #3
	bl	_PSC_AC97CFG_RXSLOT_ENA
	orr	x21, x21, x0
	mov	w0, #4
	bl	_PSC_AC97CFG_RXSLOT_ENA
LBB0_7:
	orr	x21, x21, x0
	cmp	x21, x22
	b.ne	LBB0_9
LBB0_8:
	mov	w0, #0
	b	LBB0_16
LBB0_9:
	add	x22, x20, #16
	mov	x0, x22
	bl	_mutex_lock
Lloh24:
	adrp	x25, _PSC_AC97CFG_DE_ENABLE@GOTPAGE
Lloh25:
	ldr	x25, [x25, _PSC_AC97CFG_DE_ENABLE@GOTPAGEOFF]
	ldr	x8, [x25]
	bic	x23, x21, x8
	mov	x0, x20
	bl	_AC97_CFG
	mov	x1, x0
	mov	x0, x23
	bl	_au_writel
	bl	_au_sync
	mov	x0, x20
	bl	_AC97_STAT
	bl	_au_readl
Lloh26:
	adrp	x24, _PSC_AC97STAT_DR@GOTPAGE
Lloh27:
	ldr	x24, [x24, _PSC_AC97STAT_DR@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	; InlineAsm Start
	nop
	; InlineAsm End
	mov	x0, x20
	bl	_AC97_STAT
	bl	_au_readl
	b	LBB0_10
LBB0_12:
	mov	x0, x20
	bl	_AC97_CFG
	mov	x1, x0
	mov	x0, x21
	bl	_au_writel
	bl	_au_sync
	ldr	x8, [x25]
	orr	x23, x8, x21
	mov	x0, x20
	bl	_AC97_CFG
	mov	x1, x0
	mov	x0, x23
	bl	_au_writel
	bl	_au_sync
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_AC97_STAT
	bl	_au_readl
	ldr	w8, [x24]
	tst	w8, w0
	b.ne	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	; InlineAsm Start
	nop
	; InlineAsm End
	b	LBB0_13
LBB0_15:
	mov	x0, x22
	bl	_mutex_unlock
	str	x21, [x20, #8]
	mov	x0, x19
	bl	_params_rate
	mov	x8, x0
	mov	w0, #0
	str	x8, [x20]
LBB0_16:
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_au1xpsc_ac97_workdata,8,3      ; @au1xpsc_ac97_workdata
	.comm	_PSC_AC97STAT_TB,8,3            ; @PSC_AC97STAT_TB
	.comm	_PSC_AC97STAT_RB,8,3            ; @PSC_AC97STAT_RB
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PSC_AC97CFG_LEN_MASK,8,3       ; @PSC_AC97CFG_LEN_MASK
	.comm	_PCM_TX,4,2                     ; @PCM_TX
	.comm	_PSC_AC97CFG_TXSLOT_MASK,8,3    ; @PSC_AC97CFG_TXSLOT_MASK
	.comm	_PSC_AC97CFG_RXSLOT_MASK,8,3    ; @PSC_AC97CFG_RXSLOT_MASK
	.comm	_PSC_AC97CFG_DE_ENABLE,8,3      ; @PSC_AC97CFG_DE_ENABLE
	.comm	_PSC_AC97STAT_DR,4,2            ; @PSC_AC97STAT_DR
	.no_dead_strip	_au1xpsc_ac97_hw_params
.subsections_via_symbols
