	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_start_decoding            ## -- Begin function ivtv_start_decoding
	.p2align	4, 0x90
_ivtv_start_decoding:                   ## @ivtv_start_decoding
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	(%rdi), %r12
	movq	8(%rdi), %r15
	shlq	$3, %r12
	addq	8(%r15), %r12
	movq	%r15, %rdi
	callq	_atomic_read
	testq	%rax, %rax
	je	LBB0_1
LBB0_6:
	movq	(%r12), %rcx
	movq	_IVTV_DEC_STREAM_TYPE_MPG@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_7
## %bb.8:
	movq	%r15, %rdi
	movl	%r14d, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ivtv_set_speed                 ## TAILCALL
LBB0_1:
	movq	(%r12), %rsi
	movq	%rbx, %rdi
	callq	_ivtv_claim_stream
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_IVTV_DEBUG_WARN
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_ivtv_start_v4l2_decode_stream
	testl	%eax, %eax
	jns	LBB0_6
## %bb.4:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%eax, %ecx
	jne	LBB0_7
## %bb.5:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_ivtv_start_v4l2_decode_stream
	testl	%eax, %eax
	jns	LBB0_6
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"start decode, stream already claimed\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_IVTV_DEC_STREAM_TYPE_MPG,8,3   ## @IVTV_DEC_STREAM_TYPE_MPG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_start_decoding            ; -- Begin function ivtv_start_decoding
	.p2align	2
_ivtv_start_decoding:                   ; @ivtv_start_decoding
	.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	x19, x1
	mov	x22, x0
	ldp	x8, x20, [x0]
	ldr	x9, [x20, #8]
	add	x21, x9, x8, lsl #3
	mov	x0, x20
	bl	_atomic_read
	cbz	x0, LBB0_3
LBB0_1:
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _IVTV_DEC_STREAM_TYPE_MPG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IVTV_DEC_STREAM_TYPE_MPG@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.2:
	mov	x0, x20
	mov	x1, x19
	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
	b	_ivtv_set_speed
LBB0_3:
	ldr	x1, [x21]
	mov	x0, x22
	bl	_ivtv_claim_stream
	cbz	x0, LBB0_7
; %bb.4:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_DEBUG_WARN
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	mov	w0, #0
LBB0_6:
	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
LBB0_7:
	mov	x0, x21
	mov	w1, #0
	bl	_ivtv_start_v4l2_decode_stream
	tbz	w0, #31, LBB0_1
; %bb.8:
Lloh8:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_6
; %bb.9:
	mov	x0, x21
	mov	w1, #0
	bl	_ivtv_start_v4l2_decode_stream
	tbz	w0, #31, LBB0_1
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"start decode, stream already claimed\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_IVTV_DEC_STREAM_TYPE_MPG,8,3   ; @IVTV_DEC_STREAM_TYPE_MPG
.subsections_via_symbols
