	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_v4l2_enc_poll             ## -- Begin function cx18_v4l2_enc_poll
	.p2align	4, 0x90
_cx18_v4l2_enc_poll:                    ## @cx18_v4l2_enc_poll
	.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, %rbx
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	callq	_poll_requested_events
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_file2id
	movq	%rax, %rbx
	movq	(%rax), %r15
	movq	16(%rax), %r13
	movq	8(%r13), %r12
	movq	_CX18_F_S_STREAMOFF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shlq	$5, %r15
	leaq	(%r12,%r15), %r14
	addq	$24, %r14
	movq	%r14, %rsi
	callq	_test_bit
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	movq	_CX18_F_S_STREAMING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_2
LBB0_5:
	movq	(%r12,%r15), %rax
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.6:
	movq	(%rbx), %rax
	movq	_CX18_ENC_STREAM_TYPE_YUV@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.7:
	leaq	(%r12,%r15), %rsi
	addq	$16, %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_videobuf_poll_stream
	movl	%eax, %r14d
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_v4l2_event_pending
	xorl	%ecx, %ecx
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	_EPOLLPRI@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_9:
	movq	_EPOLLERR@GOTPCREL(%rip), %rax
	movl	%r14d, %ebx
	cmpl	(%rax), %r14d
	jne	LBB0_11
## %bb.10:
	movq	_EPOLLHUP@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_11:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	cmovel	%r14d, %ebx
	orl	%ecx, %ebx
	jmp	LBB0_20
LBB0_12:
	leaq	L_.str.2(%rip), %rdi
	callq	_CX18_DEBUG_HI_FILE
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_v4l2_event_pending
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	_EPOLLPRI@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_15
LBB0_14:
	leaq	(%r12,%r15), %rsi
	addq	$12, %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_poll_wait
	xorl	%ebx, %ebx
LBB0_15:
	leaq	(%r12,%r15), %rdi
	addq	$8, %rdi
	callq	_atomic_read
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movq	_EPOLLIN@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_EPOLLRDNORM@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_17:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_20
## %bb.18:
	movq	_EPOLLHUP@GOTPCREL(%rip), %rax
LBB0_19:
	orl	(%rax), %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_EPOLLIN@GOTPCREL(%rip), %rax
	movq	_EPOLLRDNORM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%ecx, -48(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_5
## %bb.3:
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_cx18_start_capture
	movl	%eax, %r14d
	movq	%r13, %rdi
	callq	_mutex_unlock
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.21:
	movl	20(%r12,%r15), %esi
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %edx
	callq	_CX18_DEBUG_INFO
	movq	_EPOLLERR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_20
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	callq	_CX18_DEBUG_FILE
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_CX18_F_S_STREAMOFF,4,2         ## @CX18_F_S_STREAMOFF
	.comm	_CX18_F_S_STREAMING,4,2         ## @CX18_F_S_STREAMING
	.comm	_EPOLLIN,4,2                    ## @EPOLLIN
	.comm	_EPOLLRDNORM,4,2                ## @EPOLLRDNORM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not start capture for %s (%d)\n"

	.comm	_EPOLLERR,4,2                   ## @EPOLLERR
L_.str.1:                               ## @.str.1
	.asciz	"Encoder poll started capture\n"

	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_CX18_ENC_STREAM_TYPE_YUV,8,3   ## @CX18_ENC_STREAM_TYPE_YUV
	.comm	_EPOLLPRI,4,2                   ## @EPOLLPRI
	.comm	_EPOLLHUP,4,2                   ## @EPOLLHUP
L_.str.2:                               ## @.str.2
	.asciz	"Encoder poll\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_v4l2_enc_poll             ; -- Begin function cx18_v4l2_enc_poll
	.p2align	2
_cx18_v4l2_enc_poll:                    ; @cx18_v4l2_enc_poll
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x21, x0
	mov	x0, x1
	bl	_poll_requested_events
	mov	x24, x0
	mov	x0, x21
	bl	_file2id
	mov	x22, x0
	ldr	x23, [x0, #16]
	ldr	x26, [x23, #8]
	ldr	x27, [x0]
Lloh0:
	adrp	x8, _CX18_F_S_STREAMOFF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CX18_F_S_STREAMOFF@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x8, x26, x27, lsl #5
	add	x25, x8, #24
	mov	x1, x25
	bl	_test_bit
	mov	x19, x0
	cbnz	w0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _CX18_F_S_STREAMING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CX18_F_S_STREAMING@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	x1, x25
	bl	_test_bit
	cbz	w0, LBB0_12
LBB0_2:
	lsl	x8, x27, #5
	ldr	x8, [x26, x8]
Lloh6:
	adrp	x9, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
	ldr	x8, [x22]
Lloh9:
	adrp	x9, _CX18_ENC_STREAM_TYPE_YUV@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CX18_ENC_STREAM_TYPE_YUV@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
	add	x8, x26, x27, lsl #5
	add	x1, x8, #16
	mov	x0, x21
	mov	x2, x20
	bl	_videobuf_poll_stream
	mov	x20, x0
	add	x0, x22, #8
	bl	_v4l2_event_pending
Lloh12:
	adrp	x8, _EPOLLPRI@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EPOLLPRI@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w8, wzr, w8, eq
Lloh15:
	adrp	x9, _EPOLLERR@GOTPAGE
Lloh16:
	ldr	x9, [x9, _EPOLLERR@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w20, w9
	ccmp	w19, #0, #4, eq
Lloh18:
	adrp	x9, _EPOLLHUP@GOTPAGE
Lloh19:
	ldr	x9, [x9, _EPOLLHUP@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	csel	w9, w9, w20, ne
	orr	w20, w9, w8
	b	LBB0_15
LBB0_5:
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_CX18_DEBUG_HI_FILE
	add	x0, x22, #8
	bl	_v4l2_event_pending
	cbz	x0, LBB0_7
; %bb.6:
Lloh23:
	adrp	x8, _EPOLLPRI@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EPOLLPRI@GOTPAGEOFF]
Lloh25:
	ldr	w20, [x8]
	b	LBB0_8
LBB0_7:
	add	x8, x26, x27, lsl #5
	add	x1, x8, #12
	mov	x0, x21
	mov	x2, x20
	bl	_poll_wait
	mov	w20, #0
LBB0_8:
	add	x8, x26, x27, lsl #5
	add	x0, x8, #8
	bl	_atomic_read
	cbz	x0, LBB0_10
; %bb.9:
Lloh26:
	adrp	x8, _EPOLLIN@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EPOLLIN@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	orr	w8, w8, w20
Lloh29:
	adrp	x9, _EPOLLRDNORM@GOTPAGE
Lloh30:
	ldr	x9, [x9, _EPOLLRDNORM@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	orr	w20, w8, w9
	b	LBB0_15
LBB0_10:
	cbz	w19, LBB0_15
; %bb.11:
Lloh32:
	adrp	x8, _EPOLLHUP@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EPOLLHUP@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	orr	w20, w8, w20
	b	LBB0_15
LBB0_12:
Lloh35:
	adrp	x8, _EPOLLIN@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EPOLLIN@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
Lloh38:
	adrp	x9, _EPOLLRDNORM@GOTPAGE
Lloh39:
	ldr	x9, [x9, _EPOLLRDNORM@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	orr	w8, w9, w8
	tst	w8, w24
	b.eq	LBB0_2
; %bb.13:
	mov	x0, x23
	bl	_mutex_lock
	mov	x0, x22
	bl	_cx18_start_capture
	mov	x24, x0
	mov	x0, x23
	bl	_mutex_unlock
	cbz	w24, LBB0_16
; %bb.14:
	add	x8, x26, x27, lsl #5
	ldr	w1, [x8, #20]
Lloh41:
	adrp	x0, l_.str@PAGE
Lloh42:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x24
	bl	_CX18_DEBUG_INFO
Lloh43:
	adrp	x8, _EPOLLERR@GOTPAGE
Lloh44:
	ldr	x8, [x8, _EPOLLERR@GOTPAGEOFF]
Lloh45:
	ldr	w20, [x8]
LBB0_15:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_16:
Lloh46:
	adrp	x0, l_.str.1@PAGE
Lloh47:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_CX18_DEBUG_FILE
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_CX18_F_S_STREAMOFF,4,2         ; @CX18_F_S_STREAMOFF
	.comm	_CX18_F_S_STREAMING,4,2         ; @CX18_F_S_STREAMING
	.comm	_EPOLLIN,4,2                    ; @EPOLLIN
	.comm	_EPOLLRDNORM,4,2                ; @EPOLLRDNORM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not start capture for %s (%d)\n"

	.comm	_EPOLLERR,4,2                   ; @EPOLLERR
l_.str.1:                               ; @.str.1
	.asciz	"Encoder poll started capture\n"

	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_CX18_ENC_STREAM_TYPE_YUV,8,3   ; @CX18_ENC_STREAM_TYPE_YUV
	.comm	_EPOLLPRI,4,2                   ; @EPOLLPRI
	.comm	_EPOLLHUP,4,2                   ; @EPOLLHUP
l_.str.2:                               ; @.str.2
	.asciz	"Encoder poll\n"

.subsections_via_symbols
