// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xf68c
jmp 0xf6ab
leaq 0x255f0(%rip), %rdi     # 0x34c83
leaq 0x25007(%rip), %rsi     # 0x346a1
movl $0x3ab, %edx            # imm = 0x3AB
leaq 0x255e4(%rip), %rcx     # 0x34c8a
callq 0x4210
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
callq 0x12d80
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x7660
movl %eax, %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
cmpq %rcx, %rax
je 0xf7f5
cmpl $0x1, -0x20(%rbp)
jne 0xf6f5
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x7660
cmpl $0x0, %eax
je 0xf7a7
movq 0x3d8cc(%rip), %rdi     # 0x4cfc8
leaq 0x255d5(%rip), %rsi     # 0x34cd8
callq 0x4360
movq %rax, %rdi
movl -0x20(%rbp), %esi
callq 0x46c0
movq %rax, %rdi
leaq 0x255c9(%rip), %rsi     # 0x34ce6
callq 0x4360
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x7660
movq -0x48(%rbp), %rdi
movl %eax, %esi
callq 0x46c0
movq %rax, %rdi
leaq 0x255a5(%rip), %rsi     # 0x34cec
callq 0x4360
movq %rax, %rdi
movq 0x3d862(%rip), %rsi     # 0x4cfb8
callq 0x43b0
xorl %eax, %eax
cmpl $0x1, -0x20(%rbp)
movb %al, -0x39(%rbp)
jne 0xf77b
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x7660
cmpl $0x0, %eax
sete %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0xf784
jmp 0xf786
jmp 0xf7a5
leaq 0x2556a(%rip), %rdi     # 0x34cf7
leaq 0x24f0d(%rip), %rsi     # 0x346a1
movl $0x3af, %edx            # imm = 0x3AF
leaq 0x254ea(%rip), %rcx     # 0x34c8a
callq 0x4210
jmp 0xf7a7
cmpl $0x1, -0x20(%rbp)
jne 0xf7d4
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
addq $0x28, %rdi
callq 0x12d80
movq -0x50(%rbp), %rdi
movl %eax, %esi
movl $0x1, %edx
callq 0x7200
jmp 0xf7f3
leaq 0x25b3d(%rip), %rdi     # 0x35318
leaq 0x24ebf(%rip), %rsi     # 0x346a1
movl $0x3b4, %edx            # imm = 0x3B4
leaq 0x2549c(%rip), %rcx     # 0x34c8a
callq 0x4210
jmp 0xf7f5
cmpl $0x0, -0x1c(%rbp)
jne 0xf807
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
jmp 0xf81b
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x7660
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x24(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x24(%rbp), %rax
movq %rax, -0x58(%rbp)
addq $0x28, %rdi
callq 0x12d80
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpq %rcx, %rax
jae 0xf884
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
movslq -0x24(%rbp), %rsi
callq 0x12c70
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x7320
movq -0x60(%rbp), %rdi
movq %rax, %rsi
movl -0x20(%rbp), %edx
callq 0xcd10
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xf822
movq -0x30(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0xf8a0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)