	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function v4l2_prepare_contexts
_v4l2_prepare_contexts:                 ## @v4l2_prepare_contexts
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	64(%rdi), %r14
	movq	$0, 16(%rdi)
	movq	$0, 40(%rdi)
	leaq	L_.str(%rip), %rax
	movq	%rax, 24(%rdi)
	leaq	L_.str.1(%rip), %rax
	movq	%rax, (%rdi)
	addq	$56, %rdi
	xorl	%esi, %esi
	callq	_atomic_init
	leaq	52(%rbx), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_sem_init
	leaq	-48(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movl	48(%rbx), %edi
	movq	_VIDIOC_QUERYCAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdx
	callq	_ioctl
	testl	%eax, %eax
	js	LBB0_13
## %bb.1:
	testl	%r15d, %r15d
	jne	LBB0_2
## %bb.3:
	movq	_AV_LOG_INFO@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %r12d
	movl	-48(%rbp), %r15d
	movl	-44(%rbp), %r13d
	leaq	-48(%rbp), %rdi
	callq	_v4l2_mplane_video
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.3(%rip), %r9
	jmp	LBB0_7
LBB0_6:
	leaq	-48(%rbp), %rdi
	callq	_v4l2_splane_video
	testq	%rax, %rax
	leaq	L_.str.5(%rip), %rax
	leaq	L_.str.4(%rip), %r9
	cmoveq	%rax, %r9
LBB0_7:
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	%r13d, %ecx
	movl	%r15d, %r8d
	callq	_av_log
	leaq	-48(%rbp), %rdi
	callq	_v4l2_mplane_video
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_10:
	leaq	-48(%rbp), %rdi
	callq	_v4l2_splane_video
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	xorl	%eax, %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"capture"

L_.str.1:                               ## @.str.1
	.asciz	"output"

	.comm	_VIDIOC_QUERYCAP,4,2            ## @VIDIOC_QUERYCAP
	.comm	_AV_LOG_DEBUG,4,2               ## @AV_LOG_DEBUG
	.comm	_AV_LOG_INFO,4,2                ## @AV_LOG_INFO
L_.str.2:                               ## @.str.2
	.asciz	"driver '%s' on card '%s' in %s mode\n"

L_.str.3:                               ## @.str.3
	.asciz	"mplane"

L_.str.4:                               ## @.str.4
	.asciz	"splane"

L_.str.5:                               ## @.str.5
	.asciz	"unknown"

	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,4,2 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,4,2 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,4,2 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,4,2 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_v4l2_prepare_contexts
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function v4l2_prepare_contexts
_v4l2_prepare_contexts:                 ; @v4l2_prepare_contexts
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	x20, [x0, #64]
	str	xzr, [x0, #40]
Lloh0:
	adrp	x8, l_.str@PAGE
Lloh1:
	add	x8, x8, l_.str@PAGEOFF
	stp	xzr, x8, [x0, #16]
Lloh2:
	adrp	x8, l_.str.1@PAGE
Lloh3:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [x0], #56
	mov	w1, #0
	bl	_atomic_init
	add	x0, x19, #52
	mov	w1, #0
	mov	w2, #0
	bl	_sem_init
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	w0, [x19, #48]
Lloh4:
	adrp	x8, _VIDIOC_QUERYCAP@GOTPAGE
Lloh5:
	ldr	x8, [x8, _VIDIOC_QUERYCAP@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_ioctl
	tbnz	w0, #31, LBB0_9
; %bb.1:
Lloh7:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh9:
	adrp	x9, _AV_LOG_INFO@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AV_LOG_INFO@GOTPAGEOFF]
	cmp	w21, #0
	csel	x8, x9, x8, eq
	ldr	w21, [x8]
	ldp	w23, w22, [sp, #8]
	add	x0, sp, #8
	bl	_v4l2_mplane_video
	cbz	x0, LBB0_3
; %bb.2:
Lloh11:
	adrp	x5, l_.str.3@PAGE
Lloh12:
	add	x5, x5, l_.str.3@PAGEOFF
	b	LBB0_4
LBB0_3:
	add	x0, sp, #8
	bl	_v4l2_splane_video
Lloh13:
	adrp	x8, l_.str.4@PAGE
Lloh14:
	add	x8, x8, l_.str.4@PAGEOFF
Lloh15:
	adrp	x9, l_.str.5@PAGE
Lloh16:
	add	x9, x9, l_.str.5@PAGEOFF
	cmp	x0, #0
	csel	x5, x9, x8, eq
LBB0_4:
Lloh17:
	adrp	x2, l_.str.2@PAGE
Lloh18:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x1, x21
	mov	x3, x22
	mov	x4, x23
	bl	_av_log
	add	x0, sp, #8
	bl	_v4l2_mplane_video
	cbz	x0, LBB0_6
; %bb.5:
	mov	w0, #0
Lloh19:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [x19, #32]
Lloh22:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
	add	x0, sp, #8
	bl	_v4l2_splane_video
	cbz	x0, LBB0_10
; %bb.7:
	mov	w0, #0
Lloh24:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [x19, #32]
Lloh27:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	str	w8, [x19, #8]
LBB0_9:
	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
	add	sp, sp, #80
	ret
LBB0_10:
Lloh29:
	adrp	x8, _EINVAL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	bl	_AVERROR
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"capture"

l_.str.1:                               ; @.str.1
	.asciz	"output"

	.comm	_VIDIOC_QUERYCAP,4,2            ; @VIDIOC_QUERYCAP
	.comm	_AV_LOG_DEBUG,4,2               ; @AV_LOG_DEBUG
	.comm	_AV_LOG_INFO,4,2                ; @AV_LOG_INFO
l_.str.2:                               ; @.str.2
	.asciz	"driver '%s' on card '%s' in %s mode\n"

l_.str.3:                               ; @.str.3
	.asciz	"mplane"

l_.str.4:                               ; @.str.4
	.asciz	"splane"

l_.str.5:                               ; @.str.5
	.asciz	"unknown"

	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,4,2 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,4,2 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,4,2 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,4,2 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_v4l2_prepare_contexts
.subsections_via_symbols
