	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vidioc_venc_s_fmt_cap
_vidioc_venc_s_fmt_cap:                 ## @vidioc_venc_s_fmt_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %rdi
	callq	_fh_to_ctx
	movq	%rax, %r14
	movl	8(%rax), %edi
	movl	40(%r12), %esi
	callq	_v4l2_m2m_get_vq
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %rdi
	callq	_vb2_is_busy
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mtk_v4l2_err
LBB0_3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	leaq	L_.str(%rip), %rdi
LBB0_5:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mtk_v4l2_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_6:
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	40(%r12), %esi
	movq	%r14, %rdi
	callq	_mtk_venc_get_q_data
	testq	%rax, %rax
	je	LBB0_18
## %bb.9:
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_mtk_venc_find_format
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:
	movq	_mtk_video_formats@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_CAP_FMT_IDX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, 32(%r12)
	movq	%r12, %rdi
	callq	_mtk_venc_find_format
LBB0_11:
	movq	%rax, (%r15)
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_vidioc_try_fmt
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.12:
	movl	24(%r12), %eax
	movl	%eax, 32(%r15)
	movl	20(%r12), %eax
	movl	%eax, 28(%r15)
	movl	16(%r12), %eax
	movl	%eax, 24(%r15)
	cmpl	$0, (%r12)
	jle	LBB0_15
## %bb.13:
	movq	8(%r12), %rax
	movq	8(%r15), %rcx
	movq	16(%r15), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	4(%rax,%rsi,8), %edi
	movl	%edi, (%rdx,%rsi,4)
	movl	(%rax,%rsi,8), %edi
	movl	%edi, (%rcx,%rsi,4)
	incq	%rsi
	movslq	(%r12), %rdi
	cmpq	%rdi, %rsi
	jl	LBB0_14
LBB0_15:
	movq	(%r14), %rax
	movq	_MTK_STATE_FREE@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.16:
	movq	(%r15), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_venc_if_init
	testl	%eax, %eax
	je	LBB0_19
## %bb.17:
	movq	(%r15), %rcx
	movl	(%rcx), %edx
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_mtk_v4l2_err
	jmp	LBB0_3
LBB0_18:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_5
LBB0_19:
	movq	_MTK_STATE_INIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	jmp	LBB0_7
	.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	_CAP_FMT_IDX,8,3                ## @CAP_FMT_IDX
	.comm	_MTK_STATE_FREE,8,3             ## @MTK_STATE_FREE
L_.str.3:                               ## @.str.3
	.asciz	"venc_if_init failed=%d, codec type=%x"

	.comm	_MTK_STATE_INIT,8,3             ## @MTK_STATE_INIT
	.no_dead_strip	_vidioc_venc_s_fmt_cap
.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_cap
_vidioc_venc_s_fmt_cap:                 ; @vidioc_venc_s_fmt_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	x20, x2
	mov	x0, x1
	bl	_fh_to_ctx
	mov	x19, x0
	ldr	w0, [x0, #8]
	ldr	w1, [x20, #40]
	bl	_v4l2_m2m_get_vq
	cbz	x0, LBB0_4
; %bb.1:
	bl	_vb2_is_busy
	cbz	x0, LBB0_8
; %bb.2:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_3:
	bl	_mtk_v4l2_err
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
LBB0_5:
	bl	_mtk_v4l2_err
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
LBB0_8:
	ldr	w1, [x20, #40]
	mov	x0, x19
	bl	_mtk_venc_get_q_data
	cbz	x0, LBB0_18
; %bb.9:
	mov	x21, x0
	mov	x0, x20
	bl	_mtk_venc_find_format
	mov	x1, x0
	cbnz	x0, LBB0_11
; %bb.10:
Lloh8:
	adrp	x8, _mtk_video_formats@GOTPAGE
Lloh9:
	ldr	x8, [x8, _mtk_video_formats@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _CAP_FMT_IDX@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CAP_FMT_IDX@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
	str	w8, [x20, #32]
	mov	x0, x20
	bl	_mtk_venc_find_format
	mov	x1, x0
LBB0_11:
	str	x1, [x21]
	mov	x0, x20
	bl	_vidioc_try_fmt
	cbnz	w0, LBB0_7
; %bb.12:
	ldr	w8, [x20, #24]
	str	w8, [x21, #32]
	ldr	d0, [x20, #16]
	str	d0, [x21, #24]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.13:
	mov	x8, #0
	ldr	x11, [x20, #8]
	ldp	x10, x9, [x21, #8]
	add	x11, x11, #4
LBB0_14:                                ; =>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, [x20]
	add	x11, x11, #8
	cmp	x8, x12
	b.lt	LBB0_14
LBB0_15:
	ldr	x8, [x19]
Lloh14:
	adrp	x9, _MTK_STATE_FREE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MTK_STATE_FREE@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_19
; %bb.16:
	ldr	x8, [x21]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_venc_if_init
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_20
; %bb.17:
	ldr	x8, [x21]
	ldr	w8, [x8]
	stp	x0, x8, [sp]
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_3
LBB0_18:
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_19:
	mov	w0, #0
	b	LBB0_7
LBB0_20:
Lloh21:
	adrp	x8, _MTK_STATE_INIT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MTK_STATE_INIT@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	str	x8, [x19]
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.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	_CAP_FMT_IDX,8,3                ; @CAP_FMT_IDX
	.comm	_MTK_STATE_FREE,8,3             ; @MTK_STATE_FREE
l_.str.3:                               ; @.str.3
	.asciz	"venc_if_init failed=%d, codec type=%x"

	.comm	_MTK_STATE_INIT,8,3             ; @MTK_STATE_INIT
	.no_dead_strip	_vidioc_venc_s_fmt_cap
.subsections_via_symbols
