	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gsc_m2m_s_fmt_mplane
_gsc_m2m_s_fmt_mplane:                  ## @gsc_m2m_s_fmt_mplane
	.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, %rbx
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_fh_to_ctx
	movq	%rax, %r14
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_gsc_m2m_try_fmt_mplane
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	movl	64(%r14), %edi
	movl	(%r12), %esi
	callq	_v4l2_m2m_get_vq
	movq	%rax, %rdi
	callq	_vb2_is_streaming
	movl	(%r12), %esi
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_3:
	movl	%esi, %edi
	callq	_V4L2_TYPE_IS_OUTPUT
	leaq	32(%r14), %r15
	testq	%rax, %rax
	cmoveq	%r14, %r15
	leaq	28(%r12), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_find_fmt
	movq	%rax, 16(%r15)
	movl	24(%r12), %ecx
	movl	%ecx, 24(%r15)
	testq	%rax, %rax
	je	LBB0_12
## %bb.4:
	cmpl	$0, (%rax)
	jle	LBB0_7
## %bb.5:
	movq	16(%r12), %rcx
	movq	8(%r15), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rsi,4), %edi
	movl	%edi, (%rdx,%rsi,4)
	incq	%rsi
	movslq	(%rax), %rdi
	cmpq	%rdi, %rsi
	jl	LBB0_6
LBB0_7:
	movl	8(%r12), %edx
	movl	12(%r12), %esi
	movq	%r15, %rdi
	callq	_gsc_set_frame_size
	movl	(%r12), %ecx
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPCREL(%rip), %rdx
	movq	_GSC_PARAMS@GOTPCREL(%rip), %rax
	cmpl	(%rdx), %ecx
	jne	LBB0_8
## %bb.9:
	movq	_GSC_DST_FMT@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_8:
	movq	_GSC_SRC_FMT@GOTPCREL(%rip), %rcx
LBB0_10:
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	%r14, %rsi
	callq	_gsc_ctx_state_lock_set
	movl	(%r15), %edx
	movl	4(%r15), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_debug
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"queue (%d) busy"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,4,2 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
	.comm	_GSC_PARAMS,4,2                 ## @GSC_PARAMS
	.comm	_GSC_DST_FMT,4,2                ## @GSC_DST_FMT
	.comm	_GSC_SRC_FMT,4,2                ## @GSC_SRC_FMT
L_.str.1:                               ## @.str.1
	.asciz	"f_w: %d, f_h: %d"

	.no_dead_strip	_gsc_m2m_s_fmt_mplane
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gsc_m2m_s_fmt_mplane
_gsc_m2m_s_fmt_mplane:                  ; @gsc_m2m_s_fmt_mplane
	.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	x20, x2
	mov	x21, x1
	mov	x22, x0
	mov	x0, x1
	bl	_fh_to_ctx
	mov	x19, x0
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_gsc_m2m_try_fmt_mplane
	cbnz	w0, LBB0_9
; %bb.1:
	ldr	w0, [x19, #64]
	ldr	w1, [x20]
	bl	_v4l2_m2m_get_vq
	bl	_vb2_is_streaming
	ldr	w1, [x20]
	cbz	x0, LBB0_4
; %bb.2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_4:
	mov	x0, x1
	bl	_V4L2_TYPE_IS_OUTPUT
	add	x8, x19, #32
	cmp	x0, #0
	csel	x21, x19, x8, eq
	add	x0, x20, #28
	mov	x1, #0
	mov	w2, #0
	bl	_find_fmt
	str	x0, [x21, #16]
	ldr	w8, [x20, #24]
	str	w8, [x21, #24]
	cbz	x0, LBB0_10
; %bb.5:
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.6:
	mov	x8, #0
	ldr	x9, [x20, #16]
	ldr	x10, [x21, #8]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x11, x8, #2
	ldr	w12, [x9, x11]
	str	w12, [x10, x11]
	add	x8, x8, #1
	ldrsw	x11, [x0]
	cmp	x8, x11
	b.lt	LBB0_7
LBB0_8:
	ldp	w2, w1, [x20, #8]
	mov	x0, x21
	bl	_gsc_set_frame_size
	ldr	w8, [x20]
Lloh4:
	adrp	x9, _V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
Lloh7:
	adrp	x10, _GSC_PARAMS@GOTPAGE
Lloh8:
	ldr	x10, [x10, _GSC_PARAMS@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
Lloh10:
	adrp	x11, _GSC_DST_FMT@GOTPAGE
Lloh11:
	ldr	x11, [x11, _GSC_DST_FMT@GOTPAGEOFF]
Lloh12:
	adrp	x12, _GSC_SRC_FMT@GOTPAGE
Lloh13:
	ldr	x12, [x12, _GSC_SRC_FMT@GOTPAGEOFF]
	cmp	w8, w9
	csel	x8, x11, x12, eq
	ldr	w8, [x8]
	orr	w0, w8, w10
	mov	x1, x19
	bl	_gsc_ctx_state_lock_set
	ldp	w2, w1, [x21]
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
	mov	w0, #0
LBB0_9:
	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_10:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"queue (%d) busy"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,4,2 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
	.comm	_GSC_PARAMS,4,2                 ; @GSC_PARAMS
	.comm	_GSC_DST_FMT,4,2                ; @GSC_DST_FMT
	.comm	_GSC_SRC_FMT,4,2                ; @GSC_SRC_FMT
l_.str.1:                               ; @.str.1
	.asciz	"f_w: %d, f_h: %d"

	.no_dead_strip	_gsc_m2m_s_fmt_mplane
.subsections_via_symbols
