	.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	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rbx
	movq	(%rbx), %r15
	movq	8(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %r12
	movq	_CX18_F_S_STREAMOFF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shlq	$4, %r15
	leaq	(%r12,%r15), %r14
	addq	$12, %r14
	movq	%r14, %rsi
	callq	_test_bit
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_4
## %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_4:
	leaq	L_.str.2(%rip), %rdi
	callq	_CX18_DEBUG_HI_FILE
	leaq	(%r12,%r15), %rbx
	leaq	(%r12,%r15), %rsi
	addq	$4, %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_poll_wait
	movq	%rbx, %rdi
	callq	_atomic_read
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_POLLIN@GOTPCREL(%rip), %rax
	movq	_POLLRDNORM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	orl	(%rax), %r13d
	jmp	LBB0_9
LBB0_6:
	testl	%r13d, %r13d
	je	LBB0_9
## %bb.7:
	movq	_POLLHUP@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_2:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_cx18_start_capture
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_3
## %bb.10:
	movl	8(%r12,%r15), %esi
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %edx
	callq	_CX18_DEBUG_INFO
	movq	_POLLERR@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %r13d
LBB0_9:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	callq	_CX18_DEBUG_FILE
	jmp	LBB0_4
	.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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not start capture for %s (%d)\n"

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

L_.str.2:                               ## @.str.2
	.asciz	"Encoder poll\n"

	.comm	_POLLIN,4,2                     ## @POLLIN
	.comm	_POLLRDNORM,4,2                 ## @POLLRDNORM
	.comm	_POLLHUP,4,2                    ## @POLLHUP
.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	x19, x1
	mov	x21, x0
	ldr	x24, [x0]
	ldp	x26, x23, [x24]
	ldr	x27, [x23, #8]
Lloh0:
	adrp	x8, _CX18_F_S_STREAMOFF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CX18_F_S_STREAMOFF@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x22, x27, x26, lsl #4
	add	x25, x22, #12
	mov	x1, x25
	bl	_test_bit
	mov	x20, 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_5
LBB0_2:
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_CX18_DEBUG_HI_FILE
	add	x1, x22, #4
	mov	x0, x21
	mov	x2, x19
	bl	_poll_wait
	mov	x0, x22
	bl	_atomic_read
	cbz	x0, LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _POLLIN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _POLLIN@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _POLLRDNORM@GOTPAGE
Lloh12:
	ldr	x9, [x9, _POLLRDNORM@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w0, w9, w8
	b	LBB0_7
LBB0_4:
Lloh14:
	adrp	x8, _POLLHUP@GOTPAGE
Lloh15:
	ldr	x8, [x8, _POLLHUP@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w20, #0
	csel	w0, wzr, w8, eq
	b	LBB0_7
LBB0_5:
	mov	x0, x23
	bl	_mutex_lock
	mov	x0, x24
	bl	_cx18_start_capture
	mov	x24, x0
	mov	x0, x23
	bl	_mutex_unlock
	cbz	w24, LBB0_8
; %bb.6:
	add	x8, x27, x26, lsl #4
	ldr	w1, [x8, #8]
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x24
	bl	_CX18_DEBUG_INFO
Lloh19:
	adrp	x8, _POLLERR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _POLLERR@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
LBB0_7:
	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_8:
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	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 AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.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
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not start capture for %s (%d)\n"

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

l_.str.2:                               ; @.str.2
	.asciz	"Encoder poll\n"

	.comm	_POLLIN,4,2                     ; @POLLIN
	.comm	_POLLRDNORM,4,2                 ; @POLLRDNORM
	.comm	_POLLHUP,4,2                    ; @POLLHUP
.subsections_via_symbols
