	.file	"extr_ivtv-fileops.c_ivtv_v4l2_close.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"close %s\n"
	.text
	.p2align 4
	.globl	ivtv_v4l2_close
	.type	ivtv_v4l2_close, @function
ivtv_v4l2_close:
.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
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	r13, QWORD PTR [rdi]
	mov	rdi, r13
	call	fh2id@PLT
	lea	rdi, .LC0[rip]
	mov	r14, QWORD PTR 16[rax]
	mov	rbx, QWORD PTR [rax]
	mov	rbp, rax
	sal	rbx, 5
	add	rbx, QWORD PTR 24[r14]
	lea	r15, 16[r14]
	mov	esi, DWORD PTR 24[rbx]
	call	IVTV_DEBUG_FILE@PLT
	mov	rdi, r15
	call	mutex_lock@PLT
	mov	rax, QWORD PTR IVTV_ENC_STREAM_TYPE_RAD[rip]
	cmp	QWORD PTR 0[rbp], rax
	je	.L19
.L3:
	mov	rdi, r13
	call	v4l2_fh_del@PLT
	mov	rdi, r13
	call	v4l2_fh_exit@PLT
	lea	rax, 8[rbp]
	cmp	QWORD PTR 16[rbx], rax
	je	.L20
.L8:
	mov	rdi, rbp
	call	kfree@PLT
	mov	rdi, r15
	call	mutex_unlock@PLT
	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
.L20:
	.cfi_restore_state
	mov	rax, QWORD PTR IVTV_DEC_STREAM_TYPE_MPG[rip]
	cmp	QWORD PTR [rbx], rax
	jl	.L9
	mov	esi, DWORD PTR V4L2_DEC_CMD_STOP_TO_BLACK[rip]
	xor	edx, edx
	mov	rdi, rbp
	mov	r12, QWORD PTR 24[r14]
	or	esi, DWORD PTR V4L2_DEC_CMD_STOP_IMMEDIATELY[rip]
	mov	rbx, QWORD PTR IVTV_DEC_STREAM_TYPE_VOUT[rip]
	call	ivtv_stop_decoding@PLT
	mov	rax, QWORD PTR OUT_NONE[rip]
	cmp	QWORD PTR 8[r14], rax
	jne	.L8
	sal	rbx, 5
	mov	edi, DWORD PTR IVTV_F_S_APPL_IO[rip]
	lea	rsi, 8[r12+rbx]
	call	test_bit@PLT
	test	eax, eax
	jne	.L8
	mov	rdi, r14
	call	ivtv_disable_cc@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	xor	esi, esi
	mov	rdi, rbp
	call	ivtv_stop_capture@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L19:
	mov	rdi, r12
	call	v4l2_fh_is_singular_file@PLT
	test	rax, rax
	je	.L3
	mov	rdi, r14
	call	ivtv_mute@PLT
	mov	edi, DWORD PTR IVTV_F_I_RADIO_USER[rip]
	lea	rsi, 48[r14]
	call	clear_bit@PLT
	mov	esi, DWORD PTR video[rip]
	mov	ecx, DWORD PTR 44[r14]
	mov	rdi, r14
	mov	edx, DWORD PTR s_std[rip]
	call	ivtv_call_all@PLT
	mov	rdi, r14
	call	ivtv_audio_set_io@PLT
	mov	esi, DWORD PTR IVTV_HW_SAA711X[rip]
	test	DWORD PTR [r14], esi
	jne	.L21
.L5:
	lea	rdi, 40[r14]
	call	atomic_read@PLT
	test	rax, rax
	jg	.L22
.L6:
	mov	rdi, r14
	call	ivtv_unmute@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L22:
	mov	edi, DWORD PTR 36[r14]
	call	v4l2_ctrl_g_ctrl@PLT
	mov	edi, DWORD PTR 32[r14]
	mov	r12d, eax
	call	v4l2_ctrl_g_ctrl@PLT
	mov	esi, DWORD PTR CX2341X_ENC_MUTE_VIDEO[rip]
	mov	edx, 1
	mov	rdi, r14
	sal	eax, 8
	mov	ecx, eax
	or	ecx, r12d
	call	ivtv_vapi@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L21:
	mov	r8d, DWORD PTR SAA7115_FREQ_32_11_MHZ[rip]
	mov	ecx, DWORD PTR s_crystal_freq[rip]
	xor	r9d, r9d
	mov	rdi, r14
	mov	edx, DWORD PTR video[rip]
	call	ivtv_call_hw@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	ivtv_v4l2_close, .-ivtv_v4l2_close
	.comm	video,4,4
	.comm	s_std,4,4
	.comm	s_crystal_freq,4,4
	.comm	V4L2_DEC_CMD_STOP_TO_BLACK,4,4
	.comm	V4L2_DEC_CMD_STOP_IMMEDIATELY,4,4
	.comm	SAA7115_FREQ_32_11_MHZ,4,4
	.comm	OUT_NONE,8,8
	.comm	IVTV_HW_SAA711X,4,4
	.comm	IVTV_F_S_APPL_IO,4,4
	.comm	IVTV_F_I_RADIO_USER,4,4
	.comm	IVTV_ENC_STREAM_TYPE_RAD,8,8
	.comm	IVTV_DEC_STREAM_TYPE_VOUT,8,8
	.comm	IVTV_DEC_STREAM_TYPE_MPG,8,8
	.comm	CX2341X_ENC_MUTE_VIDEO,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_v4l2_close.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"close %s\012\000"
	.text
	.align	2
	.global	ivtv_v4l2_close
	.syntax unified
	.arm
	.fpu softvfp
	.type	ivtv_v4l2_close, %function
ivtv_v4l2_close:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r7, [r0]
	sub	sp, sp, #20
	mov	r5, r0
	mov	r0, r7
	bl	fh2id
	mov	r4, r0
	ldr	r6, [r0, #8]
	ldr	fp, [r0]
	ldr	r10, [r6, #12]
	ldr	r0, .L23
	add	r9, r10, fp, lsl #4
	ldr	r1, [r9, #12]
	add	r8, r6, #8
	bl	IVTV_DEBUG_FILE
	mov	r0, r8
	bl	mutex_lock
	ldr	r3, .L23+4
	ldr	r2, [r4]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L19
.L3:
	mov	r0, r7
	bl	v4l2_fh_del
	mov	r0, r7
	bl	v4l2_fh_exit
	ldr	r2, [r9, #8]
	add	r3, r4, #4
	cmp	r2, r3
	beq	.L20
.L8:
	mov	r0, r4
	bl	kfree
	mov	r0, r8
	bl	mutex_unlock
	mov	r0, #0
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L20:
	ldr	r3, .L23+8
	ldr	r2, [r10, fp, lsl #4]
	ldr	r3, [r3]
	cmp	r2, r3
	blt	.L9
	ldr	r2, .L23+12
	ldr	r3, .L23+16
	ldr	r1, [r2]
	ldr	r2, [r3]
	ldr	r3, .L23+20
	orr	r1, r1, r2
	mov	r0, r4
	mov	r2, #0
	ldr	r7, [r3]
	ldr	r5, [r6, #12]
	bl	ivtv_stop_decoding
	ldr	r3, .L23+24
	ldr	r2, [r6, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L8
	ldr	r3, .L23+28
	add	r1, r5, r7, lsl #4
	ldr	r0, [r3]
	add	r1, r1, #4
	bl	test_bit
	cmp	r0, #0
	bne	.L8
	mov	r0, r6
	bl	ivtv_disable_cc
	b	.L8
.L9:
	mov	r1, #0
	mov	r0, r4
	bl	ivtv_stop_capture
	b	.L8
.L19:
	mov	r0, r5
	bl	v4l2_fh_is_singular_file
	cmp	r0, #0
	beq	.L3
	mov	r0, r6
	bl	ivtv_mute
	ldr	r3, .L23+32
	add	r1, r6, #32
	ldr	r0, [r3]
	bl	clear_bit
	ldr	r5, .L23+36
	ldr	r3, .L23+40
	ldr	r1, [r5]
	ldr	r2, [r3]
	mov	r0, r6
	ldr	r3, [r6, #28]
	bl	ivtv_call_all
	mov	r0, r6
	bl	ivtv_audio_set_io
	ldr	r2, .L23+44
	ldr	r3, [r6]
	ldr	r1, [r2]
	tst	r1, r3
	bne	.L21
.L5:
	add	r0, r6, #24
	bl	atomic_read
	cmp	r0, #0
	bgt	.L22
.L6:
	mov	r0, r6
	bl	ivtv_unmute
	b	.L3
.L22:
	ldr	r3, .L23+48
	ldr	r0, [r6, #20]
	ldr	r1, [r3]
	str	r1, [sp, #12]
	bl	v4l2_ctrl_g_ctrl
	mov	r5, r0
	ldr	r0, [r6, #16]
	bl	v4l2_ctrl_g_ctrl
	mov	r2, #1
	orr	r3, r5, r0, lsl #8
	ldr	r1, [sp, #12]
	mov	r0, r6
	bl	ivtv_vapi
	b	.L6
.L21:
	mov	r0, #0
	ldr	r2, .L23+52
	ldr	r3, .L23+56
	ldr	ip, [r2]
	ldr	r2, [r5]
	str	r0, [sp, #4]
	str	ip, [sp]
	mov	r0, r6
	ldr	r3, [r3]
	bl	ivtv_call_hw
	b	.L5
.L24:
	.align	2
.L23:
	.word	.LC0
	.word	IVTV_ENC_STREAM_TYPE_RAD
	.word	IVTV_DEC_STREAM_TYPE_MPG
	.word	V4L2_DEC_CMD_STOP_TO_BLACK
	.word	V4L2_DEC_CMD_STOP_IMMEDIATELY
	.word	IVTV_DEC_STREAM_TYPE_VOUT
	.word	OUT_NONE
	.word	IVTV_F_S_APPL_IO
	.word	IVTV_F_I_RADIO_USER
	.word	video
	.word	s_std
	.word	IVTV_HW_SAA711X
	.word	CX2341X_ENC_MUTE_VIDEO
	.word	SAA7115_FREQ_32_11_MHZ
	.word	s_crystal_freq
	.size	ivtv_v4l2_close, .-ivtv_v4l2_close
	.comm	video,4,4
	.comm	s_std,4,4
	.comm	s_crystal_freq,4,4
	.comm	V4L2_DEC_CMD_STOP_TO_BLACK,4,4
	.comm	V4L2_DEC_CMD_STOP_IMMEDIATELY,4,4
	.comm	SAA7115_FREQ_32_11_MHZ,4,4
	.comm	OUT_NONE,4,4
	.comm	IVTV_HW_SAA711X,4,4
	.comm	IVTV_F_S_APPL_IO,4,4
	.comm	IVTV_F_I_RADIO_USER,4,4
	.comm	IVTV_ENC_STREAM_TYPE_RAD,4,4
	.comm	IVTV_DEC_STREAM_TYPE_VOUT,4,4
	.comm	IVTV_DEC_STREAM_TYPE_MPG,4,4
	.comm	CX2341X_ENC_MUTE_VIDEO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
