// File: /workspace/github_cpp_makefile_star2_O1/thunlp[P]KB2E/CTransR/Train_CTransR.cpp
// Function: Train::same_rel(double)
void same_rel(double rel)
    {
        double sum=0;
        for (int ii=0; ii<n; ii++)
            if (L1_flag)
                sum+=fabs(fb_relation_vec[cluster2fb[rel]][ii]-relation_vec[rel][ii]);
            else
                sum+=sqr(fb_relation_vec[cluster2fb[rel]][ii]-relation_vec[rel][ii]);
        if (sum>0)
        {
            double lambda = 0.001;
            res+=lambda*(sum);
            for (int ii=0; ii<n; ii++)
            {
                double x = 2*(fb_relation_vec[cluster2fb[rel]][ii]-relation_vec[rel][ii]);
                if (L1_flag)
                    if (x>0)
                        x=1;
                    else
                        x=-1;
                fb_relation_tmp[cluster2fb[rel]][ii]-=lambda*rate*x;
                relation_tmp[rel][ii]+=lambda*rate*x;
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movapd %xmm0, 0x10(%rsp)
movq %rdi, %rbx
cmpl $0x0, 0x68(%rdi)
xorpd %xmm0, %xmm0
jle 0x60c8
movapd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %ebp
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x2055(%rip), %xmm0     # 0x8050
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
xorpd %xmm0, %xmm0
xorl %r12d, %r12d
leaq 0x36f3c(%rip), %r14     # 0x3cf50
leaq 0x4(%rsp), %r15
leaq (%rdx,%rdx,2), %r13
movsd %xmm0, 0x8(%rsp)
cmpb $0x1, 0x617e(%rip)      # 0xc1a8
jne 0x606e
movl %ebp, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6e88
movslq (%rax), %rax
movq 0xd8(%rbx), %rcx
movq 0x108(%rbx), %rdx
leaq (%rax,%rax,2), %rax
movq (%rdx,%rax,8), %rax
movsd (%rax,%r12,8), %xmm0
movq (%rcx,%r13,8), %rax
subsd (%rax,%r12,8), %xmm0
andpd 0x2024(%rip), %xmm0     # 0x8090
jmp 0x60aa
movl %ebp, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6e88
movslq (%rax), %rax
movq 0xd8(%rbx), %rcx
movq 0x108(%rbx), %rdx
leaq (%rax,%rax,2), %rax
movq (%rdx,%rax,8), %rax
movsd (%rax,%r12,8), %xmm0
movq (%rcx,%r13,8), %rax
subsd (%rax,%r12,8), %xmm0
mulsd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
incq %r12
movslq 0x68(%rbx), %rax
cmpq %rax, %r12
jl 0x601d
ucomisd 0x1f90(%rip), %xmm0     # 0x8060
jbe 0x6226
mulsd 0x1f52(%rip), %xmm0     # 0x8030
addsd 0x78(%rbx), %xmm0
movsd %xmm0, 0x78(%rbx)
cmpl $0x0, 0x68(%rbx)
jle 0x6226
movapd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %ebp
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0x1f44(%rip), %xmm0     # 0x8050
cvttsd2si %xmm0, %rdx
sarq $0x3f, %rcx
andq %rcx, %rdx
orq %rax, %rdx
xorl %r12d, %r12d
leaq 0x36e2b(%rip), %r14     # 0x3cf50
leaq 0x4(%rsp), %r15
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %r13
movl %ebp, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6e88
movslq (%rax), %rax
movq 0xd8(%rbx), %rcx
movq 0x108(%rbx), %rdx
leaq (%rax,%rax,2), %rax
movq (%rdx,%rax,8), %rax
movsd (%rax,%r12,8), %xmm0
movq (%rcx,%r13), %rax
subsd (%rax,%r12,8), %xmm0
addsd %xmm0, %xmm0
xorl %eax, %eax
ucomisd 0x1ee8(%rip), %xmm0     # 0x8060
seta %cl
cmpb $0x0, 0x6026(%rip)      # 0xc1a8
je 0x6192
movb %cl, %al
leaq 0x1f13(%rip), %rcx      # 0x80a0
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x80(%rbx), %xmm0
movsd %xmm0, 0x10(%rsp)
movl %ebp, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6e88
movslq (%rax), %rax
movq 0x150(%rbx), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rax
movsd 0x10(%rsp), %xmm0
mulsd 0x1e83(%rip), %xmm0     # 0x8058
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd (%rax,%r12,8), %xmm0
movsd %xmm0, (%rax,%r12,8)
movsd 0x80(%rbx), %xmm0
mulsd 0x1e35(%rip), %xmm0     # 0x8030
movq 0x120(%rbx), %rax
movq (%rax,%r13), %rax
mulsd %xmm1, %xmm0
addsd (%rax,%r12,8), %xmm0
movsd %xmm0, (%rax,%r12,8)
incq %r12
movslq 0x68(%rbx), %rax
cmpq %rax, %r12
jl 0x6132
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop