// File: 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
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x10390
leaq -0x38(%rbp), %rdi
callq 0x10390
movq $0x0, -0x40(%rbp)
movq -0xa0(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, -0xa8(%rbp)
movq 0xef0(%rax), %rdi
callq 0x7b50
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq %rcx, %rax
jae 0x1a25d
movq -0xa0(%rbp), %rax
movq 0xef0(%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x102d0
movq %rax, -0xb0(%rbp)
jmp 0x19f75
movq -0xb0(%rbp), %rax
movq (%rax), %rsi
leaq -0x58(%rbp), %rdi
callq 0x10360
jmp 0x19f8a
leaq -0x20(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x1b3f0
leaq -0x58(%rbp), %rdi
callq 0x61a0
movq $0x0, -0x70(%rbp)
movq -0xa0(%rbp), %rax
movq -0x70(%rbp), %rcx
movq %rcx, -0xb8(%rbp)
movq 0xef0(%rax), %rdi
callq 0x7b50
movq %rax, %rcx
movq -0xb8(%rbp), %rax
cmpq %rcx, %rax
jae 0x1a24a
movq -0xa0(%rbp), %rax
movq 0xef0(%rax), %rdi
movq -0x70(%rbp), %rsi
callq 0x102d0
movq %rax, -0xc0(%rbp)
jmp 0x19ff9
movq -0xc0(%rbp), %rax
movq (%rax), %rsi
leaq -0x88(%rbp), %rdi
callq 0x10360
jmp 0x1a011
leaq -0x38(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movq %rsi, -0xd0(%rbp)
callq 0x1b3f0
movq -0xd0(%rbp), %rdi
callq 0x61a0
movq -0xa0(%rbp), %rax
movq 0xef0(%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x102d0
movq %rax, -0xc8(%rbp)
jmp 0x1a054
movq -0xa0(%rbp), %rax
movq -0xc8(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, -0xe0(%rbp)
movq 0xef0(%rax), %rdi
movq -0x70(%rbp), %rsi
callq 0x102d0
movq %rax, -0xd8(%rbp)
jmp 0x1a085
movq -0xe0(%rbp), %rax
movq -0xd8(%rbp), %rcx
cmpq (%rcx), %rax
je 0x1a237
movq $0x0, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x6d10
movq %rax, %rcx
movq -0xe8(%rbp), %rax
cmpq %rcx, %rax
jae 0x1a235
movq -0x90(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x60d0
movq %rax, -0xf0(%rbp)
jmp 0x1a0ea
movq -0xf0(%rbp), %rax
cmpq $0x0, (%rax)
je 0x1a21c
movq -0x90(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x60d0
movq %rax, -0xf8(%rbp)
jmp 0x1a114
movq -0xf8(%rbp), %rax
cmpq $0x0, (%rax)
jge 0x1a21c
movq -0xa0(%rbp), %rax
movq 0xef0(%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x102d0
movq %rax, -0x100(%rbp)
jmp 0x1a145
movq -0xa0(%rbp), %rax
movq -0x100(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, -0x110(%rbp)
movq 0xef0(%rax), %rdi
movq -0x70(%rbp), %rsi
callq 0x102d0
movq %rax, -0x108(%rbp)
jmp 0x1a176
movq -0x110(%rbp), %rdi
movq -0x108(%rbp), %rax
movq (%rax), %rsi
callq 0x1b420
jmp 0x1a18e
jmp 0x1a235
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x61a0
leaq -0x20(%rbp), %rdi
callq 0x61a0
movl -0x64(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1a286
movq -0x60(%rbp), %rdi
callq 0x5110
movq %rax, -0x98(%rbp)
movq 0x43df8(%rip), %rdi     # 0x5dfd0
leaq 0x2b8b0(%rip), %rsi     # 0x45a8f
callq 0x5300
movq %rax, -0x118(%rbp)
jmp 0x1a1ed
movq -0x98(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq -0x118(%rbp), %rdi
movq %rax, %rsi
callq 0x5300
jmp 0x1a20e
callq 0x55d0
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
jmp 0x1a21e
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x1a0a7
jmp 0x1a237
jmp 0x1a239
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x19fa8
jmp 0x1a24c
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x19f24
leaq -0x38(%rbp), %rdi
callq 0x61a0
leaq -0x20(%rbp), %rdi
callq 0x61a0
jmp 0x1a213
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x55d0
jmp 0x1a284
jmp 0x1a286
movq -0x60(%rbp), %rdi
callq 0x5650
movq %rax, %rdi
callq 0x6240
nopw (%rax,%rax)