	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_card_saa7134_capture_prepare
_snd_card_saa7134_capture_prepare:      ## @snd_card_saa7134_capture_prepare
	.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, %rbx
	movq	(%rdi), %r13
	callq	_snd_pcm_substream_chip
	movq	16(%r13), %rcx
	movq	(%rcx), %rcx
	movq	%rbx, (%rcx)
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %r14
	movl	8(%r13), %edi
	callq	_snd_pcm_format_width
	xorl	%ebx, %ebx
	cmpl	$8, %eax
	setne	%bl
	movl	8(%r13), %edi
	callq	_snd_pcm_format_signed
	movq	%rax, %r12
	movl	8(%r13), %edi
	callq	_snd_pcm_format_big_endian
	movq	%rax, %r15
	movq	24(%r14), %rax
	movl	(%rax), %eax
	cmpl	$128, %eax
	je	LBB0_4
## %bb.1:
	cmpl	$130, %eax
	je	LBB0_4
## %bb.2:
	cmpl	$129, %eax
	jne	LBB0_5
## %bb.3:
	movl	(%r13), %eax
	leal	8(%rbx), %ecx
	cmpl	$1, %eax
	cmovnel	%ebx, %ecx
	movl	%ecx, %edx
	orl	$24, %edx
	cmpl	$2, %eax
	cmovnel	%ecx, %edx
	leal	4(%rdx), %eax
	testq	%r12, %r12
	cmovel	%edx, %eax
	movq	_MIXER_ADDR_TVTUNER@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%ebx, %ebx
	cmpq	(%r14), %rcx
	sete	%bl
	shll	$6, %ebx
	orl	%eax, %ebx
	orl	$128, %ebx
	movq	_SAA7134_NUM_SAMPLES0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r14), %eax
	decl	%eax
	movzbl	%al, %esi
	callq	_saa_writeb
	movq	_SAA7134_NUM_SAMPLES1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r14), %eax
	decl	%eax
	movzbl	%ah, %esi
	callq	_saa_writeb
	movq	_SAA7134_NUM_SAMPLES2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r14), %eax
	decl	%eax
	shrl	$16, %eax
	movzbl	%al, %esi
	callq	_saa_writeb
	movq	_SAA7134_AUDIO_FORMAT_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_saa_writeb
	jmp	LBB0_5
LBB0_4:
	movl	(%r13), %eax
	leal	16(%rbx), %ecx
	cmpl	$1, %eax
	cmovnel	%ebx, %ecx
	leal	32(%rcx), %edx
	cmpl	$2, %eax
	cmovnel	%ecx, %edx
	leal	4(%rdx), %ebx
	testq	%r12, %r12
	cmovnel	%edx, %ebx
	movq	_SAA7133_NUM_SAMPLES@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r14), %esi
	decl	%esi
	callq	_saa_writel
	movq	_SAA7133_AUDIO_CHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	shll	$24, %esi
	orl	$5517840, %esi                  ## imm = 0x543210
	callq	_saa_writel
LBB0_5:
	testq	%r15, %r15
	movl	(%r13), %edx
	movl	8(%r13), %esi
	movl	$45, %eax
	movl	$98, %r8d
	cmovel	%eax, %r8d
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %ecx
	callq	_pr_debug
	movq	_SAA7134_RS_CONTROL_BURST_16@GOTPCREL(%rip), %rcx
	movq	_SAA7134_RS_CONTROL_ME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	16(%r14), %ebx
	movl	$0, %edx
	testq	%r15, %r15
	je	LBB0_7
## %bb.6:
	movq	_SAA7134_RS_CONTROL_BSWAP@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_7:
	orl	(%rcx), %eax
	sarl	$12, %ebx
	orl	%eax, %ebx
	orl	%edx, %ebx
	movl	$6, %edi
	callq	_SAA7134_RS_BA1
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_saa_writel
	movl	$6, %edi
	callq	_SAA7134_RS_BA2
	movl	8(%r14), %esi
	movl	%eax, %edi
	callq	_saa_writel
	movl	$6, %edi
	callq	_SAA7134_RS_PITCH
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_saa_writel
	movl	$6, %edi
	callq	_SAA7134_RS_CONTROL
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_saa_writel
	movl	4(%r13), %eax
	movl	%eax, 12(%r14)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	(%r14), %rcx
	movl	(%rax,%rcx,4), %edi
	movl	$1, %esi
	movl	$1, %edx
	movl	$1, %ecx
	callq	_snd_saa7134_capsrc_set
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MIXER_ADDR_TVTUNER,8,3         ## @MIXER_ADDR_TVTUNER
	.comm	_SAA7134_NUM_SAMPLES0,4,2       ## @SAA7134_NUM_SAMPLES0
	.comm	_SAA7134_NUM_SAMPLES1,4,2       ## @SAA7134_NUM_SAMPLES1
	.comm	_SAA7134_NUM_SAMPLES2,4,2       ## @SAA7134_NUM_SAMPLES2
	.comm	_SAA7134_AUDIO_FORMAT_CTRL,4,2  ## @SAA7134_AUDIO_FORMAT_CTRL
	.comm	_SAA7133_NUM_SAMPLES,4,2        ## @SAA7133_NUM_SAMPLES
	.comm	_SAA7133_AUDIO_CHANNEL,4,2      ## @SAA7133_AUDIO_CHANNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rec_start: afmt=%d ch=%d  =>  fmt=0x%x swap=%c\n"

	.comm	_SAA7134_RS_CONTROL_BURST_16,4,2 ## @SAA7134_RS_CONTROL_BURST_16
	.comm	_SAA7134_RS_CONTROL_ME,4,2      ## @SAA7134_RS_CONTROL_ME
	.comm	_SAA7134_RS_CONTROL_BSWAP,4,2   ## @SAA7134_RS_CONTROL_BSWAP
	.no_dead_strip	_snd_card_saa7134_capture_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_card_saa7134_capture_prepare
_snd_card_saa7134_capture_prepare:      ; @snd_card_saa7134_capture_prepare
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	ldr	x23, [x0]
	bl	_snd_pcm_substream_chip
	mov	x19, x0
	ldr	x8, [x23, #16]
	ldr	x8, [x8]
	str	x20, [x8]
	ldr	x24, [x0, #8]
	ldr	w0, [x23, #8]
	bl	_snd_pcm_format_width
	cmp	w0, #8
	cset	w21, ne
	ldr	w0, [x23, #8]
	bl	_snd_pcm_format_signed
	mov	x22, x0
	ldr	w0, [x23, #8]
	bl	_snd_pcm_format_big_endian
	mov	x20, x0
	ldr	x8, [x24, #24]
	ldr	w8, [x8]
	cmp	w8, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #130
	b.eq	LBB0_4
; %bb.2:
	cmp	w8, #129
	b.ne	LBB0_5
; %bb.3:
	ldr	w8, [x23]
	orr	w9, w21, #0x8
	cmp	w8, #1
	csel	w9, w9, w21, eq
	orr	w10, w9, #0x18
	cmp	w8, #2
	csel	w8, w10, w9, eq
	orr	w9, w8, #0x4
	cmp	x22, #0
	csel	w8, w8, w9, eq
Lloh0:
	adrp	x9, _MIXER_ADDR_TVTUNER@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MIXER_ADDR_TVTUNER@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	x10, [x24]
	cmp	x9, x10
	mov	w9, #128
	mov	w10, #192
	csel	w9, w10, w9, eq
	orr	w21, w8, w9
Lloh3:
	adrp	x8, _SAA7134_NUM_SAMPLES0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SAA7134_NUM_SAMPLES0@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldr	w8, [x24, #8]
	sub	w8, w8, #1
	and	w1, w8, #0xff
	bl	_saa_writeb
Lloh6:
	adrp	x8, _SAA7134_NUM_SAMPLES1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SAA7134_NUM_SAMPLES1@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ldr	w8, [x24, #8]
	sub	w8, w8, #1
	ubfx	w1, w8, #8, #8
	bl	_saa_writeb
Lloh9:
	adrp	x8, _SAA7134_NUM_SAMPLES2@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SAA7134_NUM_SAMPLES2@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldr	w8, [x24, #8]
	sub	w8, w8, #1
	ubfx	w1, w8, #16, #8
	bl	_saa_writeb
Lloh12:
	adrp	x8, _SAA7134_AUDIO_FORMAT_CTRL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SAA7134_AUDIO_FORMAT_CTRL@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_saa_writeb
	b	LBB0_5
LBB0_4:
	ldr	w8, [x23]
	orr	w9, w21, #0x10
	cmp	w8, #1
	csel	w9, w9, w21, eq
	orr	w10, w9, #0x20
	cmp	w8, #2
	csel	w8, w10, w9, eq
	orr	w9, w8, #0x4
	cmp	x22, #0
	csel	w21, w9, w8, eq
Lloh15:
	adrp	x8, _SAA7133_NUM_SAMPLES@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SAA7133_NUM_SAMPLES@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	ldr	w8, [x24, #8]
	sub	w1, w8, #1
	bl	_saa_writel
Lloh18:
	adrp	x8, _SAA7133_AUDIO_CHANNEL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SAA7133_AUDIO_CHANNEL@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	mov	w1, #12816
	movk	w1, #84, lsl #16
	bfi	w1, w21, #24, #8
	bl	_saa_writel
LBB0_5:
	ldr	w1, [x23, #8]
	ldr	w2, [x23]
	cmp	x20, #0
	mov	w8, #98
	mov	w9, #45
	csel	w4, w9, w8, eq
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	mov	x3, x21
	bl	_pr_debug
	cmp	x20, #0
Lloh23:
	adrp	x8, _SAA7134_RS_CONTROL_BURST_16@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SAA7134_RS_CONTROL_BURST_16@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _SAA7134_RS_CONTROL_ME@GOTPAGE
Lloh27:
	ldr	x9, [x9, _SAA7134_RS_CONTROL_ME@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x24, #16]
	orr	w8, w8, w9, asr #12
Lloh29:
	adrp	x9, _SAA7134_RS_CONTROL_BSWAP@GOTPAGE
Lloh30:
	ldr	x9, [x9, _SAA7134_RS_CONTROL_BSWAP@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	csel	w9, wzr, w9, eq
	orr	w20, w8, w9
	mov	w0, #6
	bl	_SAA7134_RS_BA1
	mov	w1, #0
	bl	_saa_writel
	mov	w0, #6
	bl	_SAA7134_RS_BA2
	ldr	w1, [x24, #8]
	bl	_saa_writel
	mov	w0, #6
	bl	_SAA7134_RS_PITCH
	mov	w1, #0
	bl	_saa_writel
	mov	w0, #6
	bl	_SAA7134_RS_CONTROL
	mov	x1, x20
	bl	_saa_writel
	ldr	w8, [x23, #4]
	str	w8, [x24, #12]
	ldr	x8, [x19]
	ldr	x9, [x24]
	ldr	w0, [x8, x9, lsl #2]
	mov	w1, #1
	mov	w2, #1
	mov	w3, #1
	bl	_snd_saa7134_capsrc_set
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_MIXER_ADDR_TVTUNER,8,3         ; @MIXER_ADDR_TVTUNER
	.comm	_SAA7134_NUM_SAMPLES0,4,2       ; @SAA7134_NUM_SAMPLES0
	.comm	_SAA7134_NUM_SAMPLES1,4,2       ; @SAA7134_NUM_SAMPLES1
	.comm	_SAA7134_NUM_SAMPLES2,4,2       ; @SAA7134_NUM_SAMPLES2
	.comm	_SAA7134_AUDIO_FORMAT_CTRL,4,2  ; @SAA7134_AUDIO_FORMAT_CTRL
	.comm	_SAA7133_NUM_SAMPLES,4,2        ; @SAA7133_NUM_SAMPLES
	.comm	_SAA7133_AUDIO_CHANNEL,4,2      ; @SAA7133_AUDIO_CHANNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rec_start: afmt=%d ch=%d  =>  fmt=0x%x swap=%c\n"

	.comm	_SAA7134_RS_CONTROL_BURST_16,4,2 ; @SAA7134_RS_CONTROL_BURST_16
	.comm	_SAA7134_RS_CONTROL_ME,4,2      ; @SAA7134_RS_CONTROL_ME
	.comm	_SAA7134_RS_CONTROL_BSWAP,4,2   ; @SAA7134_RS_CONTROL_BSWAP
	.no_dead_strip	_snd_card_saa7134_capture_prepare
.subsections_via_symbols
