	.file	"extr_adv7393.c_adv7393_setstd.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Invalid std or std is not supported: %llx\n"
	.align 8
.LC1:
	.string	"Error setting std, write failed\n"
	.text
	.p2align 4
	.type	adv7393_setstd, @function
adv7393_setstd:
.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	r13, rdi
	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	ebx, esi
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	to_state@PLT
	mov	rdi, QWORD PTR stdinfo[rip]
	mov	rbp, rax
	call	ARRAY_SIZE@PLT
	test	eax, eax
	jle	.L2
	mov	rdx, QWORD PTR stdinfo[rip]
	xor	ecx, ecx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L25:
	add	ecx, 1
	add	rdx, 12
	cmp	eax, ecx
	je	.L5
.L4:
	mov	r14, rdx
	test	DWORD PTR [rdx], ebx
	je	.L25
.L3:
	mov	r15d, DWORD PTR SD_STD_MASK[rip]
	mov	rsi, QWORD PTR ADV7393_SD_MODE_REG1[rip]
	mov	rdi, r13
	not	r15d
	and	r15d, DWORD PTR 0[rbp]
	or	r15d, DWORD PTR 4[r14]
	mov	edx, r15d
	call	adv7393_write@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L7
	mov	DWORD PTR 0[rbp], r15d
	mov	r15d, DWORD PTR INPUT_MODE_MASK[rip]
	mov	rdi, r13
	mov	rsi, QWORD PTR ADV7393_MODE_SELECT_REG[rip]
	not	r15d
	and	r15d, DWORD PTR 4[rbp]
	or	r15d, DWORD PTR SD_INPUT_MODE[rip]
	mov	edx, r15d
	call	adv7393_write@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L7
	mov	DWORD PTR 4[rbp], r15d
	mov	r15d, DWORD PTR 8[r14]
	mov	r14, QWORD PTR ADV7393_FSC_REG0[rip]
	cmp	r14, QWORD PTR ADV7393_FSC_REG3[rip]
	jle	.L8
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L26:
	sar	r15d, 8
	add	r14, 1
	cmp	QWORD PTR ADV7393_FSC_REG3[rip], r14
	jl	.L11
.L8:
	mov	edx, r15d
	mov	rsi, r14
	mov	rdi, r13
	call	adv7393_write@PLT
	mov	r12d, eax
	test	eax, eax
	jns	.L26
.L7:
	lea	rsi, .LC1[rip]
	mov	rdi, r13
	call	v4l2_err@PLT
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L2:
	.cfi_restore_state
	je	.L5
	mov	r14, QWORD PTR stdinfo[rip]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L5:
	mov	esi, DWORD PTR debug[rip]
	movsx	r8, ebx
	lea	rcx, .LC0[rip]
	mov	rdx, r13
	mov	edi, 1
	call	v4l2_dbg@PLT
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	edx, DWORD PTR V4L2_STD_NTSC[rip]
	or	edx, DWORD PTR V4L2_STD_NTSC_443[rip]
	mov	eax, DWORD PTR 8[rbp]
	test	edx, ebx
	je	.L27
	or	eax, DWORD PTR SD_PEDESTAL_EN[rip]
	mov	ebx, eax
.L12:
	mov	rsi, QWORD PTR ADV7393_SD_MODE_REG2[rip]
	mov	edx, ebx
	mov	rdi, r13
	call	adv7393_write@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L7
	mov	DWORD PTR 8[rbp], ebx
	je	.L1
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L27:
	and	eax, DWORD PTR SD_PEDESTAL_DI[rip]
	mov	ebx, eax
	jmp	.L12
	.cfi_endproc
.LFE0:
	.size	adv7393_setstd, .-adv7393_setstd
	.comm	stdinfo,8,8
	.comm	debug,4,4
	.comm	V4L2_STD_NTSC_443,4,4
	.comm	V4L2_STD_NTSC,4,4
	.comm	SD_STD_MASK,4,4
	.comm	SD_PEDESTAL_EN,4,4
	.comm	SD_PEDESTAL_DI,4,4
	.comm	SD_INPUT_MODE,4,4
	.comm	INPUT_MODE_MASK,4,4
	.comm	EINVAL,4,4
	.comm	ADV7393_SD_MODE_REG2,8,8
	.comm	ADV7393_SD_MODE_REG1,8,8
	.comm	ADV7393_MODE_SELECT_REG,8,8
	.comm	ADV7393_FSC_REG3,8,8
	.comm	ADV7393_FSC_REG0,8,8
	.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_adv7393.c_adv7393_setstd.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Invalid std or std is not supported: %llx\012\000"
	.align	2
.LC1:
	.ascii	"Error setting std, write failed\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	adv7393_setstd, %function
adv7393_setstd:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #12
	mov	r4, r1
	mov	r5, r0
	bl	to_state
	ldr	r7, .L23
	mov	r6, r0
	ldr	r0, [r7]
	bl	ARRAY_SIZE
	subs	r1, r0, #0
	ble	.L2
	mov	r2, #0
	ldr	r3, [r7]
	b	.L4
.L20:
	cmp	r1, r2
	add	r3, r3, #12
	beq	.L5
.L4:
	ldr	ip, [r3]
	mov	r7, r3
	tst	r4, ip
	add	r2, r2, #1
	beq	.L20
.L3:
	ldr	r3, .L23+4
	ldr	r2, [r6]
	ldr	r3, [r3]
	ldr	r9, [r7, #4]
	bic	r2, r2, r3
	ldr	r3, .L23+8
	orr	r9, r2, r9
	mov	r2, r9
	mov	r0, r5
	ldr	r1, [r3]
	bl	adv7393_write
	subs	r8, r0, #0
	blt	.L7
	ldr	r3, .L23+12
	ldr	r2, .L23+16
	ldr	r3, [r3]
	ldr	fp, [r6, #4]
	ldr	r2, [r2]
	bic	fp, fp, r3
	ldr	r3, .L23+20
	orr	fp, fp, r2
	mov	r2, fp
	mov	r0, r5
	ldr	r1, [r3]
	str	r9, [r6]
	bl	adv7393_write
	subs	r8, r0, #0
	blt	.L7
	ldr	r3, .L23+24
	ldr	r10, .L23+28
	ldr	r9, [r3]
	ldr	r3, [r10]
	ldr	r7, [r7, #8]
	cmp	r9, r3
	str	fp, [r6, #4]
	ble	.L8
	b	.L11
.L21:
	ldr	r3, [r10]
	asr	r7, r7, #8
	cmp	r3, r9
	blt	.L11
.L8:
	mov	r1, r9
	mov	r2, r7
	mov	r0, r5
	bl	adv7393_write
	subs	r8, r0, #0
	add	r9, r9, #1
	bge	.L21
.L7:
	mov	r0, r5
	ldr	r1, .L23+32
	bl	v4l2_err
	mov	r0, r8
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldrne	r7, [r7]
	bne	.L3
.L5:
	mov	r0, r4
	asr	r1, r4, #31
	stm	sp, {r0-r1}
	ldr	r3, .L23+36
	mov	r2, r5
	ldr	r1, [r3]
	mov	r0, #1
	ldr	r3, .L23+40
	bl	v4l2_dbg
	ldr	r3, .L23+44
	ldr	r0, [r3]
	rsb	r8, r0, #0
	mov	r0, r8
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L11:
	ldr	r2, .L23+48
	ldr	r3, .L23+52
	ldr	r1, [r2]
	ldr	r3, [r3]
	ldr	r2, [r6, #8]
	orr	r3, r3, r1
	tst	r3, r4
	beq	.L22
	ldr	r3, .L23+56
	ldr	r4, [r3]
	orr	r4, r2, r4
.L12:
	ldr	r3, .L23+60
	mov	r2, r4
	mov	r0, r5
	ldr	r1, [r3]
	bl	adv7393_write
	subs	r8, r0, #0
	blt	.L7
	str	r4, [r6, #8]
	bne	.L7
	mov	r0, r8
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L22:
	ldr	r3, .L23+64
	ldr	r4, [r3]
	and	r4, r4, r2
	b	.L12
.L24:
	.align	2
.L23:
	.word	stdinfo
	.word	SD_STD_MASK
	.word	ADV7393_SD_MODE_REG1
	.word	INPUT_MODE_MASK
	.word	SD_INPUT_MODE
	.word	ADV7393_MODE_SELECT_REG
	.word	ADV7393_FSC_REG0
	.word	ADV7393_FSC_REG3
	.word	.LC1
	.word	debug
	.word	.LC0
	.word	EINVAL
	.word	V4L2_STD_NTSC_443
	.word	V4L2_STD_NTSC
	.word	SD_PEDESTAL_EN
	.word	ADV7393_SD_MODE_REG2
	.word	SD_PEDESTAL_DI
	.size	adv7393_setstd, .-adv7393_setstd
	.comm	stdinfo,4,4
	.comm	debug,4,4
	.comm	V4L2_STD_NTSC_443,4,4
	.comm	V4L2_STD_NTSC,4,4
	.comm	SD_STD_MASK,4,4
	.comm	SD_PEDESTAL_EN,4,4
	.comm	SD_PEDESTAL_DI,4,4
	.comm	SD_INPUT_MODE,4,4
	.comm	INPUT_MODE_MASK,4,4
	.comm	EINVAL,4,4
	.comm	ADV7393_SD_MODE_REG2,4,4
	.comm	ADV7393_SD_MODE_REG1,4,4
	.comm	ADV7393_MODE_SELECT_REG,4,4
	.comm	ADV7393_FSC_REG3,4,4
	.comm	ADV7393_FSC_REG0,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
