	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_v4l2_iosetup
_pvr2_v4l2_iosetup:                     ## @pvr2_v4l2_iosetup
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%ebx, %ebx
	cmpq	$0, (%rdi)
	je	LBB0_1
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	8(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.3:
	leaq	16(%r14), %r15
	movq	%r15, %rdi
	callq	_pvr2_channel_claim_stream
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.4:
	movq	8(%r14), %rax
	movq	8(%rax), %rdi
	callq	_pvr2_channel_create_mpeg_stream
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	8(%r14), %rax
	movq	16(%r14), %rcx
	movq	(%rcx), %rbx
	movq	8(%rax), %rax
	movq	(%rax), %rdi
	movq	_pvr2_v4l2_notify@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdx
	callq	_pvr2_stream_set_callback
	movq	8(%r14), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_pvr2_hdw_set_stream_type
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_pvr2_hdw_set_streaming
	testl	%eax, %eax
	js	LBB0_7
## %bb.9:
	movq	(%r14), %rdi
	movl	$1, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pvr2_ioread_set_enabled        ## TAILCALL
LBB0_2:
	movq	_EPERM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_5:
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_pvr2_channel_claim_stream
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_7:
	movl	%eax, %ebx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_pvr2_v4l2_notify,8,3           ## @pvr2_v4l2_notify
	.no_dead_strip	_pvr2_v4l2_iosetup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_v4l2_iosetup
_pvr2_v4l2_iosetup:                     ; @pvr2_v4l2_iosetup
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x0]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_10
LBB0_2:
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x1, [x8, #8]
	cbz	x1, LBB0_7
; %bb.3:
	add	x20, x19, #16
	mov	x0, x20
	bl	_pvr2_channel_claim_stream
	cbnz	w0, LBB0_10
; %bb.4:
	ldr	x8, [x19, #8]
	ldr	x0, [x8, #8]
	bl	_pvr2_channel_create_mpeg_stream
	str	x0, [x19]
	cbz	x0, LBB0_8
; %bb.5:
	ldp	x9, x8, [x19, #8]
	ldr	x20, [x8]
	ldr	x8, [x9, #8]
	ldr	x0, [x8]
Lloh0:
	adrp	x8, _pvr2_v4l2_notify@GOTPAGE
Lloh1:
	ldr	x8, [x8, _pvr2_v4l2_notify@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_pvr2_stream_set_callback
	ldr	x8, [x19, #8]
	ldr	w1, [x8]
	mov	x0, x20
	bl	_pvr2_hdw_set_stream_type
	mov	x0, x20
	mov	w1, #1
	bl	_pvr2_hdw_set_streaming
	tbnz	w0, #31, LBB0_10
; %bb.6:
	ldr	x0, [x19]
	mov	w1, #1
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_pvr2_ioread_set_enabled
LBB0_7:
Lloh3:
	adrp	x8, _EPERM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
	mov	x0, x20
	mov	x1, #0
	bl	_pvr2_channel_claim_stream
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_pvr2_v4l2_notify,8,3           ; @pvr2_v4l2_notify
	.no_dead_strip	_pvr2_v4l2_iosetup
.subsections_via_symbols
