// File: JD297[P]cedit/src/cedit.cpp
// Function: cedit::Cedit::display_current_line()
void Cedit::display_current_line()
{
	bool isLastline =	this->contentIt != std::prev(this->content.end()) && 
						this->contentIt == std::prev(this->displayLastIt()) && 
						this->contentIt->at(this->contentIt->length() - 1) == '\n';

	if(isLastline)
	{
		this->contentIt->pop_back();
	}

	this->cursorY = distance(this->displayFirstIt(), this->contentIt);

	wmove(this->wcontent, this->cursorY, 0);

	this->display_linenumbers(this->contentIt);

	getyx(this->wcontent, this->cursorY, this->cursorXReset);

	for(std::size_t i = 0; i < this->contentIt->length(); i++)
	{
		if(i == this->currentIndex)
		{
			getyx(this->wcontent, this->cursorY, this->cursorX);
			wprintw(this->wcontent, "%c", this->contentIt->at(i));
			continue;
		}

		wprintw(this->wcontent, "%c", this->contentIt->at(i));
	}

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

	wmove(this->wcontent, this->cursorY, this->cursorXReset);
	wclrtoeol(this->wcontent);

	wprintw(this->wcontent, "%s", this->contentIt->c_str());

	if(isLastline)
	{
		this->contentIt->append("\n");
	}

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x68(%rbp)
movq %rdi, %rax
addq $0x18, %rax
movq %rax, -0x60(%rbp)
callq 0x92c0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9280
movq -0x60(%rbp), %rdi
movq %rax, -0x18(%rbp)
leaq -0x18(%rbp), %rsi
callq 0x9310
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x51(%rbp)
jne 0x52bb
jmp 0x5342
movq -0x68(%rbp), %rdi
movq %rdi, %rax
addq $0x18, %rax
movq %rax, -0x70(%rbp)
callq 0x8640
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x9280
movq -0x70(%rbp), %rdi
movq %rax, -0x28(%rbp)
leaq -0x28(%rbp), %rsi
callq 0x9e30
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x51(%rbp)
jne 0x5300
jmp 0x5342
movq -0x68(%rbp), %rdi
addq $0x18, %rdi
callq 0x92f0
movq -0x68(%rbp), %rdi
movq %rax, -0x78(%rbp)
addq $0x18, %rdi
callq 0x92f0
movq %rax, %rdi
callq 0x4640
movq -0x78(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x4750
movsbl (%rax), %eax
cmpl $0xa, %eax
sete %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
andb $0x1, %al
movb %al, -0x9(%rbp)
testb $0x1, -0x9(%rbp)
je 0x5365
movq -0x68(%rbp), %rdi
addq $0x18, %rdi
callq 0x92f0
movq %rax, %rdi
callq 0x4560
movq -0x68(%rbp), %rdi
callq 0x8600
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, -0x38(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x9680
movq %rax, %rcx
movq -0x68(%rbp), %rax
movl %ecx, 0x98(%rax)
movq 0xa8(%rax), %rdi
movl 0x98(%rax), %esi
xorl %edx, %edx
callq 0x4450
movq -0x68(%rbp), %rdi
movq 0x18(%rdi), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rsi
callq 0x8dd0
movq -0x68(%rbp), %rcx
xorl %eax, %eax
cmpq 0xa8(%rcx), %rax
je 0x53e6
movq -0x68(%rbp), %rax
movq 0xa8(%rax), %rax
movswl (%rax), %eax
movl %eax, -0x7c(%rbp)
jmp 0x53f0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x7c(%rbp)
jmp 0x53f0
movq -0x68(%rbp), %rcx
movl -0x7c(%rbp), %eax
movl %eax, 0x98(%rcx)
xorl %eax, %eax
cmpq 0xa8(%rcx), %rax
je 0x541c
movq -0x68(%rbp), %rax
movq 0xa8(%rax), %rax
movswl 0x2(%rax), %eax
movl %eax, -0x80(%rbp)
jmp 0x5426
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x80(%rbp)
jmp 0x5426
movq -0x68(%rbp), %rax
movl -0x80(%rbp), %ecx
movl %ecx, 0x9c(%rax)
movq $0x0, -0x50(%rbp)
movq -0x68(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, -0x88(%rbp)
addq $0x18, %rdi
callq 0x92f0
movq %rax, %rdi
callq 0x4640
movq %rax, %rcx
movq -0x88(%rbp), %rax
cmpq %rcx, %rax
jae 0x558e
movq -0x68(%rbp), %rcx
movq -0x50(%rbp), %rax
cmpq 0x50(%rcx), %rax
jne 0x553e
movq -0x68(%rbp), %rcx
xorl %eax, %eax
cmpq 0xa8(%rcx), %rax
je 0x54a5
movq -0x68(%rbp), %rax
movq 0xa8(%rax), %rax
movswl (%rax), %eax
movl %eax, -0x8c(%rbp)
jmp 0x54b2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x8c(%rbp)
jmp 0x54b2
movq -0x68(%rbp), %rcx
movl -0x8c(%rbp), %eax
movl %eax, 0x98(%rcx)
xorl %eax, %eax
cmpq 0xa8(%rcx), %rax
je 0x54e4
movq -0x68(%rbp), %rax
movq 0xa8(%rax), %rax
movswl 0x2(%rax), %eax
movl %eax, -0x90(%rbp)
jmp 0x54f1
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x90(%rbp)
jmp 0x54f1
movq -0x68(%rbp), %rdi
movl -0x90(%rbp), %eax
movl %eax, 0x94(%rdi)
movq 0xa8(%rdi), %rax
movq %rax, -0x98(%rbp)
addq $0x18, %rdi
callq 0x92f0
movq %rax, %rdi
movq -0x50(%rbp), %rsi
callq 0x4750
movq -0x98(%rbp), %rdi
movsbl (%rax), %edx
leaq 0x8c1f(%rip), %rsi      # 0xe154
movb $0x0, %al
callq 0x4080
jmp 0x557d
movq -0x68(%rbp), %rdi
movq 0xa8(%rdi), %rax
movq %rax, -0xa0(%rbp)
addq $0x18, %rdi
callq 0x92f0
movq %rax, %rdi
movq -0x50(%rbp), %rsi
callq 0x4750
movq -0xa0(%rbp), %rdi
movsbl (%rax), %edx
leaq 0x8bde(%rip), %rsi      # 0xe154
movb $0x0, %al
callq 0x4080
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x543b
movq -0x68(%rbp), %rdi
addq $0x18, %rdi
callq 0x92f0
movq %rax, %rdi
callq 0x4640
cmpq $0x0, %rax
jne 0x55c9
movq -0x68(%rbp), %rax
testb $0x1, 0x90(%rax)
jne 0x55c9
movq -0x68(%rbp), %rax
movl $0x0, 0x94(%rax)
jmp 0x566f
movq -0x68(%rbp), %rdi
addq $0x18, %rdi
callq 0x92f0
movq %rax, %rdi
callq 0x4640
movq -0x68(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jne 0x566d
movq -0x68(%rbp), %rcx
xorl %eax, %eax
cmpq 0xa8(%rcx), %rax
je 0x5611
movq -0x68(%rbp), %rax
movq 0xa8(%rax), %rax
movswl (%rax), %eax
movl %eax, -0xa4(%rbp)
jmp 0x561e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0xa4(%rbp)
jmp 0x561e
movq -0x68(%rbp), %rcx
movl -0xa4(%rbp), %eax
movl %eax, 0x98(%rcx)
xorl %eax, %eax
cmpq 0xa8(%rcx), %rax
je 0x5650
movq -0x68(%rbp), %rax
movq 0xa8(%rax), %rax
movswl 0x2(%rax), %eax
movl %eax, -0xa8(%rbp)
jmp 0x565d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0xa8(%rbp)
jmp 0x565d
movq -0x68(%rbp), %rax
movl -0xa8(%rbp), %ecx
movl %ecx, 0x94(%rax)
jmp 0x566f
movq -0x68(%rbp), %rax
movq 0xa8(%rax), %rdi
movl 0x98(%rax), %esi
movl 0x9c(%rax), %edx
callq 0x4450
movq -0x68(%rbp), %rax
movq 0xa8(%rax), %rdi
callq 0x4480
movq -0x68(%rbp), %rdi
movq 0xa8(%rdi), %rax
movq %rax, -0xb0(%rbp)
addq $0x18, %rdi
callq 0x92f0
movq %rax, %rdi
callq 0x4220
movq -0xb0(%rbp), %rdi
movq %rax, %rdx
leaq 0x8a88(%rip), %rsi      # 0xe157
movb $0x0, %al
callq 0x4080
testb $0x1, -0x9(%rbp)
je 0x56f8
movq -0x68(%rbp), %rdi
addq $0x18, %rdi
callq 0x92f0
movq %rax, %rdi
leaq 0x8b85(%rip), %rsi      # 0xe278
callq 0x4740
movq -0x68(%rbp), %rax
movq 0xa8(%rax), %rdi
movl 0x98(%rax), %esi
movl 0x94(%rax), %edx
callq 0x4450
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)