	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function coda_try_fmt_vid_cap
_coda_try_fmt_vid_cap:                  ## @coda_try_fmt_vid_cap
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rdi
	callq	_fh_to_ctx
	movq	%rax, %r12
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_coda_try_pixelformat
	testl	%eax, %eax
	js	LBB0_13
## %bb.1:
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_get_q_data
	movq	%rax, %r15
	movl	20(%r12), %edi
	movl	(%rbx), %esi
	callq	_v4l2_m2m_get_vq
	movq	%rax, %rdi
	callq	_vb2_is_streaming
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movl	(%r15), %eax
	movl	%eax, (%r14)
	movl	4(%r15), %eax
	movl	%eax, 4(%r14)
LBB0_3:
	movups	4(%r12), %xmm0
	movups	%xmm0, 20(%r14)
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_get_q_data
	movl	(%r12), %edi
	movl	8(%rax), %esi
	movl	16(%r14), %edx
	callq	_coda_find_codec
	testq	%rax, %rax
	je	LBB0_11
## %bb.4:
	movq	%rax, %rbx
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	%r14, %rdx
	callq	_coda_try_fmt
	testl	%eax, %eax
	js	LBB0_13
## %bb.5:
	movq	(%rbx), %rax
	movq	_V4L2_PIX_FMT_H264@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.6:
	movl	4(%r14), %edi
	movl	$16, %esi
	callq	_round_up
	movl	%eax, 4(%r14)
	movl	(%r14), %edi
	movl	$16, %esi
	callq	_round_up
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, 8(%r14)
	imull	4(%r14), %eax
	leal	(%rax,%rax,2), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movl	%ecx, 12(%r14)
	leaq	-36(%rbp), %rdx
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_coda_try_fmt_vdoa
	testl	%eax, %eax
	js	LBB0_13
## %bb.7:
	movl	16(%r14), %eax
	movq	_V4L2_PIX_FMT_YUYV@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_14
## %bb.8:
	cmpl	$0, -36(%rbp)
	je	LBB0_11
## %bb.9:
	movl	(%r14), %edi
	movl	$16, %esi
	callq	_round_up
	addl	%eax, %eax
	movl	%eax, 8(%r14)
	imull	4(%r14), %eax
	movl	%eax, 12(%r14)
	jmp	LBB0_14
LBB0_13:
	movl	%eax, %r15d
	jmp	LBB0_14
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_14:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,4,2 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_PIX_FMT_H264,8,3          ## @V4L2_PIX_FMT_H264
	.comm	_V4L2_PIX_FMT_YUYV,4,2          ## @V4L2_PIX_FMT_YUYV
	.no_dead_strip	_coda_try_fmt_vid_cap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function coda_try_fmt_vid_cap
_coda_try_fmt_vid_cap:                  ; @coda_try_fmt_vid_cap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x2
	mov	x0, x1
	bl	_fh_to_ctx
	mov	x20, x0
	mov	x1, x19
	bl	_coda_try_pixelformat
	tbnz	w0, #31, LBB0_12
; %bb.1:
Lloh0:
	adrp	x22, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGE
Lloh1:
	ldr	x22, [x22, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_get_q_data
	mov	x21, x0
	ldr	w0, [x20, #20]
	ldr	w1, [x22]
	bl	_v4l2_m2m_get_vq
	bl	_vb2_is_streaming
	cbz	x0, LBB0_3
; %bb.2:
	ldr	d0, [x21]
	str	d0, [x19]
LBB0_3:
	ldur	q0, [x20, #4]
	stur	q0, [x19, #20]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_get_q_data
	ldr	w8, [x20]
	ldr	w1, [x0, #8]
	ldr	w2, [x19, #16]
	mov	x0, x8
	bl	_coda_find_codec
	cbz	x0, LBB0_10
; %bb.4:
	mov	x21, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_coda_try_fmt
	tbnz	w0, #31, LBB0_12
; %bb.5:
	ldr	x8, [x21]
Lloh2:
	adrp	x9, _V4L2_PIX_FMT_H264@GOTPAGE
Lloh3:
	ldr	x9, [x9, _V4L2_PIX_FMT_H264@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.6:
	ldr	w0, [x19, #4]
	mov	w1, #16
	bl	_round_up
	str	w0, [x19, #4]
	ldr	w0, [x19]
	mov	w1, #16
	bl	_round_up
	ldr	w8, [x19, #4]
	mul	w8, w0, w8
	add	w8, w8, w8, lsl #1
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	stp	w0, w8, [x19, #8]
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x19
	bl	_coda_try_fmt_vdoa
	tbnz	w0, #31, LBB0_12
; %bb.7:
	ldr	w8, [x19, #16]
Lloh5:
	adrp	x9, _V4L2_PIX_FMT_YUYV@GOTPAGE
Lloh6:
	ldr	x9, [x9, _V4L2_PIX_FMT_YUYV@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_11
; %bb.8:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_10
; %bb.9:
	ldr	w0, [x19]
	mov	w1, #16
	bl	_round_up
	mov	x8, x0
	mov	w0, #0
	lsl	w8, w8, #1
	ldr	w9, [x19, #4]
	mul	w9, w9, w8
	stp	w8, w9, [x19, #8]
	b	LBB0_12
LBB0_10:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_11:
	mov	w0, #0
LBB0_12:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,4,2 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_PIX_FMT_H264,8,3          ; @V4L2_PIX_FMT_H264
	.comm	_V4L2_PIX_FMT_YUYV,4,2          ; @V4L2_PIX_FMT_YUYV
	.no_dead_strip	_coda_try_fmt_vid_cap
.subsections_via_symbols
