// File: /workspace/github_c_makefile_star2_O0/mrdotx[P]st/st.c
// Function: tscrollup
void
tscrollup(int orig, int n, int copyhist)
{
	int i;
	Line temp;

	LIMIT(n, 0, term.bot-orig+1);

	if (copyhist) {
		term.histi = (term.histi + 1) % HISTSIZE;
		temp = term.hist[term.histi];
		term.hist[term.histi] = term.line[orig];
		term.line[orig] = temp;
	}

	if (term.scr > 0 && term.scr < HISTSIZE)
		term.scr = MIN(term.scr + n, HISTSIZE-1);

	tclearregion(0, orig, term.col-1, orig+n-1);
	tsetdirt(orig+n, term.bot);

	for (i = orig; i <= term.bot-n; i++) {
		temp = term.line[i];
		term.line[i] = term.line[i+n];
		term.line[i+n] = temp;
	}

	if (term.scr == 0)
		selscroll(orig, -n);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
cmpl $0x0, -0x8(%rbp)
jge 0xdd7e
xorl %eax, %eax
movl %eax, -0x1c(%rbp)
jmp 0xddae
movl -0x8(%rbp), %eax
movl 0x11531(%rip), %ecx     # 0x1f2b8
subl -0x4(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jle 0xdda2
movl 0x11521(%rip), %eax     # 0x1f2b8
subl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xdda8
movl -0x8(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0xde1d
movl 0x114c0(%rip), %eax     # 0x1f280
addl $0x1, %eax
movl $0x1f4, %ecx            # imm = 0x1F4
cltd
idivl %ecx
movl %edx, 0x114af(%rip)     # 0x1f280
movslq 0x114a8(%rip), %rcx     # 0x1f280
leaq 0x104e9(%rip), %rax     # 0x1e2c8
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq 0x104e1(%rip), %rax     # 0x1e2d0
movslq -0x4(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movslq 0x11482(%rip), %rcx     # 0x1f280
leaq 0x104c3(%rip), %rax     # 0x1e2c8
movq %rdx, 0x18(%rax,%rcx,8)
movq -0x18(%rbp), %rdx
movq 0x104bb(%rip), %rax     # 0x1e2d0
movslq -0x4(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
cmpl $0x0, 0x11460(%rip)     # 0x1f284
jle 0xde63
cmpl $0x1f4, 0x11454(%rip)   # imm = 0x1F4
jge 0xde63
movl 0x1144c(%rip), %eax     # 0x1f284
addl -0x8(%rbp), %eax
cmpl $0x1f3, %eax            # imm = 0x1F3
jge 0xde50
movl 0x1143c(%rip), %eax     # 0x1f284
addl -0x8(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0xde5a
movl $0x1f3, %eax            # imm = 0x1F3
movl %eax, -0x24(%rbp)
jmp 0xde5a
movl -0x24(%rbp), %eax
movl %eax, 0x11421(%rip)     # 0x1f284
movl -0x4(%rbp), %esi
movl 0x10460(%rip), %edx     # 0x1e2cc
subl $0x1, %edx
movl -0x4(%rbp), %ecx
addl -0x8(%rbp), %ecx
subl $0x1, %ecx
xorl %edi, %edi
callq 0x9e90
movl -0x4(%rbp), %edi
addl -0x8(%rbp), %edi
movl 0x1142d(%rip), %esi     # 0x1f2b8
callq 0x7130
movl -0x4(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl 0x11419(%rip), %ecx     # 0x1f2b8
subl -0x8(%rbp), %ecx
cmpl %ecx, %eax
jg 0xdeff
movq 0x10423(%rip), %rax     # 0x1e2d0
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq 0x10410(%rip), %rax     # 0x1e2d0
movl -0x10(%rbp), %ecx
addl -0x8(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq 0x103fc(%rip), %rax     # 0x1e2d0
movslq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rdx
movq 0x103e9(%rip), %rax     # 0x1e2d0
movl -0x10(%rbp), %ecx
addl -0x8(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xde96
cmpl $0x0, 0x1137e(%rip)     # 0x1f284
jne 0xdf15
movl -0x4(%rbp), %edi
xorl %esi, %esi
subl -0x8(%rbp), %esi
callq 0x9080
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)