	.file	"extr_videobuf-dma-sg.c_videobuf_dma_init_kernel.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"init kernel [%d pages]\n"
.LC1:
	.string	"vmalloc_32(%d pages) failed\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"vmalloc is at addr %p, size=%d\n"
	.text
	.p2align 4
	.type	videobuf_dma_init_kernel, @function
videobuf_dma_init_kernel:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xor	eax, eax
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, edx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, esi
	lea	rsi, .LC0[rip]
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	mov	edi, 1
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	dprintk@PLT
	mov	DWORD PTR [rbx], ebp
	mov	edx, DWORD PTR GFP_KERNEL[rip]
	mov	edi, r13d
	mov	esi, 4
	call	kcalloc@PLT
	mov	QWORD PTR 8[rbx], rax
	test	rax, rax
	je	.L18
	mov	edx, DWORD PTR GFP_KERNEL[rip]
	mov	esi, 4
	mov	edi, r13d
	call	kcalloc@PLT
	mov	QWORD PTR 16[rbx], rax
	test	rax, rax
	je	.L4
	test	r13d, r13d
	jle	.L12
	lea	r14d, -1[r13]
	xor	ebp, ebp
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	add	r15, QWORD PTR 8[rbx]
	lea	r12d, 1[rbp]
	call	virt_to_page@PLT
	lea	rdx, 1[rbp]
	mov	DWORD PTR [r15], eax
	cmp	rbp, r14
	je	.L5
	mov	rax, QWORD PTR 16[rbx]
	mov	rbp, rdx
.L6:
	mov	edi, DWORD PTR 24[rbx]
	mov	ecx, DWORD PTR GFP_KERNEL[rip]
	mov	r12d, ebp
	lea	r15, 0[0+rbp*4]
	mov	esi, DWORD PTR PAGE_SIZE[rip]
	lea	rdx, [rax+r15]
	call	dma_alloc_coherent@PLT
	mov	rdi, rax
	test	rax, rax
	jne	.L20
.L7:
	test	r12d, r12d
	je	.L11
	movsx	rax, r12d
	lea	edx, -1[r12]
	lea	rbp, -4[0+rax*4]
	sub	rax, rdx
	lea	r12, -8[0+rax*4]
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rax, QWORD PTR 8[rbx]
	mov	edi, DWORD PTR [rax+rbp]
	call	page_address@PLT
	mov	edi, DWORD PTR 24[rbx]
	mov	esi, DWORD PTR PAGE_SIZE[rip]
	mov	rdx, rax
	mov	rax, QWORD PTR 16[rbx]
	mov	ecx, DWORD PTR [rax+rbp]
	sub	rbp, 4
	call	dma_free_coherent@PLT
	cmp	r12, rbp
	jne	.L10
.L11:
	mov	rdi, QWORD PTR 16[rbx]
	call	kfree@PLT
	mov	QWORD PTR 16[rbx], 0
	mov	rdi, QWORD PTR 8[rbx]
	call	kfree@PLT
	mov	QWORD PTR 8[rbx], 0
.L18:
	mov	eax, DWORD PTR ENOMEM[rip]
	neg	eax
.L1:
	add	rsp, 8
	.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
.L12:
	.cfi_restore_state
	xor	r12d, r12d
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rdi, QWORD PTR 8[rbx]
	mov	ecx, DWORD PTR PAGE_KERNEL[rip]
	mov	esi, r13d
	mov	edx, DWORD PTR VM_MAP[rip]
	or	edx, DWORD PTR VM_IOREMAP[rip]
	call	vmap@PLT
	mov	QWORD PTR 32[rbx], rax
	test	rax, rax
	je	.L21
	mov	ecx, DWORD PTR PAGE_SHIFT[rip]
	mov	esi, r13d
	mov	edx, eax
	mov	edi, 1
	xor	eax, eax
	sal	esi, cl
	mov	ecx, esi
	lea	rsi, .LC2[rip]
	call	dprintk@PLT
	mov	ecx, DWORD PTR PAGE_SHIFT[rip]
	mov	edx, r13d
	xor	esi, esi
	mov	rdi, QWORD PTR 32[rbx]
	sal	edx, cl
	call	memset@PLT
	mov	DWORD PTR 4[rbx], r13d
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	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
.L4:
	.cfi_restore_state
	mov	rdi, QWORD PTR 8[rbx]
	call	kfree@PLT
	mov	eax, DWORD PTR ENOMEM[rip]
	neg	eax
	jmp	.L1
.L21:
	mov	edx, r13d
	lea	rsi, .LC1[rip]
	mov	edi, 1
	call	dprintk@PLT
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	videobuf_dma_init_kernel, .-videobuf_dma_init_kernel
	.comm	VM_MAP,4,4
	.comm	VM_IOREMAP,4,4
	.comm	PAGE_SIZE,4,4
	.comm	PAGE_SHIFT,4,4
	.comm	PAGE_KERNEL,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_videobuf-dma-sg.c_videobuf_dma_init_kernel.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"init kernel [%d pages]\012\000"
	.align	2
.LC1:
	.ascii	"vmalloc_32(%d pages) failed\012\000"
	.align	2
.LC2:
	.ascii	"vmalloc is at addr %p, size=%d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	videobuf_dma_init_kernel, %function
videobuf_dma_init_kernel:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r5, r0
	mov	r6, r2
	mov	r4, r1
	ldr	r8, .L22
	ldr	r1, .L22+4
	mov	r0, #1
	bl	dprintk
	mov	r0, r6
	mov	r1, #4
	ldr	r2, [r8]
	str	r4, [r5]
	bl	kcalloc
	cmp	r0, #0
	str	r0, [r5, #8]
	beq	.L18
	ldr	r2, [r8]
	mov	r1, #4
	mov	r0, r6
	bl	kcalloc
	cmp	r0, #0
	mov	r2, r0
	str	r0, [r5, #12]
	beq	.L4
	cmp	r6, #0
	mov	r4, #0
	ldrgt	r9, .L22+8
	bgt	.L5
	b	.L6
.L20:
	ldr	r7, [r5, #8]
	bl	virt_to_page
	str	r0, [r7, r4, lsl #2]
	add	r4, r4, #1
	cmp	r6, r4
	beq	.L6
	ldr	r2, [r5, #12]
.L5:
	ldr	r3, [r8]
	ldr	r1, [r9]
	ldr	r0, [r5, #16]
	add	r2, r2, r4, lsl #2
	bl	dma_alloc_coherent
	cmp	r0, #0
	bne	.L20
.L7:
	cmp	r4, #0
	beq	.L10
	ldr	r9, .L22+8
.L9:
	ldr	r3, [r5, #8]
	sub	r4, r4, #1
	ldr	r0, [r3, r4, lsl #2]
	bl	page_address
	ldr	r3, [r5, #12]
	mov	r2, r0
	ldr	r3, [r3, r4, lsl #2]
	ldr	r1, [r9]
	ldr	r0, [r5, #16]
	bl	dma_free_coherent
	cmp	r4, #0
	bne	.L9
.L10:
	mov	r4, #0
	ldr	r0, [r5, #12]
	bl	kfree
	ldr	r0, [r5, #8]
	str	r4, [r5, #12]
	bl	kfree
	ldr	r3, .L22+12
	str	r4, [r5, #8]
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L4:
	ldr	r0, [r5, #8]
	bl	kfree
.L18:
	ldr	r3, .L22+12
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L6:
	ldr	r2, .L22+16
	ldr	r3, .L22+20
	ldr	r1, [r2]
	ldr	r2, [r3]
	ldr	r3, .L22+24
	orr	r2, r1, r2
	ldr	r3, [r3]
	mov	r1, r6
	ldr	r0, [r5, #8]
	bl	vmap
	cmp	r0, #0
	mov	r2, r0
	str	r0, [r5, #20]
	beq	.L21
	ldr	r4, .L22+28
	ldr	r1, .L22+32
	ldr	r3, [r4]
	mov	r0, #1
	lsl	r3, r6, r3
	bl	dprintk
	ldr	r2, [r4]
	mov	r1, #0
	ldr	r0, [r5, #20]
	lsl	r2, r6, r2
	bl	memset
	mov	r0, #0
	str	r6, [r5, #4]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L21:
	mov	r2, r6
	ldr	r1, .L22+36
	mov	r0, #1
	bl	dprintk
	b	.L7
.L23:
	.align	2
.L22:
	.word	GFP_KERNEL
	.word	.LC0
	.word	PAGE_SIZE
	.word	ENOMEM
	.word	VM_MAP
	.word	VM_IOREMAP
	.word	PAGE_KERNEL
	.word	PAGE_SHIFT
	.word	.LC2
	.word	.LC1
	.size	videobuf_dma_init_kernel, .-videobuf_dma_init_kernel
	.comm	VM_MAP,4,4
	.comm	VM_IOREMAP,4,4
	.comm	PAGE_SIZE,4,4
	.comm	PAGE_SHIFT,4,4
	.comm	PAGE_KERNEL,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
