	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_ivtv_pcm_capture_open
_snd_ivtv_pcm_capture_open:             ## @snd_ivtv_pcm_capture_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_snd_pcm_substream_chip
	movq	%rax, %r13
	movq	(%r14), %rbx
	movq	8(%rax), %rdi
	callq	_to_ivtv
	movq	%rax, %r12
	movq	%r13, %rdi
	callq	_snd_ivtv_lock
	movq	%r12, %rdi
	callq	_ivtv_init_on_first_open
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%r13, %rdi
	callq	_snd_ivtv_unlock
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	8(%r12), %r15
	movq	_IVTV_ENC_STREAM_TYPE_PCM@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,2), %rbx
	leaq	(%r15,%rbx,4), %rsi
	addq	$8, %rsi
	leaq	-56(%rbp), %rdi
	callq	_v4l2_fh_init
	movq	%r12, -48(%rbp)
	movl	4(%r15,%rbx,4), %esi
	movl	%esi, -52(%rbp)
	leaq	-56(%rbp), %rdi
	callq	_ivtv_claim_stream
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	-56(%rbp), %rdi
	callq	_v4l2_fh_exit
	movq	%r13, %rdi
	callq	_snd_ivtv_unlock
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leaq	(%r15,%rbx,4), %rbx
	movq	_IVTV_F_S_STREAMOFF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:
	movq	_IVTV_F_S_STREAMING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_and_set_bit
	testq	%rax, %rax
	je	LBB0_8
LBB0_7:
	movq	%r13, %rdi
	callq	_snd_ivtv_unlock
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_8:
	movq	_snd_ivtv_hw_capture@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	%eax, 8(%r15)
	movq	_SNDRV_PCM_HW_PARAM_PERIODS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_snd_pcm_hw_constraint_integer
	movq	%r14, (%r13)
	movq	%r12, (%r15)
	movq	_ivtv_alsa_announce_pcm_data@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r12)
	movq	_IVTV_F_S_STREAMING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_set_bit
	movq	%rbx, %rdi
	callq	_ivtv_start_v4l2_encode_stream
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_snd_ivtv_unlock
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_IVTV_ENC_STREAM_TYPE_PCM,8,3   ## @IVTV_ENC_STREAM_TYPE_PCM
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_IVTV_F_S_STREAMOFF,4,2         ## @IVTV_F_S_STREAMOFF
	.comm	_IVTV_F_S_STREAMING,4,2         ## @IVTV_F_S_STREAMING
	.comm	_snd_ivtv_hw_capture,4,2        ## @snd_ivtv_hw_capture
	.comm	_SNDRV_PCM_HW_PARAM_PERIODS,4,2 ## @SNDRV_PCM_HW_PARAM_PERIODS
	.comm	_ivtv_alsa_announce_pcm_data,4,2 ## @ivtv_alsa_announce_pcm_data
	.no_dead_strip	_snd_ivtv_pcm_capture_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_ivtv_pcm_capture_open
_snd_ivtv_pcm_capture_open:             ; @snd_ivtv_pcm_capture_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x0
	bl	_snd_pcm_substream_chip
	mov	x19, x0
	ldr	x21, [x20]
	ldr	x0, [x0, #8]
	bl	_to_ivtv
	mov	x22, x0
	mov	x0, x19
	bl	_snd_ivtv_lock
	mov	x0, x22
	bl	_ivtv_init_on_first_open
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_snd_ivtv_unlock
Lloh0:
	adrp	x8, _ENXIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
	ldr	x8, [x22, #8]
Lloh2:
	adrp	x9, _IVTV_ENC_STREAM_TYPE_PCM@GOTPAGE
Lloh3:
	ldr	x9, [x9, _IVTV_ENC_STREAM_TYPE_PCM@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	mov	w10, #12
	madd	x23, x9, x10, x8
	add	x1, x23, #8
	mov	x0, sp
	bl	_v4l2_fh_init
	str	x22, [sp, #8]
	ldr	w1, [x23, #4]
	str	w1, [sp, #4]
	mov	x0, sp
	bl	_ivtv_claim_stream
	cbz	x0, LBB0_6
; %bb.3:
	mov	x0, sp
	bl	_v4l2_fh_exit
	mov	x0, x19
	bl	_snd_ivtv_unlock
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_5:
	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
	add	sp, sp, #80
	ret
LBB0_6:
Lloh7:
	adrp	x8, _IVTV_F_S_STREAMOFF@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IVTV_F_S_STREAMOFF@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_test_bit
	cbnz	x0, LBB0_8
; %bb.7:
Lloh10:
	adrp	x24, _IVTV_F_S_STREAMING@GOTPAGE
Lloh11:
	ldr	x24, [x24, _IVTV_F_S_STREAMING@GOTPAGEOFF]
	ldr	w0, [x24]
	mov	x1, x23
	bl	_test_and_set_bit
	cbz	x0, LBB0_9
LBB0_8:
	mov	x0, x19
	bl	_snd_ivtv_unlock
	mov	w20, #0
	b	LBB0_5
LBB0_9:
Lloh12:
	adrp	x8, _snd_ivtv_hw_capture@GOTPAGE
Lloh13:
	ldr	x8, [x8, _snd_ivtv_hw_capture@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x21, #8]
Lloh15:
	adrp	x8, _SNDRV_PCM_HW_PARAM_PERIODS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SNDRV_PCM_HW_PARAM_PERIODS@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_snd_pcm_hw_constraint_integer
	str	x20, [x19]
	str	x22, [x21]
Lloh18:
	adrp	x8, _ivtv_alsa_announce_pcm_data@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ivtv_alsa_announce_pcm_data@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x22]
	ldr	w0, [x24]
	mov	x1, x23
	bl	_set_bit
	mov	x0, x23
	bl	_ivtv_start_v4l2_encode_stream
	mov	x20, x0
	mov	x0, x19
	bl	_snd_ivtv_unlock
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_IVTV_ENC_STREAM_TYPE_PCM,8,3   ; @IVTV_ENC_STREAM_TYPE_PCM
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_IVTV_F_S_STREAMOFF,4,2         ; @IVTV_F_S_STREAMOFF
	.comm	_IVTV_F_S_STREAMING,4,2         ; @IVTV_F_S_STREAMING
	.comm	_snd_ivtv_hw_capture,4,2        ; @snd_ivtv_hw_capture
	.comm	_SNDRV_PCM_HW_PARAM_PERIODS,4,2 ; @SNDRV_PCM_HW_PARAM_PERIODS
	.comm	_ivtv_alsa_announce_pcm_data,4,2 ; @ivtv_alsa_announce_pcm_data
	.no_dead_strip	_snd_ivtv_pcm_capture_open
.subsections_via_symbols
