// File: /workspace/github_cpp_makefile_star2_O1/luizaes[P]post-machine-simulator/main.cpp
// Function: main
int main() {

	string input_word;
	bool output;
	auto pm = new PostMachineSimulator();

	DiagramState* diagram = pm->BuildDiagram();

	if(!diagram->IsValid()) {
		cout << diagram->GetError() << endl;
		return 0;
	}

	cout << "[SUCCESS] Post Machine created successfuly." << endl;

	cin >> input_word;

	output = pm->Run(input_word);

	if(output == ACCEPT) {
		cout << "[ACCEPT] The input \"" << input_word << "\" was accepted by the machine." << endl;
	} else {
		cout << "[REJECT] The input \"" << input_word << "\" was rejected by the machine." << endl;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movl $0xa8, %edi
callq 0x2170
movq %rax, %rbx
leaq 0x18(%rax), %r14
movl $0xa8, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x20f0
movq %r14, %rdi
xorl %esi, %esi
callq 0x273e
leaq 0x78(%rbx), %rax
movq %rax, 0x68(%rbx)
xorl %eax, %eax
movq %rax, 0x70(%rbx)
movb %al, 0x78(%rbx)
movq %rbx, %rcx
addq $0x98, %rcx
movq %rcx, 0x88(%rbx)
movq %rax, 0x90(%rbx)
movb %al, 0x98(%rbx)
movq %rbx, %rdi
callq 0x2c3a
movq %rax, %r14
movq %rax, %rdi
callq 0x40ae
testb %al, %al
je 0x25b7
movq 0x4ad8(%rip), %r14      # 0x6fd0
leaq 0x2b05(%rip), %rsi      # 0x5004
movl $0x2b, %edx
movq %r14, %rdi
callq 0x21b0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq 0x4aa6(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x4aa2(%rip), %rdi      # 0x6fe0
leaq -0x38(%rbp), %rsi
callq 0x21d0
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0x3712
testb %al, %al
je 0x261c
movq 0x4a6e(%rip), %rdi      # 0x6fd0
leaq 0x2ac7(%rip), %rsi      # 0x5030
movl $0x14, %edx
callq 0x21b0
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq 0x4a4e(%rip), %rdi      # 0x6fd0
callq 0x21b0
movq %rax, %rbx
leaq 0x2ab4(%rip), %rsi      # 0x5045
movl $0x1e, %edx
movq %rax, %rdi
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
jmp 0x2673
leaq -0x58(%rbp), %rdi
movq %r14, %rsi
callq 0x40b8
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq 0x49fe(%rip), %rdi      # 0x6fd0
callq 0x21b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2686
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2686
movq 0x49ad(%rip), %rdi      # 0x6fd0
leaq 0x2a3a(%rip), %rsi      # 0x5064
movl $0x14, %edx
callq 0x21b0
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq 0x498d(%rip), %rdi      # 0x6fd0
callq 0x21b0
movq %rax, %rbx
leaq 0x2a27(%rip), %rsi      # 0x5079
movl $0x1e, %edx
movq %rax, %rdi
callq 0x21b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x269b
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x2180
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x26df
movq %rax, %r14
movq %rbx, %rdi
callq 0x2700
movl $0xa8, %esi
movq %rbx, %rdi
jmp 0x26d8
jmp 0x26df
movq %rax, %r14
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x26e2
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x26e2
movq %rax, %r14
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x26f7
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x2180
movq %r14, %rdi
callq 0x2250
nop