// File: nwieder[P]SSTS/src/Events/Diffusion_Evt.cpp
// Function: nw::Diffusion_Evt::update(double)
double Diffusion_Evt::update(double last_tau){

	double minTau = INFINITY, actTau;

//	check if this event depends on the last executed event
	if (this->dirty_flag) {
//		run through the tv vector
		for (size_t i = 0; i < tv_vec.size(); ++i) {
//			check for voxel that have been affected by last executed event
			if (tv_vec[i].v->get_dirty_flag()) {
				actTau = calc_tau(i);
//				find smallest tau value (->next voxel) for this event
				if (actTau < minTau) {
					minTau = actTau;
					nextVoxel = i;
				}
//			voxel has not been affected by last event
			} else {
//				adjust tau value to global times scale
				tv_vec[i].t -= last_tau;
//				find smallest tau value (->next voxel) for this event
				if (tv_vec[i].t < minTau) {
					minTau = tv_vec[i].t;
					nextVoxel = i;
				}
			}
		}
//  event has not been affected by last event
	} else {
//		adjust tau values to global times scale
		for (size_t i = 0; i < tv_vec.size(); ++i) {
			tv_vec[i].t -= last_tau;
			if (tv_vec[i].t < minTau) {
				minTau = tv_vec[i].t;
				nextVoxel = i;
			}
		}
	}

	this->dirty_flag = false;
	return minTau;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movsd 0x3dac7(%rip), %xmm0    # 0x45008
movsd %xmm0, -0x18(%rbp)
testb $0x1, 0x80(%rax)
je 0x766c
movq $0x0, -0x28(%rbp)
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
addq $0x50, %rdi
callq 0x5fd0
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
jae 0x7667
movq -0x38(%rbp), %rdi
addq $0x50, %rdi
movq -0x28(%rbp), %rsi
callq 0x6050
movq (%rax), %rdi
callq 0x6030
testb $0x1, %al
jne 0x759f
jmp 0x75d9
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x7740
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm1
movsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x75d7
movq -0x38(%rbp), %rax
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movq -0x28(%rbp), %rcx
movq %rcx, 0x70(%rax)
jmp 0x7654
movq -0x38(%rbp), %rdi
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
addq $0x50, %rdi
movq -0x28(%rbp), %rsi
callq 0x6050
movsd -0x48(%rbp), %xmm1
movq -0x38(%rbp), %rdi
movsd 0x8(%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rax)
addq $0x50, %rdi
movq -0x28(%rbp), %rsi
callq 0x6050
movsd 0x8(%rax), %xmm1
movsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x7652
movq -0x38(%rbp), %rdi
addq $0x50, %rdi
movq -0x28(%rbp), %rsi
callq 0x6050
movq %rax, %rcx
movq -0x38(%rbp), %rax
movsd 0x8(%rcx), %xmm0
movsd %xmm0, -0x18(%rbp)
movq -0x28(%rbp), %rcx
movq %rcx, 0x70(%rax)
jmp 0x7654
jmp 0x7656
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x755b
jmp 0x7727
movq $0x0, -0x30(%rbp)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
addq $0x50, %rdi
callq 0x5fd0
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpq %rcx, %rax
jae 0x7725
movq -0x38(%rbp), %rdi
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
addq $0x50, %rdi
movq -0x30(%rbp), %rsi
callq 0x6050
movsd -0x58(%rbp), %xmm1
movq -0x38(%rbp), %rdi
movsd 0x8(%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rax)
addq $0x50, %rdi
movq -0x30(%rbp), %rsi
callq 0x6050
movsd 0x8(%rax), %xmm1
movsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x7712
movq -0x38(%rbp), %rdi
addq $0x50, %rdi
movq -0x30(%rbp), %rsi
callq 0x6050
movq %rax, %rcx
movq -0x38(%rbp), %rax
movsd 0x8(%rcx), %xmm0
movsd %xmm0, -0x18(%rbp)
movq -0x30(%rbp), %rcx
movq %rcx, 0x70(%rax)
jmp 0x7714
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x7674
jmp 0x7727
movq -0x38(%rbp), %rax
movb $0x0, 0x80(%rax)
movsd -0x18(%rbp), %xmm0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)