// File: Manuel123cool[P]smiley/main.cpp
// Function: main
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        std::cerr << "No command line argument" << std::endl;
        return 1;
    }

    std::ifstream inf{ argv[1] };
 
    if (!inf)
    {
        std::cerr << "Uh oh, Sample.dat could not be opened for reading!\n";
        return 1;
    }
    Instruction instruction;

    while (inf)
    {
        std::string strInput;
        std::getline(inf, strInput);
        
        std::string clearedStr{ strInput };
        while (clearedStr != MyRegex::processComments(clearedStr))
        {
            clearedStr = MyRegex::processComments(clearedStr);
        }
        clearedStr = MyRegex::deleteInessentialSpaces(clearedStr);

        instruction.add(clearedStr);
    } 
    instruction.run();
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3a0, %rsp            # imm = 0x3A0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
je 0x367d
movq 0x1999a(%rip), %rdi     # 0x1cff0
leaq 0x119a7(%rip), %rsi     # 0x15004
callq 0x3220
movq %rax, %rdi
movq 0x19934(%rip), %rsi     # 0x1cfa0
callq 0x3250
movl $0x1, -0x4(%rbp)
jmp 0x3a32
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x218(%rbp), %rdi
movl $0x8, %edx
callq 0x33b0
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x218(%rbp,%rax), %rdi
callq 0x3110
movb %al, -0x379(%rbp)
jmp 0x36b6
movb -0x379(%rbp), %al
testb $0x1, %al
jne 0x36c2
jmp 0x3704
movq 0x19927(%rip), %rdi     # 0x1cff0
leaq 0x1194d(%rip), %rsi     # 0x1501d
callq 0x3220
jmp 0x36d7
movl $0x1, -0x4(%rbp)
movl $0x1, -0x228(%rbp)
jmp 0x3a16
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x3a24
leaq -0x258(%rbp), %rdi
callq 0x3a50
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x218(%rbp,%rax), %rdi
callq 0x32d0
movb %al, -0x37a(%rbp)
jmp 0x3730
movb -0x37a(%rbp), %al
testb $0x1, %al
jne 0x373f
jmp 0x39db
leaq -0x278(%rbp), %rdi
movq %rdi, -0x388(%rbp)
callq 0x3300
movq -0x388(%rbp), %rsi
leaq -0x218(%rbp), %rdi
callq 0x3060
jmp 0x3767
leaq -0x298(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x30e0
jmp 0x377c
jmp 0x377e
leaq -0x2d8(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x30e0
jmp 0x3793
leaq -0x2b8(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0xa990
jmp 0x37a8
leaq -0x298(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
callq 0x3a80
movb %al, -0x389(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x3160
leaq -0x2d8(%rbp), %rdi
callq 0x3160
movb -0x389(%rbp), %al
testb $0x1, %al
jne 0x37e8
jmp 0x38cd
leaq -0x318(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x30e0
jmp 0x37fd
leaq -0x2f8(%rbp), %rdi
leaq -0x318(%rbp), %rsi
callq 0xa990
jmp 0x3812
leaq -0x298(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x32b0
leaq -0x2f8(%rbp), %rdi
callq 0x3160
leaq -0x318(%rbp), %rdi
callq 0x3160
jmp 0x377e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x3a08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x39cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x39c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x3160
jmp 0x39c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x318(%rbp), %rdi
callq 0x3160
jmp 0x39c1
leaq -0x358(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x30e0
jmp 0x38e2
leaq -0x338(%rbp), %rdi
leaq -0x358(%rbp), %rsi
callq 0xabd0
jmp 0x38f7
leaq -0x298(%rbp), %rdi
movq %rdi, -0x398(%rbp)
leaq -0x338(%rbp), %rsi
movq %rsi, -0x3a0(%rbp)
callq 0x32b0
movq -0x3a0(%rbp), %rdi
callq 0x3160
leaq -0x358(%rbp), %rdi
callq 0x3160
movq -0x398(%rbp), %rsi
leaq -0x378(%rbp), %rdi
callq 0x30e0
jmp 0x3945
leaq -0x258(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0xffc0
jmp 0x395a
leaq -0x378(%rbp), %rdi
callq 0x3160
leaq -0x298(%rbp), %rdi
callq 0x3160
leaq -0x278(%rbp), %rdi
callq 0x3160
jmp 0x3710
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x358(%rbp), %rdi
callq 0x3160
jmp 0x39c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x378(%rbp), %rdi
callq 0x3160
leaq -0x298(%rbp), %rdi
callq 0x3160
leaq -0x278(%rbp), %rdi
callq 0x3160
jmp 0x3a08
leaq -0x258(%rbp), %rdi
callq 0x10010
jmp 0x39e9
movl $0x0, -0x4(%rbp)
movl $0x1, -0x228(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x3ab0
jmp 0x3a16
leaq -0x258(%rbp), %rdi
callq 0x3ab0
jmp 0x3a24
leaq -0x218(%rbp), %rdi
callq 0x3070
jmp 0x3a32
leaq -0x218(%rbp), %rdi
callq 0x3070
jmp 0x3a3e
movl -0x4(%rbp), %eax
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbp
retq
movq -0x220(%rbp), %rdi
callq 0x3380
nopw (%rax,%rax)