	.file	"extr_virtio_console.c_free_buf.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	free_buf, @function
free_buf:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	eax, DWORD PTR [rdi]
	test	eax, eax
	je	.L2
	xor	ebx, ebx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L13:
	call	put_page@PLT
	add	ebx, 1
	cmp	DWORD PTR 0[rbp], ebx
	jbe	.L2
.L3:
	mov	rdx, QWORD PTR 32[rbp]
	mov	eax, ebx
	lea	rdi, [rdx+rax*4]
	call	sg_page@PLT
	mov	rdi, rax
	test	rax, rax
	jne	.L13
.L2:
	mov	edi, DWORD PTR 4[rbp]
	test	edi, edi
	je	.L14
	cmp	QWORD PTR is_rproc_enabled[rip], 0
	je	.L5
	test	r12d, r12d
	je	.L15
	mov	ecx, DWORD PTR 8[rbp]
	mov	rdx, QWORD PTR 16[rbp]
	mov	esi, DWORD PTR 24[rbp]
	call	dma_free_coherent@PLT
	mov	edi, DWORD PTR 4[rbp]
	call	put_device@PLT
.L5:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	kfree@PLT
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	rdi, QWORD PTR 16[rbp]
	call	kfree@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	kfree@PLT
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	xor	r12d, r12d
	lea	rdi, dma_bufs_lock[rip]
	mov	rsi, r12
	call	spin_lock_irqsave@PLT
	lea	rdi, 28[rbp]
	lea	rsi, pending_free_dma_bufs[rip]
	call	list_add_tail@PLT
	pop	rbx
	.cfi_def_cfa_offset 24
	mov	rsi, r12
	pop	rbp
	.cfi_def_cfa_offset 16
	lea	rdi, dma_bufs_lock[rip]
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	spin_unlock_irqrestore@PLT
	.cfi_endproc
.LFE0:
	.size	free_buf, .-free_buf
	.comm	pending_free_dma_bufs,4,4
	.comm	is_rproc_enabled,8,8
	.comm	dma_bufs_lock,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_virtio_console.c_free_buf.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	free_buf, %function
free_buf:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r0]
	push	{r4, r5, r6, lr}
	cmp	r3, #0
	mov	r5, r0
	mov	r6, r1
	beq	.L2
	mov	r4, #0
	b	.L3
.L19:
	bl	put_page
	ldr	r3, [r5]
	cmp	r3, r4
	bls	.L2
.L3:
	ldr	r0, [r5, #24]
	add	r0, r0, r4, lsl #2
	bl	sg_page
	cmp	r0, #0
	add	r4, r4, #1
	bne	.L19
.L2:
	ldr	r0, [r5, #4]
	cmp	r0, #0
	beq	.L20
	ldr	r3, .L22
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L5
	cmp	r6, #0
	beq	.L21
	ldr	r3, [r5, #8]
	ldr	r2, [r5, #12]
	ldr	r1, [r5, #16]
	bl	dma_free_coherent
	ldr	r0, [r5, #4]
	bl	put_device
.L5:
	mov	r0, r5
	pop	{r4, r5, r6, lr}
	b	kfree
.L20:
	ldr	r0, [r5, #12]
	bl	kfree
	mov	r0, r5
	pop	{r4, r5, r6, lr}
	b	kfree
.L21:
	mov	r4, #0
	ldr	r0, .L22+4
	mov	r1, r4
	bl	spin_lock_irqsave
	ldr	r1, .L22+8
	add	r0, r5, #20
	bl	list_add_tail
	mov	r1, r4
	pop	{r4, r5, r6, lr}
	ldr	r0, .L22+4
	b	spin_unlock_irqrestore
.L23:
	.align	2
.L22:
	.word	is_rproc_enabled
	.word	dma_bufs_lock
	.word	pending_free_dma_bufs
	.size	free_buf, .-free_buf
	.comm	pending_free_dma_bufs,4,4
	.comm	is_rproc_enabled,4,4
	.comm	dma_bufs_lock,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
