	.file	"extr_stv680.c_stv_close.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"STV(e): stop_video failed in stv_close"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"STV(i): device unregistered"
	.text
	.p2align 4
	.type	stv_close, @function
stv_close:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	rdi, QWORD PTR [rdi]
	call	video_get_drvdata@PLT
	mov	rbp, rax
	mov	eax, DWORD PTR STV680_NUMFRAMES[rip]
	test	eax, eax
	jle	.L2
	mov	rcx, QWORD PTR 40[rbp]
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edx, DWORD PTR FRAME_UNUSED[rip]
	mov	DWORD PTR [rcx+rax*4], edx
	add	rax, 1
	cmp	DWORD PTR STV680_NUMFRAMES[rip], eax
	jg	.L3
.L2:
	cmp	QWORD PTR 32[rbp], 0
	jne	.L10
	mov	rdi, rbp
	call	stv_stop_video@PLT
	test	eax, eax
	js	.L11
.L5:
	mov	esi, DWORD PTR 0[rbp]
	imul	esi, DWORD PTR STV680_NUMFRAMES[rip]
	mov	edi, DWORD PTR 24[rbp]
	call	rvfree@PLT
	cmp	QWORD PTR 8[rbp], 0
	mov	QWORD PTR 16[rbp], 0
	jne	.L12
	mov	QWORD PTR [rbx], 0
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	mov	rdi, rbp
	call	stv680_stop_stream@PLT
	mov	rdi, rbp
	call	stv_stop_video@PLT
	test	eax, eax
	jns	.L5
.L11:
	lea	rsi, .LC0[rip]
	mov	edi, 1
	call	PDEBUG@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rdi, rbp
	call	kfree@PLT
	lea	rsi, .LC1[rip]
	xor	edi, edi
	call	PDEBUG@PLT
	mov	QWORD PTR [rbx], 0
	add	rsp, 8
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	stv_close, .-stv_close
	.comm	STV680_NUMFRAMES,4,4
	.comm	FRAME_UNUSED,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_stv680.c_stv_close.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"STV(e): stop_video failed in stv_close\000"
	.align	2
.LC1:
	.ascii	"STV(i): device unregistered\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	stv_close, %function
stv_close:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r6, r0
	ldr	r0, [r0]
	bl	video_get_drvdata
	ldr	r4, .L19
	mov	r5, r0
	ldr	r3, [r4]
	cmp	r3, #0
	ble	.L2
	mov	r3, #0
	ldr	r2, [r0, #20]
	ldr	r0, .L19+4
	sub	r2, r2, #4
.L3:
	ldr	r1, [r0]
	add	r3, r3, #1
	str	r1, [r2, #4]!
	ldr	r1, [r4]
	cmp	r1, r3
	bgt	.L3
.L2:
	ldr	r3, [r5, #16]
	cmp	r3, #0
	bne	.L16
	mov	r0, r5
	bl	stv_stop_video
	cmp	r0, #0
	blt	.L17
.L5:
	mov	r7, #0
	ldr	r3, [r5]
	ldr	r1, [r4]
	ldr	r0, [r5, #12]
	mul	r1, r3, r1
	bl	rvfree
	ldr	r3, [r5, #4]
	str	r7, [r5, #8]
	cmp	r3, r7
	bne	.L18
.L6:
	mov	r0, #0
	str	r0, [r6]
	pop	{r4, r5, r6, r7, r8, pc}
.L16:
	mov	r0, r5
	bl	stv680_stop_stream
	mov	r0, r5
	bl	stv_stop_video
	cmp	r0, #0
	bge	.L5
.L17:
	ldr	r1, .L19+8
	mov	r0, #1
	bl	PDEBUG
	b	.L5
.L18:
	mov	r0, r5
	bl	kfree
	mov	r0, r7
	ldr	r1, .L19+12
	bl	PDEBUG
	b	.L6
.L20:
	.align	2
.L19:
	.word	STV680_NUMFRAMES
	.word	FRAME_UNUSED
	.word	.LC0
	.word	.LC1
	.size	stv_close, .-stv_close
	.comm	STV680_NUMFRAMES,4,4
	.comm	FRAME_UNUSED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
