// File: /workspace/github_c_makefile_star2_O2/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 0xc01c
leaq 0x18(%rsp), %rdi
movq %rbx, 0x10(%rsp)
movq %rbx, %rsi
callq 0x33c0
movq %r15, %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0xc084
movl %eax, 0x4(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x3150
pushq $0x1
popq %r13
cmpl $-0x1, 0x4(%rsp)
je 0xbfd2
xorl %ebp, %ebp
cmpl $0x5, %ebp
je 0xbf9a
incl %ebp
xorl %ebx, %ebx
cmpl $0x5, %ebp
sete %bl
movq %r15, %rdi
leaq 0x8421(%rip), %rsi      # 0x142f9
callq 0xbcc0
movq %rax, %rdi
movl %ebx, %esi
callq 0x88e8
movq %r15, %rdi
callq 0xc116
movl %eax, %ebx
movl %r13d, %r12d
movq %r15, %rdi
movl %r14d, %esi
callq 0xc182
testb %al, %al
jne 0xbf1e
movq %r15, %rdi
movl %r12d, %esi
xorl %edx, %edx
movl %r13d, %ecx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0xc1b4
incl %r12d
jmp 0xbef4
movl %ebp, %eax
xorl $0x5, %eax
orl 0xc(%rsp), %eax
leaq 0x78(%rsp), %rbx
jne 0xbf59
movq %rbx, %rdi
leaq 0x83c1(%rip), %rsi      # 0x142f9
leaq 0xb(%rsp), %rdx
callq 0x8d8c
movq %r15, %rdi
movl 0x4(%rsp), %esi
movq %rbx, %rdx
callq 0xc2b6
movq %rbx, %rdi
callq 0x3150
movq %r15, %rdi
callq 0xc4e0
cmpl $0x5, %ebp
je 0xbebb
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x33c0
movq %r15, %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0xc548
movl %eax, 0x4(%rsp)
movq %rbx, %rdi
callq 0x3150
jmp 0xbebb
movq %r15, %rdi
callq 0xc01c
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x33c0
movq %r15, %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0xc65c
movl %eax, 0x4(%rsp)
movq %rbx, %rdi
callq 0x3150
jmp 0xbeae
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
jmp 0xc00f
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0xc00f
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
jmp 0xc00f
movq %rax, %rbx
jmp 0xc014
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3540