// File: /workspace/github_cpp_makefile_star2_O2/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, %r15
movq %rdi, %rbx
pushq $0x1
popq %r14
pushq $0x29
popq %rsi
movq %r14, %rdi
callq 0x20c0
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x2130
movq %r15, %rdi
callq 0x2070
movl $0x41524150, (%r12,%rax) # imm = 0x41524150
movb $0x0, 0x4(%r12,%rax)
leaq 0x3919(%rip), %rsi      # 0x6074
movq %r12, -0x40(%rbp)
movq %r12, %rdi
callq 0x21a0
movq %rax, %r15
pushq $0x51
popq %rsi
movq %r14, %rdi
callq 0x20c0
leaq 0x3905(%rip), %rsi      # 0x6081
leaq -0x2c(%rbp), %rcx
movq %r15, %rdi
movq %rax, -0x38(%rbp)
movq %rax, %rdx
xorl %eax, %eax
callq 0x2250
pushq $0x38
popq %rdi
callq 0x21d0
movq %rax, 0x18(%rbx)
xorl %r14d, %r14d
movl %r14d, -0x2c(%rbp)
cmpl $0x6, %r14d
jg 0x2811
movslq 0x34(%rbx), %r13
movq %r13, %rdi
shlq $0x3, %rdi
callq 0x21d0
movq 0x18(%rbx), %rcx
movslq %r14d, %rdx
movq %rax, (%rcx,%rdx,8)
xorl %r14d, %r14d
xorl %r12d, %r12d
movslq %r13d, %rax
cmpq %rax, %r12
jge 0x2800
movq 0x18(%rbx), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
addq %r14, %rdx
movq %r15, %rdi
leaq 0x38a7(%rip), %rsi      # 0x6093
xorl %eax, %eax
callq 0x2250
incq %r12
movl 0x34(%rbx), %r13d
addq $0x8, %r14
jmp 0x27cb
movq %r15, %rdi
callq 0x2210
movl -0x2c(%rbp), %r14d
incl %r14d
jmp 0x27a0
leaq 0x3869(%rip), %rsi      # 0x6081
leaq -0x2c(%rbp), %rcx
movq %r15, %rdi
movq -0x38(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x2250
movq 0x67a4(%rip), %rdi      # 0x8fd8
movq %r14, %rsi
callq 0x2160
movq %rax, %rdi
callq 0x20a0
movslq 0x34(%rbx), %r12
movq %r12, %rdi
shlq $0x3, %rdi
callq 0x21d0
movq %rax, 0x28(%rbx)
leaq 0x3834(%rip), %r14      # 0x6093
xorl %r13d, %r13d
movl %r13d, -0x2c(%rbp)
cmpl %r12d, %r13d
jge 0x28be
pushq $0x38
popq %rdi
callq 0x21d0
movq 0x28(%rbx), %rcx
movslq %r13d, %rdx
movq %rax, (%rcx,%rdx,8)
xorl %r12d, %r12d
cmpq $0x38, %r12
je 0x28a9
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 0x2250
addq $0x8, %r12
jmp 0x2881
movq %r15, %rdi
callq 0x2210
movl -0x2c(%rbp), %r13d
incl %r13d
movl 0x34(%rbx), %r12d
jmp 0x2862
leaq 0x37b1(%rip), %rsi      # 0x6076
movq %r15, %rdi
movq -0x38(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x2250
movq 0x66fb(%rip), %rdi      # 0x8fd8
movq %r14, %rsi
callq 0x2160
movq %rax, %rdi
callq 0x20a0
movslq 0x34(%rbx), %r14
movq %r14, %rdi
shlq $0x3, %rdi
callq 0x21d0
movq %rax, 0x20(%rbx)
xorl %r12d, %r12d
movl %r12d, -0x2c(%rbp)
cmpl %r14d, %r12d
jge 0x2974
movslq %r14d, %rdi
shlq $0x3, %rdi
callq 0x21d0
movq 0x20(%rbx), %rcx
movslq %r12d, %rdx
movq %rax, (%rcx,%rdx,8)
xorl %r12d, %r12d
xorl %r13d, %r13d
movslq %r14d, %rax
cmpq %rax, %r13
jge 0x295f
movq 0x20(%rbx), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
addq %r12, %rdx
movq %r15, %rdi
leaq 0x3748(%rip), %rsi      # 0x6093
xorl %eax, %eax
callq 0x2250
incq %r13
movl 0x34(%rbx), %r14d
addq $0x8, %r12
jmp 0x292a
movq %r15, %rdi
callq 0x2210
movl -0x2c(%rbp), %r12d
incl %r12d
movl 0x34(%rbx), %r14d
jmp 0x2904
leaq 0x36fb(%rip), %rsi      # 0x6076
movq %r15, %rdi
movq -0x38(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x2250
movq 0x6645(%rip), %rdi      # 0x8fd8
movq %r14, %rsi
callq 0x2160
movq %rax, %rdi
callq 0x20a0
movslq 0x34(%rbx), %r12
movq %r12, %rdi
shlq $0x3, %rdi
callq 0x21d0
movq %rax, 0x10(%rbx)
xorl %r14d, %r14d
movl %r14d, -0x2c(%rbp)
cmpl %r12d, %r14d
jge 0x2a2e
movslq 0x30(%rbx), %r13
movq %r13, %rdi
shlq $0x3, %rdi
callq 0x21d0
movq 0x10(%rbx), %rcx
movslq %r14d, %rdx
movq %rax, (%rcx,%rdx,8)
xorl %r14d, %r14d
xorl %r12d, %r12d
movslq %r13d, %rax
cmpq %rax, %r12
jge 0x2a19
movq 0x10(%rbx), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
addq %r14, %rdx
movq %r15, %rdi
leaq 0x368e(%rip), %rsi      # 0x6093
xorl %eax, %eax
callq 0x2250
incq %r12
movl 0x30(%rbx), %r13d
addq $0x8, %r14
jmp 0x29e4
movq %r15, %rdi
callq 0x2210
movl -0x2c(%rbp), %r14d
incl %r14d
movl 0x34(%rbx), %r12d
jmp 0x29ba
movq -0x40(%rbp), %rdi
callq 0x21b0
movq -0x38(%rbp), %rdi
callq 0x21b0
movq %r15, %rdi
callq 0x2170
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop