	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5p_mfc_configure_2port_memory
_s5p_mfc_configure_2port_memory:        ## @s5p_mfc_configure_2port_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	_MFC_BASE_ALIGN_ORDER@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$1, %r13d
	shll	%cl, %r13d
	movq	%rdi, %r14
	movq	24(%rdi), %rbx
	movq	_BANK_L_CTX@GOTPCREL(%rip), %r15
	movq	(%r15), %rdx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_s5p_mfc_alloc_memdev
	movq	(%r14), %rcx
	movq	(%r15), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	(%r14), %rax
	cmpq	$0, (%rax,%rdx,8)
	je	LBB0_1
## %bb.3:
	movq	_BANK_R_CTX@GOTPCREL(%rip), %r12
	movq	(%r12), %rdx
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_s5p_mfc_alloc_memdev
	movq	(%r14), %rcx
	movq	(%r12), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	(%r14), %rax
	cmpq	$0, (%rax,%rdx,8)
	je	LBB0_4
## %bb.5:
	movq	%r14, %rdi
	callq	_s5p_mfc_alloc_firmware
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	movq	(%r14), %rax
	movq	(%r12), %rcx
	movq	(%rax,%rcx,8), %rdi
	callq	_device_unregister
	movq	(%r14), %rax
	movq	(%r15), %rcx
	movq	(%rax,%rcx,8), %rdi
	callq	_device_unregister
	jmp	LBB0_10
LBB0_4:
	movq	(%r15), %rcx
	movq	(%rax,%rcx,8), %rdi
	callq	_device_unregister
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movslq	%r13d, %rbx
	movq	8(%r14), %rax
	movq	16(%r14), %rcx
	movq	(%r15), %rdx
	movq	%rcx, (%rax,%rdx,8)
	movq	(%r14), %rax
	movq	(%r12), %rcx
	movq	(%rax,%rcx,8), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rsi
	callq	_dma_alloc_coherent
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	-48(%rbp), %rcx
	subq	%rbx, %rcx
	movq	8(%r14), %rdx
	movq	(%r12), %rsi
	movq	%rcx, (%rdx,%rsi,8)
	movq	(%r14), %rcx
	movq	(%r12), %rdx
	movq	(%rcx,%rdx,8), %rdi
	movq	-48(%rbp), %rcx
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_dma_free_coherent
	movq	(%r14), %rax
	movq	(%r15), %rcx
	movq	(%rax,%rcx,8), %rbx
	movl	$32, %edi
	callq	_DMA_BIT_MASK
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_vb2_dma_contig_set_max_seg_size
	movq	(%r14), %rax
	movq	(%r12), %rcx
	movq	(%rax,%rcx,8), %rbx
	movl	$32, %edi
	callq	_DMA_BIT_MASK
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_vb2_dma_contig_set_max_seg_size
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str.2(%rip), %rdi
	callq	_mfc_err
	movq	%r14, %rdi
	callq	_s5p_mfc_release_firmware
	movq	(%r14), %rax
	movq	(%r12), %rcx
	movq	(%rax,%rcx,8), %rdi
	callq	_device_unregister
	movq	(%r14), %rax
	movq	(%r15), %rcx
	movq	(%rax,%rcx,8), %rdi
	callq	_device_unregister
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_MFC_BASE_ALIGN_ORDER,4,2       ## @MFC_BASE_ALIGN_ORDER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"left"

	.comm	_BANK_L_CTX,8,3                 ## @BANK_L_CTX
	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"right"

	.comm	_BANK_R_CTX,8,3                 ## @BANK_R_CTX
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.2:                               ## @.str.2
	.asciz	"Allocating bank2 base failed\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_s5p_mfc_configure_2port_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_2port_memory
_s5p_mfc_configure_2port_memory:        ; @s5p_mfc_configure_2port_memory
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	ldr	x20, [x0, #24]
Lloh0:
	adrp	x8, _MFC_BASE_ALIGN_ORDER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MFC_BASE_ALIGN_ORDER@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
Lloh3:
	adrp	x21, _BANK_L_CTX@GOTPAGE
Lloh4:
	ldr	x21, [x21, _BANK_L_CTX@GOTPAGEOFF]
	ldr	x2, [x21]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_s5p_mfc_alloc_memdev
	ldr	x8, [x19]
	ldr	x9, [x21]
	lsl	x9, x9, #3
	str	x0, [x8, x9]
	ldr	x8, [x19]
	ldr	x8, [x8, x9]
	cbz	x8, LBB0_5
; %bb.1:
Lloh7:
	adrp	x22, _BANK_R_CTX@GOTPAGE
Lloh8:
	ldr	x22, [x22, _BANK_R_CTX@GOTPAGEOFF]
	ldr	x2, [x22]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_s5p_mfc_alloc_memdev
	ldr	x8, [x19]
	ldr	x9, [x22]
	lsl	x9, x9, #3
	str	x0, [x8, x9]
	ldr	x8, [x19]
	ldr	x9, [x8, x9]
	cbz	x9, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_s5p_mfc_alloc_firmware
	cbz	w0, LBB0_8
; %bb.3:
	mov	x20, x0
	ldr	x8, [x19]
	ldr	x9, [x22]
	ldr	x0, [x8, x9, lsl #3]
	bl	_device_unregister
	ldr	x8, [x19]
	ldr	x9, [x21]
	ldr	x0, [x8, x9, lsl #3]
	bl	_device_unregister
	b	LBB0_7
LBB0_4:
	ldr	x9, [x21]
	ldr	x0, [x8, x9, lsl #3]
	bl	_device_unregister
LBB0_5:
Lloh11:
	adrp	x8, _ENODEV@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_7:
	mov	x0, x20
	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
	add	sp, sp, #80
	ret
LBB0_8:
	mov	w8, #1
	lsl	w8, w8, w23
	sxtw	x20, w8
	ldp	x10, x8, [x19, #8]
	ldr	x9, [x21]
	ldr	x11, [x19]
	str	x8, [x10, x9, lsl #3]
	ldr	x8, [x22]
	ldr	x0, [x11, x8, lsl #3]
Lloh13:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
	add	x2, sp, #8
	mov	x1, x20
	bl	_dma_alloc_coherent
	cbz	x0, LBB0_10
; %bb.9:
	mov	x2, x0
	ldr	x8, [sp, #8]
	sub	x8, x8, x20
	ldr	x9, [x22]
	ldp	x11, x10, [x19]
	str	x8, [x10, x9, lsl #3]
	ldr	x8, [x22]
	ldr	x0, [x11, x8, lsl #3]
	ldr	x3, [sp, #8]
	mov	x1, x20
	bl	_dma_free_coherent
	ldr	x8, [x19]
	ldr	x9, [x21]
	ldr	x20, [x8, x9, lsl #3]
	mov	w0, #32
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x20
	bl	_vb2_dma_contig_set_max_seg_size
	ldr	x8, [x19]
	ldr	x9, [x22]
	ldr	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
	mov	w20, #0
	b	LBB0_7
LBB0_10:
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_mfc_err
	mov	x0, x19
	bl	_s5p_mfc_release_firmware
	ldr	x8, [x19]
	ldr	x9, [x22]
	ldr	x0, [x8, x9, lsl #3]
	bl	_device_unregister
	ldr	x8, [x19]
	ldr	x9, [x21]
	ldr	x0, [x8, x9, lsl #3]
	bl	_device_unregister
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_MFC_BASE_ALIGN_ORDER,4,2       ; @MFC_BASE_ALIGN_ORDER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"left"

	.comm	_BANK_L_CTX,8,3                 ; @BANK_L_CTX
	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"right"

	.comm	_BANK_R_CTX,8,3                 ; @BANK_R_CTX
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.2:                               ; @.str.2
	.asciz	"Allocating bank2 base failed\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_s5p_mfc_configure_2port_memory
.subsections_via_symbols
