	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtv_encoder_cmd
_ivtv_encoder_cmd:                      ## @ivtv_encoder_cmd
	.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
	movq	%rdx, %rbx
	movq	%rsi, %rdi
	callq	_fh2id
	movq	%rax, %r12
	movl	(%rbx), %esi
	leal	-128(%rsi), %eax
	cmpl	$3, %eax
	ja	LBB0_11
## %bb.1:
	movq	(%r12), %r14
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_IVTV_DEBUG_IOCTL
	movq	_V4L2_ENC_CMD_STOP_AT_GOP_END@GOTPCREL(%rip), %rax
	movl	4(%rbx), %esi
	andl	(%rax), %esi
	movl	%esi, 4(%rbx)
	movq	%r12, %rdi
	callq	_ivtv_stop_capture
	jmp	LBB0_13
LBB0_11:
	leaq	L_.str.4(%rip), %rdi
	xorl	%r15d, %r15d
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_IVTV_DEBUG_IOCTL
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_2:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_IVTV_DEBUG_IOCTL
	movl	$0, 4(%rbx)
	movq	%r12, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ivtv_start_capture             ## TAILCALL
LBB0_8:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_IVTV_DEBUG_IOCTL
	movl	$0, 4(%rbx)
	leaq	4(%r14), %rdi
	callq	_atomic_read
	testl	%eax, %eax
	je	LBB0_5
## %bb.9:
	movq	_IVTV_F_I_ENC_PAUSED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_test_and_clear_bit
	testl	%eax, %eax
	je	LBB0_13
## %bb.10:
	movq	_CX2341X_ENC_PAUSE_ENCODER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	movl	$1, %ecx
	callq	_ivtv_vapi
	movq	%r14, %rdi
	callq	_ivtv_unmute
	jmp	LBB0_13
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_IVTV_DEBUG_IOCTL
	movl	$0, 4(%rbx)
	leaq	4(%r14), %rdi
	callq	_atomic_read
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movq	_IVTV_F_I_ENC_PAUSED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_test_and_set_bit
	testl	%eax, %eax
	jne	LBB0_13
## %bb.7:
	movq	%r14, %rdi
	callq	_ivtv_mute
	movq	_CX2341X_ENC_PAUSE_ENCODER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_ivtv_vapi
	jmp	LBB0_13
LBB0_5:
	movq	_EPERM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
LBB0_12:
	subl	(%rax), %r15d
LBB0_13:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
LJTI0_0:
	.long	L0_0_set_3
	.long	L0_0_set_2
	.long	L0_0_set_8
	.long	L0_0_set_4
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"V4L2_ENC_CMD_START\n"

L_.str.1:                               ## @.str.1
	.asciz	"V4L2_ENC_CMD_STOP\n"

	.comm	_V4L2_ENC_CMD_STOP_AT_GOP_END,4,2 ## @V4L2_ENC_CMD_STOP_AT_GOP_END
L_.str.2:                               ## @.str.2
	.asciz	"V4L2_ENC_CMD_PAUSE\n"

	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_IVTV_F_I_ENC_PAUSED,4,2        ## @IVTV_F_I_ENC_PAUSED
	.comm	_CX2341X_ENC_PAUSE_ENCODER,4,2  ## @CX2341X_ENC_PAUSE_ENCODER
L_.str.3:                               ## @.str.3
	.asciz	"V4L2_ENC_CMD_RESUME\n"

L_.str.4:                               ## @.str.4
	.asciz	"Unknown cmd %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ivtv_encoder_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivtv_encoder_cmd
_ivtv_encoder_cmd:                      ; @ivtv_encoder_cmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x2
	mov	x0, x1
	bl	_fh2id
	ldr	w9, [x20]
	sub	w8, w9, #128
	cmp	w8, #3
	b.hi	LBB0_3
; %bb.1:
	mov	x21, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IVTV_DEBUG_IOCTL
Lloh4:
	adrp	x8, _V4L2_ENC_CMD_STOP_AT_GOP_END@GOTPAGE
Lloh5:
	ldr	x8, [x8, _V4L2_ENC_CMD_STOP_AT_GOP_END@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	w9, [x20, #4]
	and	w1, w9, w8
	str	w1, [x20, #4]
	mov	x0, x21
	bl	_ivtv_stop_capture
	mov	w0, #0
	b	LBB0_13
LBB0_3:
	str	x9, [sp]
Lloh7:
	adrp	x0, l_.str.4@PAGE
Lloh8:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_IVTV_DEBUG_IOCTL
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_12
LBB0_4:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_DEBUG_IOCTL
	str	wzr, [x20, #4]
	mov	x0, x21
	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
	add	sp, sp, #64
	b	_ivtv_start_capture
LBB0_5:
Lloh13:
	adrp	x0, l_.str.3@PAGE
Lloh14:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_IVTV_DEBUG_IOCTL
	str	wzr, [x20, #4]
	add	x0, x19, #4
	bl	_atomic_read
	cbz	w0, LBB0_11
; %bb.6:
Lloh15:
	adrp	x8, _IVTV_F_I_ENC_PAUSED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IVTV_F_I_ENC_PAUSED@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_and_clear_bit
	cbz	w0, LBB0_13
; %bb.7:
Lloh18:
	adrp	x8, _CX2341X_ENC_PAUSE_ENCODER@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CX2341X_ENC_PAUSE_ENCODER@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	mov	w3, #1
	bl	_ivtv_vapi
	mov	x0, x19
	bl	_ivtv_unmute
	mov	w0, #0
	b	LBB0_13
LBB0_8:
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_IVTV_DEBUG_IOCTL
	str	wzr, [x20, #4]
	add	x0, x19, #4
	bl	_atomic_read
	cbz	w0, LBB0_11
; %bb.9:
Lloh23:
	adrp	x8, _IVTV_F_I_ENC_PAUSED@GOTPAGE
Lloh24:
	ldr	x8, [x8, _IVTV_F_I_ENC_PAUSED@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_and_set_bit
	cbz	w0, LBB0_14
; %bb.10:
	mov	w0, #0
	b	LBB0_13
LBB0_11:
Lloh26:
	adrp	x8, _EPERM@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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
	add	sp, sp, #64
	ret
LBB0_14:
	mov	x0, x19
	bl	_ivtv_mute
Lloh28:
	adrp	x8, _CX2341X_ENC_PAUSE_ENCODER@GOTPAGE
Lloh29:
	ldr	x8, [x8, _CX2341X_ENC_PAUSE_ENCODER@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	mov	w3, #0
	bl	_ivtv_vapi
	mov	w0, #0
	b	LBB0_13
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"V4L2_ENC_CMD_START\n"

l_.str.1:                               ; @.str.1
	.asciz	"V4L2_ENC_CMD_STOP\n"

	.comm	_V4L2_ENC_CMD_STOP_AT_GOP_END,4,2 ; @V4L2_ENC_CMD_STOP_AT_GOP_END
l_.str.2:                               ; @.str.2
	.asciz	"V4L2_ENC_CMD_PAUSE\n"

	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_IVTV_F_I_ENC_PAUSED,4,2        ; @IVTV_F_I_ENC_PAUSED
	.comm	_CX2341X_ENC_PAUSE_ENCODER,4,2  ; @CX2341X_ENC_PAUSE_ENCODER
l_.str.3:                               ; @.str.3
	.asciz	"V4L2_ENC_CMD_RESUME\n"

l_.str.4:                               ; @.str.4
	.asciz	"Unknown cmd %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ivtv_encoder_cmd
.subsections_via_symbols
