	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_cx25821_pcm_open
_snd_cx25821_pcm_open:                  ## @snd_cx25821_pcm_open
	.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
	callq	_snd_pcm_substream_chip
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	(%rbx), %r14
	movq	_SNDRV_PCM_HW_PARAM_PERIODS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_snd_pcm_hw_constraint_pow2
	testl	%eax, %eax
	js	LBB0_5
## %bb.3:
	movq	%rbx, (%r12)
	movq	_snd_cx25821_digital_hw@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movq	_cx25821_sram_channels@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_AUDIO_SRAM_CHANNEL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %eax
	movq	_DEFAULT_FIFO_SIZE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_6
## %bb.4:
	cltq
	imulq	$1431655766, %rax, %rax         ## imm = 0x55555556
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$32, %rax
	addl	%ecx, %eax
	andl	$-8, %eax
	movq	_AUDIO_LINE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	cmovael	%ecx, %eax
	movl	%eax, (%r14)
	movl	%eax, 4(%r14)
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_6
LBB0_5:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_dprintk
	movl	%r13d, %r15d
LBB0_6:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DEBUG: cx25821 can't find device struct. Can't proceed with open\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_SNDRV_PCM_HW_PARAM_PERIODS,4,2 ## @SNDRV_PCM_HW_PARAM_PERIODS
	.comm	_snd_cx25821_digital_hw,8,2     ## @snd_cx25821_digital_hw
	.comm	_cx25821_sram_channels,8,3      ## @cx25821_sram_channels
	.comm	_AUDIO_SRAM_CHANNEL,8,3         ## @AUDIO_SRAM_CHANNEL
	.comm	_DEFAULT_FIFO_SIZE,4,2          ## @DEFAULT_FIFO_SIZE
	.comm	_AUDIO_LINE_SIZE,4,2            ## @AUDIO_LINE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Error opening PCM!\n"

	.no_dead_strip	_snd_cx25821_pcm_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_cx25821_pcm_open
_snd_cx25821_pcm_open:                  ; @snd_cx25821_pcm_open
	.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
	mov	x21, x0
	bl	_snd_pcm_substream_chip
	cbz	x0, LBB0_4
; %bb.1:
	mov	x22, x0
	ldr	x19, [x21]
Lloh0:
	adrp	x8, _SNDRV_PCM_HW_PARAM_PERIODS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SNDRV_PCM_HW_PARAM_PERIODS@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_snd_pcm_hw_constraint_pow2
	tbnz	w0, #31, LBB0_5
; %bb.2:
	str	x21, [x22]
Lloh3:
	adrp	x8, _snd_cx25821_digital_hw@GOTPAGE
Lloh4:
	ldr	x8, [x8, _snd_cx25821_digital_hw@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	x8, [x19]
Lloh6:
	adrp	x8, _cx25821_sram_channels@GOTPAGE
Lloh7:
	ldr	x8, [x8, _cx25821_sram_channels@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
Lloh9:
	adrp	x9, _AUDIO_SRAM_CHANNEL@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AUDIO_SRAM_CHANNEL@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
Lloh12:
	adrp	x9, _DEFAULT_FIFO_SIZE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _DEFAULT_FIFO_SIZE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.3:
	mov	w20, #0
	b	LBB0_7
LBB0_4:
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh17:
	adrp	x8, _ENODEV@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_5:
	mov	x20, x0
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_dprintk
	b	LBB0_7
LBB0_6:
	mov	w20, #0
	mov	w9, #21846
	movk	w9, #21845, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	lsr	x8, x8, #32
	add	w8, w8, w9
Lloh22:
	adrp	x9, _AUDIO_LINE_SIZE@GOTPAGE
Lloh23:
	ldr	x9, [x9, _AUDIO_LINE_SIZE@GOTPAGEOFF]
	and	w8, w8, #0xfffffff8
Lloh24:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	w8, w8, w9, lo
	stp	w8, w8, [x19]
LBB0_7:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DEBUG: cx25821 can't find device struct. Can't proceed with open\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_SNDRV_PCM_HW_PARAM_PERIODS,4,2 ; @SNDRV_PCM_HW_PARAM_PERIODS
	.comm	_snd_cx25821_digital_hw,8,2     ; @snd_cx25821_digital_hw
	.comm	_cx25821_sram_channels,8,3      ; @cx25821_sram_channels
	.comm	_AUDIO_SRAM_CHANNEL,8,3         ; @AUDIO_SRAM_CHANNEL
	.comm	_DEFAULT_FIFO_SIZE,4,2          ; @DEFAULT_FIFO_SIZE
	.comm	_AUDIO_LINE_SIZE,4,2            ; @AUDIO_LINE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Error opening PCM!\n"

	.no_dead_strip	_snd_cx25821_pcm_open
.subsections_via_symbols
