	.file	"extr_ivtv-fileops.c_ivtv_get_buffer.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"EOS %s\n"
.LC1:
	.string	"User stopped %s\n"
	.text
	.p2align 4
	.type	ivtv_get_buffer, @function
ivtv_get_buffer:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, esi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR IVTV_ENC_STREAM_TYPE_VBI[rip]
	mov	rbp, QWORD PTR 40[rdi]
	mov	edi, DWORD PTR wait[rip]
	mov	QWORD PTR 24[rsp], rdx
	lea	r13, [rax+rax*2]
	sal	r13, 4
	add	r13, QWORD PTR 40[rbp]
	call	DEFINE_WAIT@PLT
	lea	rax, 20[r13]
	mov	DWORD PTR [r15], 0
	mov	QWORD PTR [rsp], rax
	lea	rax, 16[r13]
	mov	QWORD PTR 8[rsp], rax
	lea	rax, 32[r13]
	mov	QWORD PTR 16[rsp], rax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L7:
	lea	rsi, 28[rbx]
	mov	rdi, rbx
	call	ivtv_dequeue@PLT
	mov	r12, rax
	test	rax, rax
	jne	.L1
	lea	rsi, 16[rbx]
	mov	rdi, rbx
	call	ivtv_dequeue@PLT
	mov	r12, rax
	test	rax, rax
	jne	.L28
	mov	rax, QWORD PTR IVTV_DEC_STREAM_TYPE_VBI[rip]
	cmp	QWORD PTR [rbx], rax
	je	.L13
	mov	edi, DWORD PTR IVTV_F_S_STREAMING[rip]
	lea	rsi, 20[rbx]
	call	test_bit@PLT
	test	rax, rax
	je	.L29
.L13:
	test	r14d, r14d
	jne	.L30
	mov	rdi, rbp
	lea	r15, 12[rbx]
	call	mutex_unlock@PLT
	mov	edx, DWORD PTR TASK_INTERRUPTIBLE[rip]
	lea	rsi, wait[rip]
	mov	rdi, r15
	call	prepare_to_wait@PLT
	mov	eax, DWORD PTR 16[rbx]
	test	eax, eax
	je	.L31
.L15:
	lea	rsi, wait[rip]
	mov	rdi, r15
	call	finish_wait@PLT
	mov	rdi, rbp
	call	mutex_lock@PLT
	mov	edi, DWORD PTR current[rip]
	call	signal_pending@PLT
	test	rax, rax
	jne	.L32
.L16:
	mov	rax, QWORD PTR IVTV_ENC_STREAM_TYPE_MPG[rip]
	cmp	QWORD PTR [rbx], rax
	jne	.L7
	mov	rdi, rbp
	call	ivtv_update_pgm_info@PLT
	mov	r12, QWORD PTR 32[rbp]
	mov	edi, 1000
	call	msecs_to_jiffies@PLT
	mov	rdi, QWORD PTR jiffies[rip]
	lea	rsi, [r12+rax]
	call	time_after@PLT
	test	rax, rax
	jne	.L33
.L5:
	mov	rsi, QWORD PTR [rsp]
	mov	edi, DWORD PTR IVTV_F_S_INTERNAL_USE[rip]
	call	test_bit@PLT
	test	rax, rax
	jne	.L6
.L8:
	mov	rax, QWORD PTR 16[rbp]
	cmp	QWORD PTR 8[rbp], rax
	je	.L7
	lea	r12, 8[rbp]
.L1:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r12
	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
.L31:
	.cfi_restore_state
	xor	eax, eax
	call	schedule@PLT
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rsi, QWORD PTR [rsp]
	mov	edi, DWORD PTR IVTV_F_S_APPL_IO[rip]
	call	test_bit@PLT
	test	rax, rax
	jne	.L8
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	mov	edx, DWORD PTR 24[r13]
	mov	rcx, QWORD PTR 0[r13]
	mov	rsi, r12
	mov	rdi, rbp
	call	ivtv_process_vbi_data@PLT
	mov	rdx, QWORD PTR 16[rsp]
	mov	rsi, r12
	mov	rdi, r13
	call	ivtv_enqueue@PLT
.L9:
	mov	rsi, QWORD PTR 8[rsp]
	mov	rdi, r13
	call	ivtv_dequeue@PLT
	mov	r12, rax
	test	rax, rax
	jne	.L10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L33:
	mov	rax, QWORD PTR jiffies[rip]
	mov	rdi, rbp
	mov	QWORD PTR 32[rbp], rax
	call	ivtv_dualwatch@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L28:
	mov	edx, DWORD PTR 16[rax]
	mov	eax, DWORD PTR IVTV_F_B_NEED_BUF_SWAP[rip]
	test	edx, eax
	je	.L1
	not	eax
	mov	rcx, QWORD PTR [rbx]
	and	eax, edx
	cmp	rcx, QWORD PTR IVTV_ENC_STREAM_TYPE_MPG[rip]
	mov	DWORD PTR 16[r12], eax
	je	.L34
	cmp	rcx, QWORD PTR IVTV_DEC_STREAM_TYPE_VBI[rip]
	je	.L1
	mov	edx, DWORD PTR 24[rbx]
	mov	rsi, r12
	mov	rdi, rbp
	call	ivtv_process_vbi_data@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L30:
	mov	eax, DWORD PTR EAGAIN[rip]
	mov	rcx, QWORD PTR 24[rsp]
	neg	eax
	mov	DWORD PTR [rcx], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L32:
	mov	esi, DWORD PTR 8[rbx]
	lea	rdi, .LC1[rip]
	call	IVTV_DEBUG_INFO@PLT
	mov	eax, DWORD PTR EINTR[rip]
	mov	rcx, QWORD PTR 24[rsp]
	neg	eax
	mov	DWORD PTR [rcx], eax
	jmp	.L1
.L29:
	mov	esi, DWORD PTR 8[rbx]
	lea	rdi, .LC0[rip]
	call	IVTV_DEBUG_INFO@PLT
	jmp	.L1
.L34:
	mov	rdi, r12
	call	ivtv_buf_swap@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	ivtv_get_buffer, .-ivtv_get_buffer
	.comm	wait,4,4
	.comm	jiffies,8,8
	.comm	current,4,4
	.comm	TASK_INTERRUPTIBLE,4,4
	.comm	IVTV_F_S_STREAMING,4,4
	.comm	IVTV_F_S_INTERNAL_USE,4,4
	.comm	IVTV_F_S_APPL_IO,4,4
	.comm	IVTV_F_B_NEED_BUF_SWAP,4,4
	.comm	IVTV_ENC_STREAM_TYPE_VBI,8,8
	.comm	IVTV_ENC_STREAM_TYPE_MPG,8,8
	.comm	IVTV_DEC_STREAM_TYPE_VBI,8,8
	.comm	EINTR,4,4
	.comm	EAGAIN,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_ivtv-fileops.c_ivtv_get_buffer.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"EOS %s\012\000"
	.align	2
.LC1:
	.ascii	"User stopped %s\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ivtv_get_buffer, %function
ivtv_get_buffer:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L35
	ldr	r6, [r0, #32]
	ldr	r3, [r3]
	mov	r4, r0
	ldr	r0, .L35+4
	ldr	r8, [r6, #20]
	add	r3, r3, r3, lsl #3
	sub	sp, sp, #12
	ldr	r0, [r0]
	mov	r5, r2
	add	r8, r8, r3, lsl #2
	mov	r9, r1
	str	r2, [sp]
	bl	DEFINE_WAIT
	mov	r3, #0
	ldr	r10, .L35+8
	ldr	fp, .L35+12
	str	r3, [r5]
	b	.L16
.L7:
	mov	r0, r4
	add	r1, r4, #24
	bl	ivtv_dequeue
	subs	r5, r0, #0
	bne	.L1
	mov	r0, r4
	add	r1, r4, #12
	bl	ivtv_dequeue
	subs	r5, r0, #0
	bne	.L28
	ldr	r2, [r4]
	ldr	r3, [fp]
	cmp	r2, r3
	beq	.L13
	ldr	r3, .L35+16
	add	r1, r4, #16
	ldr	r0, [r3]
	bl	test_bit
	cmp	r0, #0
	beq	.L29
.L13:
	cmp	r9, #0
	bne	.L30
	mov	r0, r6
	bl	mutex_unlock
	ldr	r3, .L35+20
	add	r7, r4, #8
	ldr	r2, [r3]
	mov	r0, r7
	ldr	r1, .L35+4
	bl	prepare_to_wait
	ldr	r3, [r4, #12]
	cmp	r3, #0
	beq	.L31
.L15:
	ldr	r1, .L35+4
	mov	r0, r7
	bl	finish_wait
	mov	r0, r6
	bl	mutex_lock
	ldr	r3, .L35+24
	ldr	r0, [r3]
	bl	signal_pending
	cmp	r0, #0
	bne	.L32
.L16:
	ldr	r2, [r4]
	ldr	r3, [r10]
	cmp	r2, r3
	bne	.L7
	mov	r0, r6
	bl	ivtv_update_pgm_info
	ldr	r3, .L35+28
	mov	r0, #1000
	ldr	r7, [r3]
	ldr	r5, [r6, #16]
	bl	msecs_to_jiffies
	mov	r1, r0
	mov	r0, r7
	add	r1, r5, r1
	bl	time_after
	cmp	r0, #0
	bne	.L33
.L5:
	ldr	r3, .L35+32
	add	r5, r8, #16
	mov	r1, r5
	ldr	r0, [r3]
	bl	test_bit
	cmp	r0, #0
	bne	.L6
.L8:
	ldmib	r6, {r2, r3}
	cmp	r2, r3
	beq	.L7
	add	r5, r6, #4
.L1:
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L31:
	bl	schedule
	b	.L15
.L6:
	ldr	r3, .L35+36
	mov	r1, r5
	ldr	r0, [r3]
	bl	test_bit
	cmp	r0, #0
	addeq	r5, r8, #12
	addeq	r7, r8, #28
	streq	r4, [sp, #4]
	bne	.L8
	b	.L9
.L10:
	mov	r1, r4
	ldr	r2, [r8, #20]
	mov	r0, r6
	ldr	r3, [r8]
	bl	ivtv_process_vbi_data
	mov	r2, r7
	mov	r1, r4
	mov	r0, r8
	bl	ivtv_enqueue
.L9:
	mov	r1, r5
	mov	r0, r8
	bl	ivtv_dequeue
	subs	r4, r0, #0
	bne	.L10
	ldr	r4, [sp, #4]
	b	.L8
.L33:
	ldr	r3, .L35+28
	mov	r0, r6
	ldr	r3, [r3]
	str	r3, [r6, #16]
	bl	ivtv_dualwatch
	b	.L5
.L28:
	ldr	r3, .L35+40
	ldr	r2, [r5, #8]
	ldr	r1, [r3]
	tst	r2, r1
	beq	.L1
	ldr	r3, [r4]
	ldr	ip, [r10]
	bic	r2, r2, r1
	cmp	r3, ip
	str	r2, [r5, #8]
	beq	.L34
	ldr	r2, .L35+12
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L1
	mov	r0, r6
	mov	r1, r5
	ldr	r2, [r4, #20]
	bl	ivtv_process_vbi_data
	b	.L1
.L30:
	mov	r0, r5
	ldr	r3, .L35+44
	ldr	r2, [sp]
	ldr	r3, [r3]
	rsb	r3, r3, #0
	str	r3, [r2]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L32:
	ldr	r1, [r4, #4]
	ldr	r0, .L35+48
	bl	IVTV_DEBUG_INFO
	mov	r0, r5
	ldr	r3, .L35+52
	ldr	r2, [sp]
	ldr	r3, [r3]
	rsb	r3, r3, #0
	str	r3, [r2]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L29:
	ldr	r1, [r4, #4]
	ldr	r0, .L35+56
	bl	IVTV_DEBUG_INFO
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L34:
	bl	ivtv_buf_swap
	b	.L1
.L36:
	.align	2
.L35:
	.word	IVTV_ENC_STREAM_TYPE_VBI
	.word	wait
	.word	IVTV_ENC_STREAM_TYPE_MPG
	.word	IVTV_DEC_STREAM_TYPE_VBI
	.word	IVTV_F_S_STREAMING
	.word	TASK_INTERRUPTIBLE
	.word	current
	.word	jiffies
	.word	IVTV_F_S_INTERNAL_USE
	.word	IVTV_F_S_APPL_IO
	.word	IVTV_F_B_NEED_BUF_SWAP
	.word	EAGAIN
	.word	.LC1
	.word	EINTR
	.word	.LC0
	.size	ivtv_get_buffer, .-ivtv_get_buffer
	.comm	wait,4,4
	.comm	jiffies,4,4
	.comm	current,4,4
	.comm	TASK_INTERRUPTIBLE,4,4
	.comm	IVTV_F_S_STREAMING,4,4
	.comm	IVTV_F_S_INTERNAL_USE,4,4
	.comm	IVTV_F_S_APPL_IO,4,4
	.comm	IVTV_F_B_NEED_BUF_SWAP,4,4
	.comm	IVTV_ENC_STREAM_TYPE_VBI,4,4
	.comm	IVTV_ENC_STREAM_TYPE_MPG,4,4
	.comm	IVTV_DEC_STREAM_TYPE_VBI,4,4
	.comm	EINTR,4,4
	.comm	EAGAIN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
