// File: /workspace/github_cpp_makefile_star2_O3/huiwenliuge[P]EmoAnaer/src/RNNet.cpp
// Function: RNNet::FetchPara(char const*)
void RNNet::FetchPara(const char* pathRoot){
    char* path=(char*)calloc(sizeof(char),41);
    strcpy(path,pathRoot);
    strcpy(path+strlen(pathRoot),"PARA");

    //std::cout<< path<<std::endl;
    FILE* parafp=fopen(path,"r");
    //FILE* paratmp=fopen("paratmp","w");

    char* line=(char*)calloc(sizeof(char),81);
    int i,j;
    fscanf(parafp,"%s %d\n",line,&i);
    //std::cout<<line<<" "<<"line"<<std::endl;
    
    k2out=(double**)malloc(sizeof(double*)*EMOTIONNUM);
    
    for(i=0;i<EMOTIONNUM;++i){
        k2out[i]=(double*)malloc(sizeof(double)*hidlayerNUM);   
        for(j=0;j<hidlayerNUM;++j){
            fscanf(parafp,"#%lf#",k2out[i]+j);
      //      std::cout<<k2out[i][j]<<std::endl;
        }
        fgetc(parafp);
    }
    fscanf(parafp,"%s %d\n",line,&i);
    std::cout<<line<<std::endl;

    ro2h=(double**)malloc(sizeof(double*)*hidlayerNUM);
    for(i=0;i<hidlayerNUM;++i){
        ro2h[i]=(double*)malloc(sizeof(double)*EMOTIONNUM);
        for(j=0;j<EMOTIONNUM;++j){
            fscanf(parafp,"#%lf#",ro2h[i]+j);
        }
        fgetc(parafp);
    }

    fscanf(parafp,"%s\n",line);
    std::cout<<line<<std::endl;

    rh2h=(double**)malloc(sizeof(double*)*hidlayerNUM);
    for(i=0;i<hidlayerNUM;++i){
        rh2h[i]=(double*)malloc(sizeof(double)*hidlayerNUM);
        for(j=0;j<hidlayerNUM;++j){
            fscanf(parafp,"#%lf#",rh2h[i]+j);
        }
        fgetc(parafp);
    } 
    fscanf(parafp,"%s\n",line);
    std::cout<<line<<std::endl;

    in2hid=(double**)malloc(sizeof(double*)*hidlayerNUM);
    for(i=0;i<hidlayerNUM;++i){
        in2hid[i]=(double*)malloc(sizeof(double)*featureNUM);
        for(j=0;j<featureNUM;++j){
            fscanf(parafp,"#%lf#",in2hid[i]+j);
        }
        fgetc(parafp);
    }

    //prtPara("paratmp");
    free(path);
    free(line);
    fclose(parafp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, %edi
movl $0x29, %esi
callq 0x20c0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x2140
movq %r14, %rdi
callq 0x2080
movl $0x41524150, (%r15,%rax) # imm = 0x41524150
movb $0x0, 0x4(%r15,%rax)
leaq 0x38b9(%rip), %rsi      # 0x6074
movq %r15, -0x40(%rbp)
movq %r15, %rdi
callq 0x21c0
movq %rax, %r15
movl $0x1, %edi
movl $0x51, %esi
callq 0x20c0
leaq 0x38a1(%rip), %rsi      # 0x6081
leaq -0x2c(%rbp), %r14
movq %r15, %rdi
movq %rax, -0x38(%rbp)
movq %rax, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2280
movl $0x38, %edi
callq 0x21f0
movq %rax, 0x18(%rbx)
movl $0x0, (%r14)
leaq 0x387f(%rip), %r14      # 0x6093
xorl %r12d, %r12d
movslq 0x34(%rbx), %r13
leaq (,%r13,8), %rdi
callq 0x21f0
movq 0x18(%rbx), %rcx
movslq %r12d, %rdx
movq %rax, (%rcx,%rdx,8)
testq %r13, %r13
jle 0x286a
xorl %r13d, %r13d
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
addq %r13, %rdx
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2280
incq %r12
movslq 0x34(%rbx), %rax
addq $0x8, %r13
cmpq %rax, %r12
jl 0x283e
movq %r15, %rdi
callq 0x2230
movl -0x2c(%rbp), %eax
leal 0x1(%rax), %r12d
movl %r12d, -0x2c(%rbp)
cmpl $0x6, %eax
jl 0x2817
leaq 0x37f8(%rip), %rsi      # 0x6081
leaq -0x2c(%rbp), %rcx
movq %r15, %rdi
movq -0x38(%rbp), %r13
movq %r13, %rdx
xorl %eax, %eax
callq 0x2280
testq %r13, %r13
je 0x28bf
movq %r13, %rdi
callq 0x2080
movq 0x5726(%rip), %rdi      # 0x7fd8
movq %r13, %rsi
movq %rax, %rdx
callq 0x21a0
jmp 0x28dd
movq 0x5712(%rip), %rax      # 0x7fd8
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %rdi
movl 0x20(%rax,%rcx), %esi
orl $0x1, %esi
callq 0x2240
movq 0x56f4(%rip), %r14      # 0x7fd8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
movslq 0x34(%rbx), %r14
leaq (,%r14,8), %rdi
callq 0x21f0
movq %rax, 0x28(%rbx)
movl $0x0, -0x2c(%rbp)
testq %r14, %r14
jle 0x298d
leaq 0x3760(%rip), %r14      # 0x6093
xorl %r12d, %r12d
movl $0x38, %edi
callq 0x21f0
movq 0x28(%rbx), %rcx
movslq %r12d, %rdx
movq %rax, (%rcx,%rdx,8)
xorl %r12d, %r12d
movq 0x28(%rbx), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
addq %r12, %rdx
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2280
addq $0x8, %r12
cmpq $0x38, %r12
jne 0x294e
movq %r15, %rdi
callq 0x2230
movl -0x2c(%rbp), %r12d
incl %r12d
movl %r12d, -0x2c(%rbp)
cmpl 0x34(%rbx), %r12d
jl 0x2936
leaq 0x36e2(%rip), %rsi      # 0x6076
movq %r15, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x2280
testq %r13, %r13
je 0x29c9
movq %r13, %rdi
callq 0x2080
movq 0x5623(%rip), %rdi      # 0x7fd8
movq %r13, %rsi
movq %rax, %rdx
callq 0x21a0
movq 0x5611(%rip), %r14      # 0x7fd8
jmp 0x29e8
movq 0x5608(%rip), %r14      # 0x7fd8
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
movslq 0x34(%rbx), %r13
leaq (,%r13,8), %rdi
callq 0x21f0
movq %rax, 0x20(%rbx)
movl $0x0, -0x2c(%rbp)
testq %r13, %r13
jle 0x2aa8
leaq 0x365c(%rip), %r14      # 0x6093
xorl %r12d, %r12d
movslq %r13d, %r13
leaq (,%r13,8), %rdi
callq 0x21f0
movq 0x20(%rbx), %rcx
movslq %r12d, %rdx
movq %rax, (%rcx,%rdx,8)
testl %r13d, %r13d
jle 0x2a8c
xorl %r13d, %r13d
xorl %r12d, %r12d
movq 0x20(%rbx), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
addq %r13, %rdx
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2280
incq %r12
movslq 0x34(%rbx), %rax
addq $0x8, %r13
cmpq %rax, %r12
jl 0x2a60
movq %r15, %rdi
callq 0x2230
movl -0x2c(%rbp), %r12d
incl %r12d
movl %r12d, -0x2c(%rbp)
movl 0x34(%rbx), %r13d
cmpl %r13d, %r12d
jl 0x2a3a
leaq 0x35c7(%rip), %rsi      # 0x6076
movq %r15, %rdi
movq -0x38(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x2280
testq %r14, %r14
je 0x2ae8
movq %r14, %rdi
callq 0x2080
movq 0x5504(%rip), %rdi      # 0x7fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x21a0
movq 0x54f2(%rip), %r14      # 0x7fd8
jmp 0x2b07
movq 0x54e9(%rip), %r14      # 0x7fd8
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x2240
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
movslq 0x34(%rbx), %r14
leaq (,%r14,8), %rdi
callq 0x21f0
movq %rax, 0x10(%rbx)
movl $0x0, -0x2c(%rbp)
testq %r14, %r14
jle 0x2bc5
leaq 0x353d(%rip), %r14      # 0x6093
xorl %r12d, %r12d
movslq 0x30(%rbx), %r13
leaq (,%r13,8), %rdi
callq 0x21f0
movq 0x10(%rbx), %rcx
movslq %r12d, %rdx
movq %rax, (%rcx,%rdx,8)
testq %r13, %r13
jle 0x2bac
xorl %r13d, %r13d
xorl %r12d, %r12d
movq 0x10(%rbx), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
addq %r13, %rdx
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2280
incq %r12
movslq 0x30(%rbx), %rax
addq $0x8, %r13
cmpq %rax, %r12
jl 0x2b80
movq %r15, %rdi
callq 0x2230
movl -0x2c(%rbp), %r12d
incl %r12d
movl %r12d, -0x2c(%rbp)
cmpl 0x34(%rbx), %r12d
jl 0x2b59
movq -0x40(%rbp), %rdi
callq 0x21d0
movq -0x38(%rbp), %rdi
callq 0x21d0
movq %r15, %rdi
callq 0x2180
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq