// File: /workspace/github_cpp_makefile_star2_O1/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 0x2f9e
movq 0x30f5(%rip), %rbx      # 0x5fd8
leaq 0x111a(%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 0x10ee(%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 0x10bb(%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 0x31f6
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 0x3008(%rip), %rdi      # 0x5fd8
leaq 0x1068(%rip), %rsi      # 0x403f
movl $0x12, %edx
callq 0x2180
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x2fe8(%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 0x3740
leaq -0x6e20(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x2508
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x3069
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 0x3740
leaq -0x6e20(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x33a8
movl %eax, %ebx
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x30ac
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2170
movq 0x2f25(%rip), %rdi      # 0x5fd8
leaq 0xf98(%rip), %rsi       # 0x4052
movl $0x7, %edx
callq 0x2180
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq 0x2f05(%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 0x3150
movq 0x2ecb(%rip), %rbx      # 0x5fd8
leaq 0xf46(%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 0x2e99(%rip), %rdi      # 0x5fd8
callq 0x2030
xorl %ebx, %ebx
movq %rax, %rdi
callq 0x20f0
jmp 0x319b
movq 0x2e81(%rip), %rbx      # 0x5fd8
leaq 0xf0d(%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 0x2e4f(%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 0x31be
movq -0x6e28(%rbp,%r14), %rsi
subq %rdi, %rsi
callq 0x2170
addq $-0x18, %r14
jne 0x31a1
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x31dd
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x2170
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x31f6
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 0x324a
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2170
jmp 0x324a
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x3273
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2170
jmp 0x3273
jmp 0x3242
movq %rax, %rbx
jmp 0x328c
movq %rax, %rbx
jmp 0x3273
movq %rax, %rbx
movl $0x5dd8, %r14d          # imm = 0x5DD8
movq -0x6e38(%rbp,%r14), %rdi
testq %rdi, %rdi
je 0x326d
movq -0x6e28(%rbp,%r14), %rsi
subq %rdi, %rsi
callq 0x2170
addq $-0x18, %r14
jne 0x3250
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x328c
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x2170
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x32a5
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2210
nop