// File: /workspace/github_cpp_makefile_star2_O2/huiwenliuge[P]EmoAnaer/src/RNNet.cpp
// Function: RNNet::RNNBackward_CROSSENTROPY_Nthread(double, int)
void RNNet::RNNBackward_CROSSENTROPY_Nthread(double lnrts,int Nthread){
    lnrt=lnrts;
    int i;
    for(i=0;i<hidlayerNUM;++i){
        memset(DLDin2hid[i],'\0',sizeof(double)*featureNUM);
        memset(DLDrh2h[i],'\0',sizeof(double)*hidlayerNUM);
        memset(DLDro2h[i],'\0',sizeof(double)*EMOTIONNUM);
    }
    for(i=0;i<EMOTIONNUM;++i)
        memset(DLDk2out[i],'\0',sizeof(double)*hidlayerNUM);

    Sentence stmp = sent;
    
    flag = totnum-1;
    std::thread th[Nthread];
    int n;
    
    for(n=0;n<Nthread;++n){
       th[n]=std::thread(_Backward_CROSSENTROPY_SingleTask,\
               this,&stmp,n);
    }

    for(n=0;n<Nthread;++n){
        th[n].join();
    }
    int j;
    for(i=0;i<hidlayerNUM;++i){
        for(j=0;j<featureNUM;++j){
            in2hid[i][j]-=DLDin2hid[i][j]*lnrt;
        }
        for(j=0;j<hidlayerNUM;++j){
            rh2h[i][j]-=DLDrh2h[i][j]*lnrt;
        }
        for(j=0;j<EMOTIONNUM;++j){
            ro2h[i][j]-=DLDro2h[i][j]*lnrt;
        }
    }
    for(i=0;i<EMOTIONNUM;++i){
        for(j=0;j<hidlayerNUM;++j){
            k2out[i][j]-=DLDk2out[i][j]*lnrt;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %r13d
movq %rdi, %r14
movsd %xmm0, 0x40(%rdi)
xorl %ebx, %ebx
movslq 0x34(%r14), %rax
cmpq %rax, %rbx
jge 0x40db
movq 0x58(%r14), %rax
movq (%rax,%rbx,8), %rdi
movslq 0x30(%r14), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x20b0
movq 0x68(%r14), %rax
movq (%rax,%rbx,8), %rdi
movslq 0x34(%r14), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x20b0
movq 0x70(%r14), %rax
movq (%rax,%rbx,8), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
andq $0x0, 0x30(%rax)
incq %rbx
jmp 0x4080
xorl %ebx, %ebx
cmpq $0x7, %rbx
je 0x40ff
movq 0x60(%r14), %rax
movq (%rax,%rbx,8), %rdi
movslq 0x34(%r14), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x20b0
incq %rbx
jmp 0x40dd
movq %rsp, -0x38(%rbp)
movq 0x78(%r14), %rax
movq %rax, -0x50(%rbp)
movq 0x50(%r14), %rax
decq %rax
movq %rax, 0x48(%r14)
movl %r13d, %r12d
movq %rsp, %r15
leaq 0xf(,%r12,8), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movl %r13d, %ebx
testl %r13d, %r13d
je 0x4148
leaq (,%r12,8), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x20b0
xorl %eax, %eax
leaq -0x58(%rbp), %r13
movl %eax, -0x2c(%rbp)
cmpl %ebx, %eax
jge 0x419b
movq %r14, -0x48(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x40(%rbp)
movq %r13, %rdi
leaq 0x1c3(%rip), %rsi       # 0x432e
leaq -0x48(%rbp), %rdx
leaq -0x40(%rbp), %rcx
leaq -0x2c(%rbp), %r8
callq 0x46d8
movslq -0x2c(%rbp), %rax
leaq (%r15,%rax,8), %rdi
movq %r13, %rsi
callq 0x46aa
movq %r13, %rdi
callq 0x46c8
movl -0x2c(%rbp), %eax
incl %eax
jmp 0x414e
xorl %eax, %eax
movl %ebx, %r13d
movl %eax, -0x2c(%rbp)
cmpl %r13d, %eax
jge 0x41ba
cltq
leaq (%r15,%rax,8), %rdi
callq 0x2220
movl -0x2c(%rbp), %eax
incl %eax
jmp 0x41a0
movl 0x34(%r14), %ecx
movl 0x30(%r14), %edx
movq 0x70(%r14), %rsi
movq 0x28(%r14), %rdi
xorl %r8d, %r8d
testl %edx, %edx
cmovlel %r8d, %edx
testl %ecx, %ecx
movl $0x0, %eax
cmovgl %ecx, %eax
cmpq %rax, %r8
je 0x4292
movq 0x10(%r14), %r9
movq 0x58(%r14), %r10
xorl %r11d, %r11d
cmpq %r11, %rdx
je 0x421f
movq (%r10,%r8,8), %rbx
movsd (%rbx,%r11,8), %xmm0
movq (%r9,%r8,8), %rbx
mulsd 0x40(%r14), %xmm0
movsd (%rbx,%r11,8), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%rbx,%r11,8)
incq %r11
jmp 0x41f1
movq 0x20(%r14), %r9
movq 0x68(%r14), %r10
xorl %r11d, %r11d
cmpq %r11, %rcx
je 0x4258
movq (%r10,%r8,8), %rbx
movsd (%rbx,%r11,8), %xmm0
movq (%r9,%r8,8), %rbx
mulsd 0x40(%r14), %xmm0
movsd (%rbx,%r11,8), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%rbx,%r11,8)
incq %r11
jmp 0x422a
movq (%rsi,%r8,8), %r9
movq (%rdi,%r8,8), %r10
xorl %r11d, %r11d
cmpq $0x7, %r11
je 0x428a
movsd (%r9,%r11,8), %xmm0
mulsd 0x40(%r14), %xmm0
movsd (%r10,%r11,8), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%r10,%r11,8)
incq %r11
jmp 0x4263
incq %r8
jmp 0x41dd
xorl %ecx, %ecx
cmpq $0x7, %rcx
je 0x42d7
movq 0x18(%r14), %rdx
movq 0x60(%r14), %rsi
xorl %edi, %edi
cmpq %rdi, %rax
je 0x42d2
movq (%rsi,%rcx,8), %r8
movsd (%r8,%rdi,8), %xmm0
movq (%rdx,%rcx,8), %r8
mulsd 0x40(%r14), %xmm0
movsd (%r8,%rdi,8), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%r8,%rdi,8)
incq %rdi
jmp 0x42a4
incq %rcx
jmp 0x4294
testl %r13d, %r13d
je 0x42f3
addq $-0x8, %r15
shlq $0x3, %r12
leaq (%r15,%r12), %rdi
callq 0x46c8
addq $-0x8, %r12
jne 0x42e4
movq -0x38(%rbp), %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4308
movq %rax, %r14
testl %ebx, %ebx
je 0x4326
addq $-0x8, %r15
shlq $0x3, %r12
leaq (%r15,%r12), %rdi
callq 0x46c8
addq $-0x8, %r12
jne 0x4317
movq %r14, %rdi
callq 0x2230