// File: /workspace/github_c_makefile_star2_O1/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 0x110dc(%rip), %rbx     # 0x184ec
movl (%rbx), %eax
leaq 0x110d7(%rip), %r14     # 0x184f0
movl (%r14), %ecx
movl $0x0, 0x1537a(%rip)     # 0x1c7a0
movw $0x0, 0x15375(%rip)     # 0x1c7a4
movl %eax, 0x15373(%rip)     # 0x1c7a8
movl %ecx, 0x15371(%rip)     # 0x1c7ac
movq $0x0, 0x1536a(%rip) # 0x1c7b0
movb $0x0, 0x1536b(%rip)     # 0x1c7b8
movq 0x1538c(%rip), %rdi     # 0x1c7e0
movslq 0x11499(%rip), %rdx     # 0x188f4
shlq $0x2, %rdx
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x50a0
leaq 0x11078(%rip), %rax     # 0x184e8
movl (%rax), %ecx
cmpl 0x1147c(%rip), %ecx     # 0x188f4
jae 0x7494
movq 0x1535f(%rip), %rdx     # 0x1c7e0
movl %ecx, %esi
movl $0x1, (%rdx,%rsi,4)
addl (%rax), %ecx
cmpl 0x11462(%rip), %ecx     # 0x188f4
jb 0x7481
movl %r15d, 0x15329(%rip)    # 0x1c7c4
movq $0x0, 0x152de(%rip) # 0x1c784
movl 0x11443(%rip), %r10d    # 0x188f0
leal -0x1(%r10), %eax
movl %eax, 0x15311(%rip)     # 0x1c7c8
movl $0x41, 0x1530b(%rip)    # 0x1c7cc
movq $0x3030303, 0x15308(%rip) # imm = 0x3030303
movl %r15d, 0x113ed(%rip)    # 0x188c0
movl $0xffffffff, 0x113ff(%rip) # imm = 0xFFFFFFFF
movl 0x11410(%rip), %r11d    # 0x188f4
movq 0x1735d(%rip), %r8      # 0x1e848
movl 0x1735f(%rip), %eax     # 0x1e850
movl $0x41, %edx
movl 0x17358(%rip), %ecx     # 0x1e854
movl %ecx, %r9d
movl %eax, 0x4(%rsp)
movl %r11d, %eax
movl %r10d, %ecx
movl %edx, %esi
shrl $0x2, %esi
andl $0x1, %esi
leaq (%rsi,%rsi,8), %r10
leaq (%r10,%r10,2), %r10
addq %rsi, %r10
movups 0x15289(%rip), %xmm0    # 0x1c7ac
leaq 0x172e6(%rip), %rsi     # 0x1e810
movups %xmm0, 0xc(%rsi,%r10)
movups 0x15269(%rip), %xmm0    # 0x1c7a0
movups %xmm0, (%rsi,%r10)
testl %ecx, %ecx
jle 0x758b
movq 0x113b1(%rip), %r10     # 0x188f8
movl %ecx, %r11d
movl %eax, %r12d
shlq $0x4, %r12
xorl %r13d, %r13d
testl %eax, %eax
jle 0x7583
movq (%r10,%r13,8), %rbp
xorl %esi, %esi
movl (%rbx), %edi
movl %edi, 0x8(%rbp,%rsi)
movl (%r14), %edi
movl %edi, 0xc(%rbp,%rsi)
movw $0x0, 0x4(%rbp,%rsi)
movl $0x20, (%rbp,%rsi)
addq $0x10, %rsi
cmpq %rsi, %r12
jne 0x755e
incq %r13
cmpq %r11, %r13
jne 0x7554
movq 0x11366(%rip), %r12     # 0x188f8
movq %r8, 0x1135f(%rip)      # 0x188f8
xorl $0x4, %edx
leal 0x1(%r15), %esi
movl %r9d, %r10d
movl 0x4(%rsp), %edi
movl %edi, %r11d
movq %r12, %r8
testl %r15d, %r15d
movl %esi, %r15d
je 0x74fc
movl $0x41, 0x15209(%rip)    # 0x1c7cc
movl %r9d, 0x11326(%rip)     # 0x188f0
movl %edi, 0x11324(%rip)     # 0x188f4
movq %r12, 0x17271(%rip)     # 0x1e848
movl %eax, 0x17273(%rip)     # 0x1e850
movl %ecx, 0x17271(%rip)     # 0x1e854
testl %r9d, %r9d
jle 0x7607
movq 0x151a9(%rip), %rax     # 0x1c798
xorl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
incq %rcx
movslq 0x112ee(%rip), %rdx     # 0x188f0
cmpq %rdx, %rcx
jl 0x75f1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq