	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_em28xx_audio_setup             ## -- Begin function em28xx_audio_setup
	.p2align	4, 0x90
_em28xx_audio_setup:                    ## @em28xx_audio_setup
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	_CHIP_ID_EM2870@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	movq	_CHIP_ID_EM2874@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.4:
	cmpq	$0, 40(%r14)
	jne	LBB0_6
## %bb.5:
	movl	$1, 8(%r14)
LBB0_6:
	movl	$1, 12(%r14)
	movq	_EM28XX_R00_CHIPCFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_em28xx_read_reg
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_em28xx_info
	testl	%ebx, %ebx
	js	LBB0_7
## %bb.8:
	movq	_EM28XX_CHIPCFG_AUDIOMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	je	LBB0_3
## %bb.9:
	movq	_EM28XX_CHIPCFG_I2S_3_SAMPRATES@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_11
## %bb.10:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_em28xx_info
	movl	$1, 16(%r14)
	jmp	LBB0_13
LBB0_2:
	movq	$0, 40(%r14)
LBB0_3:
	movq	$0, 8(%r14)
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_EM28XX_CHIPCFG_AC97@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_13
LBB0_11:
	movq	_EM28XX_CHIPCFG_I2S_5_SAMPRATES@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_13
## %bb.12:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_em28xx_info
	movl	$1, 20(%r14)
LBB0_13:
	movq	_EM28XX_CHIPCFG_AUDIOMASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	_EM28XX_CHIPCFG_AC97@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_14
## %bb.15:
	movl	$130, 24(%r14)
	movq	_AC97_VENDOR_ID1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_em28xx_read_ac97
	testl	%eax, %eax
	js	LBB0_16
## %bb.17:
	movl	%eax, %ebx
	movq	_AC97_VENDOR_ID2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_em28xx_read_ac97
	testl	%eax, %eax
	js	LBB0_22
## %bb.18:
	movl	%eax, %r12d
	shll	$16, %ebx
	orl	%ebx, %r12d
	movl	%r12d, 28(%r14)
	leaq	L_.str.4(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_em28xx_warn
	movq	_AC97_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_em28xx_read_ac97
	testl	%eax, %eax
	js	LBB0_22
## %bb.19:
	movl	%eax, %r15d
	movl	%eax, 32(%r14)
	leaq	L_.str.5(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_em28xx_warn
	cmpl	$-1, %r12d
	jne	LBB0_22
## %bb.20:
	cmpl	$27280, %r15d                   ## imm = 0x6A90
	jne	LBB0_22
## %bb.21:
	movl	$131, 24(%r14)
	jmp	LBB0_22
LBB0_14:
	movl	$128, 24(%r14)
	jmp	LBB0_22
LBB0_16:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_em28xx_warn
	movl	$128, 24(%r14)
	movq	$0, 8(%r14)
LBB0_22:
	movl	24(%r14), %eax
	addl	$-128, %eax
	cmpl	$3, %eax
	ja	LBB0_29
## %bb.23:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_24:
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_25
LBB0_27:
	movzbl	28(%r14), %esi
	leaq	L_.str.8(%rip), %rdi
	xorl	%eax, %eax
	callq	_em28xx_info
	jmp	LBB0_29
LBB0_28:
	leaq	L_.str.9(%rip), %rdi
	xorl	%eax, %eax
	callq	_em28xx_warn
	jmp	LBB0_29
LBB0_26:
	leaq	L_.str.7(%rip), %rdi
LBB0_25:
	xorl	%eax, %eax
	callq	_em28xx_info
LBB0_29:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_em28xx_audio_analog_set        ## TAILCALL
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_24, LBB0_24-LJTI0_0
.set L0_0_set_27, LBB0_27-LJTI0_0
.set L0_0_set_28, LBB0_28-LJTI0_0
.set L0_0_set_26, LBB0_26-LJTI0_0
LJTI0_0:
	.long	L0_0_set_24
	.long	L0_0_set_27
	.long	L0_0_set_28
	.long	L0_0_set_26
	.end_data_region
                                        ## -- End function
	.comm	_CHIP_ID_EM2870,8,3             ## @CHIP_ID_EM2870
	.comm	_CHIP_ID_EM2874,8,3             ## @CHIP_ID_EM2874
	.comm	_EM28XX_R00_CHIPCFG,4,2         ## @EM28XX_R00_CHIPCFG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Config register raw data: 0x%02x\n"

	.comm	_EM28XX_CHIPCFG_AC97,4,2        ## @EM28XX_CHIPCFG_AC97
	.comm	_EM28XX_CHIPCFG_AUDIOMASK,4,2   ## @EM28XX_CHIPCFG_AUDIOMASK
	.comm	_EM28XX_CHIPCFG_I2S_3_SAMPRATES,4,2 ## @EM28XX_CHIPCFG_I2S_3_SAMPRATES
L_.str.1:                               ## @.str.1
	.asciz	"I2S Audio (3 sample rates)\n"

	.comm	_EM28XX_CHIPCFG_I2S_5_SAMPRATES,4,2 ## @EM28XX_CHIPCFG_I2S_5_SAMPRATES
L_.str.2:                               ## @.str.2
	.asciz	"I2S Audio (5 sample rates)\n"

	.comm	_AC97_VENDOR_ID1,4,2            ## @AC97_VENDOR_ID1
L_.str.3:                               ## @.str.3
	.asciz	"AC97 chip type couldn't be determined\n"

	.comm	_AC97_VENDOR_ID2,4,2            ## @AC97_VENDOR_ID2
L_.str.4:                               ## @.str.4
	.asciz	"AC97 vendor ID = 0x%08x\n"

	.comm	_AC97_RESET,4,2                 ## @AC97_RESET
L_.str.5:                               ## @.str.5
	.asciz	"AC97 features = 0x%04x\n"

L_.str.6:                               ## @.str.6
	.asciz	"No AC97 audio processor\n"

L_.str.7:                               ## @.str.7
	.asciz	"Empia 202 AC97 audio processor detected\n"

L_.str.8:                               ## @.str.8
	.asciz	"Sigmatel audio processor detected(stac 97%02x)\n"

L_.str.9:                               ## @.str.9
	.asciz	"Unknown AC97 audio processor detected!\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_em28xx_audio_setup             ; -- Begin function em28xx_audio_setup
	.p2align	2
_em28xx_audio_setup:                    ; @em28xx_audio_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _CHIP_ID_EM2870@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHIP_ID_EM2870@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _CHIP_ID_EM2874@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CHIP_ID_EM2874@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_3
; %bb.1:
	str	xzr, [x19, #40]
LBB0_2:
	str	xzr, [x19, #8]
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_3:
	ldr	x8, [x19, #40]
	cbnz	x8, LBB0_5
; %bb.4:
	mov	w8, #1
	str	w8, [x19, #8]
LBB0_5:
	mov	w8, #1
	str	w8, [x19, #12]
Lloh6:
	adrp	x8, _EM28XX_R00_CHIPCFG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EM28XX_R00_CHIPCFG@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_em28xx_read_reg
	mov	x20, x0
	str	x20, [sp]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_em28xx_info
Lloh11:
	adrp	x22, _EM28XX_CHIPCFG_AUDIOMASK@GOTPAGE
Lloh12:
	ldr	x22, [x22, _EM28XX_CHIPCFG_AUDIOMASK@GOTPAGEOFF]
Lloh13:
	adrp	x21, _EM28XX_CHIPCFG_AC97@GOTPAGE
Lloh14:
	ldr	x21, [x21, _EM28XX_CHIPCFG_AC97@GOTPAGEOFF]
	tbnz	w20, #31, LBB0_9
; %bb.6:
	ldr	w8, [x22]
	ands	w8, w8, w20
	b.eq	LBB0_2
; %bb.7:
Lloh15:
	adrp	x9, _EM28XX_CHIPCFG_I2S_3_SAMPRATES@GOTPAGE
Lloh16:
	ldr	x9, [x9, _EM28XX_CHIPCFG_I2S_3_SAMPRATES@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_10
; %bb.8:
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_em28xx_info
	mov	w8, #1
	str	w8, [x19, #16]
	b	LBB0_12
LBB0_9:
	ldr	w20, [x21]
	b	LBB0_12
LBB0_10:
Lloh20:
	adrp	x9, _EM28XX_CHIPCFG_I2S_5_SAMPRATES@GOTPAGE
Lloh21:
	ldr	x9, [x9, _EM28XX_CHIPCFG_I2S_5_SAMPRATES@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.11:
Lloh23:
	adrp	x0, l_.str.2@PAGE
Lloh24:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_em28xx_info
	mov	w8, #1
	str	w8, [x19, #20]
LBB0_12:
	ldr	w8, [x22]
	and	w8, w8, w20
	ldr	w9, [x21]
	cmp	w8, w9
	b.ne	LBB0_19
; %bb.13:
	mov	w8, #130
	str	w8, [x19, #24]
Lloh25:
	adrp	x8, _AC97_VENDOR_ID1@GOTPAGE
Lloh26:
	ldr	x8, [x8, _AC97_VENDOR_ID1@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_em28xx_read_ac97
	tbnz	w0, #31, LBB0_21
; %bb.14:
	mov	x20, x0
Lloh28:
	adrp	x8, _AC97_VENDOR_ID2@GOTPAGE
Lloh29:
	ldr	x8, [x8, _AC97_VENDOR_ID2@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_em28xx_read_ac97
	tbnz	w0, #31, LBB0_22
; %bb.15:
	orr	w21, w0, w20, lsl #16
	str	w21, [x19, #28]
	str	x21, [sp]
Lloh31:
	adrp	x0, l_.str.4@PAGE
Lloh32:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_em28xx_warn
Lloh33:
	adrp	x8, _AC97_RESET@GOTPAGE
Lloh34:
	ldr	x8, [x8, _AC97_RESET@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_em28xx_read_ac97
	tbnz	w0, #31, LBB0_22
; %bb.16:
	mov	x20, x0
	str	w0, [x19, #32]
	str	x20, [sp]
Lloh36:
	adrp	x0, l_.str.5@PAGE
Lloh37:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_em28xx_warn
	cmn	w21, #1
	b.ne	LBB0_22
; %bb.17:
	mov	w8, #27280
	cmp	w20, w8
	b.ne	LBB0_22
; %bb.18:
	mov	w8, #131
	b	LBB0_20
LBB0_19:
	mov	w8, #128
LBB0_20:
	str	w8, [x19, #24]
	b	LBB0_22
LBB0_21:
Lloh38:
	adrp	x0, l_.str.3@PAGE
Lloh39:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_em28xx_warn
	mov	w8, #128
	str	w8, [x19, #24]
	str	xzr, [x19, #8]
LBB0_22:
	ldr	w8, [x19, #24]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hi	LBB0_29
; %bb.23:
Lloh40:
	adrp	x9, lJTI0_0@PAGE
Lloh41:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_24
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_24:
Lloh42:
	adrp	x0, l_.str.6@PAGE
Lloh43:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_28
LBB0_25:
	ldrb	w8, [x19, #28]
	str	x8, [sp]
Lloh44:
	adrp	x0, l_.str.8@PAGE
Lloh45:
	add	x0, x0, l_.str.8@PAGEOFF
	b	LBB0_28
LBB0_26:
Lloh46:
	adrp	x0, l_.str.9@PAGE
Lloh47:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_em28xx_warn
	b	LBB0_29
LBB0_27:
Lloh48:
	adrp	x0, l_.str.7@PAGE
Lloh49:
	add	x0, x0, l_.str.7@PAGEOFF
LBB0_28:
	bl	_em28xx_info
LBB0_29:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_em28xx_audio_analog_set
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpAdd	Lloh48, Lloh49
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_24-LBB0_24)>>2
	.byte	(LBB0_25-LBB0_24)>>2
	.byte	(LBB0_26-LBB0_24)>>2
	.byte	(LBB0_27-LBB0_24)>>2
                                        ; -- End function
	.comm	_CHIP_ID_EM2870,8,3             ; @CHIP_ID_EM2870
	.comm	_CHIP_ID_EM2874,8,3             ; @CHIP_ID_EM2874
	.comm	_EM28XX_R00_CHIPCFG,4,2         ; @EM28XX_R00_CHIPCFG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Config register raw data: 0x%02x\n"

	.comm	_EM28XX_CHIPCFG_AC97,4,2        ; @EM28XX_CHIPCFG_AC97
	.comm	_EM28XX_CHIPCFG_AUDIOMASK,4,2   ; @EM28XX_CHIPCFG_AUDIOMASK
	.comm	_EM28XX_CHIPCFG_I2S_3_SAMPRATES,4,2 ; @EM28XX_CHIPCFG_I2S_3_SAMPRATES
l_.str.1:                               ; @.str.1
	.asciz	"I2S Audio (3 sample rates)\n"

	.comm	_EM28XX_CHIPCFG_I2S_5_SAMPRATES,4,2 ; @EM28XX_CHIPCFG_I2S_5_SAMPRATES
l_.str.2:                               ; @.str.2
	.asciz	"I2S Audio (5 sample rates)\n"

	.comm	_AC97_VENDOR_ID1,4,2            ; @AC97_VENDOR_ID1
l_.str.3:                               ; @.str.3
	.asciz	"AC97 chip type couldn't be determined\n"

	.comm	_AC97_VENDOR_ID2,4,2            ; @AC97_VENDOR_ID2
l_.str.4:                               ; @.str.4
	.asciz	"AC97 vendor ID = 0x%08x\n"

	.comm	_AC97_RESET,4,2                 ; @AC97_RESET
l_.str.5:                               ; @.str.5
	.asciz	"AC97 features = 0x%04x\n"

l_.str.6:                               ; @.str.6
	.asciz	"No AC97 audio processor\n"

l_.str.7:                               ; @.str.7
	.asciz	"Empia 202 AC97 audio processor detected\n"

l_.str.8:                               ; @.str.8
	.asciz	"Sigmatel audio processor detected(stac 97%02x)\n"

l_.str.9:                               ; @.str.9
	.asciz	"Unknown AC97 audio processor detected!\n"

.subsections_via_symbols
