// File: /workspace/github_cpp_makefile_star2_O3/arush15june[P]DFA-CPP/dfa.cpp
// Function: main
int main(int argc, char** argv) {
    
    if(argc < 3) {
        std::cout<<"Invalid Input!"<<std::endl;
        std::cout<<"Usage: "<<std::endl;
        std::cout<<"./dfa <dfa_filename> <input_string>"<<std::endl;
        
        return 1;
    }

    std::string dfa_filename = std::string(argv[1]);
    std::string input_string = std::string(argv[2]);

    std::cout<<"Building DFA from "<<dfa_filename<<std::endl;
    auto dfa = build_dfa_from_file(dfa_filename);

    auto evaluate = dfa.execute(input_string);

    std::cout<<"Input: "<<input_string<<std::endl;
    if(evaluate) {
        std::cout<<"Evaluation: True"<<std::endl;
        return 0;
    }
    else {
        std::cout<<"Evaluation: False"<<std::endl;
        return 1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x6e10, %rsp           # imm = 0x6E10
cmpl $0x2, %edi
jg 0x2fa3
movq 0x30f0(%rip), %rbx      # 0x5fd8
leaq 0x1115(%rip), %rsi      # 0x4004
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x10e9(%rip), %rsi      # 0x4013
movl $0x7, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x10b6(%rip), %rsi      # 0x401b
movl $0x23, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x1, %ebx
jmp 0x31fb
movq %rsi, %rbx
movq 0x8(%rsi), %rsi
leaq -0x50(%rbp), %rdi
leaq -0x6e20(%rbp), %rdx
callq 0x20a0
movq 0x10(%rbx), %rsi
leaq -0x30(%rbp), %rdi
leaq -0x6e20(%rbp), %rdx
callq 0x20a0
movq 0x3003(%rip), %rdi      # 0x5fd8
leaq 0x1063(%rip), %rsi      # 0x403f
movl $0x12, %edx
callq 0x2180
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x2fe3(%rip), %rdi      # 0x5fd8
callq 0x2180
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq -0x80(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x3758
leaq -0x6e20(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x2508
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x306e
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2170
leaq -0x60(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rdi
callq 0x3758
leaq -0x6e20(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x33b0
movl %eax, %ebx
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x30b1
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2170
movq 0x2f20(%rip), %rdi      # 0x5fd8
leaq 0xf93(%rip), %rsi       # 0x4052
movl $0x7, %edx
callq 0x2180
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq 0x2f00(%rip), %rdi      # 0x5fd8
callq 0x2180
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
testb %bl, %bl
je 0x3155
movq 0x2ec6(%rip), %rbx      # 0x5fd8
leaq 0xf41(%rip), %rsi       # 0x405a
movl $0x10, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x2e94(%rip), %rdi      # 0x5fd8
callq 0x2030
xorl %ebx, %ebx
movq %rax, %rdi
callq 0x20f0
jmp 0x31a0
movq 0x2e7c(%rip), %rbx      # 0x5fd8
leaq 0xf08(%rip), %rsi       # 0x406b
movl $0x11, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x2e4a(%rip), %rdi      # 0x5fd8
callq 0x2030
movl $0x1, %ebx
movq %rax, %rdi
callq 0x20f0
movl $0x5dd8, %r14d          # imm = 0x5DD8
movq -0x6e38(%rbp,%r14), %rdi
testq %rdi, %rdi
je 0x31c3
movq -0x6e28(%rbp,%r14), %rsi
subq %rdi, %rsi
callq 0x2170
addq $-0x18, %r14
jne 0x31a6
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x31e2
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x2170
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x31fb
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2170
movl %ebx, %eax
addq $0x6e10, %rsp           # imm = 0x6E10
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x324f
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2170
jmp 0x324f
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x3278
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2170
jmp 0x3278
jmp 0x3247
movq %rax, %rbx
jmp 0x3291
movq %rax, %rbx
jmp 0x3278
movq %rax, %rbx
movl $0x5dd8, %r14d          # imm = 0x5DD8
movq -0x6e38(%rbp,%r14), %rdi
testq %rdi, %rdi
je 0x3272
movq -0x6e28(%rbp,%r14), %rsi
subq %rdi, %rsi
callq 0x2170
addq $-0x18, %r14
jne 0x3255
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3291
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x2170
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x32aa
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2210