	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_s5p_mfc_alloc_priv_buf         ## -- Begin function s5p_mfc_alloc_priv_buf
	.p2align	4, 0x90
_s5p_mfc_alloc_priv_buf:                ## @s5p_mfc_alloc_priv_buf
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	(%rdx), %edx
	movl	%edx, %r15d
	movl	%r14d, %ecx
	sarl	%cl, %r15d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movl	(%rdi), %r12d
	movq	_SZ_64K@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str(%rip), %rsi
	movl	$3, %edi
	xorl	%eax, %eax
	callq	_mfc_debug
	cmpq	$0, 32(%r13)
	je	LBB0_4
## %bb.1:
	movl	%r14d, %ecx
	sarl	%cl, %ebx
	decl	%ebx
	sarl	%cl, %r12d
	movl	40(%r13), %edi
	movl	%r12d, %esi
	xorl	%edx, %edx
	movl	%r15d, %ecx
	movl	%ebx, %r8d
	callq	_bitmap_find_next_zero_area
	cmpl	%r12d, %eax
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	ja	LBB0_8
## %bb.2:
	movl	%eax, %ebx
	movl	40(%r13), %edi
	movl	%eax, %esi
	movl	%r15d, %edx
	callq	_bitmap_set
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	32(%r13), %rdx
	addq	%rbx, %rdx
	movq	%rdx, 24(%r12)
	addq	8(%r13), %rbx
	movq	%rbx, 8(%r12)
	jmp	LBB0_3
LBB0_4:
	movq	24(%r13), %rax
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, %ecx
	movq	(%rax,%rcx,8), %r15
	movq	16(%r13), %rax
	movq	(%rax,%rcx,8), %rbx
	movq	%rbx, -64(%rbp)
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movl	%edx, 16(%r12)
	movl	(%r12), %esi
	leaq	8(%r12), %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_dma_alloc_coherent
	movq	%rax, 24(%r12)
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	cmpq	%rbx, (%r14)
	jge	LBB0_6
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	leaq	-64(%rbp), %rdx
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_mfc_err
	movl	(%r12), %esi
	movq	24(%r12), %rdx
	movq	8(%r12), %rcx
	movq	%r15, %rdi
	callq	_dma_free_coherent
	jmp	LBB0_9
LBB0_8:
	movl	(%r12), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mfc_err
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_6:
	movq	%rax, %rdx
LBB0_3:
	addq	$8, %r12
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movl	$3, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	_mfc_debug
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_SZ_64K,4,2                     ## @SZ_64K
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Allocating priv: %zu\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"Invalid memory configuration - buffer (%pad) is below base memory address(%pad)\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"Allocated addr %p %pad\n"

L_.str.3:                               ## @.str.3
	.asciz	"Allocating private buffer of size %zu failed\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_s5p_mfc_alloc_priv_buf         ; -- Begin function s5p_mfc_alloc_priv_buf
	.p2align	2
_s5p_mfc_alloc_priv_buf:                ; @s5p_mfc_alloc_priv_buf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x24, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	w23, [x0]
	ldr	w25, [x24]
	ldr	w22, [x2]
Lloh2:
	adrp	x8, _SZ_64K@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SZ_64K@GOTPAGEOFF]
Lloh4:
	ldr	w26, [x8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #3
	mov	x2, x22
	bl	_mfc_debug
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_3
; %bb.1:
	asr	w21, w22, w25
	asr	w8, w26, w25
	sub	w4, w8, #1
	asr	w23, w23, w25
	ldr	w0, [x20, #40]
	mov	x1, x23
	mov	w2, #0
	mov	x3, x21
	bl	_bitmap_find_next_zero_area
	cmp	w0, w23
	b.hi	LBB0_6
; %bb.2:
	mov	x22, x0
	ldr	w0, [x20, #40]
	mov	x1, x22
	mov	x2, x21
	bl	_bitmap_set
	ldr	w8, [x24]
	lsl	w8, w22, w8
	ldr	x9, [x20, #32]
	add	x2, x9, x8
	str	x2, [x19, #24]
	ldr	x9, [x20, #8]
	add	x8, x9, x8
	str	x8, [x19, #8]
	b	LBB0_9
LBB0_3:
	mov	w8, w21
	lsl	x8, x8, #3
	ldp	x10, x9, [x20, #16]
	ldr	x20, [x9, x8]
	ldr	x22, [x10, x8]
	str	x22, [sp, #24]
	str	w21, [x19, #16]
	ldr	w1, [x19]
	add	x21, x19, #8
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x2, x21
	bl	_dma_alloc_coherent
	str	x0, [x19, #24]
	cbz	x0, LBB0_6
; %bb.4:
	ldr	x8, [x21]
	cmp	x8, x22
	b.ge	LBB0_8
; %bb.5:
	add	x8, sp, #24
	stp	x21, x8, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_mfc_err
	ldr	w1, [x19]
	ldr	x2, [x19, #24]
	ldr	x3, [x19, #8]
	mov	x0, x20
	bl	_dma_free_coherent
	b	LBB0_7
LBB0_6:
	ldr	w8, [x19]
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_mfc_err
LBB0_7:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_8:
	mov	x2, x0
LBB0_9:
	add	x8, x19, #8
	str	x8, [sp]
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #3
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_mfc_debug
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_SZ_64K,4,2                     ; @SZ_64K
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Allocating priv: %zu\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"Invalid memory configuration - buffer (%pad) is below base memory address(%pad)\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"Allocated addr %p %pad\n"

l_.str.3:                               ; @.str.3
	.asciz	"Allocating private buffer of size %zu failed\n"

.subsections_via_symbols
