	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5p_mfc_alloc_instance_buffer_v5
_s5p_mfc_alloc_instance_buffer_v5:      ## @s5p_mfc_alloc_instance_buffer_v5
	.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	%rdi, %rbx
	movq	(%rdi), %rax
	movq	40(%rdi), %r15
	movq	8(%r15), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx), %r13
	movq	_S5P_MFC_CODEC_H264_DEC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%cl
	movq	_S5P_MFC_CODEC_H264_ENC@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	sete	%al
	orb	%cl, %al
	movzbl	%al, %eax
	movl	4(%r13,%rax,4), %eax
	leaq	24(%rdi), %r12
	movl	%eax, 36(%rdi)
	movq	_BANK_L_CTX@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_s5p_mfc_alloc_priv_buf
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rdi
	callq	_mfc_err
	jmp	LBB0_5
LBB0_2:
	movl	28(%rbx), %edi
	callq	_OFFSETA
	movl	%eax, 24(%rbx)
	movl	32(%rbx), %edi
	movl	36(%rbx), %edx
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_memset
	xorl	%eax, %eax
	callq	_wmb
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movl	(%r13), %eax
	leaq	8(%rbx), %rdx
	movl	%eax, 20(%rbx)
	movq	_BANK_L_CTX@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_s5p_mfc_alloc_priv_buf
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rdi
	callq	_mfc_err
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_s5p_mfc_release_priv_buf
	movl	%r13d, %r14d
	jmp	LBB0_5
LBB0_4:
	movl	12(%rbx), %eax
	movq	(%r15), %rcx
	movq	_BANK_L_CTX@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	subl	(%rcx,%rdx,4), %eax
	movl	%eax, 8(%rbx)
	movq	_MFC_BANK1_ALIGN_ORDER@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$-1, %edi
	shll	%cl, %edi
	notl	%edi
	andl	%eax, %edi
	callq	_BUG_ON
	movl	16(%rbx), %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_memset
	xorl	%eax, %eax
	callq	_wmb
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_S5P_MFC_CODEC_H264_DEC,8,3     ## @S5P_MFC_CODEC_H264_DEC
	.comm	_S5P_MFC_CODEC_H264_ENC,8,3     ## @S5P_MFC_CODEC_H264_ENC
	.comm	_BANK_L_CTX,8,3                 ## @BANK_L_CTX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate instance buffer\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate shared memory buffer\n"

	.comm	_MFC_BANK1_ALIGN_ORDER,4,2      ## @MFC_BANK1_ALIGN_ORDER
	.no_dead_strip	_s5p_mfc_alloc_instance_buffer_v5
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5p_mfc_alloc_instance_buffer_v5
_s5p_mfc_alloc_instance_buffer_v5:      ; @s5p_mfc_alloc_instance_buffer_v5
	.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, x0
	ldr	x20, [x0, #40]
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	ldr	x23, [x8]
Lloh0:
	adrp	x8, _S5P_MFC_CODEC_H264_DEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _S5P_MFC_CODEC_H264_DEC@GOTPAGEOFF]
	ldr	x9, [x0]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x10, _S5P_MFC_CODEC_H264_ENC@GOTPAGE
Lloh4:
	ldr	x10, [x10, _S5P_MFC_CODEC_H264_ENC@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x9, x10
	ccmp	x9, x8, #4, ne
	mov	w8, #4
	mov	w9, #8
	csel	x8, x9, x8, eq
	ldr	w8, [x23, x8]
	add	x21, x0, #24
	str	w8, [x0, #36]
Lloh6:
	adrp	x24, _BANK_L_CTX@GOTPAGE
Lloh7:
	ldr	x24, [x24, _BANK_L_CTX@GOTPAGEOFF]
	ldr	x1, [x24]
	mov	x0, x20
	mov	x2, x21
	bl	_s5p_mfc_alloc_priv_buf
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_mfc_err
	b	LBB0_5
LBB0_2:
	ldr	w0, [x19, #28]
	bl	_OFFSETA
	str	w0, [x19, #24]
	ldp	w0, w2, [x19, #32]
	mov	w1, #0
	bl	_memset
	bl	_wmb
	ldr	w8, [x23]
	add	x2, x19, #8
	str	w8, [x19, #20]
	ldr	x1, [x24]
	mov	x0, x20
	bl	_s5p_mfc_alloc_priv_buf
	mov	x22, x0
	cbz	w0, LBB0_4
; %bb.3:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_mfc_err
	mov	x0, x20
	mov	x1, x21
	bl	_s5p_mfc_release_priv_buf
	b	LBB0_5
LBB0_4:
	ldr	w8, [x19, #12]
	ldr	x9, [x20]
	ldr	x10, [x24]
	ldr	w9, [x9, x10, lsl #2]
Lloh12:
	adrp	x10, _MFC_BANK1_ALIGN_ORDER@GOTPAGE
Lloh13:
	ldr	x10, [x10, _MFC_BANK1_ALIGN_ORDER@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	mov	w11, #-1
	lsl	w10, w11, w10
	sub	w8, w8, w9
	bic	w0, w8, w10
	str	w8, [x19, #8]
	bl	_BUG_ON
	ldr	w0, [x19, #16]
	ldr	w2, [x23]
	mov	w1, #0
	bl	_memset
	bl	_wmb
LBB0_5:
	mov	x0, x22
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_S5P_MFC_CODEC_H264_DEC,8,3     ; @S5P_MFC_CODEC_H264_DEC
	.comm	_S5P_MFC_CODEC_H264_ENC,8,3     ; @S5P_MFC_CODEC_H264_ENC
	.comm	_BANK_L_CTX,8,3                 ; @BANK_L_CTX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate instance buffer\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate shared memory buffer\n"

	.comm	_MFC_BANK1_ALIGN_ORDER,4,2      ; @MFC_BANK1_ALIGN_ORDER
	.no_dead_strip	_s5p_mfc_alloc_instance_buffer_v5
.subsections_via_symbols
