// File: /workspace/github_c_makefile_star2_O0/uobikiemukot[P]yaft/./ctrlseq/csi.h
// Function: erase_display
void erase_display(struct terminal_t *term, struct parm_t *parm)
{
	int i, j, mode;

	mode = (parm->argc <= 0) ? 0: dec2num(parm->argv[parm->argc - 1]);

	if (mode < 0 || 2 < mode)
		return;

	if (mode == 0) {
		for (i = term->cursor.y; i < term->lines; i++)
			for (j = 0; j < term->cols; j++)
				if (i > term->cursor.y || (i == term->cursor.y && j >= term->cursor.x))
					erase_cell(term, i, j);
	} else if (mode == 1) {
		for (i = 0; i <= term->cursor.y; i++)
			for (j = 0; j < term->cols; j++)
				if (i < term->cursor.y || (i == term->cursor.y && j <= term->cursor.x))
					erase_cell(term, i, j);
	} else if (mode == 2) {
		for (i = 0; i < term->lines; i++)
			for (j = 0; j < term->cols; j++)
				erase_cell(term, i, j);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jg 0x6000
xorl %eax, %eax
movl %eax, -0x20(%rbp)
jmp 0x601d
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq 0x8(%rax,%rcx,8), %rdi
callq 0x31b0
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x6033
movl $0x2, %eax
cmpl -0x1c(%rbp), %eax
jge 0x6038
jmp 0x61ab
cmpl $0x0, -0x1c(%rbp)
jne 0x60c7
movq -0x8(%rbp), %rax
movzwl 0x26(%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x60c2
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x60b5
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movzwl 0x26(%rcx), %ecx
cmpl %ecx, %eax
jg 0x6099
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movzwl 0x26(%rcx), %ecx
cmpl %ecx, %eax
jne 0x60a8
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
movzwl 0x24(%rcx), %ecx
cmpl %ecx, %eax
jl 0x60a8
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x46f0
jmp 0x60aa
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6060
jmp 0x60b7
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x604d
jmp 0x61ab
cmpl $0x1, -0x1c(%rbp)
jne 0x6152
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movzwl 0x26(%rcx), %ecx
cmpl %ecx, %eax
jg 0x6150
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x6143
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movzwl 0x26(%rcx), %ecx
cmpl %ecx, %eax
jl 0x6127
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movzwl 0x26(%rcx), %ecx
cmpl %ecx, %eax
jne 0x6136
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
movzwl 0x24(%rcx), %ecx
cmpl %ecx, %eax
jg 0x6136
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x46f0
jmp 0x6138
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x60ee
jmp 0x6145
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x60d8
jmp 0x61a9
cmpl $0x2, -0x1c(%rbp)
jne 0x61a7
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x61a5
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x6198
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x46f0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6172
jmp 0x619a
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x615f
jmp 0x61a7
jmp 0x61a9
jmp 0x61ab
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)