// File: /workspace/github_cpp_makefile_star2_O3/metastableB[P]Program-Dependence-Graph-Creator/./pdg.cpp
// Function: PDG::make_program_map()
bool PDG::make_program_map(){
 	if(!valid) {
 		std::cout << "INTERNAL ERROR!\n";
 		return false;
 	}

 	std::string s;
 	int line_no = 1;
 	int scope = 0;
 	Line_Type type;
 	Line *temp;
 	program_map.push_back({0,0,BEGIN});
 	while(std::getline(in,s)){
 		type = get_line_type(s);
 		temp = (Line*) malloc(sizeof(Line));
 		program_map.push_back({line_no,scope,type});
 		switch(type){
 			case Line_Type::ASSIGNMENT:
 				break;
 			case Line_Type::IF:
 				scope++;
 				break;
 			case Line_Type::ELSE:
 				scope++;
 				break;
 			case Line_Type::WHILE:
 				scope++;
 				break;
 			case Line_Type::SCOPE_CLOSE:
 				scope--;
 				(--program_map.end())->scope -= 1;
 				break;
 			default :
 				std::cout << "Unknown Line Type at L:" << line_no << "\""+s+"\""<<std::endl;
 				return false;
 		}
 		//std::cout << "L " << line_no << " scope " << (--program_map.end())->scope << " type " << type << std::endl;
 		line_no++;
 	}
 	total_lines = line_no - 1;
 	if(scope != 0){
 		std::cout << "Scopes did not close properly\n";
 		return false;
 	}
 	in.seekg(0);
 	return true;
 }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
cmpb $0x0, 0x210(%rdi)
je 0x28b6
movq %rdi, %rbx
leaq 0x30(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
leaq 0x218(%rdi), %r14
movq %rax, (%rsp)
movl $0x6, 0x8(%rsp)
movq 0x220(%rdi), %rsi
cmpq 0x228(%rdi), %rsi
je 0x28d5
movl 0x8(%rsp), %eax
movl %eax, 0x8(%rsi)
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x220(%rbx)
jmp 0x28e0
movq 0x671b(%rip), %rdi      # 0x8fd8
leaq 0x37c1(%rip), %rsi      # 0x6085
movl $0x10, %edx
callq 0x2200
xorl %ebp, %ebp
jmp 0x2a3f
movq %rsp, %rdx
movq %r14, %rdi
callq 0x4cd2
movq %r14, 0x40(%rsp)
xorl %r14d, %r14d
leaq 0x68(%rsp), %r12
xorl %r15d, %r15d
movl %r14d, %ebp
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %edx
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
callq 0x2330
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x29ed
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x4c3c
movq %r12, %rsi
callq 0x2cc6
movl %eax, %r13d
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x296f
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21b0
leal 0x1(%rbp), %r14d
movl %r14d, (%rsp)
movl %r15d, 0x4(%rsp)
movl %r13d, 0x8(%rsp)
movq 0x220(%rbx), %rsi
cmpq 0x228(%rbx), %rsi
je 0x29a9
movl 0x8(%rsp), %eax
movl %eax, 0x8(%rsi)
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x220(%rbx)
jmp 0x29b6
movq 0x40(%rsp), %rdi
movq %rsp, %rdx
callq 0x4cd2
cmpl $0x4, %r13d
ja 0x2a53
movl %r13d, %eax
leaq 0x3692(%rip), %rcx      # 0x605c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
incl %r15d
jmp 0x28f0
decl %r15d
movq 0x220(%rbx), %rax
decl -0x8(%rax)
jmp 0x28f0
movl %ebp, 0x214(%rbx)
testl %r15d, %r15d
je 0x2a14
movq 0x65d9(%rip), %rdi      # 0x8fd8
leaq 0x36aa(%rip), %rsi      # 0x60b0
movl $0x1e, %edx
callq 0x2200
xorl %ebp, %ebp
jmp 0x2a23
movb $0x1, %bpl
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2250
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2a3f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21b0
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x657e(%rip), %rdi      # 0x8fd8
leaq 0x3635(%rip), %rsi      # 0x6096
movl $0x17, %edx
callq 0x2200
incl %ebp
movq 0x6564(%rip), %rdi      # 0x8fd8
movl %ebp, %esi
callq 0x22f0
movq %rax, %rbx
leaq 0x3629(%rip), %rsi      # 0x60ae
leaq 0x48(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x49b5
leaq 0x3613(%rip), %rsi      # 0x60ae
leaq 0x48(%rsp), %rdi
callq 0x2340
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x2acb
movq %rsi, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x2ad5
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq %r14, %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
callq 0x2200
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x2b35
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2a10
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x2a10
movq %rax, %rbx
jmp 0x2b7b
jmp 0x2b9c
jmp 0x2b9c
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x2b7b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b9f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x2b9f
jmp 0x2b9c
jmp 0x2b9c
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2bbb
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x2310
nop