	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5p_mfc_configure_common_memory
_s5p_mfc_configure_common_memory:       ## @s5p_mfc_configure_common_memory
	.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	40(%rdi), %r14
	movq	_SZ_4M@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_CONFIG_DMA_CMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_IS_ENABLED
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_exynos_is_iommu_available
	testq	%rax, %rax
	je	LBB0_3
LBB0_2:
	movq	_SZ_8M@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
LBB0_3:
	movq	_mfc_mem_size@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	xorl	%esi, %esi
	callq	_memparse
	movq	%rax, %r15
LBB0_5:
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %r12
	movb	(%r12), %cl
	movq	%r15, %rdi
	shrq	%cl, %rdi
	callq	_BITS_TO_LONGS
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%rax,8), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_kzalloc
	movl	%eax, 32(%rbx)
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movl	(%r13), %ecx
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_dma_alloc_coherent
	movl	%eax, 36(%rbx)
	testl	%eax, %eax
	je	LBB0_8
## %bb.12:
	movq	%r15, 8(%rbx)
	movl	(%rbx), %eax
	movq	16(%rbx), %rcx
	movq	_BANK_L_CTX@GOTPCREL(%rip), %r13
	movq	(%r13), %rdx
	movl	%eax, (%rcx,%rdx,4)
	movl	(%rbx), %eax
	movq	_BANK_R_CTX@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%eax, (%rcx,%rdx,4)
	cmpl	$0, (%rbx)
	jne	LBB0_14
## %bb.13:
	movq	_MFC_BASE_ALIGN_ORDER@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$1, %r13d
	shll	%cl, %r13d
	movl	32(%rbx), %edi
	movb	(%r12), %cl
	movl	%r13d, %edx
	shrl	%cl, %edx
	xorl	%esi, %esi
	callq	_bitmap_set
	movq	16(%rbx), %rax
	movq	_BANK_L_CTX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addl	%r13d, (%rax,%rcx,4)
	movq	_BANK_R_CTX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addl	%r13d, (%rax,%rcx,4)
	movq	_BANK_L_CTX@GOTPCREL(%rip), %r13
LBB0_14:
	movq	%rbx, %rdi
	callq	_s5p_mfc_alloc_firmware
	movq	24(%rbx), %rax
	movq	_BANK_R_CTX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%r14, (%rax,%rcx,8)
	movq	24(%rbx), %rax
	movq	(%r13), %rcx
	movq	%r14, (%rax,%rcx,8)
	movl	$32, %edi
	callq	_DMA_BIT_MASK
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_vb2_dma_contig_set_max_seg_size
	movq	_SZ_1M@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%r15, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_15
## %bb.16:
	movq	%r15, %rax
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_17
LBB0_8:
	movl	32(%rbx), %edi
	callq	_kfree
	movq	_SZ_1M@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%r15, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_9
## %bb.10:
	movq	%r15, %rax
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_11
LBB0_15:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_17:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movq	%rax, %rdx
	callq	_dev_info
	xorl	%eax, %eax
	jmp	LBB0_18
LBB0_9:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_11:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movq	%rax, %rdx
	callq	_dev_err
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SZ_4M,8,3                      ## @SZ_4M
	.comm	_CONFIG_DMA_CMA,4,2             ## @CONFIG_DMA_CMA
	.comm	_SZ_8M,8,3                      ## @SZ_8M
	.comm	_mfc_mem_size,8,3               ## @mfc_mem_size
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to preallocate %ld MiB for the firmware and context buffers\n"

	.comm	_SZ_1M,8,3                      ## @SZ_1M
	.comm	_BANK_L_CTX,8,3                 ## @BANK_L_CTX
	.comm	_BANK_R_CTX,8,3                 ## @BANK_R_CTX
	.comm	_MFC_BASE_ALIGN_ORDER,4,2       ## @MFC_BASE_ALIGN_ORDER
L_.str.1:                               ## @.str.1
	.asciz	"preallocated %ld MiB buffer for the firmware and context buffers\n"

	.no_dead_strip	_s5p_mfc_configure_common_memory
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5p_mfc_configure_common_memory
_s5p_mfc_configure_common_memory:       ; @s5p_mfc_configure_common_memory
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x0
	ldr	x19, [x0, #40]
Lloh0:
	adrp	x8, _SZ_4M@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SZ_4M@GOTPAGEOFF]
Lloh2:
	ldr	x20, [x8]
Lloh3:
	adrp	x8, _CONFIG_DMA_CMA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CONFIG_DMA_CMA@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_IS_ENABLED
	cbnz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_exynos_is_iommu_available
	cbz	x0, LBB0_3
LBB0_2:
Lloh6:
	adrp	x8, _SZ_8M@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SZ_8M@GOTPAGEOFF]
Lloh8:
	ldr	x20, [x8]
LBB0_3:
Lloh9:
	adrp	x8, _mfc_mem_size@GOTPAGE
Lloh10:
	ldr	x8, [x8, _mfc_mem_size@GOTPAGEOFF]
Lloh11:
	ldr	x0, [x8]
	cbz	x0, LBB0_5
; %bb.4:
	mov	x1, #0
	bl	_memparse
	mov	x20, x0
LBB0_5:
Lloh12:
	adrp	x22, _PAGE_SHIFT@GOTPAGE
Lloh13:
	ldr	x22, [x22, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	x8, [x22]
	lsr	x0, x20, x8
	bl	_BITS_TO_LONGS
	lsl	w0, w0, #3
Lloh14:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh15:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_kzalloc
	str	w0, [x21, #32]
	cbz	w0, LBB0_11
; %bb.6:
	ldr	w3, [x23]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_dma_alloc_coherent
	str	w0, [x21, #36]
	cbz	w0, LBB0_10
; %bb.7:
	str	x20, [x21, #8]
	ldr	w8, [x21]
	ldr	x9, [x21, #16]
Lloh16:
	adrp	x23, _BANK_L_CTX@GOTPAGE
Lloh17:
	ldr	x23, [x23, _BANK_L_CTX@GOTPAGEOFF]
	ldr	x10, [x23]
	str	w8, [x9, x10, lsl #2]
	ldr	w8, [x21]
Lloh18:
	adrp	x24, _BANK_R_CTX@GOTPAGE
Lloh19:
	ldr	x24, [x24, _BANK_R_CTX@GOTPAGEOFF]
	ldr	x10, [x24]
	str	w8, [x9, x10, lsl #2]
	ldr	w8, [x21]
	cbnz	w8, LBB0_9
; %bb.8:
Lloh20:
	adrp	x8, _MFC_BASE_ALIGN_ORDER@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MFC_BASE_ALIGN_ORDER@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	mov	w9, #1
	lsl	w25, w9, w8
	ldr	w0, [x21, #32]
	ldr	w8, [x22]
	lsr	w2, w25, w8
	mov	w1, #0
	bl	_bitmap_set
	ldr	x8, [x21, #16]
	ldr	x9, [x23]
	lsl	x9, x9, #2
	ldr	w10, [x8, x9]
	add	w10, w10, w25
	str	w10, [x8, x9]
	ldr	x9, [x24]
	lsl	x9, x9, #2
	ldr	w10, [x8, x9]
	add	w10, w10, w25
	str	w10, [x8, x9]
LBB0_9:
	mov	x0, x21
	bl	_s5p_mfc_alloc_firmware
	ldr	x8, [x21, #24]
	ldr	x9, [x24]
	str	x19, [x8, x9, lsl #3]
	ldr	x8, [x21, #24]
	ldr	x9, [x23]
	str	x19, [x8, x9, lsl #3]
	mov	w0, #32
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x19
	bl	_vb2_dma_contig_set_max_seg_size
Lloh23:
	adrp	x8, _SZ_1M@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SZ_1M@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	udiv	x2, x20, x8
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_info
	mov	w0, #0
	b	LBB0_12
LBB0_10:
	ldr	w0, [x21, #32]
	bl	_kfree
Lloh28:
	adrp	x8, _SZ_1M@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SZ_1M@GOTPAGEOFF]
Lloh30:
	ldr	x8, [x8]
	udiv	x2, x20, x8
Lloh31:
	adrp	x1, l_.str@PAGE
Lloh32:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_11:
Lloh33:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_SZ_4M,8,3                      ; @SZ_4M
	.comm	_CONFIG_DMA_CMA,4,2             ; @CONFIG_DMA_CMA
	.comm	_SZ_8M,8,3                      ; @SZ_8M
	.comm	_mfc_mem_size,8,3               ; @mfc_mem_size
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to preallocate %ld MiB for the firmware and context buffers\n"

	.comm	_SZ_1M,8,3                      ; @SZ_1M
	.comm	_BANK_L_CTX,8,3                 ; @BANK_L_CTX
	.comm	_BANK_R_CTX,8,3                 ; @BANK_R_CTX
	.comm	_MFC_BASE_ALIGN_ORDER,4,2       ; @MFC_BASE_ALIGN_ORDER
l_.str.1:                               ; @.str.1
	.asciz	"preallocated %ld MiB buffer for the firmware and context buffers\n"

	.no_dead_strip	_s5p_mfc_configure_common_memory
.subsections_via_symbols
