// File: /workspace/github_cpp_makefile_star2_O1/thunlp[P]KB2E/TransE/Train_TransE.cpp
// Function: Train::run(int, double, double, int)
void run(int n_in,double rate_in,double margin_in,int method_in)
    {
        n = n_in;
        rate = rate_in;
        margin = margin_in;
        method = method_in;
        relation_vec.resize(relation_num);
		for (int i=0; i<relation_vec.size(); i++)
			relation_vec[i].resize(n);
        entity_vec.resize(entity_num);
		for (int i=0; i<entity_vec.size(); i++)
			entity_vec[i].resize(n);
        relation_tmp.resize(relation_num);
		for (int i=0; i<relation_tmp.size(); i++)
			relation_tmp[i].resize(n);
        entity_tmp.resize(entity_num);
		for (int i=0; i<entity_tmp.size(); i++)
			entity_tmp[i].resize(n);
        for (int i=0; i<relation_num; i++)
        {
            for (int ii=0; ii<n; ii++)
                relation_vec[i][ii] = randn(0,1.0/n,-6/sqrt(n),6/sqrt(n));
        }
        for (int i=0; i<entity_num; i++)
        {
            for (int ii=0; ii<n; ii++)
                entity_vec[i][ii] = randn(0,1.0/n,-6/sqrt(n),6/sqrt(n));
            norm(entity_vec[i]);
        }


        bfgs();
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl %esi, 0x30(%rdi)
movsd %xmm0, 0x50(%rdi)
movsd %xmm1, 0x58(%rdi)
movl %edx, 0x34(%rdi)
addq $0xc8, %rdi
movslq 0x37800(%rip), %rsi     # 0x3af30
callq 0x421c
movq 0xc8(%rbx), %rdi
movabsq $-0x5555555555555555, %r14 # imm = 0xAAAAAAAAAAAAAAAB
cmpq %rdi, 0xd0(%rbx)
je 0x3786
xorl %r15d, %r15d
xorl %r12d, %r12d
addq %r15, %rdi
movslq 0x30(%rbx), %rsi
callq 0x4258
incq %r12
movq 0xc8(%rbx), %rdi
movq 0xd0(%rbx), %rax
subq %rdi, %rax
sarq $0x3, %rax
imulq %r14, %rax
addq $0x18, %r15
cmpq %r12, %rax
ja 0x3755
leaq 0xe0(%rbx), %rdi
movslq 0x377a0(%rip), %rsi     # 0x3af34
callq 0x421c
movq 0xe0(%rbx), %rdi
cmpq %rdi, 0xe8(%rbx)
je 0x37e0
xorl %r15d, %r15d
xorl %r12d, %r12d
addq %r15, %rdi
movslq 0x30(%rbx), %rsi
callq 0x4258
incq %r12
movq 0xe0(%rbx), %rdi
movq 0xe8(%rbx), %rax
subq %rdi, %rax
sarq $0x3, %rax
imulq %r14, %rax
addq $0x18, %r15
cmpq %r12, %rax
ja 0x37af
leaq 0xf8(%rbx), %rdi
movslq 0x37742(%rip), %rsi     # 0x3af30
callq 0x421c
movq 0xf8(%rbx), %rdi
cmpq %rdi, 0x100(%rbx)
je 0x383a
xorl %r15d, %r15d
xorl %r12d, %r12d
addq %r15, %rdi
movslq 0x30(%rbx), %rsi
callq 0x4258
incq %r12
movq 0xf8(%rbx), %rdi
movq 0x100(%rbx), %rax
subq %rdi, %rax
sarq $0x3, %rax
imulq %r14, %rax
addq $0x18, %r15
cmpq %r12, %rax
ja 0x3809
leaq 0x110(%rbx), %rdi
movslq 0x376ec(%rip), %rsi     # 0x3af34
callq 0x421c
movq 0x110(%rbx), %rdi
cmpq %rdi, 0x118(%rbx)
je 0x3894
xorl %r15d, %r15d
xorl %r12d, %r12d
addq %r15, %rdi
movslq 0x30(%rbx), %rsi
callq 0x4258
incq %r12
movq 0x110(%rbx), %rdi
movq 0x118(%rbx), %rax
subq %rdi, %rax
sarq $0x3, %rax
imulq %r14, %rax
addq $0x18, %r15
cmpq %r12, %rax
ja 0x3863
cmpl $0x0, 0x37695(%rip)     # 0x3af30
jle 0x396b
xorl %r14d, %r14d
movl 0x30(%rbx), %eax
testl %eax, %eax
jle 0x3958
leaq (%r14,%r14,2), %r15
xorl %r12d, %r12d
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
ucomisd 0x377b(%rip), %xmm0     # 0x7040
movsd %xmm0, 0x10(%rsp)
jb 0x38d6
xorps %xmm4, %xmm4
sqrtsd %xmm0, %xmm4
jmp 0x38df
callq 0x2150
movapd %xmm0, %xmm4
xorps %xmm0, %xmm0
cvtsi2sdl 0x30(%rbx), %xmm0
ucomisd 0x3751(%rip), %xmm0     # 0x7040
jb 0x38f7
sqrtsd %xmm0, %xmm0
jmp 0x3908
movsd %xmm4, 0x8(%rsp)
callq 0x2150
movsd 0x8(%rsp), %xmm4
movsd 0x3728(%rip), %xmm3     # 0x7038
divsd %xmm0, %xmm3
movsd 0x3704(%rip), %xmm1     # 0x7020
divsd 0x10(%rsp), %xmm1
movsd 0x3706(%rip), %xmm2     # 0x7030
divsd %xmm4, %xmm2
xorpd %xmm0, %xmm0
callq 0x2797
movq 0xc8(%rbx), %rax
movq (%rax,%r15,8), %rax
movsd %xmm0, (%rax,%r12,8)
incq %r12
movslq 0x30(%rbx), %rax
cmpq %rax, %r12
jl 0x38b6
incq %r14
movslq 0x375ce(%rip), %rax     # 0x3af30
cmpq %rax, %r14
jl 0x38a4
cmpl $0x0, 0x375c2(%rip)     # 0x3af34
jle 0x3a58
xorl %r15d, %r15d
movl 0x30(%rbx), %eax
leaq (%r15,%r15,2), %r14
testl %eax, %eax
jle 0x3a2f
xorl %r12d, %r12d
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
ucomisd 0x36a4(%rip), %xmm0     # 0x7040
movsd %xmm0, 0x10(%rsp)
jb 0x39ad
xorps %xmm4, %xmm4
sqrtsd %xmm0, %xmm4
jmp 0x39b6
callq 0x2150
movapd %xmm0, %xmm4
xorps %xmm0, %xmm0
cvtsi2sdl 0x30(%rbx), %xmm0
ucomisd 0x367a(%rip), %xmm0     # 0x7040
jb 0x39ce
sqrtsd %xmm0, %xmm0
jmp 0x39df
movsd %xmm4, 0x8(%rsp)
callq 0x2150
movsd 0x8(%rsp), %xmm4
movsd 0x3651(%rip), %xmm3     # 0x7038
divsd %xmm0, %xmm3
movsd 0x362d(%rip), %xmm1     # 0x7020
divsd 0x10(%rsp), %xmm1
movsd 0x362f(%rip), %xmm2     # 0x7030
divsd %xmm4, %xmm2
xorpd %xmm0, %xmm0
callq 0x2797
movq 0xe0(%rbx), %rax
movq (%rax,%r14,8), %rax
movsd %xmm0, (%rax,%r12,8)
incq %r12
movslq 0x30(%rbx), %rax
cmpq %rax, %r12
jl 0x398d
shlq $0x3, %r14
addq 0xe0(%rbx), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x428a
incq %r15
movslq 0x374e5(%rip), %rax     # 0x3af34
cmpq %rax, %r15
jl 0x397b
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4316