	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function au1xpsc_ac97_probe
_au1xpsc_ac97_probe:                    ## @au1xpsc_ac97_probe
	.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	_au1xpsc_ac97_workdata@GOTPCREL(%rip), %r15
	cmpq	$0, (%r15)
	je	LBB0_3
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rdi, %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	addq	$20, %rax
	movq	%rax, %rdi
	callq	_mutex_init
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_platform_get_resource
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r14
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	(%r14), %rdi
	movq	8(%r14), %rsi
	subq	%rdi, %rsi
	incq	%rsi
	leaq	L_.str(%rip), %rdx
	callq	_request_mem_region
	movq	(%r15), %rcx
	movq	%rax, 8(%rcx)
	testq	%rax, %rax
	je	LBB0_11
## %bb.8:
	movq	(%r14), %rdi
	movl	$65535, %esi                    ## imm = 0xFFFF
	callq	_ioremap
	movq	(%r15), %rdi
	movl	%eax, 16(%rdi)
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movq	_PSC_AC97CFG_RT_FIFO8@GOTPCREL(%rip), %rax
	movq	_PSC_AC97CFG_TT_FIFO8@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_PSC_AC97CFG_DE_ENABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, (%rdi)
	callq	_PSC_SEL
	movl	%eax, %edi
	callq	_au_readl
	movq	%rax, %r14
	movq	_PSC_SEL_CLK_MASK@GOTPCREL(%rip), %rax
	andq	(%rax), %r14
	movq	_PSC_CTRL_DISABLE@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	(%r15), %rdi
	callq	_PSC_CTRL
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_au_writel
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_au_sync
	movq	(%r15), %rdi
	callq	_PSC_SEL
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	_au_writel
	xorl	%eax, %eax
	callq	_au_sync
	movq	_PSC_SEL_PS_AC97MODE@GOTPCREL(%rip), %rax
	orq	(%rax), %r14
	movq	(%r15), %rdi
	callq	_PSC_SEL
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_au_writel
	xorl	%eax, %eax
	callq	_au_sync
	jmp	LBB0_12
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_6:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_10:
	movq	8(%rdi), %rdi
	callq	_release_resource
	movq	(%r15), %rax
	movq	8(%rax), %rdi
	callq	_kfree
LBB0_11:
	negl	%ebx
	movq	(%r15), %rdi
	callq	_kfree
	movq	$0, (%r15)
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_au1xpsc_ac97_workdata,8,3      ## @au1xpsc_ac97_workdata
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"au1xpsc_ac97"

	.comm	_PSC_AC97CFG_RT_FIFO8,4,2       ## @PSC_AC97CFG_RT_FIFO8
	.comm	_PSC_AC97CFG_TT_FIFO8,4,2       ## @PSC_AC97CFG_TT_FIFO8
	.comm	_PSC_AC97CFG_DE_ENABLE,4,2      ## @PSC_AC97CFG_DE_ENABLE
	.comm	_PSC_SEL_CLK_MASK,8,3           ## @PSC_SEL_CLK_MASK
	.comm	_PSC_CTRL_DISABLE,8,3           ## @PSC_CTRL_DISABLE
	.comm	_PSC_SEL_PS_AC97MODE,8,3        ## @PSC_SEL_PS_AC97MODE
	.no_dead_strip	_au1xpsc_ac97_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function au1xpsc_ac97_probe
_au1xpsc_ac97_probe:                    ; @au1xpsc_ac97_probe
	.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
Lloh0:
	adrp	x20, _au1xpsc_ac97_workdata@GOTPAGE
Lloh1:
	ldr	x20, [x20, _au1xpsc_ac97_workdata@GOTPAGEOFF]
	ldr	x8, [x20]
	cbz	x8, LBB0_4
; %bb.1:
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_3:
	mov	x0, x19
	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
LBB0_4:
	mov	x19, x0
Lloh4:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kzalloc
	str	x0, [x20]
	cbz	x0, LBB0_9
; %bb.5:
	add	x0, x0, #20
	bl	_mutex_init
Lloh7:
	adrp	x8, _IORESOURCE_MEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_platform_get_resource
	cbz	x0, LBB0_10
; %bb.6:
	mov	x19, x0
Lloh10:
	adrp	x8, _EBUSY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh12:
	ldr	w21, [x8]
	ldr	x0, [x0]
	ldr	x8, [x19, #8]
	sub	x8, x8, x0
	add	x1, x8, #1
Lloh13:
	adrp	x2, l_.str@PAGE
Lloh14:
	add	x2, x2, l_.str@PAGEOFF
	bl	_request_mem_region
	ldr	x8, [x20]
	str	x0, [x8, #8]
	cbz	x0, LBB0_12
; %bb.7:
	ldr	x0, [x19]
	mov	w1, #65535
	bl	_ioremap
	mov	x8, x0
	ldr	x0, [x20]
	str	w8, [x0, #16]
	cbz	w8, LBB0_11
; %bb.8:
Lloh15:
	adrp	x8, _PSC_AC97CFG_RT_FIFO8@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PSC_AC97CFG_RT_FIFO8@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _PSC_AC97CFG_TT_FIFO8@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PSC_AC97CFG_TT_FIFO8@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh21:
	adrp	x9, _PSC_AC97CFG_DE_ENABLE@GOTPAGE
Lloh22:
	ldr	x9, [x9, _PSC_AC97CFG_DE_ENABLE@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x0]
	bl	_PSC_SEL
	bl	_au_readl
Lloh24:
	adrp	x8, _PSC_SEL_CLK_MASK@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PSC_SEL_CLK_MASK@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	and	x21, x8, x0
Lloh27:
	adrp	x8, _PSC_CTRL_DISABLE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _PSC_CTRL_DISABLE@GOTPAGEOFF]
Lloh29:
	ldr	x19, [x8]
	ldr	x0, [x20]
	bl	_PSC_CTRL
	mov	x1, x0
	mov	x0, x19
	bl	_au_writel
	bl	_au_sync
	ldr	x0, [x20]
	bl	_PSC_SEL
	mov	x1, x0
	mov	x0, #0
	bl	_au_writel
	bl	_au_sync
Lloh30:
	adrp	x8, _PSC_SEL_PS_AC97MODE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PSC_SEL_PS_AC97MODE@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
	orr	x19, x8, x21
	ldr	x0, [x20]
	bl	_PSC_SEL
	mov	x1, x0
	mov	x0, x19
	bl	_au_writel
	bl	_au_sync
	mov	w19, #0
	b	LBB0_3
LBB0_9:
Lloh33:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
LBB0_10:
Lloh35:
	adrp	x8, _ENODEV@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh37:
	ldr	w21, [x8]
	b	LBB0_12
LBB0_11:
	ldr	x0, [x0, #8]
	bl	_release_resource
	ldr	x8, [x20]
	ldr	x0, [x8, #8]
	bl	_kfree
LBB0_12:
	neg	w19, w21
	ldr	x0, [x20]
	bl	_kfree
	str	xzr, [x20]
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_au1xpsc_ac97_workdata,8,3      ; @au1xpsc_ac97_workdata
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"au1xpsc_ac97"

	.comm	_PSC_AC97CFG_RT_FIFO8,4,2       ; @PSC_AC97CFG_RT_FIFO8
	.comm	_PSC_AC97CFG_TT_FIFO8,4,2       ; @PSC_AC97CFG_TT_FIFO8
	.comm	_PSC_AC97CFG_DE_ENABLE,4,2      ; @PSC_AC97CFG_DE_ENABLE
	.comm	_PSC_SEL_CLK_MASK,8,3           ; @PSC_SEL_CLK_MASK
	.comm	_PSC_CTRL_DISABLE,8,3           ; @PSC_CTRL_DISABLE
	.comm	_PSC_SEL_PS_AC97MODE,8,3        ; @PSC_SEL_PS_AC97MODE
	.no_dead_strip	_au1xpsc_ac97_probe
.subsections_via_symbols
