// File: nwieder[P]SSTS/src/System/Gillespie_Sys.cpp
// Function: nw::Gillespie_Sys::system_output()
inline void Gillespie_Sys::system_output(){
//	print system state with a fixed time step dt (recording interval)
	if (rec_time >= rec_interval){
//			run through output voxel vector
			for(size_t k = 0; k < ovid.size(); ++k){
//				run through output species id vector
				for(size_t i = 0; i < osid.size(); ++i){
					data_output_file<<	vxl_vec->at(ovid[k])->get_state_vec()
										->at(osid[i])->get_n_molecules() << ",";
				}
			}
		if (this->output_mode == 2){
			data_output_file << curr_time << ",";
		}
		opcntr++;
		rec_time -= rec_interval;
	}

//	check if the channel state changed and if so log the open and close times
	if(	vxl_vec->at(0)->get_state_vec()->at(vxl_vec->at(0)
		->get_state_vec()->size()-1)->get_n_molecules() != channel_state){
//		update current channel state
		channel_state = vxl_vec->at(0)->get_state_vec()->at(vxl_vec->at(0)
						->get_state_vec()->size() - 1)->get_n_molecules();
//		write current system time to oc_log.e
		oc_log_file << curr_time << ",";
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movsd 0x40(%rax), %xmm0
ucomisd 0x30(%rax), %xmm0
jb 0x1b2e5
movq $0x0, -0x10(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0xed8, %rdi            # imm = 0xED8
callq 0x6d10
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x1b290
movq $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
addq $0xec0, %rdi            # imm = 0xEC0
callq 0x6d10
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
jae 0x1b27d
movq -0x20(%rbp), %rdi
movq %rdi, %rax
addq $0x690, %rax            # imm = 0x690
movq %rax, -0x38(%rbp)
movq 0xef8(%rdi), %rax
movq %rax, -0x48(%rbp)
addq $0xed8, %rdi            # imm = 0xED8
movq -0x10(%rbp), %rsi
callq 0x70f0
movq -0x48(%rbp), %rdi
movq (%rax), %rsi
callq 0x7b10
movq (%rax), %rdi
callq 0x6070
movq -0x20(%rbp), %rdi
movq %rax, -0x40(%rbp)
addq $0xec0, %rdi            # imm = 0xEC0
movq -0x18(%rbp), %rsi
callq 0x70f0
movq -0x40(%rbp), %rdi
movq (%rax), %rsi
callq 0x6090
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x56a0
movq %rax, %rdi
leaq 0x2a165(%rip), %rsi     # 0x453cc
callq 0x5300
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x1b1bc
jmp 0x1b27f
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x1b18c
movq -0x20(%rbp), %rax
cmpq $0x2, 0x8(%rax)
jne 0x1b2c2
movq -0x20(%rbp), %rax
movq %rax, %rdi
addq $0x690, %rdi            # imm = 0x690
movsd 0x38(%rax), %xmm0
callq 0x5700
movq %rax, %rdi
leaq 0x2a10f(%rip), %rsi     # 0x453cc
callq 0x5300
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movsd 0x30(%rax), %xmm1
movsd 0x40(%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rax)
movq -0x20(%rbp), %rax
movq 0xef8(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7b10
movq (%rax), %rdi
callq 0x6070
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, -0x50(%rbp)
movq 0xef8(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7b10
movq (%rax), %rdi
callq 0x6070
movq %rax, %rdi
callq 0x68d0
movq -0x50(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x6090
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq -0x20(%rbp), %rcx
cmpq 0x20(%rcx), %rax
je 0x1b3e1
movq -0x20(%rbp), %rax
movq 0xef8(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7b10
movq (%rax), %rdi
callq 0x6070
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, -0x58(%rbp)
movq 0xef8(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7b10
movq (%rax), %rdi
callq 0x6070
movq %rax, %rdi
callq 0x68d0
movq -0x58(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x6090
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq %rax, %rdi
addq $0xa90, %rdi            # imm = 0xA90
movsd 0x38(%rax), %xmm0
callq 0x5700
movq %rax, %rdi
leaq 0x29ff0(%rip), %rsi     # 0x453cc
callq 0x5300
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)