	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vidioc_venc_s_fmt_out
_vidioc_venc_s_fmt_out:                 ## @vidioc_venc_s_fmt_out
	.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
	movq	%rdx, %r13
	movq	%rsi, %rdi
	callq	_fh_to_ctx
	movq	%rax, %r14
	movl	16(%rax), %edi
	movl	64(%r13), %esi
	callq	_v4l2_m2m_get_vq
	movq	_EINVAL@GOTPCREL(%rip), %rbx
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rdi
	callq	_vb2_is_busy
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_EBUSY@GOTPCREL(%rip), %rbx
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str(%rip), %rdi
LBB0_2:
	callq	_mtk_v4l2_err
	xorl	%eax, %eax
	subl	(%rbx), %eax
LBB0_14:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	64(%r13), %esi
	movq	%r14, %rdi
	callq	_mtk_venc_get_q_data
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r15
	movq	%r13, %rdi
	callq	_mtk_venc_find_format
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	movq	_mtk_video_formats@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_OUT_FMT_IDX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, 56(%r13)
	movq	%r13, %rdi
	callq	_mtk_venc_find_format
	movq	%rax, %r12
LBB0_9:
	movq	40(%r13), %rdi
	movq	_MTK_VENC_MIN_H@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MTK_VENC_MAX_H@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_clamp
	movq	%rax, 40(%r13)
	movq	48(%r13), %rdi
	movq	_MTK_VENC_MIN_W@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MTK_VENC_MAX_W@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_clamp
	movq	%rax, 48(%r13)
	movq	%rax, 56(%r15)
	movq	40(%r13), %rax
	movq	%rax, 48(%r15)
	movq	%r12, 40(%r15)
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_vidioc_try_fmt
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	jne	LBB0_14
## %bb.10:
	movups	40(%r13), %xmm0
	movups	%xmm0, 24(%r15)
	movl	32(%r13), %eax
	movl	%eax, 16(%r15)
	movups	16(%r13), %xmm0
	movups	%xmm0, (%r14)
	cmpl	$0, (%r13)
	jle	LBB0_11
## %bb.12:
	movq	8(%r13), %rcx
	movq	(%r15), %rdx
	movq	8(%r15), %rsi
	xorl	%eax, %eax
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	4(%rcx,%rdi,8), %ebx
	movl	%ebx, (%rsi,%rdi,4)
	movl	(%rcx,%rdi,8), %ebx
	movl	%ebx, (%rdx,%rdi,4)
	incq	%rdi
	movslq	(%r13), %rbx
	cmpq	%rbx, %rdi
	jl	LBB0_13
	jmp	LBB0_14
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_2
LBB0_11:
	xorl	%eax, %eax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fail to get vq"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"queue busy"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.2:                               ## @.str.2
	.asciz	"fail to get q data"

	.comm	_mtk_video_formats,8,3          ## @mtk_video_formats
	.comm	_OUT_FMT_IDX,8,3                ## @OUT_FMT_IDX
	.comm	_MTK_VENC_MIN_H,4,2             ## @MTK_VENC_MIN_H
	.comm	_MTK_VENC_MAX_H,4,2             ## @MTK_VENC_MAX_H
	.comm	_MTK_VENC_MIN_W,4,2             ## @MTK_VENC_MIN_W
	.comm	_MTK_VENC_MAX_W,4,2             ## @MTK_VENC_MAX_W
	.no_dead_strip	_vidioc_venc_s_fmt_out
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vidioc_venc_s_fmt_out
_vidioc_venc_s_fmt_out:                 ; @vidioc_venc_s_fmt_out
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	w0, [x0, #16]
	ldr	w1, [x19, #64]
	bl	_v4l2_m2m_get_vq
	cbz	x0, LBB0_3
; %bb.1:
	bl	_vb2_is_busy
	cbz	x0, LBB0_6
; %bb.2:
Lloh0:
	adrp	x19, _EBUSY@GOTPAGE
Lloh1:
	ldr	x19, [x19, _EBUSY@GOTPAGEOFF]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_3:
Lloh4:
	adrp	x19, _EINVAL@GOTPAGE
Lloh5:
	ldr	x19, [x19, _EINVAL@GOTPAGEOFF]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
LBB0_4:
	bl	_mtk_v4l2_err
	ldr	w8, [x19]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	w1, [x19, #64]
	mov	x0, x20
	bl	_mtk_venc_get_q_data
	cbz	x0, LBB0_14
; %bb.7:
	mov	x21, x0
	mov	x0, x19
	bl	_mtk_venc_find_format
	mov	x22, x0
	cbnz	x0, LBB0_9
; %bb.8:
Lloh8:
	adrp	x8, _mtk_video_formats@GOTPAGE
Lloh9:
	ldr	x8, [x8, _mtk_video_formats@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _OUT_FMT_IDX@GOTPAGE
Lloh12:
	ldr	x9, [x9, _OUT_FMT_IDX@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
	str	w8, [x19, #56]
	mov	x0, x19
	bl	_mtk_venc_find_format
	mov	x22, x0
LBB0_9:
	ldr	x0, [x19, #40]
Lloh14:
	adrp	x8, _MTK_VENC_MIN_H@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MTK_VENC_MIN_H@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x8, _MTK_VENC_MAX_H@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MTK_VENC_MAX_H@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	bl	_clamp
	str	x0, [x19, #40]
	ldr	x0, [x19, #48]
Lloh20:
	adrp	x8, _MTK_VENC_MIN_W@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MTK_VENC_MIN_W@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x8, _MTK_VENC_MAX_W@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MTK_VENC_MAX_W@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	bl	_clamp
	str	x0, [x19, #48]
	str	x0, [x21, #56]
	ldr	x8, [x19, #40]
	stp	x22, x8, [x21, #40]
	mov	x0, x19
	mov	x1, x22
	bl	_vidioc_try_fmt
	cbnz	w0, LBB0_5
; %bb.10:
	ldp	x9, x8, [x19, #40]
	stp	x9, x8, [x21, #24]
	ldr	w8, [x19, #32]
	str	w8, [x21, #16]
	ldr	q0, [x19, #16]
	str	q0, [x20]
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.11:
	mov	x8, #0
	ldr	x11, [x19, #8]
	ldp	x10, x9, [x21]
	add	x11, x11, #4
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11]
	lsl	x13, x8, #2
	str	w12, [x9, x13]
	ldur	w12, [x11, #-4]
	str	w12, [x10, x13]
	add	x8, x8, #1
	ldrsw	x12, [x19]
	add	x11, x11, #8
	cmp	x8, x12
	b.lt	LBB0_12
LBB0_13:
	mov	w0, #0
	b	LBB0_5
LBB0_14:
Lloh26:
	adrp	x19, _EINVAL@GOTPAGE
Lloh27:
	ldr	x19, [x19, _EINVAL@GOTPAGEOFF]
Lloh28:
	adrp	x0, l_.str.2@PAGE
Lloh29:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_4
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fail to get vq"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"queue busy"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.2:                               ; @.str.2
	.asciz	"fail to get q data"

	.comm	_mtk_video_formats,8,3          ; @mtk_video_formats
	.comm	_OUT_FMT_IDX,8,3                ; @OUT_FMT_IDX
	.comm	_MTK_VENC_MIN_H,4,2             ; @MTK_VENC_MIN_H
	.comm	_MTK_VENC_MAX_H,4,2             ; @MTK_VENC_MAX_H
	.comm	_MTK_VENC_MIN_W,4,2             ; @MTK_VENC_MIN_W
	.comm	_MTK_VENC_MAX_W,4,2             ; @MTK_VENC_MAX_W
	.no_dead_strip	_vidioc_venc_s_fmt_out
.subsections_via_symbols
