// File: kusumi[P]procstat/window.cc
// Function: Window::repaint()
void Window::repaint(void)
{
	if (is_dead())
		return;

	int ret, pos, y = 0;
	bool standout;
	std::string s;

	_mutex.lock();
	int offset = _offset;
	int ylen = _panel->get_ylen();
	int xlen = _panel->get_xlen();
	_mutex.unlock();

	_buffer->block_till_ready();
	_panel->erase();
	while ((ret = _buffer->readline(pos, s, standout)) != -1) {
		_mutex.lock();
		if (y >= ylen || offset != _offset ||
			ylen != _panel->get_ylen() ||
			xlen != _panel->get_xlen()) {
			_mutex.unlock();
			break;
		}
		_mutex.unlock();
		if (pos < offset)
			continue;
		if (!foldline && (static_cast<int>(s.size()) > xlen))
			s = s.substr(0, xlen);
		_panel->print(y, 0, standout, s);
		if (!foldline) {
			y++;
		} else {
			size_t siz = s.size();
			y += (siz / xlen);
			if (siz % xlen)
				y++;
		}
	}
	_panel->refresh();
	_buffer->clear();
	_buffer->signal_blocked();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0xa160
testb $0x1, %al
jne 0xa582
jmp 0xa587
jmp 0xa7fc
movl $0x0, -0x14(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4600
movq -0x80(%rbp), %rdi
callq 0xaa50
jmp 0xa5a2
movq -0x80(%rbp), %rax
movl 0x78(%rax), %ecx
movl %ecx, -0x48(%rbp)
movq 0x68(%rax), %rdi
callq 0xaa90
movl %eax, -0x84(%rbp)
jmp 0xa5bd
movq -0x80(%rbp), %rax
movl -0x84(%rbp), %ecx
movl %ecx, -0x4c(%rbp)
movq 0x68(%rax), %rdi
callq 0xaab0
movl %eax, -0x88(%rbp)
jmp 0xa5db
movq -0x80(%rbp), %rdi
movl -0x88(%rbp), %eax
movl %eax, -0x50(%rbp)
callq 0xaa70
jmp 0xa5ef
movq -0x80(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0xb4d0
jmp 0xa5fe
movq -0x80(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0xaad0
jmp 0xa60d
jmp 0xa60f
movq -0x80(%rbp), %rax
movq 0x70(%rax), %rdi
leaq -0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdx
leaq -0x15(%rbp), %rcx
callq 0xb5b0
movl %eax, -0x8c(%rbp)
jmp 0xa630
movl -0x8c(%rbp), %eax
movl %eax, -0xc(%rbp)
cmpl $-0x1, %eax
je 0xa7c6
movq -0x80(%rbp), %rdi
callq 0xaa50
jmp 0xa64d
movl -0x14(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0xa6bd
movq -0x80(%rbp), %rcx
movl -0x48(%rbp), %eax
cmpl 0x78(%rcx), %eax
jne 0xa6bd
movq -0x80(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl %ecx, -0x94(%rbp)
movq 0x68(%rax), %rdi
callq 0xaa90
movl %eax, -0x90(%rbp)
jmp 0xa67f
movl -0x94(%rbp), %eax
movl -0x90(%rbp), %ecx
cmpl %ecx, %eax
jne 0xa6bd
movq -0x80(%rbp), %rax
movl -0x50(%rbp), %ecx
movl %ecx, -0x9c(%rbp)
movq 0x68(%rax), %rdi
callq 0xaab0
movl %eax, -0x98(%rbp)
jmp 0xa6ad
movl -0x9c(%rbp), %eax
movl -0x98(%rbp), %ecx
cmpl %ecx, %eax
je 0xa6e7
movq -0x80(%rbp), %rdi
callq 0xaa70
jmp 0xa6c8
jmp 0xa7c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4878
jmp 0xa805
movq -0x80(%rbp), %rdi
callq 0xaa70
jmp 0xa6f2
movl -0x10(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0xa6ff
jmp 0xa60f
leaq 0xcda3(%rip), %rax      # 0x174a9
testb $0x1, (%rax)
jne 0xa746
leaq -0x38(%rbp), %rdi
callq 0x42e0
cmpl -0x50(%rbp), %eax
jle 0xa746
movslq -0x50(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x70(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4440
jmp 0xa730
leaq -0x38(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x4580
leaq -0x70(%rbp), %rdi
callq 0x4878
movq -0x80(%rbp), %rax
movq 0x68(%rax), %rdi
movl -0x14(%rbp), %esi
movzbl -0x15(%rbp), %ecx
andl $0x1, %ecx
xorl %edx, %edx
leaq -0x38(%rbp), %r8
callq 0xaed0
jmp 0xa765
leaq 0xcd3d(%rip), %rax      # 0x174a9
testb $0x1, (%rax)
jne 0xa77c
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xa7c1
leaq -0x38(%rbp), %rdi
callq 0x42e0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movslq -0x50(%rbp), %rcx
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
movslq -0x14(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x14(%rbp)
movq -0x78(%rbp), %rax
movslq -0x50(%rbp), %rcx
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
je 0xa7bf
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xa7c1
jmp 0xa60f
movq -0x80(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0xa9d0
jmp 0xa7d5
movq -0x80(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0xb890
jmp 0xa7e4
movq -0x80(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0xb520
jmp 0xa7f3
leaq -0x38(%rbp), %rdi
callq 0x4878
addq $0xa0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x47b0
nop