// File: /workspace/github_cpp_makefile_star2_O3/pollow[P]MIPSClide/assembler.cpp
// Function: Assembler::format()
void Assembler::format() {
    static regex label("(\\s*(\\w+)\\s*:\\s*).*");
    // 0. remove empty line
    {
        auto i = statements.begin();
        while( i != statements.end() ) {
            if (i->length() < 1) statements.erase(i);
            else i++;
        }
    }
    // 1. extract label into new line:
    size_t i = 0;
    while ( i < statements.size() ) {
        string &str = statements[i];
        smatch result;
        if ( regex_match(str, result, label) ) {
            if ( (size_t) result[1].length() != str.length() ) {
                string tmp = result[2].str();
                str.erase( str.find(result[1].str()), result[1].length() );
                statements.insert(statements.begin()+i,tmp+":");
                i++;
            }
            i++;
        } else i++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movb 0x1e8ec(%rip), %al      # 0x2b830
testb %al, %al
je 0xd23c
movq 0x20(%rbx), %r15
movq 0x28(%rbx), %rax
cmpq %rax, %r15
je 0xd22d
leaq 0x20(%rbx), %r14
cmpq $0x0, 0x8(%r15)
je 0xcf6e
addq $0x20, %r15
jmp 0xcf7d
movq %r14, %rdi
movq %r15, %rsi
callq 0x1caea
movq 0x28(%rbx), %rax
cmpq %rax, %r15
jne 0xcf61
movq %r14, -0x70(%rbp)
movq (%r14), %r15
cmpq %r15, %rax
je 0xd22d
leaq -0x48(%rbp), %r14
xorl %r12d, %r12d
movq %r12, %r13
shlq $0x5, %r13
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
movaps %xmm0, -0x90(%rbp)
movq (%r15,%r13), %rdi
movq 0x8(%r15,%r13), %rsi
addq %rdi, %rsi
leaq -0x90(%rbp), %rdx
leaq 0x1e848(%rip), %rcx     # 0x2b810
xorl %r8d, %r8d
callq 0x1c1c4
movq -0x90(%rbp), %rdi
testb %al, %al
je 0xd208
movq -0x88(%rbp), %rcx
movq %rcx, %rax
subq %rdi, %rax
je 0xd013
movq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
addq $-0x5, %rdx
cmpq $-0x3, %rdx
ja 0xd013
leaq 0x18(%rdi), %rdx
jmp 0xd01b
leaq (%rdi,%rax), %rdx
addq $-0x48, %rdx
addq %r13, %r15
movq 0x8(%rdx), %rsi
subq (%rdx), %rsi
cmpb $0x0, 0x10(%rdx)
movl $0x0, %edx
cmoveq %rdx, %rsi
cmpq 0x8(%r15), %rsi
je 0xd208
cmpq %rcx, %rdi
je 0xd066
movq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
addq $-0x6, %rdx
cmpq $-0x4, %rdx
ja 0xd066
leaq 0x30(%rdi), %rdx
jmp 0xd06e
leaq (%rdi,%rax), %rdx
addq $-0x48, %rdx
cmpb $0x1, 0x10(%rdx)
jne 0xd0a2
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x1c5c4
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rcx
movq %rcx, %rax
subq %rdi, %rax
jmp 0xd0b6
leaq -0x58(%rbp), %rdx
movq %rdx, -0x68(%rbp)
movq $0x0, -0x60(%rbp)
movb $0x0, -0x58(%rbp)
cmpq %rcx, %rdi
je 0xd0e0
movq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
addq $-0x5, %rcx
cmpq $-0x3, %rcx
ja 0xd0e0
addq $0x18, %rdi
jmp 0xd0e7
addq %rax, %rdi
addq $-0x48, %rdi
cmpb $0x1, 0x10(%rdi)
jne 0xd10e
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq %r14, %rdi
callq 0x1c5c4
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rcx
jmp 0xd124
leaq -0x38(%rbp), %rsi
movq %rsi, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movb $0x0, -0x38(%rbp)
xorl %ecx, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x5540
movq -0x90(%rbp), %rcx
movq -0x88(%rbp), %rdx
subq %rcx, %rdx
je 0xd166
movq %rdx, %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rdi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdi, %rsi
addq $-0x5, %rsi
cmpq $-0x3, %rsi
ja 0xd166
addq $0x18, %rcx
jmp 0xd16d
addq %rdx, %rcx
addq $-0x48, %rcx
movq 0x8(%rcx), %rdx
subq (%rcx), %rdx
cmpb $0x0, 0x10(%rcx)
movl $0x0, %ecx
cmoveq %rcx, %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x5090
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
leaq -0x38(%rbp), %r15
je 0xd1a2
callq 0x52d0
movq -0x70(%rbp), %rax
addq (%rax), %r13
movq %r15, -0x48(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x9dfc
movq %r14, %rdi
leaq 0x14246(%rip), %rsi     # 0x21410
callq 0x55e0
movq -0x70(%rbp), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0xa354
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0xd1ec
callq 0x52d0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xd1fe
callq 0x52d0
incq %r12
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0xd212
callq 0x52d0
incq %r12
movq 0x20(%rbx), %r15
movq 0x28(%rbx), %rax
subq %r15, %rax
sarq $0x5, %rax
cmpq %rax, %r12
jb 0xcf99
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e5ed(%rip), %rdi     # 0x2b830
callq 0x5580
testl %eax, %eax
je 0xcf4c
leaq 0x1e5b9(%rip), %rdi     # 0x2b810
leaq 0x141c9(%rip), %rsi     # 0x21427
movl $0x10, %edx
callq 0xd6b0
leaq 0x4ad(%rip), %rdi       # 0xd71c
leaq 0x1e59a(%rip), %rsi     # 0x2b810
leaq 0x1e09b(%rip), %rdx     # 0x2b318
callq 0x52b0
leaq 0x1e5a7(%rip), %rdi     # 0x2b830
callq 0x5200
jmp 0xcf4c
movq %rax, %rbx
leaq 0x1e593(%rip), %rdi     # 0x2b830
callq 0x51f0
jmp 0xd2fa
jmp 0xd2b8
jmp 0xd2e6
jmp 0xd2aa
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
jne 0xd2cd
jmp 0xd2d2
movq %rax, %rbx
jmp 0xd2d2
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xd2d2
callq 0x52d0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xd2e9
callq 0x52d0
jmp 0xd2e9
movq %rax, %rbx
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0xd2fa
callq 0x52d0
movq %rbx, %rdi
callq 0x5560