// File: /workspace/github_cpp_makefile_star2_O1/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 0x3891(%rip), %rsi      # 0x6074
movq %r15, -0x40(%rbp)
movq %r15, %rdi
callq 0x21c0
movq %rax, %r15
movl $0x1, %edi
movl $0x51, %esi
callq 0x20c0
leaq 0x3879(%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 0x3857(%rip), %r14      # 0x6093
xorl %r12d, %r12d
movslq 0x34(%rbx), %rdi
shlq $0x3, %rdi
callq 0x21f0
movq 0x18(%rbx), %rcx
movslq %r12d, %rdx
movq %rax, (%rcx,%rdx,8)
cmpl $0x0, 0x34(%rbx)
jle 0x288f
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 0x2863
movq %r15, %rdi
callq 0x2230
movl -0x2c(%rbp), %eax
leal 0x1(%rax), %r12d
movl %r12d, -0x2c(%rbp)
cmpl $0x6, %eax
jl 0x283f
leaq 0x37d3(%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 0x28e4
movq %r13, %rdi
callq 0x2080
movq 0x5701(%rip), %rdi      # 0x7fd8
movq %r13, %rsi
movq %rax, %rdx
callq 0x21a0
jmp 0x2902
movq 0x56ed(%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 0x56cf(%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), %rdi
shlq $0x3, %rdi
callq 0x21f0
movq %rax, 0x28(%rbx)
movl $0x0, -0x2c(%rbp)
cmpl $0x0, 0x34(%rbx)
jle 0x29af
leaq 0x373e(%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 0x2970
movq %r15, %rdi
callq 0x2230
movl -0x2c(%rbp), %r12d
incl %r12d
movl %r12d, -0x2c(%rbp)
cmpl 0x34(%rbx), %r12d
jl 0x2958
leaq 0x36c0(%rip), %rsi      # 0x6076
movq %r15, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x2280
testq %r13, %r13
je 0x29eb
movq %r13, %rdi
callq 0x2080
movq 0x5601(%rip), %rdi      # 0x7fd8
movq %r13, %rsi
movq %rax, %rdx
callq 0x21a0
movq 0x55ef(%rip), %r14      # 0x7fd8
jmp 0x2a0a
movq 0x55e6(%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), %rdi
shlq $0x3, %rdi
callq 0x21f0
movq %rax, 0x20(%rbx)
movl $0x0, -0x2c(%rbp)
movl 0x34(%rbx), %eax
testl %eax, %eax
jle 0x2ac4
leaq 0x363c(%rip), %r14      # 0x6093
xorl %r12d, %r12d
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x21f0
movq 0x20(%rbx), %rcx
movslq %r12d, %rdx
movq %rax, (%rcx,%rdx,8)
cmpl $0x0, 0x34(%rbx)
jle 0x2aa9
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 0x2a7d
movq %r15, %rdi
callq 0x2230
movl -0x2c(%rbp), %r12d
incl %r12d
movl %r12d, -0x2c(%rbp)
movl 0x34(%rbx), %eax
cmpl %eax, %r12d
jl 0x2a5a
leaq 0x35ab(%rip), %rsi      # 0x6076
movq %r15, %rdi
movq -0x38(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x2280
testq %r14, %r14
je 0x2b04
movq %r14, %rdi
callq 0x2080
movq 0x54e8(%rip), %rdi      # 0x7fd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x21a0
movq 0x54d6(%rip), %r14      # 0x7fd8
jmp 0x2b23
movq 0x54cd(%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), %rdi
shlq $0x3, %rdi
callq 0x21f0
movq %rax, 0x10(%rbx)
movl $0x0, -0x2c(%rbp)
cmpl $0x0, 0x34(%rbx)
jle 0x2bdb
leaq 0x3524(%rip), %r14      # 0x6093
xorl %r12d, %r12d
movslq 0x30(%rbx), %rdi
shlq $0x3, %rdi
callq 0x21f0
movq 0x10(%rbx), %rcx
movslq %r12d, %rdx
movq %rax, (%rcx,%rdx,8)
cmpl $0x0, 0x30(%rbx)
jle 0x2bc2
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 0x2b96
movq %r15, %rdi
callq 0x2230
movl -0x2c(%rbp), %r12d
incl %r12d
movl %r12d, -0x2c(%rbp)
cmpl 0x34(%rbx), %r12d
jl 0x2b72
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