	.file	"extr_atafb.c_tt_encode_var.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	tt_encode_var, @function
tt_encode_var:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	edx, 200
	mov	rbp, rsi
	xor	esi, esi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	memset@PLT
	mov	DWORD PTR 112[rbx], 4
	movabs	rax, 515396106561
	mov	QWORD PTR [rbx], rax
	movabs	rax, 34359738468
	mov	QWORD PTR 8[rbx], rax
	movabs	rax, 601295421456
	mov	QWORD PTR 16[rbx], rax
	movabs	rax, -4294967266
	mov	QWORD PTR 24[rbx], rax
	mov	eax, 0
	test	BYTE PTR 8[rbp], 1
	cmove	rax, QWORD PTR FB_SYNC_EXT[rip]
	mov	QWORD PTR 128[rbx], 0
	mov	QWORD PTR 120[rbx], 0
	mov	QWORD PTR 184[rbx], rax
	mov	eax, DWORD PTR 12[rbp]
	and	eax, DWORD PTR TT_SHIFTER_MODEMASK[rip]
	mov	DWORD PTR 32[rbx], -1
	mov	QWORD PTR 192[rbx], 0
	add	eax, -128
	cmp	eax, 5
	ja	.L3
	lea	rdx, .L5[rip]
	movsx	rax, DWORD PTR [rdx+rax*4]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L5:
	.long	.L10-.L5
	.long	.L9-.L5
	.long	.L8-.L5
	.long	.L7-.L5
	.long	.L6-.L5
	.long	.L4-.L5
	.text
	.p2align 4,,10
	.p2align 3
.L6:
	mov	edx, DWORD PTR sttt_xres[rip]
	mov	ecx, DWORD PTR st_yres[rip]
	mov	DWORD PTR 48[rbx], 4
	mov	eax, edx
	shr	eax, 31
	add	eax, edx
	mov	edx, DWORD PTR sttt_xres_virtual[rip]
	sar	eax
	mov	DWORD PTR 36[rbx], eax
	mov	eax, edx
	shr	eax, 31
	add	eax, edx
	mov	edx, ecx
	shr	edx, 31
	sar	eax
	add	edx, ecx
	mov	DWORD PTR 40[rbx], eax
	sal	eax, 2
	sar	edx
	mov	DWORD PTR 44[rbx], edx
	.p2align 4,,10
	.p2align 3
.L11:
	test	eax, eax
	lea	ecx, 7[rax]
	movdqu	xmm0, XMMWORD PTR 112[rbx]
	mov	rdx, QWORD PTR 128[rbx]
	cmovns	ecx, eax
	mov	eax, DWORD PTR use_hwscroll[rip]
	mov	QWORD PTR 104[rbx], 0
	mov	QWORD PTR 152[rbx], rdx
	mov	QWORD PTR 176[rbx], rdx
	sar	ecx, 3
	mov	QWORD PTR 96[rbx], 0
	mov	QWORD PTR 88[rbx], 0
	movups	XMMWORD PTR 136[rbx], xmm0
	movups	XMMWORD PTR 160[rbx], xmm0
	test	eax, eax
	jne	.L12
	mov	eax, DWORD PTR 44[rbx]
	mov	DWORD PTR 52[rbx], eax
.L13:
	mov	eax, DWORD PTR screen_base[rip]
	mov	QWORD PTR 80[rbx], 0
	test	eax, eax
	je	.L17
	mov	edx, DWORD PTR 4[rbp]
	sub	edx, eax
	mov	eax, edx
	cdq
	idiv	ecx
.L17:
	mov	DWORD PTR 56[rbx], eax
	mov	eax, DWORD PTR FB_VMODE_NONINTERLACED[rip]
	mov	QWORD PTR 72[rbx], 0
	mov	DWORD PTR 60[rbx], eax
	mov	QWORD PTR 64[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
.L4:
	.cfi_restore_state
	mov	eax, DWORD PTR sttt_xres[rip]
	mov	edx, DWORD PTR st_yres[rip]
	mov	DWORD PTR 48[rbx], 1
	mov	DWORD PTR 36[rbx], eax
	mov	eax, DWORD PTR sttt_xres_virtual[rip]
	mov	DWORD PTR 44[rbx], edx
	mov	DWORD PTR 40[rbx], eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	mov	eax, DWORD PTR sttt_xres[rip]
	mov	edx, DWORD PTR tt_yres[rip]
	mov	DWORD PTR 48[rbx], 4
	mov	DWORD PTR 36[rbx], eax
	mov	eax, DWORD PTR sttt_xres_virtual[rip]
	mov	DWORD PTR 44[rbx], edx
	mov	DWORD PTR 40[rbx], eax
	sal	eax, 2
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	mov	edx, DWORD PTR sttt_xres[rip]
	mov	DWORD PTR 48[rbx], 8
	mov	eax, edx
	shr	eax, 31
	add	eax, edx
	mov	edx, DWORD PTR sttt_xres_virtual[rip]
	sar	eax
	mov	DWORD PTR 36[rbx], eax
	mov	eax, edx
	shr	eax, 31
	add	eax, edx
	mov	edx, DWORD PTR tt_yres[rip]
	sar	eax
	mov	DWORD PTR 40[rbx], eax
	sal	eax, 3
	mov	DWORD PTR 44[rbx], edx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L8:
	mov	eax, DWORD PTR sttt_xres[rip]
	mov	edi, DWORD PTR tt_yres[rip]
	mov	DWORD PTR 112[rbx], 0
	mov	DWORD PTR 48[rbx], 1
	add	eax, eax
	lea	edx, [rdi+rdi]
	mov	DWORD PTR 36[rbx], eax
	mov	eax, DWORD PTR sttt_xres_virtual[rip]
	mov	DWORD PTR 44[rbx], edx
	add	eax, eax
	mov	DWORD PTR 40[rbx], eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L7:
	mov	ecx, DWORD PTR st_yres[rip]
	mov	eax, DWORD PTR sttt_xres[rip]
	mov	DWORD PTR 48[rbx], 2
	mov	edx, ecx
	mov	DWORD PTR 36[rbx], eax
	mov	eax, DWORD PTR sttt_xres_virtual[rip]
	shr	edx, 31
	add	edx, ecx
	mov	DWORD PTR 40[rbx], eax
	add	eax, eax
	sar	edx
	mov	DWORD PTR 44[rbx], edx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	mov	eax, DWORD PTR screen_len[rip]
	test	eax, eax
	je	.L14
	mov	edx, DWORD PTR 0[rbp]
	test	edx, edx
	je	.L15
	mov	DWORD PTR 52[rbx], edx
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L14:
	mov	esi, DWORD PTR hwscroll[rip]
	mov	eax, DWORD PTR 44[rbx]
	mov	edx, esi
	sal	edx, 4
	add	edx, eax
	add	eax, eax
	test	esi, esi
	cmovns	eax, edx
	mov	DWORD PTR 52[rbx], eax
	jmp	.L13
.L3:
	mov	eax, DWORD PTR 48[rbx]
	imul	eax, DWORD PTR 40[rbx]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L15:
	cdq
	idiv	ecx
	mov	DWORD PTR 52[rbx], eax
	jmp	.L13
	.cfi_endproc
.LFE0:
	.size	tt_encode_var, .-tt_encode_var
	.comm	use_hwscroll,4,4
	.comm	tt_yres,4,4
	.comm	sttt_xres_virtual,4,4
	.comm	sttt_xres,4,4
	.comm	st_yres,4,4
	.comm	screen_len,4,4
	.comm	screen_base,4,4
	.comm	hwscroll,4,4
	.comm	TT_SHIFTER_MODEMASK,4,4
	.comm	FB_VMODE_NONINTERLACED,4,4
	.comm	FB_SYNC_EXT,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_atafb.c_tt_encode_var.c"
	.text
	.global	__aeabi_idiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tt_encode_var, %function
tt_encode_var:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r2, #96
	mov	r4, r0
	mov	r6, r1
	add	r0, r0, #36
	mov	r1, #0
	bl	memset
	mov	r0, #8
	mov	r2, #30
	mvn	r3, #0
	mov	r1, #140
	str	r0, [r4, #12]
	ldr	r0, [r6, #8]
	mov	r5, #4
	tst	r0, #1
	str	r2, [r4, #24]
	mov	r7, #120
	mov	lr, #100
	mov	ip, #16
	movne	r2, #0
	str	r3, [r4, #28]
	str	r3, [r4, #32]
	str	r1, [r4, #20]
	ldreq	r3, .L27
	ldr	r1, .L27+4
	ldreq	r2, [r3]
	ldr	r1, [r1]
	ldr	r3, [r6, #12]
	str	r5, [r4, #88]
	and	r3, r3, r1
	ldr	r5, .L27+8
	sub	r3, r3, #128
	stm	r4, {r5, r7, lr}
	str	ip, [r4, #16]
	str	r2, [r4, #124]
	cmp	r3, #5
	ldrls	pc, [pc, r3, asl #2]
	b	.L18
.L5:
	.word	.L10
	.word	.L9
	.word	.L8
	.word	.L7
	.word	.L6
	.word	.L4
.L4:
	ldr	r3, .L27+12
	mov	r2, #1
	ldr	r3, [r3]
	str	r2, [r4, #48]
	cmp	r3, #0
	add	r5, r3, #7
	movge	r5, r3
	ldr	r1, .L27+16
	ldr	r2, .L27+20
.L24:
	ldr	r2, [r2]
	ldr	r1, [r1]
	str	r3, [r4, #40]
	asr	r5, r5, #3
	str	r1, [r4, #36]
	str	r2, [r4, #44]
.L3:
	mov	lr, #0
	add	r3, r4, #100
	add	r2, r4, #88
	ldm	r2, {r0, r1, r2}
	stm	r3, {r0, r1, r2}
	ldr	r2, .L27+24
	add	ip, r4, #112
	ldr	r7, [r2]
	ldm	r3, {r0, r1, r2}
	cmp	r7, lr
	stm	ip, {r0, r1, r2}
	str	lr, [r4, #84]
	str	lr, [r4, #80]
	str	lr, [r4, #76]
	bne	.L11
	ldr	r3, [r4, #44]
	str	r3, [r4, #52]
.L12:
	mov	r2, #0
	ldr	r3, .L27+28
	str	r2, [r4, #72]
	ldr	r3, [r3]
	cmp	r3, r2
	beq	.L16
	ldr	r0, [r6, #4]
	mov	r1, r5
	sub	r0, r0, r3
	bl	__aeabi_idiv
	mov	r3, r0
.L16:
	mov	r0, #0
	ldr	r2, .L27+32
	str	r3, [r4, #56]
	ldr	r3, [r2]
	str	r0, [r4, #68]
	str	r3, [r4, #60]
	str	r0, [r4, #64]
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	mov	r2, #4
	ldr	r3, .L27+12
	str	r2, [r4, #48]
	ldr	r3, [r3]
	ldr	r1, .L27+16
	lsl	r5, r3, #2
	add	r2, r5, #7
	cmp	r5, #0
	movlt	r5, r2
	ldr	r2, .L27+36
	b	.L24
.L9:
	mov	r2, #8
	ldr	r1, .L27+12
	ldr	r3, .L27+16
	ldr	r5, [r1]
	ldr	r3, [r3]
	ldr	r1, .L27+36
	add	r3, r3, r3, lsr #31
	ldr	r1, [r1]
	add	r5, r5, r5, lsr #31
	asr	r3, r3, #1
	asr	r5, r5, #1
	str	r3, [r4, #36]
	str	r5, [r4, #40]
	str	r1, [r4, #44]
	str	r2, [r4, #48]
	b	.L3
.L8:
	mov	r2, #0
	ldr	r3, .L27+12
	mov	r0, #1
	ldr	r3, [r3]
	ldr	r1, .L27+16
	lsl	r3, r3, #1
	cmp	r3, r2
	add	r5, r3, #7
	movge	r5, r3
	str	r2, [r4, #88]
	ldr	r2, .L27+36
	ldr	r1, [r1]
	ldr	r2, [r2]
	lsl	r1, r1, r0
	lsl	r2, r2, r0
	str	r3, [r4, #40]
	asr	r5, r5, #3
	str	r1, [r4, #36]
	str	r2, [r4, #44]
	str	r0, [r4, #48]
	b	.L3
.L7:
	mov	r3, #2
	ldr	r2, .L27+12
	str	r3, [r4, #48]
	ldr	r2, [r2]
	ldr	r1, .L27+16
	lsl	r5, r2, #1
	add	r3, r5, #7
	cmp	r5, #0
	movlt	r5, r3
	ldr	r3, .L27+20
	ldr	r1, [r1]
	ldr	r3, [r3]
	str	r2, [r4, #40]
	add	r3, r3, r3, lsr #31
	asr	r3, r3, #1
	asr	r5, r5, #3
	str	r3, [r4, #44]
	str	r1, [r4, #36]
	b	.L3
.L6:
	mov	r2, #4
	ldr	r3, .L27+12
	str	r2, [r4, #48]
	ldr	r3, [r3]
	ldr	r1, .L27+16
	add	r3, r3, r3, lsr #31
	asr	r3, r3, #1
	lsl	r5, r3, #2
	add	r2, r5, #7
	cmp	r5, #0
	movlt	r5, r2
	ldr	r2, .L27+20
	ldr	r1, [r1]
	ldr	r2, [r2]
	add	r1, r1, r1, lsr #31
	add	r2, r2, r2, lsr #31
	asr	r1, r1, #1
	asr	r2, r2, #1
	str	r3, [r4, #40]
	asr	r5, r5, #3
	str	r1, [r4, #36]
	str	r2, [r4, #44]
	b	.L3
.L11:
	ldr	r3, .L27+40
	ldr	r0, [r3]
	cmp	r0, #0
	beq	.L13
	ldr	r3, [r6]
	cmp	r3, #0
	bne	.L25
	mov	r1, r5
	bl	__aeabi_idiv
	str	r0, [r4, #52]
	b	.L12
.L13:
	ldr	r2, .L27+44
	ldr	r3, [r4, #44]
	ldr	r2, [r2]
	cmp	r2, #0
	lsllt	r3, r3, #1
	strlt	r3, [r4, #52]
	blt	.L12
	add	r3, r3, r2, lsl #4
.L25:
	str	r3, [r4, #52]
	b	.L12
.L18:
	mov	r5, #0
	b	.L3
.L28:
	.align	2
.L27:
	.word	FB_SYNC_EXT
	.word	TT_SHIFTER_MODEMASK
	.word	31041
	.word	sttt_xres_virtual
	.word	sttt_xres
	.word	st_yres
	.word	use_hwscroll
	.word	screen_base
	.word	FB_VMODE_NONINTERLACED
	.word	tt_yres
	.word	screen_len
	.word	hwscroll
	.size	tt_encode_var, .-tt_encode_var
	.comm	use_hwscroll,4,4
	.comm	tt_yres,4,4
	.comm	sttt_xres_virtual,4,4
	.comm	sttt_xres,4,4
	.comm	st_yres,4,4
	.comm	screen_len,4,4
	.comm	screen_base,4,4
	.comm	hwscroll,4,4
	.comm	TT_SHIFTER_MODEMASK,4,4
	.comm	FB_VMODE_NONINTERLACED,4,4
	.comm	FB_SYNC_EXT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
