// File: /workspace/github_cpp_makefile_star2_O3/64Mega[P]todo-cli/src/todo.cpp
// Function: read_todos(bool)
void read_todos(bool local_mode) {
    auto buffer = get_todos(local_mode);
    if(buffer.size() == 0) {
        ccout << "Nothing to do!" << std::endl;
        return;
    }
    for(int i = 0; i < buffer.size(); i++) {
        std::string todo = buffer[i];
        if(todo.length() < 2) { continue; }
        std::replace(todo.begin(), todo.end(), '\n', ' ');
        std::replace(todo.begin(), todo.end(), '\r', ' ');
        char state = todo[0];
        todo = todo.substr(2);

        ccout << "[" << i << "] ";
        ccout << (state == 'X' ? GLYPH_INCOMPLETE : GLYPH_COMPLETE) << "\t";
        ccout << todo.c_str() << std::endl; 
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edi, %esi
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x1636e
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x15462
leaq 0x10(%rsp), %r13
xorl %ebx, %ebx
movq %rsp, %r14
leaq 0x38(%rsp), %r15
leaq 0xe21d7(%rip), %r12     # 0xf7460
movq %rbx, %rcx
shlq $0x5, %rcx
movq %r13, (%rsp)
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x1706c
movq 0x8(%rsp), %rax
cmpq $0x2, %rax
jb 0x1542d
movq (%rsp), %rcx
xorl %edx, %edx
cmpb $0xa, (%rcx,%rdx)
jne 0x152c7
movb $0x20, (%rcx,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0x152bd
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
testq %rcx, %rcx
je 0x152f5
xorl %edx, %edx
cmpb $0xd, (%rax,%rdx)
jne 0x152e9
movb $0x20, (%rax,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x152df
movq (%rsp), %rax
movb (%rax), %bpl
movl $0x2, %edx
movq %r15, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x89c60
movq %r14, %rdi
movq %r15, %rsi
callq 0x873d0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x15336
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x17970
movl $0x1, %edx
movq %r12, %rdi
leaq 0xa5f51(%rip), %rsi     # 0xbb296
callq 0x80a80
movq %r12, %rdi
movl %ebx, %esi
callq 0x81350
movl $0x2, %edx
movq %rax, %rdi
leaq 0xa9db4(%rip), %rsi     # 0xbf117
callq 0x80a80
cmpb $0x58, %bpl
leaq 0xe103d(%rip), %rax     # 0xf63b0
leaq 0xe103e(%rip), %rcx     # 0xf63b8
cmoveq %rcx, %rax
movq (%rax), %rbp
testq %rbp, %rbp
je 0x1539e
movq %rbp, %rdi
callq 0x122f0
movq %r12, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x80a80
jmp 0x153b7
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x61900
movl $0x1, %edx
movq %r12, %rdi
leaq 0xa5ed2(%rip), %rsi     # 0xbb298
callq 0x80a80
movq (%rsp), %rbp
testq %rbp, %rbp
je 0x153ec
movq %rbp, %rdi
callq 0x122f0
movq %r12, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x80a80
jmp 0x15405
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x61900
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x61bd0
movsbl %al, %esi
movq %r12, %rdi
callq 0x80580
movq %rax, %rdi
callq 0x7fb50
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x15443
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x17970
incq %rbx
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rbx, %rcx
ja 0x15289
jmp 0x154a8
leaq 0xe1ff7(%rip), %rbx     # 0xf7460
leaq 0xa5e17(%rip), %rsi     # 0xbb287
movl $0xe, %edx
movq %rbx, %rdi
callq 0x80a80
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x61bd0
movsbl %al, %esi
leaq 0xe1fc5(%rip), %rdi     # 0xf7460
callq 0x80580
movq %rax, %rdi
callq 0x7fb50
leaq 0x20(%rsp), %rdi
callq 0x16d8e
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x154c5
jmp 0x154ca
movq %rax, %rbx
jmp 0x154e3
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x154e3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x17970
leaq 0x20(%rsp), %rdi
callq 0x16d8e
movq %rbx, %rdi
callq 0xb83a0