	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function device_process
_device_process:                        ## @device_process
	.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	%rdx, %r13
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	72(%rdi), %rax
	cmpq	$0, 56(%rdi)
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jne	LBB0_3
## %bb.1:
	cmpq	$0, 48(%r12)
	je	LBB0_2
LBB0_3:
	leaq	8(%rbx), %r14
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_vb2_plane_vaddr
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	cmpq	$0, 48(%r12)
	je	LBB0_10
## %bb.4:
	movq	16(%rbx), %rdi
	leaq	68(%r12), %rsi
	callq	_v4l2_ctrl_request_setup
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_26
## %bb.5:
	movq	%r12, %rdi
	callq	_update_state_from_header
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_vb2_get_plane_payload
	movl	%eax, %edi
	callq	_htonl
	movl	%eax, 12(%r12)
	movl	8(%r12), %edi
	callq	_ntohl
	movq	_FWHT_FL_I_FRAME@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.9:
	movq	$0, 24(%r12)
	jmp	LBB0_10
LBB0_2:
	movq	40(%r12), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	jmp	LBB0_10
LBB0_6:
	movl	64(%r12), %edi
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_v4l2_m2m_get_vq
	movq	%rax, %rbx
	movl	32(%r12), %esi
	xorl	%r15d, %r15d
	movq	%rax, %rdi
	xorl	%edx, %edx
	callq	_vb2_find_timestamp
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	movq	(%rbx), %rcx
	movl	%eax, %eax
	movq	(%rcx,%rax,8), %rdi
	movq	(%rdi), %rax
	movq	_VB2_BUF_STATE_ERROR@GOTPCREL(%rip), %rcx
	movq	_EINVAL@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	subl	(%rdx), %esi
	cmpq	(%rcx), %rax
	cmovel	%esi, %r15d
	xorl	%esi, %esi
	callq	_vb2_plane_vaddr
	movq	%rax, 24(%r12)
LBB0_10:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	leaq	8(%r13), %r14
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_vb2_plane_vaddr
	cmpq	$0, -48(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_12
## %bb.11:
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	leaq	8(%r12), %rbx
	cmpq	$0, 56(%r12)
	je	LBB0_17
## %bb.14:
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_get_q_data
	movl	4(%rax), %eax
	movl	%eax, 16(%r12)
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%r13, %rdx
	callq	_v4l2_fwht_encode
	testl	%eax, %eax
	js	LBB0_15
## %bb.16:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_vb2_set_plane_payload
	jmp	LBB0_26
LBB0_12:
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_v4l2_err
	movq	_EFAULT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %r15d
LBB0_26:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	%rbx, %r15
	movl	12(%r12), %edi
	callq	_ntohl
	movl	%eax, %ebx
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_get_q_data
	cmpl	(%r12), %ebx
	jbe	LBB0_19
## %bb.18:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_26
LBB0_15:
	movl	%eax, %r15d
	jmp	LBB0_26
LBB0_19:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	4(%rax), %eax
	movl	%eax, 16(%r12)
	movq	%r15, %rbx
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%r13, %rdx
	callq	_v4l2_fwht_decode
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_26
## %bb.20:
	cmpq	$0, 48(%r12)
	jne	LBB0_22
## %bb.21:
	movl	16(%r12), %esi
	movq	%r13, %rdi
	movq	%rbx, %rdx
	callq	_copy_cap_to_ref
LBB0_22:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_vb2_set_plane_payload
	movl	(%rbx), %edi
	callq	_ntohl
	movq	_FWHT_FL_I_FRAME@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_24
## %bb.23:
	movq	_V4L2_BUF_FLAG_KEYFRAME@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_26
LBB0_24:
	movq	_V4L2_BUF_FLAG_PFRAME@GOTPCREL(%rip), %rax
LBB0_25:
	movl	(%rax), %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	orl	%eax, (%rcx)
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_FWHT_FL_I_FRAME,4,2            ## @FWHT_FL_I_FRAME
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,4,2 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VB2_BUF_STATE_ERROR,8,3        ## @VB2_BUF_STATE_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Acquiring kernel pointers to buffers failed\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,4,2 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.comm	_V4L2_BUF_FLAG_KEYFRAME,4,2     ## @V4L2_BUF_FLAG_KEYFRAME
	.comm	_V4L2_BUF_FLAG_PFRAME,4,2       ## @V4L2_BUF_FLAG_PFRAME
	.no_dead_strip	_device_process
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function device_process
_device_process:                        ; @device_process
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
	ldr	x23, [x0, #72]
	ldr	x8, [x0, #56]
	cbnz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x20, #48]
	cbz	x8, LBB0_7
LBB0_2:
	add	x24, x22, #8
	mov	x0, x24
	mov	w1, #0
	bl	_vb2_plane_vaddr
	mov	x21, x0
	ldr	x8, [x20, #48]
	cbz	x8, LBB0_6
; %bb.3:
	ldr	x0, [x22, #16]
	add	x1, x20, #68
	bl	_v4l2_ctrl_request_setup
	mov	x22, x0
	cbnz	w0, LBB0_19
; %bb.4:
	mov	x0, x20
	bl	_update_state_from_header
	mov	x0, x24
	mov	w1, #0
	bl	_vb2_get_plane_payload
	bl	_htonl
	str	w0, [x20, #12]
	ldr	w0, [x20, #8]
	bl	_ntohl
Lloh0:
	adrp	x8, _FWHT_FL_I_FRAME@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FWHT_FL_I_FRAME@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.5:
	mov	w22, #0
	str	xzr, [x20, #24]
	b	LBB0_10
LBB0_6:
	mov	w22, #0
	b	LBB0_10
LBB0_7:
	mov	w22, #0
	ldr	x21, [x20, #40]
	b	LBB0_10
LBB0_8:
	ldr	w0, [x20, #64]
Lloh3:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_v4l2_m2m_get_vq
	mov	x22, x0
	ldr	w1, [x20, #32]
	mov	w2, #0
	bl	_vb2_find_timestamp
	tbnz	w0, #31, LBB0_17
; %bb.9:
	ldr	x8, [x22]
	ldr	x0, [x8, w0, uxtw #3]
	ldr	x8, [x0]
Lloh6:
	adrp	x9, _VB2_BUF_STATE_ERROR@GOTPAGE
Lloh7:
	ldr	x9, [x9, _VB2_BUF_STATE_ERROR@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
Lloh9:
	adrp	x10, _EINVAL@GOTPAGE
Lloh10:
	ldr	x10, [x10, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	cmp	x8, x9
	csneg	w22, wzr, w10, ne
	mov	w1, #0
	bl	_vb2_plane_vaddr
	str	x0, [x20, #24]
LBB0_10:
	add	x24, x19, #8
	mov	x0, x24
	mov	w1, #0
	bl	_vb2_plane_vaddr
	cbz	x21, LBB0_15
; %bb.11:
	mov	x25, x0
	cbz	x0, LBB0_15
; %bb.12:
	add	x23, x20, #8
	ldr	x8, [x20, #56]
	cbz	x8, LBB0_16
; %bb.13:
Lloh12:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_get_q_data
	ldr	w8, [x0, #4]
	str	w8, [x20, #16]
	mov	x0, x23
	mov	x1, x21
	mov	x2, x25
	bl	_v4l2_fwht_encode
	mov	x2, x0
	tbnz	w0, #31, LBB0_20
; %bb.14:
	mov	x0, x24
	mov	w1, #0
	bl	_vb2_set_plane_payload
	b	LBB0_19
LBB0_15:
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	bl	_v4l2_err
Lloh17:
	adrp	x8, _EFAULT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_18
LBB0_16:
	ldr	w0, [x20, #12]
	bl	_ntohl
	mov	x22, x0
Lloh19:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_get_q_data
	ldr	w8, [x20]
	cmp	w22, w8
	b.ls	LBB0_21
LBB0_17:
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_19:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_20:
	mov	x22, x2
	b	LBB0_19
LBB0_21:
	mov	x26, x0
	ldr	w8, [x0, #4]
	str	w8, [x20, #16]
	mov	x0, x23
	mov	x1, x21
	mov	x2, x25
	bl	_v4l2_fwht_decode
	mov	x22, x0
	tbnz	w0, #31, LBB0_19
; %bb.22:
	ldr	x8, [x20, #48]
	cbnz	x8, LBB0_24
; %bb.23:
	ldr	w1, [x20, #16]
	mov	x0, x25
	mov	x2, x23
	bl	_copy_cap_to_ref
LBB0_24:
	ldr	w2, [x26]
	mov	x0, x24
	mov	w1, #0
	bl	_vb2_set_plane_payload
	ldr	w0, [x23]
	bl	_ntohl
Lloh24:
	adrp	x8, _FWHT_FL_I_FRAME@GOTPAGE
Lloh25:
	ldr	x8, [x8, _FWHT_FL_I_FRAME@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_26
; %bb.25:
Lloh27:
	adrp	x8, _V4L2_BUF_FLAG_KEYFRAME@GOTPAGE
Lloh28:
	ldr	x8, [x8, _V4L2_BUF_FLAG_KEYFRAME@GOTPAGEOFF]
	b	LBB0_27
LBB0_26:
Lloh29:
	adrp	x8, _V4L2_BUF_FLAG_PFRAME@GOTPAGE
Lloh30:
	ldr	x8, [x8, _V4L2_BUF_FLAG_PFRAME@GOTPAGEOFF]
LBB0_27:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	b	LBB0_19
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_FWHT_FL_I_FRAME,4,2            ; @FWHT_FL_I_FRAME
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,4,2 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VB2_BUF_STATE_ERROR,8,3        ; @VB2_BUF_STATE_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Acquiring kernel pointers to buffers failed\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,4,2 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.comm	_V4L2_BUF_FLAG_KEYFRAME,4,2     ; @V4L2_BUF_FLAG_KEYFRAME
	.comm	_V4L2_BUF_FLAG_PFRAME,4,2       ; @V4L2_BUF_FLAG_PFRAME
	.no_dead_strip	_device_process
.subsections_via_symbols
