// File: phillip-h[P]todo/src/todolist.cpp
// Function: TodoList::completedStr[abi:cxx11]()
string TodoList::completedStr()
{
    unsigned count = 0;
    unsigned comp = 0;
    for (unsigned i = 0; i < size(); i++){
        if (at(i).div()){
            continue;
        }
        count++;
        if (at(i).completed()){
            comp++;
        }
    }

    string info = std::to_string(comp) + "/" + std::to_string(count);
    info += " -> ";
    if (size() == 0){
        info += " NaN";
    } else {
        info += std::to_string((int) ((float) comp / (float) count * 100));
        info += "%";
    }
    
    return info;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0xc8(%rbp)
movq %rdi, %rax
movq %rax, -0xc0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0xb8(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, -0xcc(%rbp)
callq 0xd9c0
movl %eax, %ecx
movl -0xcc(%rbp), %eax
cmpl %ecx, %eax
jae 0xdf70
movq -0xb8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0xd9e0
movq %rax, %rdi
callq 0xcf90
testb $0x1, %al
jne 0xdf32
jmp 0xdf34
jmp 0xdf65
movq -0xb8(%rbp), %rdi
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x1c(%rbp), %esi
callq 0xd9e0
movq %rax, %rdi
callq 0xd010
testb $0x1, %al
jne 0xdf5a
jmp 0xdf63
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xdf65
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xdef4
movb $0x0, -0x1d(%rbp)
movl -0x18(%rbp), %esi
leaq -0x60(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0xc6d0
movq -0xd8(%rbp), %rsi
leaq 0x4658(%rip), %rdx      # 0x125ed
leaq -0x40(%rbp), %rdi
callq 0xa530
jmp 0xdfa0
movl -0x14(%rbp), %esi
leaq -0x90(%rbp), %rdi
callq 0xc6d0
jmp 0xdfb1
movq -0xc8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0xe590
jmp 0xdfca
leaq -0x90(%rbp), %rdi
callq 0x4738
leaq -0x40(%rbp), %rdi
callq 0x4738
leaq -0x60(%rbp), %rdi
callq 0x4738
movq -0xc8(%rbp), %rdi
leaq 0x45f9(%rip), %rsi      # 0x125ef
callq 0x4320
jmp 0xdffd
movq -0xb8(%rbp), %rdi
callq 0xd9c0
cmpl $0x0, %eax
jne 0xe084
movq -0xc8(%rbp), %rdi
leaq 0x45d8(%rip), %rsi      # 0x125f4
callq 0x4320
jmp 0xe023
jmp 0xe108
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0xe065
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0xe05c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x4738
leaq -0x40(%rbp), %rdi
callq 0x4738
leaq -0x60(%rbp), %rdi
callq 0x4738
jmp 0xe13a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0xe12e
movl -0x18(%rbp), %eax
cvtsi2ss %rax, %xmm0
movl -0x14(%rbp), %eax
cvtsi2ss %rax, %xmm1
divss %xmm1, %xmm0
movss 0x452c(%rip), %xmm1     # 0x125cc
mulss %xmm1, %xmm0
cvttss2si %xmm0, %esi
leaq -0xb0(%rbp), %rdi
callq 0xd0c0
jmp 0xe0b6
movq -0xc8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x44c0
jmp 0xe0cb
leaq -0xb0(%rbp), %rdi
callq 0x4738
movq -0xc8(%rbp), %rdi
leaq 0x4514(%rip), %rsi      # 0x125f9
callq 0x4320
jmp 0xe0ec
jmp 0xe108
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x4738
jmp 0xe12e
movb $0x1, -0x1d(%rbp)
testb $0x1, -0x1d(%rbp)
jne 0xe11e
movq -0xc8(%rbp), %rdi
callq 0x4738
movq -0xc0(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
movq -0xc8(%rbp), %rdi
callq 0x4738
movq -0x68(%rbp), %rdi
callq 0x4680
nopw %cs:(%rax,%rax)