	.file	"extr_video.c_VIDEO_Configure.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	VIDEO_Configure
	.type	VIDEO_Configure, @function
VIDEO_Configure:
.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
	xor	edi, edi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	_CPU_ISR_Disable@PLT
	mov	edi, DWORD PTR [rbx]
	mov	eax, edi
	and	eax, 3
	cmp	DWORD PTR HorVer[rip], eax
	je	.L2
	mov	DWORD PTR changeMode[rip], 1
	mov	DWORD PTR HorVer[rip], eax
.L2:
	mov	edx, 3
	mov	esi, 2
	call	_SHIFTR@PLT
	mov	ecx, DWORD PTR 4[rbx]
	mov	edx, DWORD PTR VI_NON_INTERLACE[rip]
	mov	DWORD PTR HorVer[rip+4], eax
	mov	esi, DWORD PTR HorVer[rip]
	mov	edi, eax
	mov	eax, DWORD PTR 32[rbx]
	mov	r8, QWORD PTR 16[rbx]
	cmp	esi, edx
	mov	DWORD PTR HorVer[rip+128], eax
	lea	eax, [rcx+rcx]
	cmovne	eax, ecx
	mov	ecx, DWORD PTR 24[rbx]
	mov	DWORD PTR HorVer[rip+8], eax
	mov	eax, DWORD PTR 28[rbx]
	mov	DWORD PTR HorVer[rip+96], ecx
	mov	DWORD PTR HorVer[rip+100], eax
	mov	eax, DWORD PTR 8[rbx]
	mov	DWORD PTR HorVer[rip+80], ecx
	mov	ecx, DWORD PTR VI_PROGRESSIVE[rip]
	mov	DWORD PTR HorVer[rip+12], eax
	mov	QWORD PTR HorVer[rip+16], r8
	or	edx, ecx
	mov	DWORD PTR HorVer[rip+24], eax
	mov	QWORD PTR HorVer[rip+88], 0
	mov	QWORD PTR HorVer[rip+120], 0
	cmp	esi, ecx
	je	.L7
	cmp	esi, edx
	je	.L7
	cmp	r8, QWORD PTR VI_XFBMODE_SF[rip]
	je	.L17
.L7:
	mov	DWORD PTR HorVer[rip+28], eax
.L6:
	xor	eax, eax
	cmp	esi, edx
	sete	al
	mov	DWORD PTR HorVer[rip+32], eax
	call	VI_TVMODE@PLT
	mov	edi, eax
	call	__gettiming@PLT
	mov	edi, DWORD PTR 16[rax]
	mov	rbx, rax
	mov	QWORD PTR HorVer[rip+112], rax
	call	__adjustPosition@PLT
	mov	rdi, rbx
	call	__setInterruptRegs@PLT
	mov	edi, DWORD PTR HorVer[rip+32]
	mov	edx, 1
	mov	rax, QWORD PTR regs[rip]
	mov	esi, 3
	mov	ebp, DWORD PTR 4[rax]
	call	_SHIFTL@PLT
	mov	edi, DWORD PTR HorVer[rip]
	and	ebp, -781
	or	ebp, eax
	mov	eax, DWORD PTR VI_PROGRESSIVE[rip]
	cmp	edi, eax
	je	.L8
	or	eax, DWORD PTR VI_NON_INTERLACE[rip]
	cmp	edi, eax
	jne	.L9
.L8:
	or	ebp, 4
.L10:
	mov	edi, DWORD PTR HorVer[rip+4]
	cmp	edi, DWORD PTR VI_EURGB60[rip]
	je	.L11
	mov	edx, 2
	mov	esi, 8
	call	_SHIFTL@PLT
	or	ebp, eax
.L11:
	mov	rax, QWORD PTR regs[rip]
	mov	edi, 1
	mov	DWORD PTR 4[rax], ebp
	call	VI_REGCHANGE@PLT
	mov	rcx, QWORD PTR regs[rip]
	or	DWORD PTR changed[rip], eax
	mov	esi, DWORD PTR HorVer[rip]
	mov	edx, DWORD PTR VI_PROGRESSIVE[rip]
	mov	eax, DWORD PTR 216[rcx]
	and	eax, -2
	mov	DWORD PTR 216[rcx], eax
	cmp	esi, edx
	je	.L12
	or	edx, DWORD PTR VI_NON_INTERLACE[rip]
	cmp	esi, edx
	je	.L12
.L13:
	mov	edi, 54
	call	VI_REGCHANGE@PLT
	mov	edx, DWORD PTR HorVer[rip+32]
	mov	esi, DWORD PTR HorVer[rip+100]
	mov	edi, DWORD PTR HorVer[rip+80]
	or	DWORD PTR changed[rip], eax
	call	__setScalingRegs@PLT
	mov	edx, DWORD PTR HorVer[rip+100]
	mov	esi, DWORD PTR HorVer[rip+104]
	mov	rdi, rbx
	call	__setHorizontalRegs@PLT
	mov	rdi, rbx
	call	__setBBIntervalRegs@PLT
	lea	rax, HorVer[rip+64]
	mov	rdx, QWORD PTR HorVer[rip+88]
	mov	ecx, DWORD PTR HorVer[rip+80]
	mov	rsi, QWORD PTR HorVer[rip+16]
	mov	edi, DWORD PTR HorVer[rip+96]
	push	rax
	.cfi_def_cfa_offset 40
	add	rax, 4
	push	rax
	.cfi_def_cfa_offset 48
	lea	r9, 4[rax]
	lea	r8, 8[rax]
	call	__setPicConfig@PLT
	cmp	QWORD PTR fbSet[rip], 0
	pop	rax
	.cfi_def_cfa_offset 40
	pop	rdx
	.cfi_def_cfa_offset 32
	jne	.L18
.L14:
	mov	eax, DWORD PTR HorVer[rip+36]
	sub	rsp, 8
	.cfi_def_cfa_offset 40
	mov	r9d, DWORD PTR 8[rbx]
	mov	r8d, DWORD PTR 12[rbx]
	mov	ecx, DWORD PTR 16[rbx]
	mov	edx, DWORD PTR 20[rbx]
	mov	edi, DWORD PTR HorVer[rip+44]
	push	rax
	.cfi_def_cfa_offset 48
	mov	eax, DWORD PTR [rbx]
	mov	esi, DWORD PTR HorVer[rip+40]
	push	rax
	.cfi_def_cfa_offset 56
	mov	eax, DWORD PTR 4[rbx]
	push	rax
	.cfi_def_cfa_offset 64
	call	__setVerticalRegs@PLT
	add	rsp, 40
	.cfi_def_cfa_offset 24
	xor	edi, edi
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	_CPU_ISR_Restore@PLT
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_def_cfa_offset 32
	or	eax, 1
	mov	DWORD PTR 216[rcx], eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	mov	edx, 1
	mov	esi, 2
	call	_SHIFTL@PLT
	or	ebp, eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L18:
	lea	r8, HorVer[rip+48]
	lea	rcx, 4[r8]
	lea	rdx, 4[rcx]
	lea	rsi, 4[rdx]
	lea	rdi, -56[rdx]
	call	__setFbbRegs@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L17:
	add	eax, eax
	mov	DWORD PTR HorVer[rip+28], eax
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	VIDEO_Configure, .-VIDEO_Configure
	.comm	regs,8,8
	.comm	fbSet,8,8
	.comm	changed,4,4
	.comm	changeMode,4,4
	.comm	VI_XFBMODE_SF,8,8
	.comm	VI_PROGRESSIVE,4,4
	.comm	VI_NON_INTERLACE,4,4
	.comm	VI_EURGB60,4,4
	.comm	HorVer,136,32
	.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_video.c_VIDEO_Configure.c"
	.text
	.align	2
	.global	VIDEO_Configure
	.syntax unified
	.arm
	.fpu softvfp
	.type	VIDEO_Configure, %function
VIDEO_Configure:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r5, r0
	ldr	r4, .L21
	sub	sp, sp, #28
	mov	r0, #0
	bl	_CPU_ISR_Disable
	ldr	r0, [r5]
	ldr	r2, [r4]
	and	r3, r0, #3
	cmp	r2, r3
	movne	r1, #1
	ldrne	r2, .L21+4
	strne	r3, [r4]
	strne	r1, [r2]
	mov	r2, #3
	mov	r1, #2
	bl	_SHIFTR
	mov	ip, #0
	ldr	r7, .L21+8
	ldr	r1, [r4]
	ldr	r6, [r7]
	ldr	r2, [r5, #4]
	ldr	r3, [r5, #24]
	ldr	r8, .L21+12
	cmp	r1, r6
	str	r2, [r4, #8]
	str	r3, [r4, #104]
	lsleq	r2, r2, #1
	ldr	r3, [r8]
	ldr	lr, [r5, #16]
	ldr	r9, [r5, #20]
	streq	r2, [r4, #8]
	ldr	r2, [r5, #8]
	ldr	r5, [r5, #12]
	cmp	r1, r3
	str	r0, [r4, #4]
	orr	r3, r6, r3
	str	r9, [r4, #88]
	str	lr, [r4, #84]
	str	ip, [r4, #80]
	str	r2, [r4, #12]
	str	r5, [r4, #16]
	str	lr, [r4, #76]
	str	r2, [r4, #20]
	str	ip, [r4, #100]
	beq	.L7
	cmp	r1, r3
	beq	.L7
	ldr	ip, .L21+16
	ldr	ip, [ip]
	cmp	r5, ip
	lsleq	r2, r2, #1
	streq	r2, [r4, #24]
	beq	.L6
.L7:
	str	r2, [r4, #24]
.L6:
	sub	r3, r1, r3
	clz	r3, r3
	lsr	r3, r3, #5
	str	r3, [r4, #28]
	bl	VI_TVMODE
	bl	__gettiming
	mov	r5, r0
	ldr	r9, .L21+20
	ldr	r0, [r0, #16]
	str	r5, [r4, #96]
	bl	__adjustPosition
	mov	r0, r5
	bl	__setInterruptRegs
	ldr	r3, [r9]
	mov	r2, #1
	mov	r1, #3
	ldr	r0, [r4, #28]
	ldr	r6, [r3, #4]
	bl	_SHIFTL
	ldr	r2, [r4]
	ldr	r3, [r8]
	bic	r6, r6, #780
	cmp	r2, r3
	orr	r6, r6, r0
	beq	.L8
	ldr	r1, [r7]
	orr	r3, r3, r1
	cmp	r2, r3
	bne	.L9
.L8:
	orr	r6, r6, #4
.L10:
	ldr	r3, .L21+24
	ldr	r0, [r4, #4]
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L11
	mov	r2, #2
	mov	r1, #8
	bl	_SHIFTL
	orr	r6, r6, r0
.L11:
	ldr	r3, [r9]
	mov	r0, #1
	str	r6, [r3, #4]
	bl	VI_REGCHANGE
	ldr	r6, .L21+28
	ldr	ip, [r9]
	ldr	r2, [r6]
	ldr	r3, [ip, #216]
	orr	r2, r2, r0
	ldr	r1, [r8]
	ldr	r0, [r4]
	bic	r3, r3, #1
	cmp	r0, r1
	str	r2, [r6]
	str	r3, [ip, #216]
	beq	.L12
	ldr	r2, [r7]
	orr	r1, r1, r2
	cmp	r0, r1
	beq	.L12
.L13:
	mov	r0, #54
	bl	VI_REGCHANGE
	ldr	r3, [r6]
	ldr	r2, [r4, #28]
	orr	r3, r3, r0
	ldr	r1, [r4, #88]
	ldr	r0, [r4, #76]
	str	r3, [r6]
	bl	__setScalingRegs
	ldr	r6, .L21+32
	ldr	r2, [r4, #88]
	ldr	r1, [r4, #92]
	mov	r0, r5
	bl	__setHorizontalRegs
	mov	r0, r5
	bl	__setBBIntervalRegs
	add	r1, r6, #4
	add	r2, r6, #8
	add	r3, r6, #12
	str	r1, [sp, #8]
	str	r2, [sp, #4]
	str	r3, [sp]
	ldr	r2, [r4, #80]
	ldr	r3, [r4, #76]
	ldr	r1, [r4, #16]
	ldr	r0, [r4, #84]
	str	r6, [sp, #12]
	bl	__setPicConfig
	ldr	r3, .L21+36
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L20
.L14:
	ldr	r1, [r4, #32]
	ldr	r3, [r5, #16]
	ldr	r2, [r5, #20]
	str	r1, [sp, #16]
	ldr	r1, [r5]
	str	r1, [sp, #12]
	ldr	r1, [r5, #4]
	str	r1, [sp, #8]
	ldr	r0, [r5, #8]
	ldr	r1, [r4, #36]
	str	r0, [sp, #4]
	ldr	ip, [r5, #12]
	ldr	r0, [r4, #40]
	str	ip, [sp]
	bl	__setVerticalRegs
	mov	r0, #0
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, lr}
	b	_CPU_ISR_Restore
.L12:
	orr	r3, r3, #1
	str	r3, [ip, #216]
	b	.L13
.L9:
	mov	r0, r2
	mov	r1, #2
	mov	r2, #1
	bl	_SHIFTL
	orr	r6, r6, r0
	b	.L10
.L20:
	sub	r3, r6, #16
	str	r3, [sp]
	sub	r2, r6, #8
	sub	r3, r6, #12
	sub	r1, r6, #4
	sub	r0, r6, #60
	bl	__setFbbRegs
	b	.L14
.L22:
	.align	2
.L21:
	.word	HorVer
	.word	changeMode
	.word	VI_NON_INTERLACE
	.word	VI_PROGRESSIVE
	.word	VI_XFBMODE_SF
	.word	regs
	.word	VI_EURGB60
	.word	changed
	.word	HorVer+60
	.word	fbSet
	.size	VIDEO_Configure, .-VIDEO_Configure
	.comm	regs,4,4
	.comm	fbSet,4,4
	.comm	changed,4,4
	.comm	changeMode,4,4
	.comm	VI_XFBMODE_SF,4,4
	.comm	VI_PROGRESSIVE,4,4
	.comm	VI_NON_INTERLACE,4,4
	.comm	VI_EURGB60,4,4
	.comm	HorVer,108,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
