// File: IdelCoder[P]PTransE-ag/Train_PTransE-pos.cpp
// Function: Train::gradient_path(int, std::vector<int, std::allocator<int>>, double)
void gradient_path(int r1,vector<int> rel_path, double belta)
    {
        for (int ii=0; ii<n; ii++)
        {

			double x = relation_vec[r1][ii];
			for (int j=0; j<rel_path.size(); j++)
				x-=relation_vec[rel_path[j]][ii];
            if (L1_flag)
            	if (x>0)
            		x=1;
            	else
            		x=-1;
            relation_tmp[r1][ii]+=belta*rate*x;
			for (int j=0; j<rel_path.size(); j++)
            	relation_tmp[rel_path[j]][ii]-=belta*rate*x;
        }
    }

// Assembly:
subq $0x88, %rsp
movq %rdx, 0x40(%rsp)
movq %rdi, 0x80(%rsp)
movl %esi, 0x7c(%rsp)
movq %rdx, 0x70(%rsp)
movsd %xmm0, 0x68(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x48(%rsp)
movl $0x0, 0x64(%rsp)
movq 0x48(%rsp), %rcx
movl 0x64(%rsp), %eax
cmpl 0x30(%rcx), %eax
jge 0x14214
movq 0x48(%rsp), %rdi
addq $0xe0, %rdi
movslq 0x7c(%rsp), %rsi
callq 0xbb00
movq %rax, %rdi
movslq 0x64(%rsp), %rsi
callq 0x4890
movsd (%rax), %xmm0
movsd %xmm0, 0x58(%rsp)
movl $0x0, 0x54(%rsp)
movq 0x40(%rsp), %rdi
movslq 0x54(%rsp), %rax
movq %rax, 0x38(%rsp)
callq 0x8450
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0x140aa
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rax
addq $0xe0, %rax
movq %rax, 0x30(%rsp)
movslq 0x54(%rsp), %rsi
callq 0xee40
movq 0x30(%rsp), %rdi
movslq (%rax), %rsi
callq 0xbb00
movq %rax, %rdi
movslq 0x64(%rsp), %rsi
callq 0x4890
movsd (%rax), %xmm1
movsd 0x58(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x1402f
testb $0x1, 0x11157(%rip)     # 0x25208
je 0x140e2
movsd 0x58(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x140d2
movsd 0x5f56(%rip), %xmm0     # 0x1a020
movsd %xmm0, 0x58(%rsp)
jmp 0x140e0
movsd 0x5f3e(%rip), %xmm0     # 0x1a018
movsd %xmm0, 0x58(%rsp)
jmp 0x140e2
movq 0x48(%rsp), %rdi
movsd 0x68(%rsp), %xmm0
mulsd 0x58(%rdi), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
addq $0x110, %rdi            # imm = 0x110
movslq 0x7c(%rsp), %rsi
callq 0xbb00
movq %rax, %rdi
movslq 0x64(%rsp), %rsi
callq 0x4890
movsd 0x20(%rsp), %xmm0
movsd 0x28(%rsp), %xmm2
movsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movl $0x0, 0x50(%rsp)
movq 0x40(%rsp), %rdi
movslq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
callq 0x8450
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jae 0x14202
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rax
movsd 0x68(%rsp), %xmm0
mulsd 0x58(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
addq $0x110, %rax            # imm = 0x110
movq %rax, (%rsp)
movslq 0x50(%rsp), %rsi
callq 0xee40
movq (%rsp), %rdi
movslq (%rax), %rsi
callq 0xbb00
movq %rax, %rdi
movslq 0x64(%rsp), %rsi
callq 0x4890
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm2
movsd (%rax), %xmm1
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movl 0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x50(%rsp)
jmp 0x14146
jmp 0x14204
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x13fe8
addq $0x88, %rsp
retq
nopl (%rax)