// File: /workspace/github_cpp_makefile_star2_O3/saumya-prakash[P]AssemblerEmulator/Assembler.cpp
// Function: Assembler::generate_log_file() const
void Assembler::generate_log_file() const
{
    string::size_type ind = filename.find_first_of('.');

    string log_name = string(filename.begin(), filename.begin()+ind);

    ofstream lg(log_name+".log", ofstream::out);

    if(!errors.empty())
    {
        lg<<"Errors -"<<endl;

        for(map<unsigned, class Error>::const_iterator et=errors.begin(); et!=errors.end(); ++et)
        {
            lg<<"Line "<<et->first<<": "<<et->second.message<<endl;
        }

        lg<<endl;
    }

    if(!warnings.empty())
    {
        lg<<"Warnings -"<<endl;

        for(map<unsigned, class Warning>::const_iterator wt=warnings.begin(); wt!=warnings.end(); ++wt)
        {
            lg<<"Line "<<wt->first<<": "<<wt->second.message<<endl;
        }

        lg<<endl;
    }

    lg.close();

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movq %rdi, %rbx
addq $0xa8, %rdi
movl $0x2e, %esi
xorl %edx, %edx
callq 0x2240
movq 0xa8(%rbx), %rsi
leaq (%rax,%rsi), %rdx
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rsp, %r14
movq %r14, %rdi
callq 0x92b6
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x3298
leaq 0x2b75(%rip), %rsi      # 0xa1e1
leaq 0x20(%rsp), %rdi
callq 0x2310
leaq 0x48(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x10, %edx
callq 0x2320
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x76a1
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21c0
cmpq $0x0, 0xf0(%rbx)
je 0x77cd
leaq 0x2b30(%rip), %rsi      # 0xa1e6
leaq 0x48(%rsp), %r14
movl $0x8, %edx
movq %r14, %rdi
callq 0x2200
movq 0x48(%rsp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq 0x48(%rsp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0xe0(%rbx), %r15
movq %rbx, 0x40(%rsp)
addq $0xd0, %rbx
cmpq %rbx, %r15
je 0x779b
leaq 0x2ad9(%rip), %r12      # 0xa1ef
leaq 0x48(%rsp), %r13
leaq 0x2946(%rip), %rbp      # 0xa068
movl $0x5, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x2200
movl 0x20(%r15), %esi
movq %r13, %rdi
callq 0x2120
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2200
movq 0x28(%r15), %rsi
movq 0x30(%r15), %rdx
movq %r14, %rdi
callq 0x2200
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq %r15, %rdi
callq 0x2210
movq %rax, %r15
cmpq %rbx, %rax
jne 0x7722
movq 0x48(%rsp), %rax
leaq 0x48(%rsp), %rdi
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x2190
movq 0x40(%rsp), %rbx
movsbl %al, %esi
leaq 0x48(%rsp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
cmpq $0x0, 0x120(%rbx)
je 0x78ef
leaq 0x2a13(%rip), %rsi      # 0xa1f5
leaq 0x48(%rsp), %r14
movl $0xa, %edx
movq %r14, %rdi
callq 0x2200
movq 0x48(%rsp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq 0x48(%rsp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x110(%rbx), %r15
addq $0x100, %rbx            # imm = 0x100
cmpq %rbx, %r15
je 0x78c2
leaq 0x29b2(%rip), %r12      # 0xa1ef
leaq 0x48(%rsp), %r13
leaq 0x281f(%rip), %rbp      # 0xa068
movl $0x5, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x2200
movl 0x20(%r15), %esi
movq %r13, %rdi
callq 0x2120
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2200
movq 0x28(%r15), %rsi
movq 0x30(%r15), %rdx
movq %r14, %rdi
callq 0x2200
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq %r15, %rdi
callq 0x2210
movq %rax, %r15
cmpq %rbx, %rax
jne 0x7849
movq 0x48(%rsp), %rax
leaq 0x48(%rsp), %rdi
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq 0x48(%rsp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x48(%rsp), %rdi
callq 0x2260
movq 0x66c8(%rip), %rax      # 0xdfc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x50(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x48(%rsp,%rcx)
callq 0x2170
leaq 0x140(%rsp), %rdi
callq 0x20b0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x7946
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21c0
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x795a
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x7979
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21c0
jmp 0x7979
movq %rax, %rbx
leaq 0x10(%rsp), %r14
jmp 0x7996
jmp 0x7984
jmp 0x7984
movq %rax, %rbx
leaq 0x10(%rsp), %r14
leaq 0x48(%rsp), %rdi
callq 0x2290
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x79ac
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x22e0