// File: JD297[P]cedit/src/cedit.cpp
// Function: cedit::Cedit::display_content()
void Cedit::display_content()
{
	wclear(this->wcontent);

	const auto itBegin = this->displayFirstIt();
	const auto itEnd = this->displayLastIt();

	for(auto it = itBegin; it != itEnd; it++)
	{
		this->display_linenumbers(it);

		if(this->contentIt == it)
		{
			getyx(this->wcontent, this->cursorY, this->cursorXReset);
			this->display_current_line();
			wmove(this->wcontent, this->cursorY, this->cursorXReset);
		}

		// Last line to print to screen
		if(it != std::prev(this->content.end()) && it == std::prev(itEnd) && it->at(it->length() - 1) == '\n')
		{
			wprintw(this->wcontent, "%s", it->substr(0, it->length() - 1).c_str());
		}
		else
		{
			wprintw(this->wcontent, "%s", it->c_str());
		}

		if(this->contentIt->length() == 0 && !this->showLineNumbers)
		{
			this->cursorX = 0;
		}
		else if(this->contentIt->length() == this->currentIndex)
		{
			getyx(this->wcontent, this->cursorY, this->cursorX);
		}
	}

	for(size_t i = 0; i < this->height - distance(itBegin, itEnd); i++)
	{
		wprintw(this->wcontent, "\n~");
	}

	wmove(this->wcontent, this->cursorY, this->cursorX);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq 0xa8(%rax), %rdi
callq 0x4410
movq -0xa0(%rbp), %rdi
callq 0x8600
movq -0xa0(%rbp), %rdi
movq %rax, -0x10(%rbp)
callq 0x8640
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x9310
testb $0x1, %al
jne 0x8934
jmp 0x8cf0
movq -0xa0(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
callq 0x8dd0
movq -0xa0(%rbp), %rdi
addq $0x18, %rdi
leaq -0x20(%rbp), %rsi
callq 0x9e30
testb $0x1, %al
jne 0x8969
jmp 0x8a1d
movq -0xa0(%rbp), %rcx
xorl %eax, %eax
cmpq 0xa8(%rcx), %rax
je 0x8994
movq -0xa0(%rbp), %rax
movq 0xa8(%rax), %rax
movswl (%rax), %eax
movl %eax, -0xa4(%rbp)
jmp 0x89a1
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0xa4(%rbp)
jmp 0x89a1
movq -0xa0(%rbp), %rcx
movl -0xa4(%rbp), %eax
movl %eax, 0x98(%rcx)
xorl %eax, %eax
cmpq 0xa8(%rcx), %rax
je 0x89d9
movq -0xa0(%rbp), %rax
movq 0xa8(%rax), %rax
movswl 0x2(%rax), %eax
movl %eax, -0xa8(%rbp)
jmp 0x89e6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0xa8(%rbp)
jmp 0x89e6
movq -0xa0(%rbp), %rdi
movl -0xa8(%rbp), %eax
movl %eax, 0x9c(%rdi)
callq 0x5260
movq -0xa0(%rbp), %rax
movq 0xa8(%rax), %rdi
movl 0x98(%rax), %esi
movl 0x9c(%rax), %edx
callq 0x4450
movq -0xa0(%rbp), %rdi
callq 0x92c0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movl $0x1, %esi
callq 0x9280
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x9310
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xa9(%rbp)
jne 0x8a5d
jmp 0x8ad8
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movl $0x1, %esi
callq 0x9280
movq %rax, -0x40(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x9e30
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xa9(%rbp)
jne 0x8a95
jmp 0x8ad8
leaq -0x20(%rbp), %rdi
callq 0x92f0
movq %rax, -0xb8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x92f0
movq %rax, %rdi
callq 0x4640
movq -0xb8(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x4750
movsbl (%rax), %eax
cmpl $0xa, %eax
sete %al
movb %al, -0xa9(%rbp)
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0x8ae7
jmp 0x8b9d
movq -0xa0(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0xc8(%rbp)
leaq -0x20(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x92f0
movq -0xe0(%rbp), %rdi
movq %rax, -0xd8(%rbp)
callq 0x92f0
movq %rax, %rdi
callq 0x4640
movq -0xd8(%rbp), %rsi
movq %rax, %rcx
decq %rcx
xorl %eax, %eax
movl %eax, -0xbc(%rbp)
movl %eax, %edx
leaq -0x68(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x4430
movq -0xd0(%rbp), %rdi
callq 0x4220
movq -0xc8(%rbp), %rdi
movq %rax, %rdx
movl -0xbc(%rbp), %eax
leaq 0x55e6(%rip), %rsi      # 0xe157
callq 0x4080
jmp 0x8b78
leaq -0x68(%rbp), %rdi
callq 0x42d0
jmp 0x8bdb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x42d0
jmp 0x8dbb
movq -0xa0(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0xe8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x92f0
movq %rax, %rdi
callq 0x4220
movq -0xe8(%rbp), %rdi
movq %rax, %rdx
leaq 0x5583(%rip), %rsi      # 0xe157
movb $0x0, %al
callq 0x4080
movq -0xa0(%rbp), %rdi
addq $0x18, %rdi
callq 0x92f0
movq %rax, %rdi
callq 0x4640
cmpq $0x0, %rax
jne 0x8c1f
movq -0xa0(%rbp), %rax
testb $0x1, 0x90(%rax)
jne 0x8c1f
movq -0xa0(%rbp), %rax
movl $0x0, 0x94(%rax)
jmp 0x8cda
movq -0xa0(%rbp), %rdi
addq $0x18, %rdi
callq 0x92f0
movq %rax, %rdi
callq 0x4640
movq -0xa0(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jne 0x8cd8
movq -0xa0(%rbp), %rcx
xorl %eax, %eax
cmpq 0xa8(%rcx), %rax
je 0x8c73
movq -0xa0(%rbp), %rax
movq 0xa8(%rax), %rax
movswl (%rax), %eax
movl %eax, -0xec(%rbp)
jmp 0x8c80
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0xec(%rbp)
jmp 0x8c80
movq -0xa0(%rbp), %rcx
movl -0xec(%rbp), %eax
movl %eax, 0x98(%rcx)
xorl %eax, %eax
cmpq 0xa8(%rcx), %rax
je 0x8cb8
movq -0xa0(%rbp), %rax
movq 0xa8(%rax), %rax
movswl 0x2(%rax), %eax
movl %eax, -0xf0(%rbp)
jmp 0x8cc5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0xf0(%rbp)
jmp 0x8cc5
movq -0xa0(%rbp), %rax
movl -0xf0(%rbp), %ecx
movl %ecx, 0x94(%rax)
jmp 0x8cda
jmp 0x8cdc
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9360
movq %rax, -0x80(%rbp)
jmp 0x891e
movq $0x0, -0x88(%rbp)
movq -0xa0(%rbp), %rax
movq -0x88(%rbp), %rcx
movq %rcx, -0xf8(%rbp)
movq 0x100(%rax), %rax
movq %rax, -0x100(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0x9680
movq -0x100(%rbp), %rcx
movq %rax, %rdx
movq -0xf8(%rbp), %rax
subq %rdx, %rcx
cmpq %rcx, %rax
jae 0x8d93
movq -0xa0(%rbp), %rax
movq 0xa8(%rax), %rdi
leaq 0x53e5(%rip), %rsi      # 0xe15a
movb $0x0, %al
callq 0x4080
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x8cfb
movq -0xa0(%rbp), %rax
movq 0xa8(%rax), %rdi
movl 0x98(%rax), %esi
movl 0x94(%rax), %edx
callq 0x4450
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x70(%rbp), %rdi
callq 0x4700
nopw %cs:(%rax,%rax)