// File: /workspace/github_c_makefile_star2_O3/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LSMTransientSim(networkmode_t, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Network::LSMTransientSim(networkmode_t networkmode, int  tid, const string sample_type){
    int count = 0;
	int IP_iter;
#ifdef	SPIKL_IP
	IP_iter=5;
#else
	IP_iter=1;
#endif
    LSMClearSignals();
    int info = this->LoadFirstSpeech(false, networkmode, sample_type);
    while(info != -1){
        count++;
		int iter_count=0;
		while(iter_count!=IP_iter){
			iter_count++;
			if(iter_count==IP_iter)
				SearchForNeuronGroup("reservoir")->SetGenerateTransient(true);
			else
				SearchForNeuronGroup("reservoir")->SetGenerateTransient(false);
				
			int time = 0, end_time = this->SpeechEndTime();
		
			while(!LSMEndOfSpeech(networkmode, end_time)){
				LSMNextTimeStep(++time,false,1, end_time, NULL);
			}
			if(iter_count==IP_iter&&tid == 0){
					SpeechPrint(info, "reservoir"); // dump the reservoir response for quick simulation
			}
			LSMClearSignalsIP();
			if(iter_count!=IP_iter)
				info=LoadSpeechAgain(false, networkmode, sample_type);
		}
		LSMClearSignals();
		info = LoadNextSpeech(false, networkmode, sample_type);
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, %rbx
movl %edx, 0xc(%rsp)
movl %esi, %r14d
movq %rdi, %r15
callq 0xe1b8
leaq 0x88(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rbx), %rsi
movq %rbx, 0x10(%rsp)
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0xb50c
movq %r15, %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0xe22c
movl %eax, %r13d
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xdf8f
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x32f0
cmpl $-0x1, %r13d
je 0xe13f
xorl %ebx, %ebx
incl %ebx
xorl %ebp, %ebp
cmpl $0x5, %ebx
sete %bpl
movq %r15, %rdi
leaq 0x9369(%rip), %rsi      # 0x17319
callq 0xdc86
movq %rax, %rdi
movl %ebp, %esi
callq 0xa3d4
movq %r15, %rdi
callq 0xe2c4
movl %eax, %r12d
movl $0x1, %ebp
testl %r14d, %r14d
sete %cl
movl 0x2b0(%r15), %eax
testl %eax, %eax
setg %dl
testb %dl, %cl
jne 0xe002
cmpl $0x2, %r14d
je 0xe01d
testl %eax, %eax
setg %al
cmpl $0x0, 0x2b4(%r15)
setg %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xe01d
movq %r15, %rdi
movl %ebp, %esi
xorl %edx, %edx
movl $0x1, %ecx
movl %r12d, %r8d
xorl %r9d, %r9d
callq 0xe396
incl %ebp
jmp 0xdfcf
movl %ebx, %eax
xorl $0x5, %eax
orl 0xc(%rsp), %eax
jne 0xe07c
leaq 0x68(%rsp), %r12
movq %r12, 0x58(%rsp)
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
leaq 0x92d8(%rip), %rsi      # 0x17319
leaq 0x92da(%rip), %rdx      # 0x17322
callq 0xaf16
movq %r15, %rdi
movl %r13d, %esi
movq %rbx, %rdx
callq 0xe488
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0xe072
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x32f0
movq %r15, %rdi
callq 0xe968
jmp 0xe08e
movq %r15, %rdi
callq 0xe968
cmpl $0x5, %ebx
leaq 0x48(%rsp), %r12
jne 0xe0f1
movq %r15, %rdi
callq 0xe1b8
leaq 0x28(%rsp), %r12
movq %r12, 0x18(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rdi
callq 0xb50c
movq %r15, %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0xeaf2
movl %eax, %r13d
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0xe0e0
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32f0
movl $0x0, %ebx
cmpl $-0x1, %r13d
jne 0xdf9b
jmp 0xe13f
movq %r12, 0x38(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0xb50c
movq %r15, %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0xe9dc
movl %eax, %r13d
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0xdf9b
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x32f0
jmp 0xdf9b
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xe1af
movq 0x88(%rsp), %rsi
jmp 0xe1a7
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0xe1af
movq 0x48(%rsp), %rsi
jmp 0xe1a7
movq %rax, %rbx
jmp 0xe1af
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0xe1af
movq 0x68(%rsp), %rsi
jmp 0xe1a7
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0xe1af
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32f0
movq %rbx, %rdi
callq 0x3570
nop