// File: /workspace/github_c_makefile_star2_O3/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 %edi, %r12d
cmpl %edi, 0x10d80(%rip)     # 0x188e4
jne 0x7b9a
cmpl %esi, 0x10d74(%rip)     # 0x188e0
jne 0x7b9a
testl %esi, %esi
jle 0x7e38
movq 0x14c0b(%rip), %rax     # 0x1c788
xorl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
incq %rcx
movslq 0x10d50(%rip), %rdx     # 0x188e0
cmpq %rdx, %rcx
jl 0x7b7f
jmp 0x7e38
cmpl $0x0, 0x10d3b(%rip)     # 0x188dc
je 0x7bb7
movl $0x0, 0x10d03(%rip)     # 0x188b0
movl $0xffffffff, 0x10d15(%rip) # imm = 0xFFFFFFFF
xorl %r14d, %r14d
movslq %esi, %r15
cmpl %esi, 0x14be1(%rip)     # 0x1c7a4
movq %rsi, 0x8(%rsp)
jl 0x7c1c
xorl %r14d, %r14d
movq %r14, %rbx
movq 0x10d11(%rip), %rax     # 0x188e8
movq (%rax,%r14,8), %rdi
callq 0x5340
incq %r14
movslq 0x14bba(%rip), %rax     # 0x1c7a4
subq %r15, %rax
cmpq %rax, %rbx
jl 0x7bcd
movq 0x10cef(%rip), %rdi     # 0x188e8
movl %r14d, %eax
leaq (%rdi,%rax,8), %rsi
leaq (,%r15,8), %rdx
callq 0x5510
leal -0x1(%r15), %eax
movl %eax, 0x14b8d(%rip)     # 0x1c7a4
movq 0x8(%rsp), %rsi
addl %esi, %r14d
cmpl 0x10cba(%rip), %r14d    # 0x188e0
jge 0x7c4a
movslq %r14d, %rbx
movq 0x10cb6(%rip), %rax     # 0x188e8
movq (%rax,%rbx,8), %rdi
callq 0x5340
incq %rbx
movslq 0x10c9b(%rip), %rax     # 0x188e0
cmpq %rax, %rbx
jl 0x7c2b
movq 0x10c97(%rip), %rdi     # 0x188e8
leaq (,%r15,8), %rsi
callq 0x5fa0
movq %rax, 0x10c83(%rip)     # 0x188e8
movl 0x10c75(%rip), %eax     # 0x188e0
cmpl %r15d, %eax
movq 0x8(%rsp), %rbx
cmovgel %ebx, %eax
movq %r12, %r15
movslq %r12d, %rdi
testl %eax, %eax
jle 0x7d26
movq %rdi, 0x10(%rsp)
movq %rdi, %r12
shlq $0x4, %r12
xorl %r13d, %r13d
leaq 0x10846(%rip), %rbp     # 0x184e0
leaq 0x1083b(%rip), %r14     # 0x184dc
movq 0x10c40(%rip), %rax     # 0x188e8
movq (%rax,%r13,8), %rdi
movq %r12, %rsi
callq 0x5fa0
movq 0x10c2d(%rip), %rcx     # 0x188e8
movq %rax, (%rcx,%r13,8)
movslq 0x10c1e(%rip), %rcx     # 0x188e4
cmpl %r15d, %ecx
jge 0x7d0a
movq 0x10c16(%rip), %rax     # 0x188e8
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 (%r14), %esi
movl %esi, -0x4(%rcx)
movl %edx, (%rcx)
movw $0x0, -0x8(%rcx)
movl $0x20, -0xc(%rcx)
addq $0x10, %rcx
decq %rax
jne 0x7ce9
incq %r13
movl 0x10bcd(%rip), %eax     # 0x188e0
cmpl %ebx, %eax
cmovgel %ebx, %eax
cltq
cmpq %rax, %r13
jl 0x7ca1
movq 0x10(%rsp), %rdi
jmp 0x7d29
xorl %r13d, %r13d
cmpl %ebx, %r13d
jge 0x7da9
shlq $0x4, %rdi
movl %r13d, %r14d
movl 0x8(%rsp), %eax
movq %rax, 0x10(%rsp)
movl %r15d, %r13d
shlq $0x4, %r13
leaq 0x10794(%rip), %rbp     # 0x184e0
leaq 0x10789(%rip), %rbx     # 0x184dc
movq %rdi, %r12
callq 0x5edc
movq 0x10b86(%rip), %rcx     # 0x188e8
movq %rax, (%rcx,%r14,8)
testl %r15d, %r15d
jle 0x7d9c
movq 0x10b76(%rip), %rax     # 0x188e8
movq (%rax,%r14,8), %rax
xorl %ecx, %ecx
movl (%rbp), %edx
movl (%rbx), %esi
movl %esi, 0x8(%rax,%rcx)
movl %edx, 0xc(%rax,%rcx)
movw $0x0, 0x4(%rax,%rcx)
movl $0x20, (%rax,%rcx)
addq $0x10, %rcx
cmpq %rcx, %r13
jne 0x7d78
incq %r14
cmpq 0x10(%rsp), %r14
movq %r12, %rdi
jne 0x7d53
movl 0x149f1(%rip), %ecx     # 0x1c7a0
movb 0x149f3(%rip), %al      # 0x1c7a8
cmpl %r15d, %ecx
jge 0x7dde
testb $0x1, %al
movq 0x8(%rsp), %rdx
je 0x7df5
addl 0x149b7(%rip), %ecx     # 0x1c780
cmpl %r15d, %ecx
jge 0x7df5
movl %ecx, 0x149cc(%rip)     # 0x1c7a0
andb $-0x2, %al
movb %al, 0x149cc(%rip)      # 0x1c7a8
jmp 0x7df5
andb $-0x2, %al
movb %al, 0x149c2(%rip)      # 0x1c7a8
leal -0x1(%r15), %eax
movl %eax, 0x149b0(%rip)     # 0x1c7a0
movq 0x8(%rsp), %rdx
movl %r15d, 0x10ae8(%rip)    # 0x188e4
movl %edx, 0x10ade(%rip)     # 0x188e0
movl $0x0, 0x149a8(%rip)     # 0x1c7b4
leal -0x1(%rdx), %eax
movl %eax, 0x149a3(%rip)     # 0x1c7b8
testl %edx, %edx
jle 0x7e38
movq 0x14968(%rip), %rax     # 0x1c788
xorl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
incq %rcx
movslq 0x10aad(%rip), %rdx     # 0x188e0
cmpq %rdx, %rcx
jl 0x7e22
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq