	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_em28xx_audio_analog_set        ## -- Begin function em28xx_audio_analog_set
	.p2align	4, 0x90
_em28xx_audio_analog_set:               ## @em28xx_audio_analog_set
	.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
	movq	(%rdi), %rax
	movq	_EM28XX_INT_AUDIO_NONE@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx), %rax
	je	LBB0_21
## %bb.1:
	movq	%rdi, %r15
	movq	32(%rdi), %rax
	movq	_EM28XX_NO_AC97@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	je	LBB0_7
## %bb.2:
	movq	_outputs@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_7
## %bb.3:
	xorl	%ebx, %ebx
	leaq	L_.str(%rip), %r14
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jge	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movl	4(%rax,%rbx,8), %esi
	movq	%r15, %rdi
	movl	$32768, %edx                    ## imm = 0x8000
	callq	_em28xx_write_ac97
	testl	%eax, %eax
	jns	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	16(%r15), %rdi
	movq	(%r13), %rax
	movl	4(%rax,%rbx,8), %edx
	movq	%r14, %rsi
	callq	_dev_warn
	jmp	LBB0_6
LBB0_7:
	movl	40(%r15), %eax
	andl	$127, %eax
	xorl	%edx, %edx
	cmpq	$0, 24(%r15)
	jne	LBB0_9
## %bb.8:
	movq	_EM28XX_XCLK_AUDIO_UNMUTE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
LBB0_9:
	orl	%eax, %edx
	movq	_EM28XX_R0F_XCLK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_em28xx_write_reg
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movl	$10000, %edi                    ## imm = 0x2710
	movl	$11000, %esi                    ## imm = 0x2AF8
	callq	_usleep_range
	movq	%r15, %rdi
	callq	_em28xx_set_audio_source
	movl	%eax, %r14d
	movq	32(%r15), %rax
	cmpq	(%r12), %rax
	je	LBB0_21
## %bb.12:
	movq	_AC97_POWERDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$16896, %edx                    ## imm = 0x4200
	callq	_em28xx_write_ac97
	movq	_AC97_EXTENDED_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$49, %edx
	callq	_em28xx_write_ac97
	movq	_AC97_PCM_LR_ADC_RATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$48000, %edx                    ## imm = 0xBB80
	callq	_em28xx_write_ac97
	movl	$31, %eax
	subl	8(%r15), %eax
	movl	%eax, %ecx
	shll	$8, %ecx
	orl	%eax, %ecx
	movl	%ecx, %ebx
	orl	$32768, %ebx                    ## imm = 0x8000
	cmpq	$0, 24(%r15)
	cmovel	%ecx, %ebx
	movq	_outputs@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_19
## %bb.13:
	xorl	%r12d, %r12d
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	incq	%r12
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %r12
	jge	LBB0_19
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movl	(%rax,%r12,8), %ecx
	testl	%ecx, 12(%r15)
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	4(%rax,%r12,8), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_em28xx_write_ac97
	movl	%eax, %r14d
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	testl	%r14d, %r14d
	jns	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	16(%r15), %rdi
	movq	(%r13), %rax
	movl	4(%rax,%r12,8), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	jmp	LBB0_18
LBB0_10:
	movl	%eax, %r14d
	jmp	LBB0_21
LBB0_19:
	movl	12(%r15), %edi
	movq	_EM28XX_AOUT_PCM_IN@GOTPCREL(%rip), %rax
	testl	%edi, (%rax)
	je	LBB0_21
## %bb.20:
	callq	_ac97_return_record_select
	movl	%eax, %edx
	shll	$8, %edx
	orl	%eax, %edx
	movq	_AC97_REC_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_em28xx_write_ac97
LBB0_21:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EM28XX_INT_AUDIO_NONE,8,3      ## @EM28XX_INT_AUDIO_NONE
	.comm	_EM28XX_NO_AC97,8,3             ## @EM28XX_NO_AC97
	.comm	_outputs,8,3                    ## @outputs
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"couldn't setup AC97 register %d\n"

	.comm	_EM28XX_XCLK_AUDIO_UNMUTE,4,2   ## @EM28XX_XCLK_AUDIO_UNMUTE
	.comm	_EM28XX_R0F_XCLK,4,2            ## @EM28XX_R0F_XCLK
	.comm	_AC97_POWERDOWN,4,2             ## @AC97_POWERDOWN
	.comm	_AC97_EXTENDED_STATUS,4,2       ## @AC97_EXTENDED_STATUS
	.comm	_AC97_PCM_LR_ADC_RATE,4,2       ## @AC97_PCM_LR_ADC_RATE
	.comm	_EM28XX_AOUT_PCM_IN,4,2         ## @EM28XX_AOUT_PCM_IN
	.comm	_AC97_REC_SEL,4,2               ## @AC97_REC_SEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_em28xx_audio_analog_set        ; -- Begin function em28xx_audio_analog_set
	.p2align	2
_em28xx_audio_analog_set:               ; @em28xx_audio_analog_set
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _EM28XX_INT_AUDIO_NONE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EM28XX_INT_AUDIO_NONE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_20
LBB0_2:
	mov	x19, x0
	ldr	x8, [x0, #32]
Lloh3:
	adrp	x21, _EM28XX_NO_AC97@GOTPAGE
Lloh4:
	ldr	x21, [x21, _EM28XX_NO_AC97@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.3:
Lloh5:
	adrp	x22, _outputs@GOTPAGE
Lloh6:
	ldr	x22, [x22, _outputs@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.4:
	mov	x23, #0
	mov	w24, #4
Lloh7:
	adrp	x20, l_.str@PAGE
Lloh8:
	add	x20, x20, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x23, x23, #1
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	add	x24, x24, #8
	cmp	x23, w0, sxtw
	b.ge	LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	ldr	w1, [x8, x24]
	mov	x0, x19
	mov	w2, #32768
	bl	_em28xx_write_ac97
	tbz	w0, #31, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [x19, #16]
	ldr	x8, [x22]
	ldr	w2, [x8, x24]
	mov	x1, x20
	bl	_dev_warn
	b	LBB0_5
LBB0_8:
	ldr	w8, [x19, #40]
	and	w8, w8, #0x7f
	ldr	x9, [x19, #24]
Lloh9:
	adrp	x10, _EM28XX_XCLK_AUDIO_UNMUTE@GOTPAGE
Lloh10:
	ldr	x10, [x10, _EM28XX_XCLK_AUDIO_UNMUTE@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	cmp	x9, #0
	csel	w9, w10, wzr, eq
	orr	w2, w9, w8
Lloh12:
	adrp	x8, _EM28XX_R0F_XCLK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EM28XX_R0F_XCLK@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_em28xx_write_reg
	tbnz	w0, #31, LBB0_17
; %bb.9:
	mov	w0, #10000
	mov	w1, #11000
	bl	_usleep_range
	mov	x0, x19
	bl	_em28xx_set_audio_source
	mov	x20, x0
	ldr	x8, [x19, #32]
	ldr	x9, [x21]
	cmp	x8, x9
	b.eq	LBB0_20
; %bb.10:
Lloh15:
	adrp	x8, _AC97_POWERDOWN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AC97_POWERDOWN@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #16896
	bl	_em28xx_write_ac97
Lloh18:
	adrp	x8, _AC97_EXTENDED_STATUS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AC97_EXTENDED_STATUS@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #49
	bl	_em28xx_write_ac97
Lloh21:
	adrp	x8, _AC97_PCM_LR_ADC_RATE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AC97_PCM_LR_ADC_RATE@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #48000
	bl	_em28xx_write_ac97
	ldr	w8, [x19, #8]
	mov	w9, #31
	sub	w8, w9, w8
	orr	w8, w8, w8, lsl #8
	ldr	x9, [x19, #24]
	orr	w10, w8, #0x8000
	cmp	x9, #0
	csel	w21, w8, w10, eq
Lloh24:
	adrp	x23, _outputs@GOTPAGE
Lloh25:
	ldr	x23, [x23, _outputs@GOTPAGEOFF]
	ldr	x0, [x23]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_18
; %bb.11:
	mov	x24, #0
	mov	x25, #0
Lloh26:
	adrp	x22, l_.str@PAGE
Lloh27:
	add	x22, x22, l_.str@PAGEOFF
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x25, x25, #1
	ldr	x0, [x23]
	bl	_ARRAY_SIZE
	add	x24, x24, #8
	cmp	x25, w0, sxtw
	b.ge	LBB0_18
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x19, #12]
	ldr	x8, [x23]
	ldr	w10, [x8, x24]
	tst	w10, w9
	b.eq	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x8, x8, x24
	ldr	w1, [x8, #4]
	mov	x0, x19
	mov	x2, x21
	bl	_em28xx_write_ac97
	mov	x20, x0
LBB0_15:                                ;   in Loop: Header=BB0_13 Depth=1
	tbz	w20, #31, LBB0_12
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	x0, [x19, #16]
	ldr	x8, [x23]
	add	x8, x8, x24
	ldr	w2, [x8, #4]
	mov	x1, x22
	bl	_dev_warn
	b	LBB0_12
LBB0_17:
	mov	x20, x0
	b	LBB0_20
LBB0_18:
	ldr	w0, [x19, #12]
Lloh28:
	adrp	x8, _EM28XX_AOUT_PCM_IN@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EM28XX_AOUT_PCM_IN@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_20
; %bb.19:
	bl	_ac97_return_record_select
	orr	w2, w0, w0, lsl #8
Lloh31:
	adrp	x8, _AC97_REC_SEL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _AC97_REC_SEL@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_em28xx_write_ac97
LBB0_20:
	mov	x0, x20
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_EM28XX_INT_AUDIO_NONE,8,3      ; @EM28XX_INT_AUDIO_NONE
	.comm	_EM28XX_NO_AC97,8,3             ; @EM28XX_NO_AC97
	.comm	_outputs,8,3                    ; @outputs
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"couldn't setup AC97 register %d\n"

	.comm	_EM28XX_XCLK_AUDIO_UNMUTE,4,2   ; @EM28XX_XCLK_AUDIO_UNMUTE
	.comm	_EM28XX_R0F_XCLK,4,2            ; @EM28XX_R0F_XCLK
	.comm	_AC97_POWERDOWN,4,2             ; @AC97_POWERDOWN
	.comm	_AC97_EXTENDED_STATUS,4,2       ; @AC97_EXTENDED_STATUS
	.comm	_AC97_PCM_LR_ADC_RATE,4,2       ; @AC97_PCM_LR_ADC_RATE
	.comm	_EM28XX_AOUT_PCM_IN,4,2         ; @EM28XX_AOUT_PCM_IN
	.comm	_AC97_REC_SEL,4,2               ; @AC97_REC_SEL
.subsections_via_symbols
