// File: /workspace/github_cpp_makefile_star2_O1/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 0x28ae
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 0x28cd
movl 0x8(%rsp), %eax
movl %eax, 0x8(%rsi)
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x220(%rbx)
jmp 0x28d8
movq 0x6723(%rip), %rdi      # 0x8fd8
leaq 0x37c9(%rip), %rsi      # 0x6085
movl $0x10, %edx
callq 0x2200
xorl %ebp, %ebp
jmp 0x2a37
movq %rsp, %rdx
movq %r14, %rdi
callq 0x4c9a
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 0x29e5
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x4c0a
movq %r12, %rsi
callq 0x2cda
movl %eax, %r13d
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2967
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 0x29a1
movl 0x8(%rsp), %eax
movl %eax, 0x8(%rsi)
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x220(%rbx)
jmp 0x29ae
movq 0x40(%rsp), %rdi
movq %rsp, %rdx
callq 0x4c9a
cmpl $0x4, %r13d
ja 0x2a4b
movl %r13d, %eax
leaq 0x369a(%rip), %rcx      # 0x605c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
incl %r15d
jmp 0x28e8
decl %r15d
movq 0x220(%rbx), %rax
decl -0x8(%rax)
jmp 0x28e8
movl %ebp, 0x214(%rbx)
testl %r15d, %r15d
je 0x2a0c
movq 0x65e1(%rip), %rdi      # 0x8fd8
leaq 0x36b2(%rip), %rsi      # 0x60b0
movl $0x1e, %edx
callq 0x2200
xorl %ebp, %ebp
jmp 0x2a1b
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 0x2a37
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 0x6586(%rip), %rdi      # 0x8fd8
leaq 0x363d(%rip), %rsi      # 0x6096
movl $0x17, %edx
callq 0x2200
incl %ebp
movq 0x656c(%rip), %rdi      # 0x8fd8
movl %ebp, %esi
callq 0x22f0
movq %rax, %rbx
leaq 0x3631(%rip), %rsi      # 0x60ae
leaq 0x48(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x4985
leaq 0x361b(%rip), %rsi      # 0x60ae
leaq 0x48(%rsp), %rdi
callq 0x2340
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2ac3
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x2aca
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
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 0x2b33
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2a08
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x2a08
movq %rax, %rbx
jmp 0x2b79
jmp 0x2b9a
jmp 0x2b9a
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x2b79
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b9d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x2b9d
jmp 0x2b9a
jmp 0x2b9a
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2bb9
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x2310
nop