// File: 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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x1, %edi
movl $0x29, %esi
callq 0x20b0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2120
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2070
movq -0x40(%rbp), %rdi
addq %rax, %rdi
leaq 0x57c4(%rip), %rsi      # 0x805b
callq 0x2120
movq -0x18(%rbp), %rdi
leaq 0x57c9(%rip), %rsi      # 0x8070
callq 0x2190
movq %rax, -0x20(%rbp)
movl $0x1, %edi
movl $0x51, %esi
callq 0x20b0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x57ab(%rip), %rsi      # 0x807d
leaq -0x2c(%rbp), %rcx
movb $0x0, %al
callq 0x2260
movl $0x38, %edi
callq 0x21c0
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x2c(%rbp)
cmpl $0x7, -0x2c(%rbp)
jge 0x2989
movq -0x38(%rbp), %rax
movslq 0x34(%rax), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, %rdx
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x30(%rbp)
movq -0x38(%rbp), %rcx
movl -0x30(%rbp), %eax
cmpl 0x34(%rcx), %eax
jge 0x2972
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rdi
movq 0x18(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movslq -0x30(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
leaq 0x572f(%rip), %rsi      # 0x808f
movb $0x0, %al
callq 0x2260
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x292e
movq -0x20(%rbp), %rdi
callq 0x2200
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x28f9
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x56e5(%rip), %rsi      # 0x807d
leaq -0x2c(%rbp), %rcx
movb $0x0, %al
callq 0x2260
movq -0x28(%rbp), %rsi
movq 0x862a(%rip), %rdi      # 0xafd8
callq 0x2140
movq %rax, %rdi
movq 0x8603(%rip), %rsi      # 0xafc0
callq 0x2170
movq -0x38(%rbp), %rax
movslq 0x34(%rax), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x28(%rax)
movl $0x0, -0x2c(%rbp)
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %eax
cmpl 0x34(%rcx), %eax
jge 0x2a6a
movl $0x38, %edi
callq 0x21c0
movq %rax, %rdx
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x30(%rbp)
cmpl $0x7, -0x30(%rbp)
jge 0x2a53
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rdi
movq 0x28(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movslq -0x30(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
leaq 0x564e(%rip), %rsi      # 0x808f
movb $0x0, %al
callq 0x2260
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x2a15
movq -0x20(%rbp), %rdi
callq 0x2200
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x29e5
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x55f9(%rip), %rsi      # 0x8072
movb $0x0, %al
callq 0x2260
movq -0x28(%rbp), %rsi
movq 0x854d(%rip), %rdi      # 0xafd8
callq 0x2140
movq %rax, %rdi
movq 0x8526(%rip), %rsi      # 0xafc0
callq 0x2170
movq -0x38(%rbp), %rax
movslq 0x34(%rax), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x20(%rax)
movl $0x0, -0x2c(%rbp)
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %eax
cmpl 0x34(%rcx), %eax
jge 0x2b58
movq -0x38(%rbp), %rax
movslq 0x34(%rax), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, %rdx
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x30(%rbp)
movq -0x38(%rbp), %rcx
movl -0x30(%rbp), %eax
cmpl 0x34(%rcx), %eax
jge 0x2b41
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rdi
movq 0x20(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movslq -0x30(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
leaq 0x5560(%rip), %rsi      # 0x808f
movb $0x0, %al
callq 0x2260
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x2afd
movq -0x20(%rbp), %rdi
callq 0x2200
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2ac2
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x550b(%rip), %rsi      # 0x8072
movb $0x0, %al
callq 0x2260
movq -0x28(%rbp), %rsi
movq 0x845f(%rip), %rdi      # 0xafd8
callq 0x2140
movq %rax, %rdi
movq 0x8438(%rip), %rsi      # 0xafc0
callq 0x2170
movq -0x38(%rbp), %rax
movslq 0x34(%rax), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, -0x2c(%rbp)
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %eax
cmpl 0x34(%rcx), %eax
jge 0x2c46
movq -0x38(%rbp), %rax
movslq 0x30(%rax), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, %rdx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x30(%rbp)
movq -0x38(%rbp), %rcx
movl -0x30(%rbp), %eax
cmpl 0x30(%rcx), %eax
jge 0x2c2f
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rdi
movq 0x10(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movslq -0x30(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
leaq 0x5472(%rip), %rsi      # 0x808f
movb $0x0, %al
callq 0x2260
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x2beb
movq -0x20(%rbp), %rdi
callq 0x2200
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2bb0
movq -0x18(%rbp), %rdi
callq 0x21a0
movq -0x28(%rbp), %rdi
callq 0x21a0
movq -0x20(%rbp), %rdi
callq 0x2150
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)