	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dev_poll
_dev_poll:                              ## @dev_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %r15
	movq	_D_FRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_PDEBUG
	leaq	28(%r15), %rsi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	callq	_poll_wait
	movq	(%r15), %rax
	movq	_GSPCA_MEMORY_NO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.1:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_read_alloc
	testl	%eax, %eax
	jne	LBB0_2
LBB0_3:
	leaq	20(%r15), %r14
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_4
LBB0_2:
	movq	_POLLERR@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	8(%r15), %r12
	leaq	24(%r15), %rdi
	callq	_atomic_read
	movq	_POLLIN@GOTPCREL(%rip), %rcx
	movq	_POLLRDNORM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	xorl	%ebx, %ebx
	cmpq	%rax, %r12
	cmovnel	%edx, %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
	cmpl	$0, 16(%r15)
	jne	LBB0_7
## %bb.5:
	movq	_POLLHUP@GOTPCREL(%rip), %rax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_D_FRAM,4,2                     ## @D_FRAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"poll"

	.comm	_GSPCA_MEMORY_NO,8,3            ## @GSPCA_MEMORY_NO
	.comm	_POLLERR,4,2                    ## @POLLERR
	.comm	_POLLIN,4,2                     ## @POLLIN
	.comm	_POLLRDNORM,4,2                 ## @POLLRDNORM
	.comm	_POLLHUP,4,2                    ## @POLLHUP
	.no_dead_strip	_dev_poll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dev_poll
_dev_poll:                              ; @dev_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
	mov	x21, x1
	mov	x20, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _D_FRAM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _D_FRAM@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_PDEBUG
	add	x1, x19, #28
	mov	x0, x20
	mov	x2, x21
	bl	_poll_wait
	ldr	x8, [x19]
Lloh5:
	adrp	x9, _GSPCA_MEMORY_NO@GOTPAGE
Lloh6:
	ldr	x9, [x9, _GSPCA_MEMORY_NO@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_read_alloc
	cbnz	w0, LBB0_3
LBB0_2:
	add	x20, x19, #20
	mov	x0, x20
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_4
LBB0_3:
Lloh8:
	adrp	x8, _POLLERR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _POLLERR@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	b	LBB0_5
LBB0_4:
	ldr	x21, [x19, #8]
	add	x0, x19, #24
	bl	_atomic_read
Lloh11:
	adrp	x8, _POLLIN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _POLLIN@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _POLLRDNORM@GOTPAGE
Lloh15:
	ldr	x9, [x9, _POLLRDNORM@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w8, w9, w8
	cmp	x21, x0
	csel	w21, wzr, w8, eq
	mov	x0, x20
	bl	_mutex_unlock
	ldr	w8, [x19, #16]
Lloh17:
	adrp	x9, _POLLHUP@GOTPAGE
Lloh18:
	ldr	x9, [x9, _POLLHUP@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	cmp	w8, #0
	csel	w0, w9, w21, eq
LBB0_5:
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_D_FRAM,4,2                     ; @D_FRAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"poll"

	.comm	_GSPCA_MEMORY_NO,8,3            ; @GSPCA_MEMORY_NO
	.comm	_POLLERR,4,2                    ; @POLLERR
	.comm	_POLLIN,4,2                     ; @POLLIN
	.comm	_POLLRDNORM,4,2                 ; @POLLRDNORM
	.comm	_POLLHUP,4,2                    ; @POLLHUP
	.no_dead_strip	_dev_poll
.subsections_via_symbols
