// File: /workspace/github_cpp_makefile_star2_O1/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 0x1637e
movq 0x8(%rbx), %rax
cmpq (%rbx), %rax
je 0x15472
movq 0x20(%rsp), %rax
cmpq %rax, 0x28(%rsp)
je 0x154b8
leaq 0x10(%rsp), %r13
xorl %ebx, %ebx
movq %rsp, %r14
leaq 0x38(%rsp), %r15
leaq 0xe21c7(%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 0x17038
movq 0x8(%rsp), %rax
cmpq $0x2, %rax
jb 0x1543d
movq (%rsp), %rcx
xorl %edx, %edx
cmpb $0xa, (%rcx,%rdx)
jne 0x152d7
movb $0x20, (%rcx,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0x152cd
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0x15301
movq (%rsp), %rcx
xorl %edx, %edx
cmpb $0xd, (%rcx,%rdx)
jne 0x152f9
movb $0x20, (%rcx,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0x152ef
movq (%rsp), %rax
movb (%rax), %bpl
movl $0x2, %edx
movq %r15, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x89c10
movq %r14, %rdi
movq %r15, %rsi
callq 0x87380
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x15346
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x17920
movl $0x1, %edx
movq %r12, %rdi
leaq 0xa5f41(%rip), %rsi     # 0xbb296
callq 0x80a30
movq %r12, %rdi
movl %ebx, %esi
callq 0x81300
movl $0x2, %edx
movq %rax, %rdi
leaq 0xa9da4(%rip), %rsi     # 0xbf117
callq 0x80a30
cmpb $0x58, %bpl
leaq 0xe102d(%rip), %rax     # 0xf63b0
leaq 0xe102e(%rip), %rcx     # 0xf63b8
cmoveq %rcx, %rax
movq (%rax), %rbp
testq %rbp, %rbp
je 0x153ae
movq %rbp, %rdi
callq 0x122f0
movq %r12, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x80a30
jmp 0x153c7
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x618b0
movl $0x1, %edx
movq %r12, %rdi
leaq 0xa5ec2(%rip), %rsi     # 0xbb298
callq 0x80a30
movq (%rsp), %rbp
testq %rbp, %rbp
je 0x153fc
movq %rbp, %rdi
callq 0x122f0
movq %r12, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x80a30
jmp 0x15415
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x618b0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x61b80
movsbl %al, %esi
movq %r12, %rdi
callq 0x80530
movq %rax, %rdi
callq 0x7fb00
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x15453
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x17920
incq %rbx
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rbx, %rcx
ja 0x15299
jmp 0x154b8
leaq 0xe1fe7(%rip), %rbx     # 0xf7460
leaq 0xa5e07(%rip), %rsi     # 0xbb287
movl $0xe, %edx
movq %rbx, %rdi
callq 0x80a30
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x61b80
movsbl %al, %esi
leaq 0xe1fb5(%rip), %rdi     # 0xf7460
callq 0x80530
movq %rax, %rdi
callq 0x7fb00
leaq 0x20(%rsp), %rdi
callq 0x16d6a
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x154d5
jmp 0x154da
movq %rax, %rbx
jmp 0x154f3
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x154f3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x17920
leaq 0x20(%rsp), %rdi
callq 0x16d6a
movq %rbx, %rdi
callq 0xb8350