	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx18_encoder_cmd
_cx18_encoder_cmd:                      ## @cx18_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_3
## %bb.1:
	movq	(%r12), %r14
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_2:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_CX18_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	_cx18_stop_capture
	jmp	LBB0_17
LBB0_3:
	leaq	L_.str.6(%rip), %rdi
	xorl	%r15d, %r15d
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_CX18_DEBUG_IOCTL
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_4:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_CX18_DEBUG_IOCTL
	movl	$0, 4(%rbx)
	movq	%r12, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cx18_start_capture             ## TAILCALL
LBB0_5:
	leaq	L_.str.4(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_CX18_DEBUG_IOCTL
	movl	$0, 4(%rbx)
	leaq	4(%r14), %rdi
	callq	_atomic_read
	testl	%eax, %eax
	je	LBB0_14
## %bb.6:
	movq	_CX18_F_I_ENC_PAUSED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_test_and_clear_bit
	testl	%eax, %eax
	je	LBB0_17
## %bb.7:
	movq	%r14, %rdi
	callq	_cx18_find_handle
	movq	_CX18_INVALID_TASK_HANDLE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_18
## %bb.8:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_13
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_CX18_DEBUG_IOCTL
	movl	$0, 4(%rbx)
	leaq	4(%r14), %rdi
	callq	_atomic_read
	testl	%eax, %eax
	je	LBB0_14
## %bb.10:
	movq	_CX18_F_I_ENC_PAUSED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_test_and_set_bit
	testl	%eax, %eax
	jne	LBB0_17
## %bb.11:
	movq	%r14, %rdi
	callq	_cx18_find_handle
	movl	%eax, %ebx
	movq	_CX18_INVALID_TASK_HANDLE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_19
## %bb.12:
	leaq	L_.str.3(%rip), %rdi
LBB0_13:
	callq	_CX18_ERR
	movq	_EBADFD@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_14:
	movq	_EPERM@GOTPCREL(%rip), %rax
LBB0_15:
	xorl	%r15d, %r15d
LBB0_16:
	subl	(%rax), %r15d
LBB0_17:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	_CX18_CPU_CAPTURE_RESUME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	movl	%eax, %ecx
	callq	_cx18_vapi
	movq	%r14, %rdi
	callq	_cx18_unmute
	jmp	LBB0_17
LBB0_19:
	movq	%r14, %rdi
	callq	_cx18_mute
	movq	_CX18_CPU_CAPTURE_PAUSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	movl	%ebx, %ecx
	callq	_cx18_vapi
	jmp	LBB0_17
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_4
	.long	L0_0_set_5
	.long	L0_0_set_9
	.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	_CX18_F_I_ENC_PAUSED,4,2        ## @CX18_F_I_ENC_PAUSED
	.comm	_CX18_INVALID_TASK_HANDLE,4,2   ## @CX18_INVALID_TASK_HANDLE
L_.str.3:                               ## @.str.3
	.asciz	"Can't find valid task handle for V4L2_ENC_CMD_PAUSE\n"

	.comm	_EBADFD,4,2                     ## @EBADFD
	.comm	_CX18_CPU_CAPTURE_PAUSE,4,2     ## @CX18_CPU_CAPTURE_PAUSE
L_.str.4:                               ## @.str.4
	.asciz	"V4L2_ENC_CMD_RESUME\n"

L_.str.5:                               ## @.str.5
	.asciz	"Can't find valid task handle for V4L2_ENC_CMD_RESUME\n"

	.comm	_CX18_CPU_CAPTURE_RESUME,4,2    ## @CX18_CPU_CAPTURE_RESUME
L_.str.6:                               ## @.str.6
	.asciz	"Unknown cmd %d\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx18_encoder_cmd
_cx18_encoder_cmd:                      ; @cx18_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	_CX18_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	_cx18_stop_capture
	mov	w0, #0
	b	LBB0_17
LBB0_3:
	str	x9, [sp]
Lloh7:
	adrp	x0, l_.str.6@PAGE
Lloh8:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_CX18_DEBUG_IOCTL
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_16
LBB0_4:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CX18_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	_cx18_start_capture
LBB0_5:
Lloh13:
	adrp	x0, l_.str.4@PAGE
Lloh14:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_CX18_DEBUG_IOCTL
	str	wzr, [x20, #4]
	add	x0, x19, #4
	bl	_atomic_read
	cbz	w0, LBB0_12
; %bb.6:
Lloh15:
	adrp	x8, _CX18_F_I_ENC_PAUSED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CX18_F_I_ENC_PAUSED@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_and_clear_bit
	cbz	w0, LBB0_17
; %bb.7:
	mov	x0, x19
	bl	_cx18_find_handle
Lloh18:
	adrp	x8, _CX18_INVALID_TASK_HANDLE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CX18_INVALID_TASK_HANDLE@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_18
; %bb.8:
Lloh21:
	adrp	x0, l_.str.5@PAGE
Lloh22:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_15
LBB0_9:
Lloh23:
	adrp	x0, l_.str.2@PAGE
Lloh24:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_CX18_DEBUG_IOCTL
	str	wzr, [x20, #4]
	add	x0, x19, #4
	bl	_atomic_read
	cbz	w0, LBB0_12
; %bb.10:
Lloh25:
	adrp	x8, _CX18_F_I_ENC_PAUSED@GOTPAGE
Lloh26:
	ldr	x8, [x8, _CX18_F_I_ENC_PAUSED@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_and_set_bit
	cbz	w0, LBB0_13
; %bb.11:
	mov	w0, #0
	b	LBB0_17
LBB0_12:
Lloh28:
	adrp	x8, _EPERM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_16
LBB0_13:
	mov	x0, x19
	bl	_cx18_find_handle
Lloh30:
	adrp	x8, _CX18_INVALID_TASK_HANDLE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _CX18_INVALID_TASK_HANDLE@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_19
; %bb.14:
Lloh33:
	adrp	x0, l_.str.3@PAGE
Lloh34:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_15:
	bl	_CX18_ERR
Lloh35:
	adrp	x8, _EBADFD@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EBADFD@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	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_18:
	mov	x3, x0
Lloh37:
	adrp	x8, _CX18_CPU_CAPTURE_RESUME@GOTPAGE
Lloh38:
	ldr	x8, [x8, _CX18_CPU_CAPTURE_RESUME@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_cx18_vapi
	mov	x0, x19
	bl	_cx18_unmute
	mov	w0, #0
	b	LBB0_17
LBB0_19:
	mov	x20, x0
	mov	x0, x19
	bl	_cx18_mute
Lloh40:
	adrp	x8, _CX18_CPU_CAPTURE_PAUSE@GOTPAGE
Lloh41:
	ldr	x8, [x8, _CX18_CPU_CAPTURE_PAUSE@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	mov	x3, x20
	bl	_cx18_vapi
	mov	w0, #0
	b	LBB0_17
	.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 AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.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_9-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	_CX18_F_I_ENC_PAUSED,4,2        ; @CX18_F_I_ENC_PAUSED
	.comm	_CX18_INVALID_TASK_HANDLE,4,2   ; @CX18_INVALID_TASK_HANDLE
l_.str.3:                               ; @.str.3
	.asciz	"Can't find valid task handle for V4L2_ENC_CMD_PAUSE\n"

	.comm	_EBADFD,4,2                     ; @EBADFD
	.comm	_CX18_CPU_CAPTURE_PAUSE,4,2     ; @CX18_CPU_CAPTURE_PAUSE
l_.str.4:                               ; @.str.4
	.asciz	"V4L2_ENC_CMD_RESUME\n"

l_.str.5:                               ; @.str.5
	.asciz	"Can't find valid task handle for V4L2_ENC_CMD_RESUME\n"

	.comm	_CX18_CPU_CAPTURE_RESUME,4,2    ; @CX18_CPU_CAPTURE_RESUME
l_.str.6:                               ; @.str.6
	.asciz	"Unknown cmd %d\n"

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