// File: /workspace/github_c_makefile_star2_O1/stonezwr[P]SpiKL-IP/neuron.C
// Function: NeuronGroup::LSMLoadSpeech(Speech*, int*, neuronmode_t, channelmode_t)
void NeuronGroup::LSMLoadSpeech(Speech * speech, int * n_channel, neuronmode_t neuronmode, channelmode_t channelmode){
    assert(speech);
    if(_neurons.size() != speech->NumChannels(channelmode)){
        if(!(channelmode == RESERVOIRCHANNEL && (speech->NumChannels(channelmode) == 0))){
            cout<<"channelmode: "<<channelmode<<" has "<<speech->NumChannels(channelmode)<<" channels!"<<endl;
            assert(channelmode == RESERVOIRCHANNEL && speech->NumChannels(channelmode) == 0);
        }
        if(channelmode == RESERVOIRCHANNEL)
            speech->SetNumChannel(_neurons.size(), RESERVOIRCHANNEL);
        else
            assert(0); // your code should never go here
    }
    if(neuronmode == DEACTIVATED)
        *n_channel = 0;
    else
        *n_channel = speech->NumChannels(channelmode);

    // assign the channel ptr to each neuron:
    for(int i = 0; i < _neurons.size(); i++){
        _neurons[i]->LSMSetChannel(speech->GetChannel(i,channelmode),channelmode);
    }
    LSMSetNeurons(neuronmode);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x95b7
movl %r8d, %ebp
movl %ecx, %ebx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
movq 0x30(%rdi), %r13
subq 0x28(%rdi), %r13
sarq $0x3, %r13
movq %rsi, %rdi
movl %r8d, %esi
callq 0x4d62
cltq
cmpq %rax, %r13
je 0x9527
cmpl $0x1, %ebp
jne 0x95d6
movq %r14, %rdi
movl $0x1, %esi
callq 0x4d62
testl %eax, %eax
je 0x950e
movq 0x17b5f(%rip), %r13     # 0x20fd0
leaq 0xe8a8(%rip), %rsi      # 0x17d20
movl $0xd, %edx
movq %r13, %rdi
callq 0x3340
movq %r13, %rdi
movl %ebp, %esi
callq 0x3560
movq %rax, %r13
leaq 0xe895(%rip), %rsi      # 0x17d2e
movl $0x5, %edx
movq %rax, %rdi
callq 0x3340
movq %r14, %rdi
movl %ebp, %esi
callq 0x4d62
movq %r13, %rdi
movl %eax, %esi
callq 0x3560
movq %rax, %r13
leaq 0xe870(%rip), %rsi      # 0x17d34
movl $0xa, %edx
movq %rax, %rdi
callq 0x3340
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31e0
movq %r14, %rdi
movl $0x1, %esi
callq 0x4d62
testl %eax, %eax
jne 0x9645
movq 0x30(%r15), %rsi
subq 0x28(%r15), %rsi
shrq $0x3, %rsi
movq %r14, %rdi
movl $0x1, %edx
callq 0x4978
testl %ebx, %ebx
je 0x9537
movq %r14, %rdi
movl %ebp, %esi
callq 0x4d62
jmp 0x9539
xorl %eax, %eax
movl %eax, (%r12)
movq 0x28(%r15), %rax
cmpq %rax, 0x30(%r15)
je 0x957f
xorl %r12d, %r12d
movq (%rax,%r12,8), %r13
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x4aa6
movq %r13, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x79ce
incq %r12
movq 0x28(%r15), %rax
movq 0x30(%r15), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
ja 0x954a
movq 0x30(%r15), %rcx
cmpq %rax, %rcx
je 0x95a8
subq %rax, %rcx
sarq $0x3, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %edx, %edx
movq (%rax,%rdx,8), %rsi
movl %ebx, 0x8(%rsi)
incq %rdx
cmpq %rdx, %rcx
jne 0x9599
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe70d(%rip), %rdi      # 0x17ccb
leaq 0xe124(%rip), %rsi      # 0x176e9
leaq 0xe706(%rip), %rcx      # 0x17cd2
movl $0x3ab, %edx            # imm = 0x3AB
callq 0x31b0
movq 0x179f3(%rip), %rbx     # 0x20fd0
leaq 0xe73c(%rip), %rsi      # 0x17d20
movl $0xd, %edx
movq %rbx, %rdi
callq 0x3340
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3560
movq %rax, %rbx
leaq 0xe729(%rip), %rsi      # 0x17d2e
movl $0x5, %edx
movq %rax, %rdi
callq 0x3340
movq %r14, %rdi
movl %ebp, %esi
callq 0x4d62
movq %rbx, %rdi
movl %eax, %esi
callq 0x3560
movq %rax, %rbx
leaq 0xe704(%rip), %rsi      # 0x17d34
movl $0xa, %edx
movq %rax, %rdi
callq 0x3340
movq %rbx, %rdi
callq 0x3160
leaq 0xe6f3(%rip), %rdi      # 0x17d3f
leaq 0xe096(%rip), %rsi      # 0x176e9
leaq 0xe678(%rip), %rcx      # 0x17cd2
movl $0x3af, %edx            # imm = 0x3AF
callq 0x31b0