	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hva_try_fmt_stream
_hva_try_fmt_stream:                    ## @hva_try_fmt_stream
	.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	%rdx, %r13
	movl	(%rdi), %edi
	callq	_fh_to_ctx
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_ctx_to_dev
	movq	%rax, %r15
	movq	(%r13), %rdx
	movl	40(%r14), %esi
	movq	%r14, %rdi
	callq	_hva_find_encoder
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	leaq	8(%r13), %r15
	movq	8(%r13), %rbx
	movq	16(%r13), %r8
	leaq	16(%r13), %r12
	movq	_HVA_FLAG_FRAMEINFO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%r14)
	je	LBB0_6
## %bb.3:
	movq	24(%r14), %r9
	movq	%r9, (%r15)
	movq	32(%r14), %rax
	movq	%rax, (%r12)
	cmpq	%rbx, %r9
	jne	LBB0_5
## %bb.4:
	cmpq	%r8, %rax
	je	LBB0_10
LBB0_5:
	movl	20(%r14), %edx
	movq	%rax, (%rsp)
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_9
LBB0_1:
	movl	20(%r14), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movq	%r13, %rcx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_6:
	movq	_HVA_MIN_WIDTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%rax), %ecx
	movl	4(%rax), %edx
	movq	_HVA_MIN_HEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	%ecx, (%rsp)
	movl	$0, 16(%rsp)
	movl	$0, 8(%rsp)
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%r12, %r8
	callq	_v4l_bound_align_image
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	movq	(%r15), %r9
	movq	(%r12), %rax
	cmpq	%rbx, %r9
	jne	LBB0_8
## %bb.7:
	cmpq	%r8, %rax
	je	LBB0_10
LBB0_8:
	movl	20(%r14), %edx
	movq	%rax, (%rsp)
	leaq	L_.str.2(%rip), %rsi
LBB0_9:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rcx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_10:
	movq	8(%r13), %rdi
	movq	16(%r13), %rsi
	callq	_estimated_stream_size
	cmpq	%rax, 24(%r13)
	jge	LBB0_12
## %bb.11:
	movq	%rax, 24(%r13)
LBB0_12:
	movq	$0, 56(%r13)
	movups	4(%r14), %xmm0
	movups	%xmm0, 36(%r13)
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r13)
	xorl	%ebx, %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s V4L2 TRY_FMT (CAPTURE): unsupported format %.4s\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_HVA_FLAG_FRAMEINFO,4,2         ## @HVA_FLAG_FRAMEINFO
L_.str.1:                               ## @.str.1
	.asciz	"%s V4L2 TRY_FMT (CAPTURE): resolution updated %dx%d -> %dx%d to fit frame resolution\n"

	.comm	_HVA_MIN_WIDTH,4,2              ## @HVA_MIN_WIDTH
	.comm	_HVA_MIN_HEIGHT,4,2             ## @HVA_MIN_HEIGHT
L_.str.2:                               ## @.str.2
	.asciz	"%s V4L2 TRY_FMT (CAPTURE): resolution updated %dx%d -> %dx%d to fit min/max/alignment\n"

	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
	.no_dead_strip	_hva_try_fmt_stream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hva_try_fmt_stream
_hva_try_fmt_stream:                    ; @hva_try_fmt_stream
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	ldr	w0, [x0]
	bl	_fh_to_ctx
	mov	x20, x0
	bl	_ctx_to_dev
	mov	x21, x0
	ldr	x2, [x19]
	ldr	w1, [x20, #40]
	mov	x0, x20
	bl	_hva_find_encoder
	cbz	x0, LBB0_4
; %bb.1:
	mov	x23, x19
	ldr	x22, [x23, #8]!
	mov	x24, x23
	ldr	x25, [x24, #8]!
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _HVA_FLAG_FRAMEINFO@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HVA_FLAG_FRAMEINFO@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.2:
	ldp	x8, x9, [x20, #24]
	str	x8, [x23]
	str	x9, [x24]
	cmp	x8, x22
	ccmp	x9, x25, #0, eq
	b.eq	LBB0_9
; %bb.3:
	ldr	w2, [x20, #20]
	stp	x8, x9, [sp, #8]
	str	x25, [sp]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_4:
	ldr	w2, [x20, #20]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x3, x19
	bl	_dev_dbg
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_5:
Lloh10:
	adrp	x8, _HVA_MIN_WIDTH@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HVA_MIN_WIDTH@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x8, _HVA_MIN_HEIGHT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _HVA_MIN_HEIGHT@GOTPAGEOFF]
Lloh15:
	ldr	w5, [x8]
	ldp	w6, w2, [x0]
	str	wzr, [sp]
	mov	x0, x23
	mov	w3, #0
	mov	x4, x24
	mov	w7, #0
	bl	_v4l_bound_align_image
	ldr	x8, [x23]
	ldr	x9, [x24]
	cmp	x8, x22
	b.ne	LBB0_7
; %bb.6:
	cmp	x9, x25
	b.eq	LBB0_9
LBB0_7:
	ldr	w2, [x20, #20]
	stp	x8, x9, [sp, #8]
	str	x25, [sp]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_8:
	mov	x0, x21
	mov	x3, x22
	bl	_dev_dbg
LBB0_9:
	ldp	x0, x1, [x19, #8]
	bl	_estimated_stream_size
	ldr	x8, [x19, #24]
	cmp	x8, x0
	b.ge	LBB0_11
; %bb.10:
	str	x0, [x19, #24]
LBB0_11:
	mov	w0, #0
	str	xzr, [x19, #56]
	ldur	q0, [x20, #4]
	stur	q0, [x19, #36]
Lloh18:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x19, #32]
LBB0_12:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s V4L2 TRY_FMT (CAPTURE): unsupported format %.4s\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_HVA_FLAG_FRAMEINFO,4,2         ; @HVA_FLAG_FRAMEINFO
l_.str.1:                               ; @.str.1
	.asciz	"%s V4L2 TRY_FMT (CAPTURE): resolution updated %dx%d -> %dx%d to fit frame resolution\n"

	.comm	_HVA_MIN_WIDTH,4,2              ; @HVA_MIN_WIDTH
	.comm	_HVA_MIN_HEIGHT,4,2             ; @HVA_MIN_HEIGHT
l_.str.2:                               ; @.str.2
	.asciz	"%s V4L2 TRY_FMT (CAPTURE): resolution updated %dx%d -> %dx%d to fit min/max/alignment\n"

	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
	.no_dead_strip	_hva_try_fmt_stream
.subsections_via_symbols
