// File: /workspace/github_cpp_makefile_star2_O2/huiwenliuge[P]EmoAnaer/src/RNNet.cpp
// Function: RNNet::RNNet(int, int, char const*)
RNNet::RNNet(int featurenum,int hidlayernum,const char* pathRoot){

    featureNUM=featurenum;
    hidlayerNUM=hidlayernum;
    ccdict=NULL;
    tdict=NULL;
    sent=NULL;
    
    DLDin2hid=(double**)malloc(sizeof(double*)*hidlayerNUM);
    DLDk2out =(double**)malloc(sizeof(double*)*EMOTIONNUM);
    DLDrh2h  =(double**)malloc(sizeof(double*)*hidlayerNUM);
    DLDro2h  =(double**)malloc(sizeof(double*)*hidlayerNUM);

    int i;
    for(i=0;i<hidlayerNUM;++i){
        DLDin2hid[i]=(double*)calloc(sizeof(double),featureNUM);
        DLDrh2h[i]=(double*)calloc(sizeof(double),hidlayerNUM);
        DLDro2h[i]=(double*)calloc(sizeof(double),EMOTIONNUM);
    }
    for(i=0;i<EMOTIONNUM;++i)
        DLDk2out[i] =(double*)calloc(sizeof(double),hidlayerNUM);

    EMOLIST=(char**)malloc(sizeof(char*)*EMOTIONNUM);
    for(i=0;i<EMOTIONNUM;++i)
        EMOLIST[i]=(char*)calloc(sizeof(char),11);
    strcpy(EMOLIST[0],"ANGRY");
    strcpy(EMOLIST[1],"ANXIOUS");
    strcpy(EMOLIST[2],"AWKWARD");
    strcpy(EMOLIST[3],"HAPPY");
    strcpy(EMOLIST[4],"MOVE");
    strcpy(EMOLIST[5],"NOVEL");
    strcpy(EMOLIST[6],"SAD");
    
    char* pdic=(char*)calloc(sizeof(char),41);
    int pathrootlen=strlen(pathRoot);
    strcpy(pdic,pathRoot);
    strcpy(pdic+pathrootlen,"Dictionary/CROSS");
    FetchDict(pdic);
    FetchPara(pdic);
    //
    //RNNForward_CROSSENTROPY_Nthread("../",2);
    //
    
    char* path=(char*)calloc(sizeof(char),41);
    strcpy(path,"tmp/CROSS");
    _save_var(path);
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movl %esi, 0x30(%rdi)
movl %edx, 0x34(%rdi)
andq $0x0, 0x78(%rdi)
movq %rcx, -0x30(%rbp)
movslq %edx, %r15
leaq (,%r15,8), %r12
movq %r12, %rdi
callq 0x21d0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq %rax, 0x58(%rbx)
pushq $0x38
popq %rdi
callq 0x21d0
movq %rax, 0x60(%rbx)
movq %r12, %rdi
callq 0x21d0
movq %rax, 0x68(%rbx)
movq %r12, %rdi
callq 0x21d0
movq %rax, 0x70(%rbx)
movslq %r14d, %rax
movq %rax, -0x38(%rbp)
xorl %r14d, %r14d
testl %r15d, %r15d
movl $0x0, %r12d
cmovgl %r15d, %r12d
pushq $0x8
popq %r13
cmpq %r14, %r12
je 0x24d2
movq %r13, %rdi
movq -0x38(%rbp), %rsi
callq 0x20c0
movq 0x58(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
movq %r13, %rdi
movq %r15, %rsi
callq 0x20c0
movq 0x68(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
movq %r13, %rdi
pushq $0x7
popq %rsi
callq 0x20c0
movq 0x70(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
jmp 0x248e
xorl %r12d, %r12d
pushq $0x8
popq %r14
cmpq $0x7, %r12
je 0x24f7
movq %r14, %rdi
movq %r15, %rsi
callq 0x20c0
movq 0x60(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
jmp 0x24d9
pushq $0x38
popq %rdi
callq 0x21d0
movq %rax, 0x80(%rbx)
xorl %r12d, %r12d
pushq $0x1
popq %r14
pushq $0xb
popq %r15
cmpq $0x7, %r12
je 0x2532
movq %r14, %rdi
movq %r15, %rsi
callq 0x20c0
movq 0x80(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
jmp 0x2511
movq 0x80(%rbx), %rax
movq (%rax), %rax
movw $0x59, %cx
movw %cx, 0x4(%rax)
movl $0x52474e41, (%rax)     # imm = 0x52474E41
movq 0x80(%rbx), %rax
movq 0x8(%rax), %rax
movabsq $0x53554f49584e41, %rdx # imm = 0x53554F49584E41
movq %rdx, (%rax)
movq 0x80(%rbx), %rax
movq 0x10(%rax), %rax
movabsq $0x445241574b5741, %rdx # imm = 0x445241574B5741
movq %rdx, (%rax)
movq 0x80(%rbx), %rax
movq 0x18(%rax), %rax
movw %cx, 0x4(%rax)
movl $0x50504148, (%rax)     # imm = 0x50504148
movq 0x80(%rbx), %rax
movq 0x20(%rax), %rax
xorl %r14d, %r14d
movb %r14b, 0x4(%rax)
movl $0x45564f4d, (%rax)     # imm = 0x45564F4D
movq 0x80(%rbx), %rax
movq 0x28(%rax), %rax
movw $0x4c, 0x4(%rax)
movl $0x45564f4e, (%rax)     # imm = 0x45564F4E
movq 0x80(%rbx), %rax
movq 0x30(%rax), %rax
movl $0x444153, (%rax)       # imm = 0x444153
pushq $0x1
popq %rdi
pushq $0x29
popq %rsi
callq 0x20c0
movq %rax, %r12
movq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x2070
movq %rax, %r13
movq %r12, %rdi
movq %r15, %rsi
callq 0x2130
movslq %r13d, %rax
movb %r14b, 0x10(%r12,%rax)
movups 0x3a39(%rip), %xmm0     # 0x603f
movups %xmm0, (%r12,%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2658
movq %rbx, %rdi
movq %r12, %rsi
callq 0x270a
pushq $0x1
popq %rdi
pushq $0x29
popq %rsi
callq 0x20c0
movabsq $0x534f52432f706d74, %rcx # imm = 0x534F52432F706D74
movq %rcx, (%rax)
movw $0x53, 0x8(%rax)
movq %rbx, %rdi
movq %rax, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2a58