	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function device_run
_device_run:                            ## @device_run
	.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	$40, %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	88(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	28(%rdi), %edi
	callq	_v4l2_m2m_next_src_buf
	movq	%rax, %r14
	movl	28(%rbx), %edi
	callq	_v4l2_m2m_dst_buf_remove
	movq	%rax, %r12
	movq	8(%r14), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_get_q_data
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_get_q_data
	movq	%rax, %r15
	movq	_VB2_BUF_STATE_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_device_process
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_VB2_BUF_STATE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_3
LBB0_2:
	movslq	(%r15), %rax
	leal	1(%rax), %ecx
	movl	%ecx, (%r15)
	movq	%rax, (%r12)
LBB0_3:
	leaq	28(%rbx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_V4L2_BUF_FLAG_LAST@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	notl	%eax
	andl	%eax, 16(%r12)
	movq	%r14, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_v4l2_m2m_buf_copy_metadata
	movl	52(%rbx), %edi
	callq	_spin_lock
	cmpl	$0, (%rbx)
	jne	LBB0_6
## %bb.4:
	cmpq	80(%rbx), %r14
	je	LBB0_5
LBB0_6:
	cmpq	$0, 40(%rbx)
	jne	LBB0_8
LBB0_7:
	cmpq	$0, 32(%rbx)
	jne	LBB0_8
## %bb.9:
	movq	%r14, %rdi
	addq	$8, %rdi
	xorl	%esi, %esi
	callq	_vb2_get_plane_payload
	cmpq	16(%rbx), %rax
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_11
## %bb.10:
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movslq	(%rdx), %rax
	leal	1(%rax), %ecx
	movl	%ecx, (%rdx)
	movq	%rax, (%r14)
	movl	28(%rbx), %edi
	callq	_v4l2_m2m_src_buf_remove
	movq	%rax, %rdi
	movl	%r13d, %esi
	callq	_v4l2_m2m_buf_done
	movq	$0, 16(%rbx)
	movl	$0, (%rbx)
	jmp	LBB0_11
LBB0_5:
	movl	(%r15), %eax
	orl	%eax, 16(%r12)
	movq	_vicodec_eos_event@GOTPCREL(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_v4l2_event_queue_fh
	movabsq	$4294967296, %rax               ## imm = 0x100000000
	movq	%rax, 4(%rbx)
	cmpq	$0, 40(%rbx)
	je	LBB0_7
LBB0_8:
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movslq	(%rdx), %rax
	leal	1(%rax), %ecx
	movl	%ecx, (%rdx)
	movq	%rax, (%r14)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_v4l2_m2m_src_buf_remove
	movq	%rax, %rdi
	movl	%r13d, %esi
	callq	_v4l2_m2m_buf_done
	movq	-72(%rbp), %r15                 ## 8-byte Reload
LBB0_11:
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_v4l2_m2m_buf_done
	movl	$0, 24(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 56(%rbx)
	movq	$0, 72(%rbx)
	movl	52(%rbx), %edi
	callq	_spin_unlock
	cmpq	$0, 32(%rbx)
	je	LBB0_14
## %bb.12:
	testq	%r15, %r15
	je	LBB0_14
## %bb.13:
	leaq	48(%rbx), %rsi
	movq	%r15, %rdi
	callq	_v4l2_ctrl_request_complete
LBB0_14:
	cmpq	$0, 40(%rbx)
	je	LBB0_16
## %bb.15:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	$8, %rax
	jmp	LBB0_19
LBB0_16:
	cmpq	$0, 32(%rbx)
	je	LBB0_18
## %bb.17:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	$4, %rax
	jmp	LBB0_19
LBB0_18:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
LBB0_19:
	movl	(%rax), %edi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_v4l2_m2m_job_finish            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,4,2 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,4,2 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_VB2_BUF_STATE_DONE,4,2         ## @VB2_BUF_STATE_DONE
	.comm	_VB2_BUF_STATE_ERROR,4,2        ## @VB2_BUF_STATE_ERROR
	.comm	_V4L2_BUF_FLAG_LAST,4,2         ## @V4L2_BUF_FLAG_LAST
	.comm	_vicodec_eos_event,4,2          ## @vicodec_eos_event
	.no_dead_strip	_device_run
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function device_run
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_device_run:                            ; @device_run
	.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, x0
	ldr	x28, [x0, #88]
	mov	x19, x0
	ldr	w0, [x19, #28]!
	bl	_v4l2_m2m_next_src_buf
	mov	x24, x0
	ldr	w0, [x19]
	bl	_v4l2_m2m_dst_buf_remove
	mov	x22, x0
	mov	x26, x24
	ldr	x21, [x26, #8]!
Lloh0:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_get_q_data
	mov	x25, x0
Lloh3:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_get_q_data
	mov	x27, x0
Lloh6:
	adrp	x8, _VB2_BUF_STATE_DONE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VB2_BUF_STATE_DONE@GOTPAGEOFF]
Lloh8:
	ldr	w23, [x8]
	mov	x0, x20
	mov	x1, x24
	mov	x2, x22
	bl	_device_process
	cbz	x0, LBB0_2
; %bb.1:
Lloh9:
	adrp	x8, _VB2_BUF_STATE_ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VB2_BUF_STATE_ERROR@GOTPAGEOFF]
Lloh11:
	ldr	w23, [x8]
	b	LBB0_3
LBB0_2:
	ldrsw	x8, [x27]
	add	w9, w8, #1
	str	w9, [x27]
	str	x8, [x22]
LBB0_3:
Lloh12:
	adrp	x27, _V4L2_BUF_FLAG_LAST@GOTPAGE
Lloh13:
	ldr	x27, [x27, _V4L2_BUF_FLAG_LAST@GOTPAGEOFF]
	ldr	w8, [x27]
	ldr	w9, [x22, #16]
	bic	w8, w9, w8
	str	w8, [x22, #16]
	mov	x0, x24
	mov	x1, x22
	mov	w2, #0
	bl	_v4l2_m2m_buf_copy_metadata
	ldr	w0, [x20, #52]
	bl	_spin_lock
	ldr	w8, [x20]
	cbnz	w8, LBB0_5
; %bb.4:
	ldr	x8, [x20, #80]
	cmp	x24, x8
	b.eq	LBB0_9
LBB0_5:
	ldr	x8, [x20, #40]
	cbnz	x8, LBB0_10
LBB0_6:
	ldr	x8, [x20, #32]
	cbnz	x8, LBB0_10
; %bb.7:
	mov	x0, x26
	mov	w1, #0
	bl	_vb2_get_plane_payload
	ldr	x8, [x20, #16]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.8:
	ldrsw	x8, [x25]
	add	w9, w8, #1
	str	w9, [x25]
	str	x8, [x24]
	ldr	w0, [x20, #28]
	bl	_v4l2_m2m_src_buf_remove
	mov	x1, x23
	bl	_v4l2_m2m_buf_done
	str	xzr, [x20, #16]
	str	wzr, [x20]
	b	LBB0_11
LBB0_9:
	ldr	w8, [x27]
	ldr	w9, [x22, #16]
	orr	w8, w9, w8
	str	w8, [x22, #16]
Lloh14:
	adrp	x1, _vicodec_eos_event@GOTPAGE
Lloh15:
	ldr	x1, [x1, _vicodec_eos_event@GOTPAGEOFF]
	mov	x0, x19
	bl	_v4l2_event_queue_fh
Lloh16:
	adrp	x8, lCPI0_0@PAGE
Lloh17:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	stur	d0, [x20, #4]
	ldr	x8, [x20, #40]
	cbz	x8, LBB0_6
LBB0_10:
	ldrsw	x8, [x25]
	add	w9, w8, #1
	str	w9, [x25]
	str	x8, [x24]
	ldr	w0, [x19]
	bl	_v4l2_m2m_src_buf_remove
	mov	x1, x23
	bl	_v4l2_m2m_buf_done
LBB0_11:
	mov	x0, x22
	mov	x1, x23
	bl	_v4l2_m2m_buf_done
	str	wzr, [x20, #24]
	stp	xzr, xzr, [x20, #64]
	str	xzr, [x20, #56]
	ldr	w0, [x20, #52]
	bl	_spin_unlock
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_14
; %bb.12:
	cbz	x21, LBB0_14
; %bb.13:
	add	x1, x20, #48
	mov	x0, x21
	bl	_v4l2_ctrl_request_complete
LBB0_14:
	ldr	x8, [x20, #40]
	cbz	x8, LBB0_16
; %bb.15:
	add	x28, x28, #8
	b	LBB0_18
LBB0_16:
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_18
; %bb.17:
	add	x28, x28, #4
LBB0_18:
	ldr	w0, [x28]
	ldr	w1, [x19]
	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
	b	_v4l2_m2m_job_finish
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdr	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,4,2 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,4,2 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_VB2_BUF_STATE_DONE,4,2         ; @VB2_BUF_STATE_DONE
	.comm	_VB2_BUF_STATE_ERROR,4,2        ; @VB2_BUF_STATE_ERROR
	.comm	_V4L2_BUF_FLAG_LAST,4,2         ; @V4L2_BUF_FLAG_LAST
	.comm	_vicodec_eos_event,4,2          ; @vicodec_eos_event
	.no_dead_strip	_device_run
.subsections_via_symbols
