// File: /workspace/github_cpp_makefile_star2_O3/nwieder[P]SSTS/src/System/Gillespie_Sys.cpp
// Function: nw::Gillespie_Sys::build_dep_graph()
void Gillespie_Sys::build_dep_graph(){

	try{
//		temporary vectors
		vector<long> sc_a, sc_b;

//		find dependency relations based on state change vectors
		for (size_t i = 0; i < evt_vec->size(); ++i){
			sc_a = evt_vec->at(i)->get_sc_vec();
			for (size_t j = 0; j < evt_vec->size(); ++j){
				sc_b = evt_vec->at(j)->get_sc_vec();
				if(evt_vec->at(i) != evt_vec->at(j)){
					for (size_t k = 0; k < sc_a.size(); ++k){
						if(sc_a.at(k) != 0 && sc_b.at(k) < 0 ){
							evt_vec->at(i)->add_dep_list(evt_vec->at(j));
							break;
						}
					}
				}
			}
		}
	}

	catch(exception& e){
		cout << "System::build_dep_graph()" << e.what();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, 0x28(%rsp)
movq 0xef0(%rdi), %rax
movq (%rax), %r8
movq 0x8(%rax), %rdx
cmpq %r8, %rdx
je 0xefcf
xorl %r13d, %r13d
xorl %r14d, %r14d
xorl %ebx, %ebx
movq $0x0, (%rsp)
xorl %ebp, %ebp
subq %r8, %rdx
sarq $0x3, %rdx
cmpq %r13, %rdx
jbe 0xf027
movq (%r8,%r13,8), %rsi
addq $0x38, %rsi
leaq 0x10(%rsp), %rdi
callq 0x67f2
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x20(%rsp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rbp, %rbp
je 0xee20
movq (%rsp), %rsi
subq %rbp, %rsi
movq %rbp, %rdi
callq 0x42c0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xee20
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x42c0
movq %r13, (%rsp)
movq %r15, 0x8(%rsp)
movq 0x28(%rsp), %rax
movq 0xef0(%rax), %rax
movq (%rax), %r8
movq 0x8(%rax), %rdx
movq %rdx, %rax
subq %r8, %rax
je 0xef89
movq 0x30(%rsp), %r15
subq %r12, %r15
sarq $0x3, %r15
cmpq $0x1, %r15
adcq $0x0, %r15
xorl %r13d, %r13d
subq %r8, %rdx
sarq $0x3, %rdx
cmpq %r13, %rdx
jbe 0xeff2
movq (%r8,%r13,8), %rsi
addq $0x38, %rsi
leaq 0x10(%rsp), %rdi
callq 0x67f2
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x18(%rsp), %rbp
movq 0x20(%rsp), %rax
movq %rax, 0x38(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rbx, %rbx
je 0xeed5
subq %rbx, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x42c0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xeed5
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x42c0
movq 0x28(%rsp), %rax
movq 0xef0(%rax), %rax
movq (%rax), %r8
movq 0x8(%rax), %rdx
movq %rdx, %rax
subq %r8, %rax
sarq $0x3, %rax
cmpq (%rsp), %rax
jbe 0xf003
cmpq %r13, %rax
movq 0x40(%rsp), %rbx
movq 0x38(%rsp), %r14
jbe 0xf013
movq (%rsp), %rcx
movq (%r8,%rcx,8), %rdi
cmpq %r12, 0x30(%rsp)
sete %cl
movq (%r8,%r13,8), %rsi
cmpq %rsi, %rdi
sete %r9b
orb %cl, %r9b
jne 0xef7b
subq %rbx, %rbp
sarq $0x3, %rbp
xorl %ecx, %ecx
cmpq $0x0, (%r12,%rcx,8)
je 0xef4f
cmpq %rcx, %rbp
jbe 0xefde
cmpq $0x0, (%rbx,%rcx,8)
js 0xef59
incq %rcx
cmpq %rcx, %r15
jne 0xef38
jmp 0xef7b
callq 0xfeea
movq 0x28(%rsp), %rax
movq 0xef0(%rax), %rax
movq (%rax), %r8
movq 0x8(%rax), %rdx
movq %rdx, %rax
subq %r8, %rax
sarq $0x3, %rax
incq %r13
cmpq %rax, %r13
jb 0xee5f
jmp 0xef8d
sarq $0x3, %rax
movq (%rsp), %r13
incq %r13
movq 0x8(%rsp), %r15
movq %r15, (%rsp)
movq %r12, %rbp
cmpq %rax, %r13
jb 0xedae
testq %rbx, %rbx
je 0xefbc
subq %rbx, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x42c0
testq %r12, %r12
je 0xefcf
subq %r12, %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x42c0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1505e(%rip), %rdi     # 0x24043
movq %rcx, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x4430
leaq 0x1504a(%rip), %rdi     # 0x24043
movq %r13, %rsi
xorl %eax, %eax
callq 0x4430
movq 0x40(%rsp), %rbx
movq 0x38(%rsp), %r14
movq (%rsp), %rsi
jmp 0xf016
movq %r13, %rsi
leaq 0x15026(%rip), %rdi     # 0x24043
movq %rax, %rdx
xorl %eax, %eax
callq 0x4430
leaq 0x15015(%rip), %rdi     # 0x24043
movq %r13, %rsi
xorl %eax, %eax
callq 0x4430
jmp 0xf03a
movq %rdx, %r13
movq (%rsp), %r15
movq %rbp, %r12
movq %rax, %rbp
jmp 0xf067
movq %rdx, %r13
movq %rax, %rbp
movq 0x8(%rsp), %r15
jmp 0xf06c
jmp 0xf05c
jmp 0xf05c
jmp 0xf05c
movq %rdx, %r13
movq %rax, %rbp
movq 0x8(%rsp), %r15
testq %rbx, %rbx
je 0xf07a
subq %rbx, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x42c0
testq %r12, %r12
je 0xf08d
subq %r12, %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x42c0
cmpl $0x1, %r13d
jne 0xf0e0
movq %rbp, %rdi
callq 0x4100
movq %rax, %rbx
movq 0x23f23(%rip), %rdi     # 0x32fc8
leaq 0x15a2b(%rip), %rsi     # 0x24ad7
movl $0x19, %edx
callq 0x42f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x23f02(%rip), %rdi     # 0x32fc8
movq %rax, %rsi
callq 0x4290
callq 0x44a0
jmp 0xefcf
movq %rax, %rbp
callq 0x44a0
movq %rbp, %rdi
callq 0x4510
movq %rax, %rdi
callq 0x71af