// File: thunlp[P]KB2E/TransR/Test_TransR.cpp
// Function: Test::calc_sum(int, int, int)
double calc_sum(int e1,int e2,int rel)
    {
        vector<double> e1_vec;
        e1_vec.resize(m);
        vector<double> e2_vec;
        e2_vec.resize(m);
        for (int ii=0; ii<m; ii++)
            for (int jj=0; jj<n; jj++)
            {
                e1_vec[ii]+=A[rel][jj][ii]*entity_vec[e1][jj];
                e2_vec[ii]+=A[rel][jj][ii]*entity_vec[e2][jj];
            }
        double sum=0;
        for (int ii=0; ii<m; ii++)
            sum+=-fabs(e2_vec[ii]-e1_vec[ii]-relation_vec[rel][ii]);
        return sum;
    }

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xc0(%rsp)
movl %esi, 0xbc(%rsp)
movl %edx, 0xb8(%rsp)
movl %ecx, 0xb4(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x98(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0xb710
movq 0x50(%rsp), %rdi
movslq 0x158f1(%rip), %rsi     # 0x201e0
callq 0xa710
jmp 0xa8f6
leaq 0x70(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0xb710
movq 0x40(%rsp), %rdi
movslq 0x158cf(%rip), %rsi     # 0x201e0
callq 0xa710
jmp 0xa918
movl $0x0, 0x6c(%rsp)
movl 0x6c(%rsp), %eax
cmpl 0x158b6(%rip), %eax     # 0x201e0
jge 0xaad3
movl $0x0, 0x68(%rsp)
movl 0x68(%rsp), %eax
cmpl 0x158a2(%rip), %eax     # 0x201e4
jge 0xaac1
movq 0x48(%rsp), %rdi
addq $0xd8, %rdi
movslq 0xb4(%rsp), %rsi
callq 0xa850
movq %rax, %rdi
movslq 0x68(%rsp), %rsi
callq 0xa6f0
movq %rax, %rdi
movslq 0x6c(%rsp), %rsi
callq 0x3e50
movq 0x48(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
addq $0x18, %rdi
movslq 0xbc(%rsp), %rsi
callq 0xa6f0
movq %rax, %rdi
movslq 0x68(%rsp), %rsi
callq 0x3e50
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movslq 0x6c(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0x3e50
movsd 0x20(%rsp), %xmm0
movsd 0x28(%rsp), %xmm2
movq 0x48(%rsp), %rdi
movsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
addq $0xd8, %rdi
movslq 0xb4(%rsp), %rsi
callq 0xa850
movq %rax, %rdi
movslq 0x68(%rsp), %rsi
callq 0xa6f0
movq %rax, %rdi
movslq 0x6c(%rsp), %rsi
callq 0x3e50
movq 0x48(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
addq $0x18, %rdi
movslq 0xb8(%rsp), %rsi
callq 0xa6f0
movq %rax, %rdi
movslq 0x68(%rsp), %rsi
callq 0x3e50
movsd (%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
movslq 0x6c(%rsp), %rsi
leaq 0x70(%rsp), %rdi
callq 0x3e50
movsd 0x30(%rsp), %xmm0
movsd 0x38(%rsp), %xmm2
movsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movl 0x68(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x68(%rsp)
jmp 0xa938
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
jmp 0xabc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x8890
jmp 0xabc7
jmp 0xaac3
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0xa920
xorps %xmm0, %xmm0
movsd %xmm0, 0x60(%rsp)
movl $0x0, 0x5c(%rsp)
movl 0x5c(%rsp), %eax
cmpl 0x156f2(%rip), %eax     # 0x201e0
jge 0xab96
movslq 0x5c(%rsp), %rsi
leaq 0x70(%rsp), %rdi
callq 0x3e50
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movslq 0x5c(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0x3e50
movsd 0x10(%rsp), %xmm0
movq 0x48(%rsp), %rdi
subsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
movslq 0xb4(%rsp), %rsi
callq 0xa6f0
movq %rax, %rdi
movslq 0x5c(%rsp), %rsi
callq 0x3e50
movsd 0x18(%rsp), %xmm0
subsd (%rax), %xmm0
movaps 0xb4d1(%rip), %xmm1     # 0x16030
pand %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
addsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0xaae4
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x8890
leaq 0x98(%rsp), %rdi
callq 0x8890
movsd 0x8(%rsp), %xmm0
addq $0xc8, %rsp
retq
leaq 0x98(%rsp), %rdi
callq 0x8890
movq 0x90(%rsp), %rdi
callq 0x2320
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)