	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_es1968_capture_setup
_snd_es1968_capture_setup:              ## @snd_es1968_capture_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	%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, %rbx
	movl	(%rsi), %r12d
	movb	4(%rsi), %cl
	sarl	%cl, %r12d
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	movq	32(%rsi), %rax
	movq	_ESM_MIXBUF_SIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	leal	3(%rcx), %r8d
	testl	%ecx, %ecx
	cmovnsl	%ecx, %r8d
	movq	(%rax), %rcx
	sarl	$2, %r8d
	movq	_ESM_APU_INPUTMIXER@GOTPCREL(%rip), %r15
	movl	(%r15), %r9d
	movl	$20, (%rsp)
	movl	$2, %edx
	callq	_init_capture_apu
	movq	8(%rbx), %rax
	movq	24(%rbx), %rcx
	movq	(%rcx), %rcx
	movq	_ESM_APU_SRCONVERTOR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	movl	8(%rax), %eax
	movl	%eax, (%rsp)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	movl	%r12d, %r8d
	callq	_init_capture_apu
	movq	_ESS_FMT_STEREO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%rbx)
	je	LBB0_2
## %bb.1:
	movq	32(%rbx), %rax
	movl	(%r13), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%edx, %ecx
	sarl	%ecx
	movslq	%ecx, %rcx
	addq	(%rax), %rcx
	leal	3(%rdx), %r8d
	testl	%edx, %edx
	cmovnsl	%edx, %r8d
	sarl	$2, %r8d
	movl	(%r15), %r9d
	movl	$21, (%rsp)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	$3, %edx
	callq	_init_capture_apu
	movq	8(%rbx), %rax
	movq	24(%rbx), %rdx
	leal	(%r12,%r12), %ecx
	movslq	%ecx, %rcx
	addq	(%rdx), %rcx
	movq	_ESM_APU_SRCONVERTOR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	movl	12(%rax), %eax
	movl	%eax, (%rsp)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	movl	%r12d, %r8d
	callq	_init_capture_apu
LBB0_2:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	cmpl	$47999, %eax                    ## imm = 0xBB7F
	movl	$47999, %ecx                    ## imm = 0xBB7F
	cmovll	%eax, %ecx
	cmpl	$4001, %ecx                     ## imm = 0xFA1
	movl	$4000, %esi                     ## imm = 0xFA0
	cmovgel	%ecx, %esi
	movq	%r14, %rdi
	callq	_snd_es1968_compute_rate
	movl	%eax, %r15d
	movq	8(%rbx), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_snd_es1968_apu_set_freq
	movq	8(%rbx), %rax
	movl	4(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_snd_es1968_apu_set_freq
	movq	8(%rbx), %rax
	movl	8(%rax), %esi
	movq	%r14, %rdi
	movl	$65536, %edx                    ## imm = 0x10000
	callq	_snd_es1968_apu_set_freq
	movq	8(%rbx), %rax
	movl	12(%rax), %esi
	movq	%r14, %rdi
	movl	$65536, %edx                    ## imm = 0x10000
	callq	_snd_es1968_apu_set_freq
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r14), %rsi
	addq	$4, %rsi
	movl	$1, %edi
	callq	_outw
	movq	_ESM_PORT_HOST_IRQ@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	8(%r14), %rdi
	callq	_inw
	movq	_ESM_HIRQ_DSIE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	(%rbx), %rsi
	addq	8(%r14), %rsi
	movl	%eax, %edi
	callq	_outw
	movq	%r14, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ESM_MIXBUF_SIZE,4,2            ## @ESM_MIXBUF_SIZE
	.comm	_ESM_APU_INPUTMIXER,4,2         ## @ESM_APU_INPUTMIXER
	.comm	_ESM_APU_SRCONVERTOR,4,2        ## @ESM_APU_SRCONVERTOR
	.comm	_ESS_FMT_STEREO,4,2             ## @ESS_FMT_STEREO
	.comm	_ESM_PORT_HOST_IRQ,8,3          ## @ESM_PORT_HOST_IRQ
	.comm	_ESM_HIRQ_DSIE,4,2              ## @ESM_HIRQ_DSIE
	.no_dead_strip	_snd_es1968_capture_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_es1968_capture_setup
_snd_es1968_capture_setup:              ; @snd_es1968_capture_setup
	.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	x20, x1
	mov	x19, x0
	ldp	w8, w9, [x1]
	asr	w22, w8, w9
	ldr	x8, [x1, #32]
	ldr	x3, [x8]
Lloh0:
	adrp	x25, _ESM_MIXBUF_SIZE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _ESM_MIXBUF_SIZE@GOTPAGEOFF]
	ldr	w8, [x25]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w4, w8, #2
Lloh2:
	adrp	x24, _ESM_APU_INPUTMIXER@GOTPAGE
Lloh3:
	ldr	x24, [x24, _ESM_APU_INPUTMIXER@GOTPAGEOFF]
	ldr	w5, [x24]
	mov	w2, #2
	mov	w6, #20
	bl	_init_capture_apu
	ldr	x8, [x20, #24]
	ldr	x3, [x8]
Lloh4:
	adrp	x23, _ESM_APU_SRCONVERTOR@GOTPAGE
Lloh5:
	ldr	x23, [x23, _ESM_APU_SRCONVERTOR@GOTPAGEOFF]
	ldr	w5, [x23]
	ldr	x8, [x20, #8]
	ldr	w6, [x8, #8]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	mov	x4, x22
	bl	_init_capture_apu
	ldr	w8, [x20, #16]
Lloh6:
	adrp	x9, _ESS_FMT_STEREO@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ESS_FMT_STEREO@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	x8, [x20, #32]
	ldr	x8, [x8]
	ldr	w9, [x25]
	add	w10, w9, #3
	cmp	w9, #0
	csel	w10, w10, w9, lt
	cinc	w9, w9, lt
	asr	w9, w9, #1
	add	x3, x8, w9, sxtw
	asr	w4, w10, #2
	ldr	w5, [x24]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #3
	mov	w6, #21
	bl	_init_capture_apu
	ldr	x8, [x20, #24]
	ldr	x8, [x8]
	lsl	w9, w22, #1
	add	x3, x8, w9, sxtw
	ldr	w5, [x23]
	ldr	x8, [x20, #8]
	ldr	w6, [x8, #12]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	mov	x4, x22
	bl	_init_capture_apu
LBB0_2:
	ldr	w8, [x21]
	mov	w9, #47999
	cmp	w8, w9
	csel	w8, w8, w9, lt
	mov	w9, #4000
	cmp	w8, #4000
	csel	w1, w8, w9, gt
	mov	x0, x19
	bl	_snd_es1968_compute_rate
	mov	x21, x0
	ldr	x8, [x20, #8]
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_snd_es1968_apu_set_freq
	ldr	x8, [x20, #8]
	ldr	w1, [x8, #4]
	mov	x0, x19
	mov	x2, x21
	bl	_snd_es1968_apu_set_freq
	ldr	x8, [x20, #8]
	ldr	w1, [x8, #8]
	mov	x0, x19
	mov	w2, #65536
	bl	_snd_es1968_apu_set_freq
	ldr	x8, [x20, #8]
	ldr	w1, [x8, #12]
	mov	x0, x19
	mov	w2, #65536
	bl	_snd_es1968_apu_set_freq
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #8]
	add	x1, x8, #4
	mov	w0, #1
	bl	_outw
	ldr	x8, [x19, #8]
Lloh9:
	adrp	x20, _ESM_PORT_HOST_IRQ@GOTPAGE
Lloh10:
	ldr	x20, [x20, _ESM_PORT_HOST_IRQ@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_inw
Lloh11:
	adrp	x8, _ESM_HIRQ_DSIE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ESM_HIRQ_DSIE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_outw
	mov	x0, x19
	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
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_ESM_MIXBUF_SIZE,4,2            ; @ESM_MIXBUF_SIZE
	.comm	_ESM_APU_INPUTMIXER,4,2         ; @ESM_APU_INPUTMIXER
	.comm	_ESM_APU_SRCONVERTOR,4,2        ; @ESM_APU_SRCONVERTOR
	.comm	_ESS_FMT_STEREO,4,2             ; @ESS_FMT_STEREO
	.comm	_ESM_PORT_HOST_IRQ,8,3          ; @ESM_PORT_HOST_IRQ
	.comm	_ESM_HIRQ_DSIE,4,2              ; @ESM_HIRQ_DSIE
	.no_dead_strip	_snd_es1968_capture_setup
.subsections_via_symbols
