// File: /workspace/github_c_makefile_star2_O2/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 0x7c0c
movl %r8d, %ebx
movl %ecx, %ebp
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 0x4678
cltq
cmpq %rax, %r13
je 0x7ba4
cmpl $0x1, %ebx
jne 0x7c2b
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x4678
testl %eax, %eax
je 0x7b8d
movq 0x184a3(%rip), %rdi     # 0x1ffc8
leaq 0xd274(%rip), %rsi      # 0x14da0
callq 0x32a0
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x3530
leaq 0xd26b(%rip), %rsi      # 0x14dae
movq %rax, %rdi
callq 0x32a0
movq %rax, %r13
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0x4678
movq %r13, %rdi
movl %eax, %esi
callq 0x3530
leaq 0xd24a(%rip), %rsi      # 0x14db4
movq %rax, %rdi
callq 0x32a0
movq %rax, %rdi
callq 0x3160
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0x4678
testl %eax, %eax
jne 0x7c85
movq 0x30(%r15), %rsi
subq 0x28(%r15), %rsi
shrq $0x3, %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x434c
testl %ebp, %ebp
je 0x7bb4
movq %r14, %rdi
movl %ebx, %esi
callq 0x4678
jmp 0x7bb6
xorl %eax, %eax
movl %eax, (%r12)
xorl %r12d, %r12d
movq 0x28(%r15), %rax
movq 0x30(%r15), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jbe 0x7bf4
movq (%rax,%r12,8), %r13
movq %r14, %rdi
movl %r12d, %esi
movl %ebx, %edx
callq 0x4430
movq %r13, %rdi
movq %rax, %rsi
movl %ebx, %edx
callq 0x64e4
incq %r12
jmp 0x7bbd
movq %r15, %rdi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7ca4
leaq 0xd138(%rip), %rdi      # 0x14d4b
leaq 0xcb4f(%rip), %rsi      # 0x14769
leaq 0xd131(%rip), %rcx      # 0x14d52
movl $0x3ab, %edx            # imm = 0x3AB
callq 0x31b0
movq 0x18396(%rip), %rdi     # 0x1ffc8
leaq 0xd167(%rip), %rsi      # 0x14da0
callq 0x32a0
movq %rax, %rdi
movl %ebx, %esi
callq 0x3530
leaq 0xd15f(%rip), %rsi      # 0x14dae
movq %rax, %rdi
callq 0x32a0
movq %rax, %r15
movq %r14, %rdi
movl %ebx, %esi
callq 0x4678
movq %r15, %rdi
movl %eax, %esi
callq 0x3530
leaq 0xd13f(%rip), %rsi      # 0x14db4
movq %rax, %rdi
callq 0x32a0
movq %rax, %rdi
callq 0x3160
leaq 0xd133(%rip), %rdi      # 0x14dbf
leaq 0xcad6(%rip), %rsi      # 0x14769
leaq 0xd0b8(%rip), %rcx      # 0x14d52
movl $0x3af, %edx            # imm = 0x3AF
callq 0x31b0