	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_v4l2_poll
_pvr2_v4l2_poll:                        ## @pvr2_v4l2_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	cmpq	$0, 8(%rbx)
	je	LBB0_2
## %bb.1:
	movq	_EPOLLIN@GOTPCREL(%rip), %rcx
	movq	_EPOLLRDNORM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	jmp	LBB0_6
LBB0_2:
	movq	%rsi, %r14
	movq	%rdi, %r15
	cmpl	$0, (%rbx)
	je	LBB0_3
LBB0_5:
	leaq	4(%rbx), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_poll_wait
	movl	(%rbx), %edi
	callq	_pvr2_ioread_avail
	movq	%rax, %rcx
	movq	_EPOLLIN@GOTPCREL(%rip), %rax
	movq	_EPOLLRDNORM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rax), %edx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	cmovnsl	%edx, %eax
	jmp	LBB0_6
LBB0_3:
	movq	%rbx, %rdi
	callq	_pvr2_v4l2_iosetup
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movq	_EPOLLERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EPOLLIN,4,2                    ## @EPOLLIN
	.comm	_EPOLLRDNORM,4,2                ## @EPOLLRDNORM
	.comm	_EPOLLERR,4,2                   ## @EPOLLERR
	.no_dead_strip	_pvr2_v4l2_poll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_v4l2_poll
_pvr2_v4l2_poll:                        ; @pvr2_v4l2_poll
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x19, [x0]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EPOLLIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EPOLLIN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _EPOLLRDNORM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EPOLLRDNORM@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w0, w9, w8
	b	LBB0_6
LBB0_2:
	mov	x20, x1
	mov	x21, x0
	ldr	w8, [x19]
	cbz	w8, LBB0_4
LBB0_3:
	add	x1, x19, #4
	mov	x0, x21
	mov	x2, x20
	bl	_poll_wait
	ldr	w0, [x19]
	bl	_pvr2_ioread_avail
Lloh6:
	adrp	x8, _EPOLLIN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EPOLLIN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _EPOLLRDNORM@GOTPAGE
Lloh10:
	ldr	x9, [x9, _EPOLLRDNORM@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
	asr	x9, x0, #63
	bic	w0, w8, w9
	b	LBB0_6
LBB0_4:
	mov	x0, x19
	bl	_pvr2_v4l2_iosetup
	cbz	w0, LBB0_3
; %bb.5:
Lloh12:
	adrp	x8, _EPOLLERR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EPOLLERR@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EPOLLIN,4,2                    ; @EPOLLIN
	.comm	_EPOLLRDNORM,4,2                ; @EPOLLRDNORM
	.comm	_EPOLLERR,4,2                   ; @EPOLLERR
	.no_dead_strip	_pvr2_v4l2_poll
.subsections_via_symbols
