// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl %esi, 0x30(%rdi)
movsd %xmm0, 0x50(%rdi)
movsd %xmm1, 0x58(%rdi)
movl %edx, 0x34(%rdi)
addq $0xc8, %rdi
movslq 0x377f0(%rip), %rsi     # 0x3af30
callq 0x4212
movq 0xc8(%rbx), %rdi
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
cmpq %rdi, 0xd0(%rbx)
je 0x3796
xorl %r14d, %r14d
xorl %r12d, %r12d
addq %r14, %rdi
movslq 0x30(%rbx), %rsi
callq 0x424e
incq %r12
movq 0xc8(%rbx), %rdi
movq 0xd0(%rbx), %rax
subq %rdi, %rax
sarq $0x3, %rax
imulq %r15, %rax
addq $0x18, %r14
cmpq %r12, %rax
ja 0x3765
leaq 0xe0(%rbx), %r14
movslq 0x37790(%rip), %rsi     # 0x3af34
movq %r14, %rdi
callq 0x4212
movq 0xe0(%rbx), %rdi
cmpq %rdi, 0xe8(%rbx)
je 0x37f3
xorl %r12d, %r12d
xorl %r13d, %r13d
addq %r12, %rdi
movslq 0x30(%rbx), %rsi
callq 0x424e
incq %r13
movq 0xe0(%rbx), %rdi
movq 0xe8(%rbx), %rax
subq %rdi, %rax
sarq $0x3, %rax
imulq %r15, %rax
addq $0x18, %r12
cmpq %r13, %rax
ja 0x37c2
leaq 0xf8(%rbx), %rdi
movslq 0x3772f(%rip), %rsi     # 0x3af30
callq 0x4212
movq 0xf8(%rbx), %rdi
cmpq %rdi, 0x100(%rbx)
je 0x384d
xorl %r12d, %r12d
xorl %r13d, %r13d
addq %r12, %rdi
movslq 0x30(%rbx), %rsi
callq 0x424e
incq %r13
movq 0xf8(%rbx), %rdi
movq 0x100(%rbx), %rax
subq %rdi, %rax
sarq $0x3, %rax
imulq %r15, %rax
addq $0x18, %r12
cmpq %r13, %rax
ja 0x381c
leaq 0x110(%rbx), %rdi
movslq 0x376d9(%rip), %rsi     # 0x3af34
callq 0x4212
movq 0x110(%rbx), %rdi
cmpq %rdi, 0x118(%rbx)
je 0x38a7
xorl %r12d, %r12d
xorl %r13d, %r13d
addq %r12, %rdi
movslq 0x30(%rbx), %rsi
callq 0x424e
incq %r13
movq 0x110(%rbx), %rdi
movq 0x118(%rbx), %rax
subq %rdi, %rax
sarq $0x3, %rax
imulq %r15, %rax
addq $0x18, %r12
cmpq %r13, %rax
ja 0x3876
movl 0x37683(%rip), %ecx     # 0x3af30
testl %ecx, %ecx
jle 0x397f
movl 0x30(%rbx), %eax
xorl %r15d, %r15d
testl %eax, %eax
jle 0x3970
leaq (%r15,%r15,2), %r12
xorl %r13d, %r13d
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
ucomisd 0x3767(%rip), %xmm0     # 0x7040
movsd %xmm0, 0x8(%rsp)
jb 0x38ea
xorps %xmm4, %xmm4
sqrtsd %xmm0, %xmm4
jmp 0x38f3
callq 0x2150
movapd %xmm0, %xmm4
xorps %xmm0, %xmm0
cvtsi2sdl 0x30(%rbx), %xmm0
ucomisd 0x373d(%rip), %xmm0     # 0x7040
jb 0x390b
sqrtsd %xmm0, %xmm0
jmp 0x391a
movsd %xmm4, (%rsp)
callq 0x2150
movsd (%rsp), %xmm4
movsd 0x3716(%rip), %xmm3     # 0x7038
divsd %xmm0, %xmm3
movsd 0x36f2(%rip), %xmm1     # 0x7020
divsd 0x8(%rsp), %xmm1
movsd 0x36f4(%rip), %xmm2     # 0x7030
divsd %xmm4, %xmm2
xorpd %xmm0, %xmm0
callq 0x2797
movq 0xc8(%rbx), %rax
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
movslq 0x30(%rbx), %rax
cmpq %rax, %r13
jl 0x38ca
movl 0x375c0(%rip), %ecx     # 0x3af30
incq %r15
movslq %ecx, %rdx
cmpq %rdx, %r15
jl 0x38bb
cmpl $0x0, 0x375ae(%rip)     # 0x3af34
jle 0x3a65
xorl %r15d, %r15d
movl 0x30(%rbx), %eax
leaq (%r15,%r15,2), %r12
testl %eax, %eax
jle 0x3a43
xorl %r13d, %r13d
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
ucomisd 0x3690(%rip), %xmm0     # 0x7040
movsd %xmm0, 0x8(%rsp)
jb 0x39c1
xorps %xmm4, %xmm4
sqrtsd %xmm0, %xmm4
jmp 0x39ca
callq 0x2150
movapd %xmm0, %xmm4
xorps %xmm0, %xmm0
cvtsi2sdl 0x30(%rbx), %xmm0
ucomisd 0x3666(%rip), %xmm0     # 0x7040
jb 0x39e2
sqrtsd %xmm0, %xmm0
jmp 0x39f1
movsd %xmm4, (%rsp)
callq 0x2150
movsd (%rsp), %xmm4
movsd 0x363f(%rip), %xmm3     # 0x7038
divsd %xmm0, %xmm3
movsd 0x361b(%rip), %xmm1     # 0x7020
divsd 0x8(%rsp), %xmm1
movsd 0x361d(%rip), %xmm2     # 0x7030
divsd %xmm4, %xmm2
xorpd %xmm0, %xmm0
callq 0x2797
movq 0xe0(%rbx), %rcx
movq (%rcx,%r12,8), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
movslq 0x30(%rbx), %rax
cmpq %rax, %r13
jl 0x39a1
jmp 0x3a46
movq (%r14), %rcx
leaq (%rcx,%r12,8), %rsi
movq %rbx, %rdi
callq 0x4280
incq %r15
movslq 0x374d8(%rip), %rax     # 0x3af34
cmpq %rax, %r15
jl 0x398f
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x430c