// File: /workspace/github_cpp_makefile_star2_O3/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)
cmpl $0x0, 0x34(%rdi)
jle 0x4568
xorl %ebx, %ebx
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)
movq $0x0, 0x30(%rax)
incq %rbx
movslq 0x34(%r14), %rax
cmpq %rax, %rbx
jl 0x450c
xorl %ebx, %ebx
movq 0x60(%r14), %rax
movq (%rax,%rbx,8), %rdi
movslq 0x34(%r14), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x20b0
incq %rbx
cmpq $0x7, %rbx
jne 0x456a
movq %rsp, -0x38(%rbp)
movq 0x78(%r14), %rax
movq %rax, -0x60(%rbp)
movq 0x50(%r14), %rax
decq %rax
movq %rax, 0x48(%r14)
movl %r13d, %ebx
movq %rsp, %r15
leaq 0xf(,%rbx,8), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
testl %r13d, %r13d
movl %r13d, -0x30(%rbp)
je 0x465b
leaq (,%rbx,8), %r12
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x20b0
movl $0x0, -0x2c(%rbp)
testl %r13d, %r13d
jle 0x465b
leaq -0x60(%rbp), %r13
movq %r14, -0x50(%rbp)
movq %r13, -0x48(%rbp)
leaq -0x58(%rbp), %rdi
leaq 0x1c8(%rip), %rsi       # 0x47c6
leaq -0x50(%rbp), %rdx
leaq -0x48(%rbp), %rcx
leaq -0x2c(%rbp), %r8
callq 0x4b78
movslq -0x2c(%rbp), %rax
cmpq $0x0, (%r15,%rax,8)
jne 0x47c1
movq -0x58(%rbp), %rcx
movq %rcx, (%r15,%rax,8)
incl %eax
movl %eax, -0x2c(%rbp)
cmpl -0x30(%rbp), %eax
jl 0x45eb
movl $0x0, -0x2c(%rbp)
movl -0x30(%rbp), %eax
testl %eax, %eax
jle 0x465b
movl %eax, %r13d
xorl %eax, %eax
cltq
leaq (%r15,%rax,8), %rdi
callq 0x2250
movl -0x2c(%rbp), %eax
incl %eax
movl %eax, -0x2c(%rbp)
cmpl %r13d, %eax
jl 0x4643
movl 0x34(%r14), %eax
testl %eax, %eax
jle 0x472f
movl 0x30(%r14), %ecx
movq 0x58(%r14), %rdx
movq %rdx, -0x40(%rbp)
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rdi
movq 0x68(%r14), %r8
movq 0x70(%r14), %r9
movq 0x28(%r14), %r10
xorl %r11d, %r11d
testl %ecx, %ecx
jle 0x46c2
movq -0x40(%rbp), %rdx
movq (%rdx,%r11,8), %r12
movq (%rsi,%r11,8), %r13
xorl %edx, %edx
movsd (%r12,%rdx,8), %xmm0
movsd (%r13,%rdx,8), %xmm1
mulsd 0x40(%r14), %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, (%r13,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x469c
movq (%r8,%r11,8), %r12
movq (%rdi,%r11,8), %r13
xorl %edx, %edx
movsd (%r12,%rdx,8), %xmm0
movsd (%r13,%rdx,8), %xmm1
mulsd 0x40(%r14), %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, (%r13,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x46cc
movq (%r9,%r11,8), %r12
movq (%r10,%r11,8), %r13
xorl %edx, %edx
movsd (%r12,%rdx,8), %xmm0
movsd (%r13,%rdx,8), %xmm1
mulsd 0x40(%r14), %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, (%r13,%rdx,8)
incq %rdx
cmpq $0x7, %rdx
jne 0x46fc
incq %r11
cmpq %rax, %r11
jne 0x468a
movq 0x18(%r14), %rcx
movq 0x60(%r14), %rdx
xorl %esi, %esi
movl -0x30(%rbp), %r10d
testl %eax, %eax
jle 0x4770
movq (%rdx,%rsi,8), %rdi
movq (%rcx,%rsi,8), %r8
xorl %r9d, %r9d
movsd (%rdi,%r9,8), %xmm0
movsd (%r8,%r9,8), %xmm1
mulsd 0x40(%r14), %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, (%r8,%r9,8)
incq %r9
cmpq %r9, %rax
jne 0x474c
incq %rsi
cmpq $0x7, %rsi
jne 0x473d
testl %r10d, %r10d
je 0x4790
shlq $0x3, %rbx
cmpq $0x0, -0x8(%r15,%rbx)
jne 0x47c1
addq $-0x8, %rbx
jne 0x4782
movq -0x38(%rbp), %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x47a5
cmpl $0x0, -0x30(%rbp)
je 0x47b9
cmpq $0x0, -0x8(%r15,%r12)
jne 0x47c1
addq $-0x8, %r12
jne 0x47ab
movq %rax, %rdi
callq 0x2260
callq 0x2060