// File: /workspace/github_c_makefile_star2_O1/anachronic[P]st/st.c
// Function: tresizealt
void
tresizealt(int col, int row)
{
	int i, j;

	/* return if dimensions haven't changed */
	if (term.col == col && term.row == row) {
		tfulldirt();
		return;
	}
	if (sel.alt)
		selremove();
	/* slide screen up if otherwise cursor would get out of the screen */
	for (i = 0; i <= term.c.y - row; i++)
		free(term.line[i]);
	if (i > 0) {
		/* ensure that both src and dst are not NULL */
		memmove(term.line, term.line + i, row * sizeof(Line));
		term.c.y = row - 1;
	}
	for (i += row; i < term.row; i++)
		free(term.line[i]);
	/* resize to new height */
	term.line = xrealloc(term.line, row * sizeof(Line));
	/* resize to new width */
	for (i = 0; i < MIN(row, term.row); i++) {
		term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph));
		for (j = term.col; j < col; j++)
			tclearglyph(&term.line[i][j], 0);
	}
	/* allocate any new rows */
	for (/*i = MIN(row, term.row) */; i < row; i++) {
		term.line[i] = xmalloc(col * sizeof(Glyph));
		for (j = 0; j < col; j++)
			tclearglyph(&term.line[i][j], 0);
	}
	/* update cursor */
	if (term.c.x >= col) {
		term.c.state &= ~CURSOR_WRAPNEXT;
		term.c.x = col - 1;
	} else {
		UPDATEWRAPNEXT(1, col);
	}
	/* update terminal size */
	term.col = col, term.row = row;
	/* reset scrolling region */
	term.top = 0, term.bot = row - 1;
	/* dirty all lines */
	tfulldirt();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl 0x10e84(%rip), %ecx     # 0x188f4
xorl %edi, %ecx
movl 0x10e78(%rip), %eax     # 0x188f0
movl %eax, %edx
xorl %esi, %edx
orl %ecx, %edx
jne 0x7aac
testl %eax, %eax
jle 0x7d54
movq 0x14d09(%rip), %rax     # 0x1c798
xorl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
incq %rcx
movslq 0x10e4e(%rip), %rdx     # 0x188f0
cmpq %rdx, %rcx
jl 0x7a91
jmp 0x7d54
movl %esi, %ebx
movl %edi, %r12d
cmpl $0x0, 0x10e34(%rip)     # 0x188ec
je 0x7ace
movl $0x0, 0x10dfc(%rip)     # 0x188c0
movl $0xffffffff, 0x10e0e(%rip) # imm = 0xFFFFFFFF
xorl %r14d, %r14d
movslq %ebx, %r15
cmpl %ebx, 0x14cda(%rip)     # 0x1c7b4
movq %rbx, 0x8(%rsp)
jl 0x7b0e
xorl %r14d, %r14d
movq %r14, %rbx
movq 0x10e0a(%rip), %rax     # 0x188f8
movq (%rax,%r14,8), %rdi
callq 0x5340
incq %r14
movslq 0x14cb3(%rip), %rax     # 0x1c7b4
subq %r15, %rax
cmpq %rax, %rbx
jl 0x7ae4
movq 0x8(%rsp), %rbx
testl %r14d, %r14d
je 0x7b38
movq 0x10dde(%rip), %rdi     # 0x188f8
movl %r14d, %eax
leaq (%rdi,%rax,8), %rsi
leaq (,%r15,8), %rdx
callq 0x5510
leal -0x1(%r15), %eax
movl %eax, 0x14c7c(%rip)     # 0x1c7b4
addl %ebx, %r14d
cmpl 0x10dae(%rip), %r14d    # 0x188f0
jge 0x7b66
movslq %r14d, %rbx
movq 0x10daa(%rip), %rax     # 0x188f8
movq (%rax,%rbx,8), %rdi
callq 0x5340
incq %rbx
movslq 0x10d8f(%rip), %rax     # 0x188f0
cmpq %rax, %rbx
jl 0x7b47
movq 0x10d8b(%rip), %rdi     # 0x188f8
leaq (,%r15,8), %rsi
callq 0x5fb0
movq %rax, 0x10d77(%rip)     # 0x188f8
movl 0x10d69(%rip), %eax     # 0x188f0
cmpl %r15d, %eax
movq 0x8(%rsp), %rbx
cmovgel %ebx, %eax
movq %r12, %r15
movslq %r12d, %rdi
testl %eax, %eax
jle 0x7c42
movq %rdi, 0x10(%rsp)
movq %rdi, %r12
shlq $0x4, %r12
xorl %r13d, %r13d
leaq 0x10936(%rip), %rbp     # 0x184ec
leaq 0x10933(%rip), %r14     # 0x184f0
movq 0x10d34(%rip), %rax     # 0x188f8
movq (%rax,%r13,8), %rdi
movq %r12, %rsi
callq 0x5fb0
movq 0x10d21(%rip), %rcx     # 0x188f8
movq %rax, (%rcx,%r13,8)
movslq 0x10d12(%rip), %rcx     # 0x188f4
cmpl %r15d, %ecx
jge 0x7c26
movq 0x10d0a(%rip), %rax     # 0x188f8
movq (%rax,%r13,8), %rdx
movq 0x10(%rsp), %rax
subq %rcx, %rax
shlq $0x4, %rcx
addq %rdx, %rcx
addq $0xc, %rcx
movl (%rbp), %edx
movl %edx, -0x4(%rcx)
movl (%r14), %edx
movl %edx, (%rcx)
movw $0x0, -0x8(%rcx)
movl $0x20, -0xc(%rcx)
addq $0x10, %rcx
decq %rax
jne 0x7c05
incq %r13
movl 0x10cc1(%rip), %eax     # 0x188f0
cmpl %ebx, %eax
cmovgel %ebx, %eax
cltq
cmpq %rax, %r13
jl 0x7bbd
movq 0x10(%rsp), %rdi
jmp 0x7c45
xorl %r13d, %r13d
cmpl %ebx, %r13d
jge 0x7cc5
shlq $0x4, %rdi
movl %r13d, %r14d
movl 0x8(%rsp), %eax
movq %rax, 0x10(%rsp)
movl %r15d, %r13d
shlq $0x4, %r13
leaq 0x10884(%rip), %rbp     # 0x184ec
leaq 0x10881(%rip), %rbx     # 0x184f0
movq %rdi, %r12
callq 0x5eec
movq 0x10c7a(%rip), %rcx     # 0x188f8
movq %rax, (%rcx,%r14,8)
testl %r15d, %r15d
jle 0x7cb8
movq 0x10c6a(%rip), %rax     # 0x188f8
movq (%rax,%r14,8), %rax
xorl %ecx, %ecx
movl (%rbp), %edx
movl %edx, 0x8(%rax,%rcx)
movl (%rbx), %edx
movl %edx, 0xc(%rax,%rcx)
movw $0x0, 0x4(%rax,%rcx)
movl $0x20, (%rax,%rcx)
addq $0x10, %rcx
cmpq %rcx, %r13
jne 0x7c94
incq %r14
cmpq 0x10(%rsp), %r14
movq %r12, %rdi
jne 0x7c6f
movl 0x14ae5(%rip), %ecx     # 0x1c7b0
movb 0x14ae7(%rip), %al      # 0x1c7b8
cmpl %r15d, %ecx
jge 0x7cfa
testb $0x1, %al
movq 0x8(%rsp), %rdx
je 0x7d11
addl 0x14aab(%rip), %ecx     # 0x1c790
cmpl %r15d, %ecx
jge 0x7d11
movl %ecx, 0x14ac0(%rip)     # 0x1c7b0
andb $-0x2, %al
movb %al, 0x14ac0(%rip)      # 0x1c7b8
jmp 0x7d11
andb $-0x2, %al
movb %al, 0x14ab6(%rip)      # 0x1c7b8
leal -0x1(%r15), %eax
movl %eax, 0x14aa4(%rip)     # 0x1c7b0
movq 0x8(%rsp), %rdx
movl %r15d, 0x10bdc(%rip)    # 0x188f4
movl %edx, 0x10bd2(%rip)     # 0x188f0
movl $0x0, 0x14a9c(%rip)     # 0x1c7c4
leal -0x1(%rdx), %eax
movl %eax, 0x14a97(%rip)     # 0x1c7c8
testl %edx, %edx
jle 0x7d54
movq 0x14a5c(%rip), %rax     # 0x1c798
xorl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
incq %rcx
movslq 0x10ba1(%rip), %rdx     # 0x188f0
cmpq %rdx, %rcx
jl 0x7d3e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq