	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5p_mfc_queue_setup
_s5p_mfc_queue_setup:                   ## @s5p_mfc_queue_setup
	.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	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r15
	movq	%rdx, %r13
	movq	%rsi, %r12
	movq	%rdi, %r14
	movl	8(%rdi), %edi
	callq	_fh_to_ctx
	movq	%rax, %rbx
	movq	24(%rax), %rdi
	movq	(%r14), %rsi
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_9
## %bb.1:
	movq	(%rbx), %rsi
	movq	_MFCINST_GOT_INST@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_18
## %bb.2:
	movq	40(%rbx), %rax
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	_MFC_ENC_CAP_PLANE_COUNT@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
	movl	%eax, (%r13)
	movl	(%r12), %eax
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movl	$1, (%r12)
	movl	$1, %eax
LBB0_6:
	movq	_MFC_MAX_BUFFERS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	jbe	LBB0_8
## %bb.7:
	movl	%ecx, (%r12)
LBB0_8:
	movl	8(%rbx), %eax
	movl	%eax, (%r15)
	movq	(%rdi), %rax
	movq	_BANK_L_CTX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	jmp	LBB0_23
LBB0_9:
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_19
## %bb.10:
	movq	32(%rbx), %rax
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	movq	_MFC_ENC_OUT_PLANE_COUNT@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
	movl	%eax, (%r13)
	movl	(%r12), %eax
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	movl	$1, (%r12)
	movl	$1, %eax
LBB0_14:
	movq	_MFC_MAX_BUFFERS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	jbe	LBB0_16
## %bb.15:
	movl	%ecx, (%r12)
LBB0_16:
	movl	12(%rbx), %eax
	movl	%eax, (%r15)
	movl	16(%rbx), %eax
	movl	%eax, 4(%r15)
	callq	_IS_MFCV6_PLUS
	movq	24(%rbx), %rcx
	movq	(%rcx), %rcx
	testq	%rax, %rax
	je	LBB0_21
## %bb.17:
	movq	_BANK_L_CTX@GOTPCREL(%rip), %rax
	jmp	LBB0_22
LBB0_18:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_20
LBB0_19:
	leaq	L_.str.1(%rip), %rdi
LBB0_20:
	callq	_mfc_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_24
LBB0_21:
	movq	_BANK_R_CTX@GOTPCREL(%rip), %rax
LBB0_22:
	movq	(%rax), %rax
	movq	(%rcx,%rax,8), %rcx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%rcx, (%rdx)
	movq	24(%rbx), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%rax,8), %rax
	movq	%rax, 8(%rdx)
LBB0_23:
	xorl	%eax, %eax
LBB0_24:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,8,3 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
	.comm	_MFCINST_GOT_INST,8,3           ## @MFCINST_GOT_INST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid state: %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MFC_ENC_CAP_PLANE_COUNT,4,2    ## @MFC_ENC_CAP_PLANE_COUNT
	.comm	_MFC_MAX_BUFFERS,4,2            ## @MFC_MAX_BUFFERS
	.comm	_BANK_L_CTX,8,3                 ## @BANK_L_CTX
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,8,3 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
	.comm	_MFC_ENC_OUT_PLANE_COUNT,4,2    ## @MFC_ENC_OUT_PLANE_COUNT
	.comm	_BANK_R_CTX,8,3                 ## @BANK_R_CTX
L_.str.1:                               ## @.str.1
	.asciz	"invalid queue type: %d\n"

	.no_dead_strip	_s5p_mfc_queue_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5p_mfc_queue_setup
_s5p_mfc_queue_setup:                   ; @s5p_mfc_queue_setup
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x4
	mov	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x24, x0
	ldr	w0, [x0, #8]
	bl	_fh_to_ctx
	mov	x20, x0
	ldr	x0, [x0, #24]
	ldr	x1, [x24]
Lloh0:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_7
; %bb.1:
	ldr	x1, [x20]
Lloh3:
	adrp	x8, _MFCINST_GOT_INST@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MFCINST_GOT_INST@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_14
; %bb.2:
Lloh6:
	adrp	x8, _MFC_ENC_CAP_PLANE_COUNT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MFC_ENC_CAP_PLANE_COUNT@GOTPAGEOFF]
	ldr	x9, [x20, #40]
	cmp	x9, #0
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	str	w8, [x23]
	ldr	w8, [x22]
	cbnz	w8, LBB0_4
; %bb.3:
	mov	w8, #1
	str	w8, [x22]
LBB0_4:
Lloh8:
	adrp	x9, _MFC_MAX_BUFFERS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MFC_MAX_BUFFERS@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ls	LBB0_6
; %bb.5:
	str	w9, [x22]
LBB0_6:
	mov	w8, #0
	ldr	w9, [x20, #8]
	str	w9, [x21]
	ldr	x9, [x0]
Lloh11:
	adrp	x10, _BANK_L_CTX@GOTPAGE
Lloh12:
	ldr	x10, [x10, _BANK_L_CTX@GOTPAGEOFF]
Lloh13:
	ldr	x10, [x10]
	ldr	x9, [x9, x10, lsl #3]
	str	x9, [x19]
	b	LBB0_19
LBB0_7:
Lloh14:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_15
; %bb.8:
Lloh17:
	adrp	x8, _MFC_ENC_OUT_PLANE_COUNT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MFC_ENC_OUT_PLANE_COUNT@GOTPAGEOFF]
	ldr	x9, [x20, #32]
	cmp	x9, #0
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	str	w8, [x23]
	ldr	w8, [x22]
	cbnz	w8, LBB0_10
; %bb.9:
	mov	w8, #1
	str	w8, [x22]
LBB0_10:
Lloh19:
	adrp	x9, _MFC_MAX_BUFFERS@GOTPAGE
Lloh20:
	ldr	x9, [x9, _MFC_MAX_BUFFERS@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ls	LBB0_12
; %bb.11:
	str	w9, [x22]
LBB0_12:
	ldr	w8, [x20, #12]
	str	w8, [x21]
	ldr	w8, [x20, #16]
	str	w8, [x21, #4]
	bl	_IS_MFCV6_PLUS
	ldr	x8, [x20, #24]
	ldr	x9, [x8]
	mov	w8, #0
	cbz	x0, LBB0_17
; %bb.13:
Lloh22:
	adrp	x10, _BANK_L_CTX@GOTPAGE
Lloh23:
	ldr	x10, [x10, _BANK_L_CTX@GOTPAGEOFF]
	b	LBB0_18
LBB0_14:
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_16
LBB0_15:
Lloh26:
	adrp	x0, l_.str.1@PAGE
Lloh27:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_16:
	bl	_mfc_err
Lloh28:
	adrp	x8, _EINVAL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w8, w8
	b	LBB0_19
LBB0_17:
Lloh31:
	adrp	x10, _BANK_R_CTX@GOTPAGE
Lloh32:
	ldr	x10, [x10, _BANK_R_CTX@GOTPAGEOFF]
LBB0_18:
	ldr	x10, [x10]
	lsl	x10, x10, #3
	ldr	x9, [x9, x10]
	str	x9, [x19]
	ldr	x9, [x20, #24]
	ldr	x9, [x9]
	ldr	x9, [x9, x10]
	str	x9, [x19, #8]
LBB0_19:
	mov	x0, x8
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,8,3 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
	.comm	_MFCINST_GOT_INST,8,3           ; @MFCINST_GOT_INST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid state: %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MFC_ENC_CAP_PLANE_COUNT,4,2    ; @MFC_ENC_CAP_PLANE_COUNT
	.comm	_MFC_MAX_BUFFERS,4,2            ; @MFC_MAX_BUFFERS
	.comm	_BANK_L_CTX,8,3                 ; @BANK_L_CTX
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,8,3 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
	.comm	_MFC_ENC_OUT_PLANE_COUNT,4,2    ; @MFC_ENC_OUT_PLANE_COUNT
	.comm	_BANK_R_CTX,8,3                 ; @BANK_R_CTX
l_.str.1:                               ; @.str.1
	.asciz	"invalid queue type: %d\n"

	.no_dead_strip	_s5p_mfc_queue_setup
.subsections_via_symbols
