	.file	"extr_saa7146_vbi.c_buffer_prepare.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"vb:%p\n"
.LC1:
	.string	"size mismatch\n"
.LC2:
	.string	"error out\n"
	.text
	.p2align 4
	.type	buffer_prepare, @function
buffer_prepare:
.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
	mov	r13d, edx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	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
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR [rdi]
	mov	r15d, DWORD PTR vbi_pixel_to_capture[rip]
	lea	rdi, .LC0[rip]
	mov	rax, QWORD PTR [rax]
	mov	ebx, r15d
	sal	ebx, 5
	mov	r14, QWORD PTR [rax]
	xor	eax, eax
	call	DEB_VBI@PLT
	cmp	QWORD PTR 8[r12], 0
	je	.L2
	cmp	DWORD PTR 16[r12], ebx
	jl	.L13
.L2:
	cmp	DWORD PTR 20[r12], ebx
	jne	.L14
	mov	rax, QWORD PTR VIDEOBUF_NEEDS_INIT[rip]
	cmp	QWORD PTR 24[r12], rax
	je	.L5
.L7:
	mov	rax, QWORD PTR VIDEOBUF_PREPARED[rip]
	xor	r13d, r13d
	mov	QWORD PTR 24[r12], rax
	mov	eax, DWORD PTR buffer_activate[rip]
	mov	DWORD PTR [r12], eax
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	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
.L14:
	.cfi_restore_state
	mov	rdx, r12
	mov	rsi, rbp
	mov	rdi, r14
	call	saa7146_dma_free@PLT
	mov	rax, QWORD PTR VIDEOBUF_NEEDS_INIT[rip]
	cmp	QWORD PTR 24[r12], rax
	jne	.L7
.L5:
	lea	r8, 8[r12]
	mov	rdi, r8
	mov	QWORD PTR 8[rsp], r8
	call	videobuf_to_dma@PLT
	mov	DWORD PTR 40[r12], r13d
	mov	edi, DWORD PTR [r14]
	mov	QWORD PTR [rsp], rax
	mov	rax, QWORD PTR 48[r12]
	mov	DWORD PTR 32[r12], r15d
	mov	DWORD PTR 36[r12], 32
	lea	rsi, 8[rax]
	mov	DWORD PTR 20[r12], ebx
	call	saa7146_pgtable_free@PLT
	mov	rax, QWORD PTR 48[r12]
	mov	edi, DWORD PTR [r14]
	lea	rsi, 8[rax]
	call	saa7146_pgtable_alloc@PLT
	mov	r8, QWORD PTR 8[rsp]
	xor	edx, edx
	mov	rdi, rbp
	mov	rsi, r8
	call	videobuf_iolock@PLT
	mov	rcx, QWORD PTR [rsp]
	test	eax, eax
	mov	r13d, eax
	jne	.L15
	mov	rax, QWORD PTR 48[r12]
	mov	edx, DWORD PTR 4[rcx]
	mov	edi, DWORD PTR [r14]
	mov	ecx, DWORD PTR [rcx]
	lea	rsi, 8[rax]
	call	saa7146_pgtable_build_single@PLT
	mov	r13d, eax
	test	eax, eax
	je	.L7
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	DEB_VBI@PLT
	mov	r13d, DWORD PTR EINVAL[rip]
	neg	r13d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L15:
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	DEB_VBI@PLT
	mov	rdx, r12
	mov	rsi, rbp
	mov	rdi, r14
	call	saa7146_dma_free@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	buffer_prepare, .-buffer_prepare
	.comm	vbi_pixel_to_capture,4,4
	.comm	buffer_activate,4,4
	.comm	VIDEOBUF_PREPARED,8,8
	.comm	VIDEOBUF_NEEDS_INIT,8,8
	.comm	EINVAL,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_saa7146_vbi.c_buffer_prepare.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"vb:%p\012\000"
	.align	2
.LC1:
	.ascii	"size mismatch\012\000"
	.align	2
.LC2:
	.ascii	"error out\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	buffer_prepare, %function
buffer_prepare:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r1
	mov	r5, r0
	ldr	r0, [r0]
	ldr	r3, .L19
	ldr	ip, [r0]
	ldr	r0, .L19+4
	ldr	r8, [r3]
	mov	r6, r2
	ldr	r9, [ip]
	bl	DEB_VBI
	ldr	r3, [r4, #4]
	lsl	r7, r8, #5
	cmp	r3, #0
	beq	.L2
	ldr	r3, [r4, #8]
	cmp	r3, r7
	blt	.L16
.L2:
	ldr	r3, [r4, #12]
	cmp	r3, r7
	bne	.L17
.L4:
	ldr	r3, .L19+8
	ldr	r2, [r4, #16]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L5
.L7:
	mov	r6, #0
	ldr	r2, .L19+12
	ldr	r3, .L19+16
	ldr	r2, [r2]
	ldr	r3, [r3]
	str	r2, [r4, #16]
	str	r3, [r4]
.L1:
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L17:
	mov	r2, r4
	mov	r1, r5
	mov	r0, r9
	bl	saa7146_dma_free
	b	.L4
.L16:
	ldr	r0, .L19+20
	bl	DEB_VBI
	ldr	r3, .L19+24
	ldr	r6, [r3]
	rsb	r6, r6, #0
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L5:
	add	r10, r4, #4
	mov	r0, r10
	bl	videobuf_to_dma
	mov	r2, #32
	mov	r3, r0
	ldr	r1, [r4, #32]
	str	r2, [r4, #24]
	str	r7, [r4, #12]
	str	r6, [r4, #28]
	add	r1, r1, #8
	ldr	r0, [r9]
	str	r8, [r4, #20]
	mov	r7, r3
	bl	saa7146_pgtable_free
	ldr	r1, [r4, #32]
	ldr	r0, [r9]
	add	r1, r1, #8
	bl	saa7146_pgtable_alloc
	mov	r1, r10
	mov	r2, #0
	mov	r0, r5
	bl	videobuf_iolock
	subs	r6, r0, #0
	bne	.L18
	ldr	r1, [r4, #32]
	ldr	r0, [r9]
	ldr	r3, [r7]
	ldr	r2, [r7, #4]
	add	r1, r1, #8
	bl	saa7146_pgtable_build_single
	subs	r6, r0, #0
	beq	.L7
	b	.L1
.L18:
	ldr	r0, .L19+28
	bl	DEB_VBI
	mov	r2, r4
	mov	r1, r5
	mov	r0, r9
	bl	saa7146_dma_free
	b	.L1
.L20:
	.align	2
.L19:
	.word	vbi_pixel_to_capture
	.word	.LC0
	.word	VIDEOBUF_NEEDS_INIT
	.word	VIDEOBUF_PREPARED
	.word	buffer_activate
	.word	.LC1
	.word	EINVAL
	.word	.LC2
	.size	buffer_prepare, .-buffer_prepare
	.comm	vbi_pixel_to_capture,4,4
	.comm	buffer_activate,4,4
	.comm	VIDEOBUF_PREPARED,4,4
	.comm	VIDEOBUF_NEEDS_INIT,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
