// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/buffer.cc
// Function: Buffer::readline(int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, bool&)
int Buffer::readline(int &pos, std::string &s, bool &standout)
{
	std::getline(_ifs, s);
	if (_ifs.eof() && s.empty())
		return -1;

	size_t i = 0;
	while ((i = s.find("%", i)) != std::string::npos) {
		s.insert(i, "%");
		i += 2;
	}

	if (blinkline) {
		if (_curline >= static_cast<int>(_chunk.size()))
			_chunk.resize(_chunk.size() * 2 + 1);
		standout = (!_chunk[_curline].empty() && _chunk[_curline] != s);
		_chunk[_curline] = s;
	} else {
		standout = false;
	}

	pos = _curline++;
	if (showlnum) {
		std::stringstream ss;
		ss << _curline << ' ' << s;
		s = ss.str();
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x70(%rdi), %r13
movq 0x70(%rdi), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3350
movsbl %al, %edx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x36c0
movq 0x70(%r14), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x90(%r14,%rax)
je 0x63c9
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq $0x0, 0x8(%rbx)
je 0x6560
leaq 0x222b(%rip), %rsi      # 0x85fb
movl $0x1, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3670
cmpq $-0x1, %rax
je 0x6425
movq %rax, %r13
leaq 0x220c(%rip), %rbp      # 0x85fb
movl $0x1, %r8d
movq %rbx, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %rbp, %rcx
callq 0x33d0
addq $0x2, %r13
movl $0x1, %ecx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x3670
movq %rax, %r13
cmpq $-0x1, %rax
jne 0x63ef
leaq 0x5f64(%rip), %rax      # 0xc390
cmpb $0x1, (%rax)
jne 0x6492
movq 0x60(%r14), %rsi
subq 0x58(%r14), %rsi
movq %rsi, %rax
shrq $0x5, %rax
cmpl %eax, 0x298(%r14)
jl 0x645a
leaq 0x58(%r14), %rdi
sarq $0x4, %rsi
orq $0x1, %rsi
callq 0x65dc
movslq 0x298(%r14), %rax
movq 0x58(%r14), %rcx
shlq $0x5, %rax
leaq (%rcx,%rax), %r13
movq 0x8(%rcx,%rax), %rdx
testq %rdx, %rdx
je 0x6499
movb $0x1, %al
cmpq 0x8(%rbx), %rdx
jne 0x649b
movq (%rbx), %rsi
movq (%r13), %rdi
callq 0x3390
testl %eax, %eax
setne %al
jmp 0x649b
movb $0x0, (%r12)
jmp 0x64aa
xorl %eax, %eax
movb %al, (%r12)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x31f0
movl 0x298(%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x298(%r14)
movl %eax, (%r15)
leaq 0x5f2b(%rip), %rax      # 0xc3f0
xorl %ebp, %ebp
cmpb $0x1, (%rax)
jne 0x6560
leaq 0x20(%rsp), %rdi
callq 0x3280
leaq 0x30(%rsp), %rdi
movl 0x298(%r14), %esi
callq 0x3650
movq %rsp, %rsi
movb $0x20, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x3400
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x3400
leaq 0x38(%rsp), %rsi
movq %rsp, %rdi
callq 0x35e0
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x34a0
movq (%r14), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6542
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3380
movq 0x5a2f(%rip), %rsi      # 0xbf78
leaq 0x20(%rsp), %rdi
callq 0x32a0
leaq 0xa0(%rsp), %rdi
callq 0x3120
movl %ebp, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6576
movq %rax, %rbx
movq 0x59f8(%rip), %rsi      # 0xbf78
leaq 0x20(%rsp), %rdi
callq 0x32a0
leaq 0xa0(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3680
nop