// File: /workspace/github_c_makefile_star2_O0/stonezwr[P]SpiKL-IP/neuron.C
// Function: Neuron::RMZeroSyns(synapsetype_t, char const*)
int Neuron::RMZeroSyns(synapsetype_t syn_t, const char * t){
    bool f;
    int cnt = 0;
    if(strcmp(t, "in") == 0)  f = false;
    else if(strcmp(t, "out") == 0)  f = true;
    else assert(0);
    vector<Synapse*>& syns = !f ? _inputSyns : _outputSyns;

    for(auto iter = syns.begin(); iter != syns.end(); ){
        assert(*iter);
        bool flag = syn_t == INPUT_SYN ? (*iter)->IsInputSyn() :
            syn_t == READOUT_SYN ? (*iter)->IsReadoutSyn() : 
            syn_t == RESERVOIR_SYN ? (*iter)->IsLiquidSyn() : false;
        flag &= (*iter)->IsWeightZero();
        if(flag){
            (*iter)->DisableStatus(true); 
            iter = syns.erase(iter);
            cnt++;
        }
        else
            iter++;	       
    }
    return cnt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x272c7(%rip), %rsi     # 0x348b7
callq 0x4520
cmpl $0x0, %eax
jne 0xd600
movb $0x0, -0x19(%rbp)
jmp 0xd63c
movq -0x18(%rbp), %rdi
leaq 0x292b5(%rip), %rsi     # 0x368c0
callq 0x4520
cmpl $0x0, %eax
jne 0xd61b
movb $0x1, -0x19(%rbp)
jmp 0xd63a
leaq 0x27cf6(%rip), %rdi     # 0x35318
leaq 0x27078(%rip), %rsi     # 0x346a1
movl $0x235, %edx            # imm = 0x235
leaq 0x27285(%rip), %rcx     # 0x348ba
callq 0x4210
jmp 0xd63c
testb $0x1, -0x19(%rbp)
jne 0xd650
movq -0x60(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x68(%rbp)
jmp 0xd65c
movq -0x60(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x12080
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x120b0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x120e0
testb $0x1, %al
jne 0xd694
jmp 0xd7c7
leaq -0x30(%rbp), %rdi
callq 0x12120
cmpq $0x0, (%rax)
je 0xd6a5
jmp 0xd6c4
leaq 0x27242(%rip), %rdi     # 0x348ee
leaq 0x26fee(%rip), %rsi     # 0x346a1
movl $0x239, %edx            # imm = 0x239
leaq 0x271fb(%rip), %rcx     # 0x348ba
callq 0x4210
cmpl $0x1, -0xc(%rbp)
jne 0xd6e0
leaq -0x30(%rbp), %rdi
callq 0x12120
movq (%rax), %rdi
callq 0x1be50
movb %al, -0x69(%rbp)
jmp 0xd72b
cmpl $0x2, -0xc(%rbp)
jne 0xd6fc
leaq -0x30(%rbp), %rdi
callq 0x12120
movq (%rax), %rdi
callq 0x1bde0
movb %al, -0x6a(%rbp)
jmp 0xd725
cmpl $0x0, -0xc(%rbp)
jne 0xd718
leaq -0x30(%rbp), %rdi
callq 0x12120
movq (%rax), %rdi
callq 0x12960
movb %al, -0x6b(%rbp)
jmp 0xd71f
xorl %eax, %eax
movb %al, -0x6b(%rbp)
jmp 0xd71f
movb -0x6b(%rbp), %al
movb %al, -0x6a(%rbp)
movb -0x6a(%rbp), %al
movb %al, -0x69(%rbp)
movb -0x69(%rbp), %al
andb $0x1, %al
movb %al, -0x39(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x12120
movq (%rax), %rdi
callq 0x12a90
andb $0x1, %al
movzbl %al, %ecx
movb -0x39(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
andl %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x39(%rbp)
testb $0x1, -0x39(%rbp)
je 0xd7b3
leaq -0x30(%rbp), %rdi
callq 0x12120
movq (%rax), %rdi
movl $0x1, %esi
callq 0x12980
movq -0x28(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x12a10
movq -0x78(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x129a0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xd7c2
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x12a50
movq %rax, -0x58(%rbp)
jmp 0xd671
movl -0x20(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)