// File: /workspace/github_c_makefile_star2_O3/anachronic[P]st/st.c
// Function: treset
void
treset(void)
{
	uint i;
  int x, y;

	tresetcursor();

	memset(term.tabs, 0, term.col * sizeof(*term.tabs));
	for (i = tabspaces; i < term.col; i += tabspaces)
		term.tabs[i] = 1;
	term.top = 0;
	term.histf = 0;
	term.scr = 0;
	term.bot = term.row - 1;
	term.mode = MODE_WRAP|MODE_UTF8;
	memset(term.trantbl, CS_USA, sizeof(term.trantbl));
	term.charset = 0;

  selremove();
	for (i = 0; i < 2; i++) {
  	tcursor(CURSOR_SAVE); /* reset saved cursor */
		for (y = 0; y < term.row; y++)
			for (x = 0; x < term.col; x++)
				tclearglyph(&term.line[y][x], 0);
		tswapscreen();
	}
  tfulldirt();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x10fbe(%rip), %rbx     # 0x184dc
movl (%rbx), %eax
leaq 0x10fb9(%rip), %r14     # 0x184e0
movl (%r14), %ecx
movl $0x0, 0x1525c(%rip)     # 0x1c790
movw $0x0, 0x15257(%rip)     # 0x1c794
movl %eax, 0x15255(%rip)     # 0x1c798
movl %ecx, 0x15253(%rip)     # 0x1c79c
movq $0x0, 0x1524c(%rip) # 0x1c7a0
movb $0x0, 0x1524d(%rip)     # 0x1c7a8
movq 0x1526e(%rip), %rdi     # 0x1c7d0
movslq 0x1137b(%rip), %rdx     # 0x188e4
shlq $0x2, %rdx
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x50a0
leaq 0x10f5a(%rip), %rax     # 0x184d8
movl (%rax), %ecx
movl 0x1135e(%rip), %ebp     # 0x188e4
cmpl %ebp, %ecx
jae 0x75a6
movq 0x1523f(%rip), %rdx     # 0x1c7d0
movl %ecx, %esi
movl $0x1, (%rdx,%rsi,4)
addl (%rax), %ecx
movl 0x11342(%rip), %ebp     # 0x188e4
cmpl %ebp, %ecx
jb 0x7591
movl %r15d, 0x15207(%rip)    # 0x1c7b4
movq $0x0, 0x151bc(%rip) # 0x1c774
movl 0x11321(%rip), %r12d    # 0x188e0
leal -0x1(%r12), %eax
movl %eax, 0x151ee(%rip)     # 0x1c7b8
movq $0x3030303, 0x151ef(%rip) # imm = 0x3030303
movl %r15d, 0x112d4(%rip)    # 0x188b0
movl $0xffffffff, 0x112e6(%rip) # imm = 0xFFFFFFFF
movq 0x1724b(%rip), %rdi     # 0x1e838
movl 0x1724d(%rip), %eax     # 0x1e840
movl 0x1724b(%rip), %ecx     # 0x1e844
movl $0x41, %edx
movb $0x1, %sil
movq 0x112e0(%rip), %r15     # 0x188e8
movl %ecx, 0x4(%rsp)
movl %eax, (%rsp)
movl %ebp, %eax
movl %r12d, %ecx
movq %r15, %r11
movl %edx, %r8d
shrl $0x2, %r8d
andl $0x1, %r8d
leaq (%r8,%r8,8), %r15
leaq (%r15,%r15,2), %r15
addq %r8, %r15
movups 0x15168(%rip), %xmm0    # 0x1c79c
leaq 0x171c5(%rip), %r8      # 0x1e800
movups %xmm0, 0xc(%r8,%r15)
movups 0x15148(%rip), %xmm0    # 0x1c790
movups %xmm0, (%r8,%r15)
testl %r12d, %r12d
jle 0x769c
movl %ecx, %r15d
movl %eax, %r12d
shlq $0x4, %r12
xorl %r13d, %r13d
testl %eax, %eax
jle 0x7694
movq (%r11,%r13,8), %rbp
xorl %r8d, %r8d
movl (%r14), %r9d
movl (%rbx), %r10d
movl %r10d, 0x8(%rbp,%r8)
movl %r9d, 0xc(%rbp,%r8)
movw $0x0, 0x4(%rbp,%r8)
movl $0x20, (%rbp,%r8)
addq $0x10, %r8
cmpq %r8, %r12
jne 0x766a
incq %r13
cmpq %r15, %r13
jne 0x765f
movq %rdi, 0x11245(%rip)     # 0x188e8
xorl $0x4, %edx
movq %rdi, %r15
movl 0x4(%rsp), %r8d
movl %r8d, %r12d
movl (%rsp), %r9d
movl %r9d, %ebp
movq %r11, %rdi
testb $0x1, %sil
movl $0x0, %esi
jne 0x7608
movl $0x41, 0x150e8(%rip)    # 0x1c7bc
movl %r8d, 0x11205(%rip)     # 0x188e0
movl %r9d, 0x11202(%rip)     # 0x188e4
movq %r11, 0x1714f(%rip)     # 0x1e838
movl %eax, 0x17151(%rip)     # 0x1e840
movl %ecx, 0x1714f(%rip)     # 0x1e844
testl %r8d, %r8d
jle 0x7719
movq 0x15087(%rip), %rax     # 0x1c788
xorl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
incq %rcx
movslq 0x111cc(%rip), %rdx     # 0x188e0
cmpq %rdx, %rcx
jl 0x7703
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq