	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_v4l2_enc_poll             ## -- Begin function ivtv_v4l2_enc_poll
	.p2align	4, 0x90
_ivtv_v4l2_enc_poll:                    ## @ivtv_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, -44(%rbp)                 ## 4-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %edi
	callq	_fh2id
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	16(%r13), %rbx
	movq	8(%rbx), %r14
	movq	_IVTV_F_S_STREAMOFF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	(%rax,%rax,4), %r12
	leaq	(%r14,%r12,8), %r15
	addq	$32, %r15
	movq	%r15, %rsi
	callq	_test_bit
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movq	_IVTV_F_S_STREAMING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_test_bit
	testl	%eax, %eax
	jne	LBB0_6
## %bb.2:
	movq	(%r14,%r12,8), %rax
	movq	_IVTV_ENC_STREAM_TYPE_RAD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.3:
	movq	_EPOLLIN@GOTPCREL(%rip), %rax
	movq	_EPOLLRDNORM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%ecx, -44(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_6
## %bb.4:
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%r13, %rdi
	callq	_ivtv_start_capture
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_mutex_unlock
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.16:
	movl	28(%r14,%r12,8), %esi
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %edx
	callq	_IVTV_DEBUG_INFO
	movq	_EPOLLERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_15
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	callq	_IVTV_DEBUG_FILE
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	callq	_IVTV_DEBUG_HI_FILE
	leaq	(%r14,%r12,8), %rsi
	addq	$24, %rsi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_poll_wait
	addq	$8, %r13
	movq	%r13, %rdi
	callq	_v4l2_event_pending
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_EPOLLPRI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	$0, 16(%r14,%r12,8)
	jne	LBB0_11
	jmp	LBB0_10
LBB0_8:
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_poll_wait
	xorl	%eax, %eax
	cmpq	$0, 16(%r14,%r12,8)
	jne	LBB0_11
LBB0_10:
	cmpq	$0, 8(%r14,%r12,8)
	je	LBB0_12
LBB0_11:
	movq	_EPOLLIN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_EPOLLRDNORM@GOTPCREL(%rip), %rcx
LBB0_14:
	orl	(%rcx), %eax
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_15
## %bb.13:
	movq	_EPOLLHUP@GOTPCREL(%rip), %rcx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_IVTV_F_S_STREAMOFF,4,2         ## @IVTV_F_S_STREAMOFF
	.comm	_IVTV_F_S_STREAMING,4,2         ## @IVTV_F_S_STREAMING
	.comm	_IVTV_ENC_STREAM_TYPE_RAD,8,3   ## @IVTV_ENC_STREAM_TYPE_RAD
	.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"

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

	.comm	_EPOLLPRI,4,2                   ## @EPOLLPRI
	.comm	_EPOLLHUP,4,2                   ## @EPOLLHUP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_v4l2_enc_poll             ; -- Begin function ivtv_v4l2_enc_poll
	.p2align	2
_ivtv_v4l2_enc_poll:                    ; @ivtv_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
	ldr	w0, [x21]
	bl	_fh2id
	mov	x22, x0
	ldr	x23, [x0, #16]
	ldr	x26, [x23, #8]
	ldr	x27, [x0]
Lloh0:
	adrp	x8, _IVTV_F_S_STREAMOFF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IVTV_F_S_STREAMOFF@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	w8, #40
	madd	x8, x27, x8, x26
	add	x25, x8, #32
	mov	x1, x25
	bl	_test_bit
	mov	x19, x0
	cbnz	w0, LBB0_7
; %bb.1:
Lloh3:
	adrp	x8, _IVTV_F_S_STREAMING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IVTV_F_S_STREAMING@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	x1, x25
	bl	_test_bit
	cbnz	w0, LBB0_7
; %bb.2:
	mov	w8, #40
	mul	x8, x27, x8
	ldr	x8, [x26, x8]
Lloh6:
	adrp	x9, _IVTV_ENC_STREAM_TYPE_RAD@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IVTV_ENC_STREAM_TYPE_RAD@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_7
; %bb.3:
Lloh9:
	adrp	x8, _EPOLLIN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EPOLLIN@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _EPOLLRDNORM@GOTPAGE
Lloh13:
	ldr	x9, [x9, _EPOLLRDNORM@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
	tst	w8, w24
	b.eq	LBB0_7
; %bb.4:
	mov	x0, x23
	bl	_mutex_lock
	mov	x0, x22
	bl	_ivtv_start_capture
	mov	x24, x0
	mov	x0, x23
	bl	_mutex_unlock
	cbz	w24, LBB0_6
; %bb.5:
	mov	w8, #40
	madd	x8, x27, x8, x26
	ldr	w1, [x8, #28]
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x24
	bl	_IVTV_DEBUG_INFO
Lloh17:
	adrp	x8, _EPOLLERR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EPOLLERR@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	b	LBB0_13
LBB0_6:
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IVTV_DEBUG_FILE
LBB0_7:
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_IVTV_DEBUG_HI_FILE
	mov	w8, #40
	madd	x8, x27, x8, x26
	add	x1, x8, #24
	mov	x0, x21
	mov	x2, x20
	bl	_poll_wait
	add	x22, x22, #8
	mov	x0, x22
	bl	_v4l2_event_pending
	cbz	x0, LBB0_9
; %bb.8:
Lloh24:
	adrp	x8, _EPOLLPRI@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EPOLLPRI@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	b	LBB0_10
LBB0_9:
	mov	x0, x21
	mov	x1, x22
	mov	x2, x20
	bl	_poll_wait
	mov	w0, #0
LBB0_10:
	mov	w8, #40
	madd	x8, x27, x8, x26
	ldr	x8, [x8, #16]
	cbnz	x8, LBB0_12
; %bb.11:
	mov	w8, #40
	madd	x8, x27, x8, x26
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_14
LBB0_12:
Lloh27:
	adrp	x8, _EPOLLIN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EPOLLIN@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh30:
	adrp	x9, _EPOLLRDNORM@GOTPAGE
Lloh31:
	ldr	x9, [x9, _EPOLLRDNORM@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w0, w8, w9
LBB0_13:
	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_14:
	cbz	w19, LBB0_13
; %bb.15:
Lloh33:
	adrp	x8, _EPOLLHUP@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EPOLLHUP@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	orr	w0, w8, w0
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_IVTV_F_S_STREAMOFF,4,2         ; @IVTV_F_S_STREAMOFF
	.comm	_IVTV_F_S_STREAMING,4,2         ; @IVTV_F_S_STREAMING
	.comm	_IVTV_ENC_STREAM_TYPE_RAD,8,3   ; @IVTV_ENC_STREAM_TYPE_RAD
	.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"

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

	.comm	_EPOLLPRI,4,2                   ; @EPOLLPRI
	.comm	_EPOLLHUP,4,2                   ; @EPOLLHUP
.subsections_via_symbols
