	.file	"extr_s5p_mfc_opr.c_s5p_mfc_alloc_priv_buf.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Allocating priv: %zu\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"Invalid memory configuration - buffer (%pad) is below base memory address(%pad)\n"
	.section	.rodata.str1.1
.LC2:
	.string	"Allocated addr %p %pad\n"
	.section	.rodata.str1.8
	.align 8
.LC3:
	.string	"Allocating private buffer of size %zu failed\n"
	.text
	.p2align 4
	.globl	s5p_mfc_alloc_priv_buf
	.type	s5p_mfc_alloc_priv_buf, @function
s5p_mfc_alloc_priv_buf:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, esi
	lea	rsi, .LC0[rip]
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdx
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	r13d, DWORD PTR [rdx]
	mov	r15d, DWORD PTR PAGE_SHIFT[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR [rdi]
	mov	edi, 3
	mov	r14d, DWORD PTR SZ_64K[rip]
	mov	edx, r13d
	mov	DWORD PTR 12[rsp], eax
	xor	eax, eax
	call	mfc_debug@PLT
	cmp	QWORD PTR 32[rbp], 0
	je	.L2
	mov	ecx, r15d
	mov	esi, DWORD PTR 12[rsp]
	mov	edi, DWORD PTR 40[rbp]
	xor	edx, edx
	sar	r14d, cl
	sar	r13d, cl
	sar	esi, cl
	lea	r8d, -1[r14]
	mov	ecx, r13d
	mov	DWORD PTR 12[rsp], esi
	call	bitmap_find_next_zero_area@PLT
	mov	esi, DWORD PTR 12[rsp]
	mov	r12d, eax
	cmp	esi, eax
	jnb	.L11
.L3:
	mov	esi, DWORD PTR [rbx]
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	mfc_err@PLT
	mov	eax, DWORD PTR ENOMEM[rip]
	neg	eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rdx, QWORD PTR 24[rbp]
	mov	eax, r12d
	mov	ecx, DWORD PTR GFP_KERNEL[rip]
	mov	esi, DWORD PTR [rbx]
	mov	r13, QWORD PTR [rdx+rax*8]
	mov	rdx, QWORD PTR 16[rbp]
	mov	rax, QWORD PTR [rdx+rax*8]
	mov	DWORD PTR 16[rbx], r12d
	lea	r12, 8[rbx]
	mov	rdi, r13
	mov	rdx, r12
	mov	QWORD PTR 16[rsp], rax
	call	dma_alloc_coherent@PLT
	mov	QWORD PTR 24[rbx], rax
	mov	rdx, rax
	test	rax, rax
	je	.L3
	mov	rax, QWORD PTR 16[rsp]
	cmp	QWORD PTR 8[rbx], rax
	jl	.L12
.L4:
	mov	rcx, r12
	lea	rsi, .LC2[rip]
	mov	edi, 3
	xor	eax, eax
	call	mfc_debug@PLT
	xor	eax, eax
.L1:
	mov	rcx, QWORD PTR 24[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L13
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	edi, DWORD PTR 40[rbp]
	mov	edx, r13d
	mov	esi, eax
	call	bitmap_set@PLT
	mov	ecx, DWORD PTR PAGE_SHIFT[rip]
	mov	rdx, QWORD PTR 32[rbp]
	sal	r12d, cl
	add	rdx, r12
	add	r12, QWORD PTR 8[rbp]
	mov	QWORD PTR 8[rbx], r12
	lea	r12, 8[rbx]
	mov	QWORD PTR 24[rbx], rdx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	lea	rdx, 16[rsp]
	mov	rsi, r12
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	mfc_err@PLT
	mov	rcx, QWORD PTR 8[rbx]
	mov	rdx, QWORD PTR 24[rbx]
	mov	rdi, r13
	mov	esi, DWORD PTR [rbx]
	call	dma_free_coherent@PLT
	mov	eax, DWORD PTR ENOMEM[rip]
	neg	eax
	jmp	.L1
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	s5p_mfc_alloc_priv_buf, .-s5p_mfc_alloc_priv_buf
	.comm	SZ_64K,4,4
	.comm	PAGE_SHIFT,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_s5p_mfc_opr.c_s5p_mfc_alloc_priv_buf.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Allocating priv: %zu\012\000"
	.align	2
.LC1:
	.ascii	"Invalid memory configuration - buffer (%pad) is bel"
	.ascii	"ow base memory address(%pad)\012\000"
	.align	2
.LC2:
	.ascii	"Allocated addr %p %pad\012\000"
	.align	2
.LC3:
	.ascii	"Allocating private buffer of size %zu failed\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	s5p_mfc_alloc_priv_buf
	.syntax unified
	.arm
	.fpu softvfp
	.type	s5p_mfc_alloc_priv_buf, %function
s5p_mfc_alloc_priv_buf:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	ldr	r7, [r2]
	ldr	r3, .L14
	ldr	ip, .L14+4
	ldr	r9, .L14+8
	sub	sp, sp, #20
	mov	r5, r2
	mov	r6, r1
	mov	r2, r7
	mov	r0, #3
	ldr	r1, .L14+12
	ldr	r8, [r3]
	ldr	ip, [ip]
	str	ip, [sp, #12]
	mov	ip,#0
	ldr	r10, [r4]
	ldr	fp, [r9]
	bl	mfc_debug
	ldr	r3, [r4, #16]
	cmp	r3, #0
	beq	.L2
	asr	r8, r8, fp
	sub	r8, r8, #1
	asr	r10, r10, fp
	str	r8, [sp]
	asr	r7, r7, fp
	mov	r3, r7
	mov	r1, r10
	mov	r2, #0
	ldr	r0, [r4, #20]
	bl	bitmap_find_next_zero_area
	cmp	r10, r0
	mov	r6, r0
	bcs	.L11
.L3:
	ldr	r1, [r5]
	ldr	r0, .L14+16
	bl	mfc_err
	ldr	r3, .L14+20
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L2:
	mov	r8, r5
	ldr	r3, [r4, #12]
	ldr	r2, [r4, #8]
	ldr	r1, [r8], #4
	ldr	r4, [r3, r6, lsl #2]
	ldr	r3, .L14+24
	ldr	ip, [r2, r6, lsl #2]
	mov	r0, r4
	mov	r2, r8
	ldr	r3, [r3]
	str	r6, [r5, #8]
	str	ip, [sp, #8]
	bl	dma_alloc_coherent
	cmp	r0, #0
	mov	r2, r0
	str	r0, [r5, #12]
	beq	.L3
	ldr	r1, [r5, #4]
	ldr	r3, [sp, #8]
	cmp	r1, r3
	blt	.L12
.L4:
	mov	r3, r8
	mov	r0, #3
	ldr	r1, .L14+28
	bl	mfc_debug
	mov	r0, #0
.L1:
	ldr	r3, .L14+4
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L13
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L11:
	mov	r8, r5
	mov	r1, r0
	mov	r2, r7
	ldr	r0, [r4, #20]
	bl	bitmap_set
	ldr	r1, [r9]
	ldr	r2, [r4, #16]
	ldr	r3, [r4, #4]
	lsl	r6, r6, r1
	add	r2, r6, r2
	add	r6, r3, r6
	str	r2, [r5, #12]
	str	r6, [r8, #4]!
	b	.L4
.L12:
	mov	r1, r8
	add	r2, sp, #8
	ldr	r0, .L14+32
	bl	mfc_err
	ldr	r3, [r5, #4]
	mov	r0, r4
	ldr	r2, [r5, #12]
	ldr	r1, [r5]
	bl	dma_free_coherent
	ldr	r3, .L14+20
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L13:
	bl	__stack_chk_fail
.L15:
	.align	2
.L14:
	.word	SZ_64K
	.word	.LC4
	.word	PAGE_SHIFT
	.word	.LC0
	.word	.LC3
	.word	ENOMEM
	.word	GFP_KERNEL
	.word	.LC2
	.word	.LC1
	.size	s5p_mfc_alloc_priv_buf, .-s5p_mfc_alloc_priv_buf
	.comm	SZ_64K,4,4
	.comm	PAGE_SHIFT,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
