	.file	"extr_bttv-driver.c_set_tvnorm.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	set_tvnorm, @function
set_tvnorm:
.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
	xor	edi, edi
	cmp	DWORD PTR BTTV_TVNORMS[rip], esi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	setbe	dil
	call	BUG_ON@PLT
	mov	eax, DWORD PTR BTTV_TVNORMS[rip]
	xor	edi, edi
	cmp	DWORD PTR 0[rbp], eax
	setnb	dil
	call	BUG_ON@PLT
	mov	rax, QWORD PTR bttv_tvnorms[rip]
	mov	edx, r12d
	lea	rdx, [rdx+rdx*4]
	lea	rbx, [rax+rdx*8]
	mov	edx, DWORD PTR 0[rbp]
	lea	rsi, 24[rbx]
	lea	rdx, [rdx+rdx*4]
	lea	rdi, 24[rax+rdx*8]
	mov	edx, 16
	call	memcmp@PLT
	test	rax, rax
	jne	.L8
.L3:
	mov	esi, DWORD PTR BT848_ADELAY[rip]
	mov	edi, DWORD PTR [rbx]
	mov	DWORD PTR 0[rbp], r12d
	call	btwrite@PLT
	mov	edi, DWORD PTR 4[rbx]
	mov	esi, DWORD PTR BT848_BDELAY[rip]
	call	btwrite@PLT
	mov	edx, DWORD PTR BT848_IFORM[rip]
	mov	esi, DWORD PTR BT848_IFORM_NORM[rip]
	mov	edi, DWORD PTR 16[rbx]
	or	esi, DWORD PTR BT848_IFORM_XTBOTH[rip]
	not	esi
	call	btaor@PLT
	mov	edi, DWORD PTR 8[rbx]
	mov	esi, DWORD PTR BT848_VBI_PACK_SIZE[rip]
	call	btwrite@PLT
	mov	esi, DWORD PTR BT848_VBI_PACK_DEL[rip]
	mov	edi, 1
	call	btwrite@PLT
	mov	rdi, rbp
	call	bt848A_set_timing@PLT
	mov	eax, DWORD PTR 8[rbp]
	add	eax, -128
	cmp	eax, 1
	jbe	.L9
.L5:
	mov	ecx, DWORD PTR 12[rbx]
	mov	edx, DWORD PTR s_std[rip]
	mov	rdi, rbp
	mov	esi, DWORD PTR core[rip]
	call	bttv_call_all@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	mov	rdi, QWORD PTR 24[rbp]
	mov	esi, r12d
	call	bttv_crop_reset@PLT
	mov	rax, QWORD PTR 24[rbp]
	mov	edx, DWORD PTR [rax]
	mov	DWORD PTR 4[rax], edx
	mov	eax, DWORD PTR 4[rbp]
	test	DWORD PTR VIDEO_RESOURCES[rip], eax
	jne	.L3
	mov	rax, QWORD PTR 24[rbx]
	add	rax, QWORD PTR 32[rbx]
	mov	QWORD PTR 16[rbp], rax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L9:
	xor	eax, eax
	call	gpio_read@PLT
	mov	rdi, rbp
	mov	esi, eax
	call	bttv_tda9880_setnorm@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	set_tvnorm, .-set_tvnorm
	.comm	s_std,4,4
	.comm	core,4,4
	.comm	bttv_tvnorms,8,8
	.comm	VIDEO_RESOURCES,4,4
	.comm	BTTV_TVNORMS,4,4
	.comm	BT848_VBI_PACK_SIZE,4,4
	.comm	BT848_VBI_PACK_DEL,4,4
	.comm	BT848_IFORM_XTBOTH,4,4
	.comm	BT848_IFORM_NORM,4,4
	.comm	BT848_IFORM,4,4
	.comm	BT848_BDELAY,4,4
	.comm	BT848_ADELAY,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_bttv-driver.c_set_tvnorm.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	set_tvnorm, %function
set_tvnorm:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	mov	r5, r1
	ldr	r6, .L10
	ldr	r0, [r6]
	cmp	r0, r1
	movhi	r0, #0
	movls	r0, #1
	bl	BUG_ON
	ldr	r3, [r6]
	ldr	r0, [r4]
	cmp	r0, r3
	movcc	r0, #0
	movcs	r0, #1
	bl	BUG_ON
	ldr	r3, .L10+4
	ldr	r0, [r4]
	ldr	r8, [r3]
	rsb	r0, r0, r0, lsl #3
	rsb	r3, r5, r5, lsl #3
	add	r6, r8, r3, lsl #2
	add	r0, r8, r0, lsl #2
	mov	r2, #8
	add	r0, r0, #20
	add	r1, r6, #20
	lsl	r7, r3, #2
	bl	memcmp
	cmp	r0, #0
	bne	.L8
.L3:
	ldr	r3, .L10+8
	ldr	r0, [r8, r7]
	ldr	r1, [r3]
	str	r5, [r4]
	bl	btwrite
	ldr	r3, .L10+12
	ldr	r0, [r6, #4]
	ldr	r1, [r3]
	bl	btwrite
	ldr	r2, .L10+16
	ldr	r3, .L10+20
	ldr	r1, [r2]
	ldr	r2, [r3]
	ldr	r3, .L10+24
	orr	r1, r1, r2
	mvn	r1, r1
	ldr	r2, [r3]
	ldr	r0, [r6, #16]
	bl	btaor
	ldr	r3, .L10+28
	ldr	r0, [r6, #8]
	ldr	r1, [r3]
	bl	btwrite
	ldr	r3, .L10+32
	mov	r0, #1
	ldr	r1, [r3]
	bl	btwrite
	mov	r0, r4
	bl	bt848A_set_timing
	ldr	r3, [r4, #8]
	sub	r3, r3, #128
	cmp	r3, #1
	bls	.L9
.L5:
	ldr	r2, .L10+36
	ldr	r1, .L10+40
	mov	r0, r4
	ldr	r3, [r6, #12]
	ldr	r2, [r2]
	ldr	r1, [r1]
	bl	bttv_call_all
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L8:
	mov	r1, r5
	ldr	r0, [r4, #16]
	bl	bttv_crop_reset
	ldr	r3, [r4, #16]
	ldr	r2, .L10+44
	ldr	r1, [r3]
	ldr	r2, [r2]
	str	r1, [r3, #4]
	ldr	r3, [r4, #4]
	tst	r3, r2
	ldreq	r3, [r6, #24]
	ldreq	r2, [r6, #20]
	addeq	r3, r3, r2
	streq	r3, [r4, #12]
	b	.L3
.L9:
	bl	gpio_read
	mov	r1, r0
	mov	r0, r4
	bl	bttv_tda9880_setnorm
	b	.L5
.L11:
	.align	2
.L10:
	.word	BTTV_TVNORMS
	.word	bttv_tvnorms
	.word	BT848_ADELAY
	.word	BT848_BDELAY
	.word	BT848_IFORM_NORM
	.word	BT848_IFORM_XTBOTH
	.word	BT848_IFORM
	.word	BT848_VBI_PACK_SIZE
	.word	BT848_VBI_PACK_DEL
	.word	s_std
	.word	core
	.word	VIDEO_RESOURCES
	.size	set_tvnorm, .-set_tvnorm
	.comm	s_std,4,4
	.comm	core,4,4
	.comm	bttv_tvnorms,4,4
	.comm	VIDEO_RESOURCES,4,4
	.comm	BTTV_TVNORMS,4,4
	.comm	BT848_VBI_PACK_SIZE,4,4
	.comm	BT848_VBI_PACK_DEL,4,4
	.comm	BT848_IFORM_XTBOTH,4,4
	.comm	BT848_IFORM_NORM,4,4
	.comm	BT848_IFORM,4,4
	.comm	BT848_BDELAY,4,4
	.comm	BT848_ADELAY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
