// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rax
movq %rcx, -0x30(%rbp)
movl %edx, %r12d
movl %esi, %r13d
movq %rdi, %rbx
movl %esi, 0x30(%rdi)
movl %edx, 0x34(%rdi)
movq $0x0, 0x78(%rdi)
movslq %edx, %r15
leaq (,%r15,8), %r14
movq %r14, %rdi
callq 0x21f0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq %rax, 0x58(%rbx)
movl $0x38, %edi
callq 0x21f0
movq %rax, 0x60(%rbx)
movq %r14, %rdi
callq 0x21f0
movq %rax, 0x68(%rbx)
movq %r14, %rdi
callq 0x21f0
movq %rax, 0x70(%rbx)
testl %r15d, %r15d
jle 0x24ff
movslq %r13d, %r13
movl %r12d, %r14d
xorl %r12d, %r12d
movl $0x8, %edi
movq %r13, %rsi
callq 0x20c0
movq 0x58(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
movl $0x8, %edi
movq %r15, %rsi
callq 0x20c0
movq 0x68(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
movl $0x8, %edi
movl $0x7, %esi
callq 0x20c0
movq 0x70(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
cmpq %r12, %r14
jne 0x24b6
xorl %r14d, %r14d
movl $0x8, %edi
movq %r15, %rsi
callq 0x20c0
movq 0x60(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
cmpq $0x7, %r14
jne 0x2502
movl $0x38, %edi
callq 0x21f0
movq %rax, 0x80(%rbx)
xorl %r14d, %r14d
movl $0x1, %edi
movl $0xb, %esi
callq 0x20c0
movq 0x80(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
cmpq $0x7, %r14
jne 0x2534
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 %r12d, %r12d
movb %r12b, 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
movl $0x1, %edi
movl $0x29, %esi
callq 0x20c0
movq %rax, %r14
movq -0x30(%rbp), %r13
movq %r13, %rdi
callq 0x2080
movq %rax, %r15
movq %r14, %rdi
movq %r13, %rsi
callq 0x2140
movslq %r15d, %rax
movb %r12b, 0x10(%r14,%rax)
movups 0x3a10(%rip), %xmm0     # 0x603f
movups %xmm0, (%r14,%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2686
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2792
movl $0x1, %edi
movl $0x29, %esi
callq 0x20c0
movabsq $0x534f52432f706d74, %rcx # imm = 0x534F52432F706D74
movq %rcx, (%rax)
movw $0x53, 0x8(%rax)
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2c04
nop