// File: IdelCoder[P]PTransE-ag/Train_PTransE-pos.cpp
// Function: Train::bfgs()
void bfgs()
    {
        // margin是损失函数L(h,r,t)使用的，margin_rel是损失函数L(p,r)使用的
        double margin = 1,margin_rel = 1;
        cout<<"margin="<<' '<<margin<<"margin_rel="<<margin_rel<<endl;
        cout <<"positive_margin="<< " " << positive_margin <<endl;
        res=0;
        // mini-batch中每一批的样本量
        int nbatches=100;
        // 可能等同于nepoch，迭代的轮数
        int neval = 500;
        int batchsize = fb_h.size()/nbatches;
 		relation_tmp=relation_vec;
		entity_tmp = entity_vec;
		map<string, int> fb_count;
        for (int eval=0; eval<neval; eval++)
        {
            // 每轮迭代
        	res=0;
            positive_margin_count = 0;
         	for (int batch = 0; batch<nbatches; batch++)
         	{
                // 每一批次，都随机选择一个头结点（似乎没有使用）
				int e1 = rand_max(entity_num);
         		for (int k=0; k<batchsize; k++)
         		{
                    // 每个样本
					int j=rand_max(entity_num);
					int i=rand_max(fb_h.size());
                    // fb_h，fb_r，fb_l的索引都是三元组的索引，相同索引，就是同一个三元组
					int e1 = fb_h[i], rel = fb_r[i], e2  = fb_l[i];


					int rand_tmp = rand()%100;
					if (rand_tmp<25)
					{
                        // ok的类型是map<pair<int,int>, map<int,int> >
						while (ok[make_pair(e1,rel)].count(j)>0)
                            j=rand_max(entity_num);
                        train_kb(e1,e2,rel,e1,j,rel,margin);
                        // 替换尾实体
                        int candidate_size = givenHeadRel[to_string(e1) + "_" + to_string(rel)].size();
                        if(candidate_size > 1) {
                            j = givenHeadRel[to_string(e1) + "_" + to_string(rel)][rand() % candidate_size];
                            while (j == e2) {
                                j = givenHeadRel[to_string(e1) + "_" + to_string(rel)][rand() % candidate_size];
                            }

                            train_pos(e1, e2, rel, e1, j, rel, margin);
                        }


                        // 固定头结点和关系，随机出训练集中不存在的三元组来训练


					}
					else
					if (rand_tmp<50)
					{
						while (ok[make_pair(j,rel)].count(e2)>0)
                            j=rand_max(entity_num);
                        train_kb(e1,e2,rel,j,e2,rel,margin);
                        // 替换头实体
                        int candidate_size = givenTailRel[to_string(e2) + "_" + to_string(rel)].size();
                        if(candidate_size > 1) {
                            j = givenTailRel[to_string(e2) + "_" + to_string(rel)][rand() % candidate_size];
                            while (j == e1) {
                                j = givenTailRel[to_string(e2) + "_" + to_string(rel)][rand() % candidate_size];
                            }


                            train_pos(e1,e2,rel,j,e2,rel,margin);
                        }



					}
					else
					{
                        // rand_tmp [50, 100)
						int rel_neg = rand_max(relation_num);
						while (ok[make_pair(e1,rel_neg)].count(e2)>0)
                            rel_neg = rand_max(relation_num);
                        train_kb(e1,e2,rel,e1,e2,rel_neg,margin);

					}
                    // fb_path的类型vector<vector<pair<vector<int>,double> > >
					if (fb_path[i].size()>0)
					{
                        // 这个三元组存在其他路径
                        // relation_num包括了逆关系
						int rel_neg = rand_max(relation_num);
						while (ok[make_pair(e1,rel_neg)].count(e2)>0)
							rel_neg = rand_max(relation_num);
                        // 随机出一个不存在的三元组
						for (int path_id = 0; path_id<fb_path[i].size(); path_id++)
						{
                            // 遍历第i个三元组对应的每一条路径
                            // fb_path类型vector<vector<pair<vector<int>,double> > >
                            // rel_path 就是某条路径所组成的关系的数组
							vector<int> rel_path = fb_path[i][path_id].first;
							string  s = "";
                            // path2s的类型是map<vector<int>,string>
							if (path2s.count(rel_path)==0)
							{
							    ostringstream oss;//创建一个流
                                // 将这些数组组合成一个路径的字符串
								for (int ii=0; ii<rel_path.size(); ii++)
								{
									oss<<rel_path[ii]<<" ";
								}
							    s=oss.str();//
                                // path2s的key是路径的关系数组，value是关系数组转成的字符串
								path2s[rel_path] = s;
							}
                            // s是路径的字符串
							s = path2s[rel_path];
                            // pr是每条路径的概率
							double pr = fb_path[i][path_id].second;
                            // pr_path是路径的置信度
							double pr_path = 0;
							if (path_confidence.count(make_pair(s,rel))>0)
								pr_path = path_confidence[make_pair(s,rel)];
							pr_path = 0.99*pr_path + 0.01;
                            // rel是三元组实际存在的关系，rel_neg是这个三元组两个实体间不存在的关系
                            // rel_path是这个关系对应的一个路径
							train_path(rel,rel_neg,rel_path,2*margin,pr*pr_path);
						}
					}
                    // e1,e2,rel组成了这个三元组，j则是用来替换头或者尾的实体，构成一个corrupted triplets
					norm(relation_tmp[rel]);
            		norm(entity_tmp[e1]);
            		norm(entity_tmp[e2]);
            		norm(entity_tmp[j]);
                    // 这句话也没有效果
					e1 = e2;
         		}
                // 每一批迭代过后，更新relation_vec和entity_vec
	            relation_vec = relation_tmp;
	            entity_vec = entity_tmp;
         	}
            // 每一轮迭代过后，记录实体和关系的向量
            cout<<"eval:"<<eval<<' '<<res<<' '<<positive_margin_count<<endl;
            FILE* f2 = fopen(("relation2vec.txt"+version).c_str(),"w");
            FILE* f3 = fopen(("entity2vec.txt"+version).c_str(),"w");
            // 每一行对应一个关系的向量
            for (int i=0; i<relation_num; i++)
            {
                for (int ii=0; ii<n; ii++)
                    fprintf(f2,"%.6lf\t",relation_vec[i][ii]);
                fprintf(f2,"\n");
            }
            for (int i=0; i<entity_num; i++)
            {
                for (int ii=0; ii<n; ii++)
                    fprintf(f3,"%.6lf\t",entity_vec[i][ii]);
                fprintf(f3,"\n");
            }
            fclose(f2);
            fclose(f3);
        }//所有epoch结束
    }

// Assembly:
subq $0x838, %rsp            # imm = 0x838
movq %rdi, 0x830(%rsp)
movq 0x830(%rsp), %rax
movq %rax, 0x1a8(%rsp)
movsd 0xe379(%rip), %xmm0     # 0x1a020
movsd %xmm0, 0x828(%rsp)
movsd 0xe368(%rip), %xmm0     # 0x1a020
movsd %xmm0, 0x820(%rsp)
movq 0x19310(%rip), %rdi     # 0x24fd8
leaq 0xe495(%rip), %rsi      # 0x1a164
callq 0x21f0
movq %rax, %rdi
movl $0x20, %esi
callq 0x2260
movq %rax, %rdi
movsd 0x828(%rsp), %xmm0
callq 0x23b0
movq %rax, %rdi
leaq 0xe453(%rip), %rsi      # 0x1a14f
callq 0x21f0
movq %rax, %rdi
movsd 0x820(%rsp), %xmm0
callq 0x23b0
movq %rax, %rdi
movq 0x192a4(%rip), %rsi     # 0x24fc0
callq 0x2240
movq 0x192b0(%rip), %rdi     # 0x24fd8
leaq 0xe42c(%rip), %rsi      # 0x1a15b
callq 0x21f0
movq %rax, %rdi
leaq 0xe3cf(%rip), %rsi      # 0x1a10d
callq 0x21f0
movq %rax, %rdi
movsd 0x1961a(%rip), %xmm0    # 0x25368
callq 0x23b0
movq %rax, %rdi
movq 0x19263(%rip), %rsi     # 0x24fc0
callq 0x2240
movq 0x1a8(%rsp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, 0x38(%rdi)
movl $0x64, 0x81c(%rsp)
movl $0x1f4, 0x818(%rsp) # imm = 0x1F4
addq $0x68, %rdi
callq 0x8450
movq 0x1a8(%rsp), %rdi
movslq 0x81c(%rsp), %rcx
xorl %edx, %edx
divq %rcx
movl %eax, 0x814(%rsp)
movq %rdi, %rsi
addq $0xe0, %rsi
addq $0x110, %rdi            # imm = 0x110
callq 0xeb30
movq 0x1a8(%rsp), %rdi
movq %rdi, %rsi
addq $0xf8, %rsi
addq $0x128, %rdi            # imm = 0x128
callq 0xeb30
leaq 0x7e0(%rsp), %rdi
callq 0x48b0
movl $0x0, 0x7dc(%rsp)
movl 0x7dc(%rsp), %eax
cmpl 0x818(%rsp), %eax
jge 0xd6fe
movq 0x1a8(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x38(%rax)
movl $0x0, 0x40(%rax)
movl $0x0, 0x7d8(%rsp)
movl 0x7d8(%rsp), %eax
cmpl 0x81c(%rsp), %eax
jge 0xd381
movq 0x1a8(%rsp), %rdi
movl 0x62903(%rip), %esi     # 0x6e754
callq 0xedf0
movl %eax, 0x1a4(%rsp)
jmp 0xbe5f
movl 0x1a4(%rsp), %eax
movl %eax, 0x7d4(%rsp)
movl $0x0, 0x7c0(%rsp)
movl 0x7c0(%rsp), %eax
cmpl 0x814(%rsp), %eax
jge 0xd329
movq 0x1a8(%rsp), %rdi
movl 0x628ba(%rip), %esi     # 0x6e754
callq 0xedf0
movl %eax, 0x1a0(%rsp)
jmp 0xbea8
movq 0x1a8(%rsp), %rdi
movl 0x1a0(%rsp), %eax
movl %eax, 0x7bc(%rsp)
addq $0x68, %rdi
callq 0x8450
movq 0x1a8(%rsp), %rdi
movl %eax, %esi
callq 0xedf0
movl %eax, 0x19c(%rsp)
jmp 0xbedf
movq 0x1a8(%rsp), %rdi
movl 0x19c(%rsp), %eax
movl %eax, 0x7b8(%rsp)
addq $0x68, %rdi
movslq 0x7b8(%rsp), %rsi
callq 0xee40
movq 0x1a8(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x7b4(%rsp)
addq $0x98, %rdi
movslq 0x7b8(%rsp), %rsi
callq 0xee40
movq 0x1a8(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x7b0(%rsp)
addq $0x80, %rdi
movslq 0x7b8(%rsp), %rsi
callq 0xee40
movl (%rax), %eax
movl %eax, 0x7ac(%rsp)
callq 0x2090
movl $0x64, %ecx
cltd
idivl %ecx
movl %edx, 0x7a8(%rsp)
cmpl $0x19, 0x7a8(%rsp)
jge 0xc546
jmp 0xbf7d
movq 0x1a8(%rsp), %rax
movq %rax, 0x188(%rsp)
leaq 0x7b4(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
callq 0x8dc0
movq %rax, 0x190(%rsp)
jmp 0xbfac
movq 0x188(%rsp), %rdi
movq 0x190(%rsp), %rax
movq %rax, 0x7a0(%rsp)
leaq 0x7a0(%rsp), %rsi
callq 0x8cd0
movq %rax, 0x180(%rsp)
jmp 0xbfdb
movq 0x180(%rsp), %rdi
leaq 0x7bc(%rsp), %rsi
callq 0xee60
movq %rax, 0x178(%rsp)
jmp 0xbffa
movq 0x178(%rsp), %rax
cmpq $0x0, %rax
jbe 0xc050
movq 0x1a8(%rsp), %rdi
movl 0x6273e(%rip), %esi     # 0x6e754
callq 0xedf0
movl %eax, 0x174(%rsp)
jmp 0xc024
movl 0x174(%rsp), %eax
movl %eax, 0x7bc(%rsp)
jmp 0xbf7d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xd713
movq 0x1a8(%rsp), %rdi
movl 0x7b4(%rsp), %r8d
movl 0x7ac(%rsp), %edx
movl 0x7b0(%rsp), %ecx
movl 0x7bc(%rsp), %r9d
movsd 0x828(%rsp), %xmm0
movq %rsp, %rax
movl %ecx, (%rax)
movl %r8d, %esi
callq 0xeec0
jmp 0xc08e
movl 0x7b4(%rsp), %esi
leaq 0x738(%rsp), %rdi
callq 0x5020
jmp 0xc0a4
leaq 0xe01a(%rip), %rdx      # 0x1a0c5
leaq 0x758(%rsp), %rdi
leaq 0x738(%rsp), %rsi
callq 0x4ae0
jmp 0xc0c2
movl 0x7b0(%rsp), %esi
leaq 0x718(%rsp), %rdi
callq 0x5020
jmp 0xc0d8
leaq 0x778(%rsp), %rdi
leaq 0x758(%rsp), %rsi
leaq 0x718(%rsp), %rdx
callq 0x4f30
jmp 0xc0f7
leaq 0x1919a(%rip), %rdi     # 0x25298
leaq 0x778(%rsp), %rsi
callq 0xefa0
movq %rax, 0x168(%rsp)
jmp 0xc115
movq 0x168(%rsp), %rdi
callq 0x8450
movl %eax, 0x164(%rsp)
leaq 0x778(%rsp), %rdi
callq 0x23f8
leaq 0x718(%rsp), %rdi
callq 0x23f8
leaq 0x758(%rsp), %rdi
callq 0x23f8
leaq 0x738(%rsp), %rdi
callq 0x23f8
movl 0x164(%rsp), %eax
movl %eax, 0x79c(%rsp)
cmpl $0x1, 0x79c(%rsp)
jle 0xc541
movl 0x7b4(%rsp), %esi
leaq 0x6b8(%rsp), %rdi
callq 0x5020
jmp 0xc18f
leaq 0xdf2f(%rip), %rdx      # 0x1a0c5
leaq 0x6d8(%rsp), %rdi
leaq 0x6b8(%rsp), %rsi
callq 0x4ae0
jmp 0xc1ad
movl 0x7b0(%rsp), %esi
leaq 0x698(%rsp), %rdi
callq 0x5020
jmp 0xc1c3
leaq 0x6f8(%rsp), %rdi
leaq 0x6d8(%rsp), %rsi
leaq 0x698(%rsp), %rdx
callq 0x4f30
jmp 0xc1e2
leaq 0x190af(%rip), %rdi     # 0x25298
leaq 0x6f8(%rsp), %rsi
callq 0xefa0
movq %rax, 0x158(%rsp)
jmp 0xc200
callq 0x2090
movq 0x158(%rsp), %rdi
cltd
idivl 0x79c(%rsp)
movslq %edx, %rsi
callq 0xee40
movl (%rax), %eax
movl %eax, 0x7bc(%rsp)
leaq 0x6f8(%rsp), %rdi
callq 0x23f8
leaq 0x698(%rsp), %rdi
callq 0x23f8
leaq 0x6d8(%rsp), %rdi
callq 0x23f8
leaq 0x6b8(%rsp), %rdi
callq 0x23f8
movl 0x7bc(%rsp), %eax
cmpl 0x7ac(%rsp), %eax
jne 0xc501
movl 0x7b4(%rsp), %esi
leaq 0x638(%rsp), %rdi
callq 0x5020
jmp 0xc284
leaq 0xde3a(%rip), %rdx      # 0x1a0c5
leaq 0x658(%rsp), %rdi
leaq 0x638(%rsp), %rsi
callq 0x4ae0
jmp 0xc2a2
movl 0x7b0(%rsp), %esi
leaq 0x618(%rsp), %rdi
callq 0x5020
jmp 0xc2b8
leaq 0x678(%rsp), %rdi
leaq 0x658(%rsp), %rsi
leaq 0x618(%rsp), %rdx
callq 0x4f30
jmp 0xc2d7
leaq 0x18fba(%rip), %rdi     # 0x25298
leaq 0x678(%rsp), %rsi
callq 0xefa0
movq %rax, 0x150(%rsp)
jmp 0xc2f5
callq 0x2090
movq 0x150(%rsp), %rdi
cltd
idivl 0x79c(%rsp)
movslq %edx, %rsi
callq 0xee40
movl (%rax), %eax
movl %eax, 0x7bc(%rsp)
leaq 0x678(%rsp), %rdi
callq 0x23f8
leaq 0x618(%rsp), %rdi
callq 0x23f8
leaq 0x658(%rsp), %rdi
callq 0x23f8
leaq 0x638(%rsp), %rdi
callq 0x23f8
jmp 0xc25a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xc3d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xc3c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xc3b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
leaq 0x778(%rsp), %rdi
callq 0x23f8
leaq 0x718(%rsp), %rdi
callq 0x23f8
leaq 0x758(%rsp), %rdi
callq 0x23f8
leaq 0x738(%rsp), %rdi
callq 0x23f8
jmp 0xd713
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xc460
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xc453
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xc446
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
leaq 0x6f8(%rsp), %rdi
callq 0x23f8
leaq 0x698(%rsp), %rdi
callq 0x23f8
leaq 0x6d8(%rsp), %rdi
callq 0x23f8
leaq 0x6b8(%rsp), %rdi
callq 0x23f8
jmp 0xd713
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xc4ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xc4e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xc4d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
leaq 0x678(%rsp), %rdi
callq 0x23f8
leaq 0x618(%rsp), %rdi
callq 0x23f8
leaq 0x658(%rsp), %rdi
callq 0x23f8
leaq 0x638(%rsp), %rdi
callq 0x23f8
jmp 0xd713
movq 0x1a8(%rsp), %rdi
movl 0x7b4(%rsp), %r8d
movl 0x7ac(%rsp), %edx
movl 0x7b0(%rsp), %ecx
movl 0x7bc(%rsp), %r9d
movsd 0x828(%rsp), %xmm0
movq %rsp, %rax
movl %ecx, (%rax)
movl %r8d, %esi
callq 0xf090
jmp 0xc53f
jmp 0xc541
jmp 0xcc2f
cmpl $0x32, 0x7a8(%rsp)
jge 0xcb06
jmp 0xc556
movq 0x1a8(%rsp), %rax
movq %rax, 0x140(%rsp)
leaq 0x7bc(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
callq 0x8dc0
movq %rax, 0x148(%rsp)
jmp 0xc585
movq 0x140(%rsp), %rdi
movq 0x148(%rsp), %rax
movq %rax, 0x610(%rsp)
leaq 0x610(%rsp), %rsi
callq 0x8cd0
movq %rax, 0x138(%rsp)
jmp 0xc5b4
movq 0x138(%rsp), %rdi
leaq 0x7ac(%rsp), %rsi
callq 0xee60
movq %rax, 0x130(%rsp)
jmp 0xc5d3
movq 0x130(%rsp), %rax
cmpq $0x0, %rax
jbe 0xc610
movq 0x1a8(%rsp), %rdi
movl 0x62165(%rip), %esi     # 0x6e754
callq 0xedf0
movl %eax, 0x12c(%rsp)
jmp 0xc5fd
movl 0x12c(%rsp), %eax
movl %eax, 0x7bc(%rsp)
jmp 0xc556
movq 0x1a8(%rsp), %rdi
movl 0x7b4(%rsp), %esi
movl 0x7ac(%rsp), %r9d
movl 0x7b0(%rsp), %ecx
movl 0x7bc(%rsp), %r8d
movsd 0x828(%rsp), %xmm0
movq %rsp, %rax
movl %ecx, (%rax)
movl %r9d, %edx
callq 0xeec0
jmp 0xc64e
movl 0x7ac(%rsp), %esi
leaq 0x5a8(%rsp), %rdi
callq 0x5020
jmp 0xc664
leaq 0xda5a(%rip), %rdx      # 0x1a0c5
leaq 0x5c8(%rsp), %rdi
leaq 0x5a8(%rsp), %rsi
callq 0x4ae0
jmp 0xc682
movl 0x7b0(%rsp), %esi
leaq 0x588(%rsp), %rdi
callq 0x5020
jmp 0xc698
leaq 0x5e8(%rsp), %rdi
leaq 0x5c8(%rsp), %rsi
leaq 0x588(%rsp), %rdx
callq 0x4f30
jmp 0xc6b7
leaq 0x18c0a(%rip), %rdi     # 0x252c8
leaq 0x5e8(%rsp), %rsi
callq 0xefa0
movq %rax, 0x120(%rsp)
jmp 0xc6d5
movq 0x120(%rsp), %rdi
callq 0x8450
movl %eax, 0x11c(%rsp)
leaq 0x5e8(%rsp), %rdi
callq 0x23f8
leaq 0x588(%rsp), %rdi
callq 0x23f8
leaq 0x5c8(%rsp), %rdi
callq 0x23f8
leaq 0x5a8(%rsp), %rdi
callq 0x23f8
movl 0x11c(%rsp), %eax
movl %eax, 0x60c(%rsp)
cmpl $0x1, 0x60c(%rsp)
jle 0xcb01
movl 0x7ac(%rsp), %esi
leaq 0x528(%rsp), %rdi
callq 0x5020
jmp 0xc74f
leaq 0xd96f(%rip), %rdx      # 0x1a0c5
leaq 0x548(%rsp), %rdi
leaq 0x528(%rsp), %rsi
callq 0x4ae0
jmp 0xc76d
movl 0x7b0(%rsp), %esi
leaq 0x508(%rsp), %rdi
callq 0x5020
jmp 0xc783
leaq 0x568(%rsp), %rdi
leaq 0x548(%rsp), %rsi
leaq 0x508(%rsp), %rdx
callq 0x4f30
jmp 0xc7a2
leaq 0x18b1f(%rip), %rdi     # 0x252c8
leaq 0x568(%rsp), %rsi
callq 0xefa0
movq %rax, 0x110(%rsp)
jmp 0xc7c0
callq 0x2090
movq 0x110(%rsp), %rdi
cltd
idivl 0x60c(%rsp)
movslq %edx, %rsi
callq 0xee40
movl (%rax), %eax
movl %eax, 0x7bc(%rsp)
leaq 0x568(%rsp), %rdi
callq 0x23f8
leaq 0x508(%rsp), %rdi
callq 0x23f8
leaq 0x548(%rsp), %rdi
callq 0x23f8
leaq 0x528(%rsp), %rdi
callq 0x23f8
movl 0x7bc(%rsp), %eax
cmpl 0x7b4(%rsp), %eax
jne 0xcac1
movl 0x7ac(%rsp), %esi
leaq 0x4a8(%rsp), %rdi
callq 0x5020
jmp 0xc844
leaq 0xd87a(%rip), %rdx      # 0x1a0c5
leaq 0x4c8(%rsp), %rdi
leaq 0x4a8(%rsp), %rsi
callq 0x4ae0
jmp 0xc862
movl 0x7b0(%rsp), %esi
leaq 0x488(%rsp), %rdi
callq 0x5020
jmp 0xc878
leaq 0x4e8(%rsp), %rdi
leaq 0x4c8(%rsp), %rsi
leaq 0x488(%rsp), %rdx
callq 0x4f30
jmp 0xc897
leaq 0x18a2a(%rip), %rdi     # 0x252c8
leaq 0x4e8(%rsp), %rsi
callq 0xefa0
movq %rax, 0x108(%rsp)
jmp 0xc8b5
callq 0x2090
movq 0x108(%rsp), %rdi
cltd
idivl 0x60c(%rsp)
movslq %edx, %rsi
callq 0xee40
movl (%rax), %eax
movl %eax, 0x7bc(%rsp)
leaq 0x4e8(%rsp), %rdi
callq 0x23f8
leaq 0x488(%rsp), %rdi
callq 0x23f8
leaq 0x4c8(%rsp), %rdi
callq 0x23f8
leaq 0x4a8(%rsp), %rdi
callq 0x23f8
jmp 0xc81a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xc991
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xc984
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xc977
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
leaq 0x5e8(%rsp), %rdi
callq 0x23f8
leaq 0x588(%rsp), %rdi
callq 0x23f8
leaq 0x5c8(%rsp), %rdi
callq 0x23f8
leaq 0x5a8(%rsp), %rdi
callq 0x23f8
jmp 0xd713
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xca20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xca13
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xca06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
leaq 0x568(%rsp), %rdi
callq 0x23f8
leaq 0x508(%rsp), %rdi
callq 0x23f8
leaq 0x548(%rsp), %rdi
callq 0x23f8
leaq 0x528(%rsp), %rdi
callq 0x23f8
jmp 0xd713
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xcaaf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xcaa2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xca95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
leaq 0x4e8(%rsp), %rdi
callq 0x23f8
leaq 0x488(%rsp), %rdi
callq 0x23f8
leaq 0x4c8(%rsp), %rdi
callq 0x23f8
leaq 0x4a8(%rsp), %rdi
callq 0x23f8
jmp 0xd713
movq 0x1a8(%rsp), %rdi
movl 0x7b4(%rsp), %esi
movl 0x7ac(%rsp), %r9d
movl 0x7b0(%rsp), %ecx
movl 0x7bc(%rsp), %r8d
movsd 0x828(%rsp), %xmm0
movq %rsp, %rax
movl %ecx, (%rax)
movl %r9d, %edx
callq 0xf090
jmp 0xcaff
jmp 0xcb01
jmp 0xcc2d
movq 0x1a8(%rsp), %rdi
movl 0x61c3c(%rip), %esi     # 0x6e750
callq 0xedf0
movl %eax, 0x104(%rsp)
jmp 0xcb22
movl 0x104(%rsp), %eax
movl %eax, 0x484(%rsp)
movq 0x1a8(%rsp), %rax
movq %rax, 0xf0(%rsp)
leaq 0x7b4(%rsp), %rdi
leaq 0x484(%rsp), %rsi
callq 0x8dc0
movq %rax, 0xf8(%rsp)
jmp 0xcb5f
movq 0xf0(%rsp), %rdi
movq 0xf8(%rsp), %rax
movq %rax, 0x47c(%rsp)
leaq 0x47c(%rsp), %rsi
callq 0x8cd0
movq %rax, 0xe8(%rsp)
jmp 0xcb8e
movq 0xe8(%rsp), %rdi
leaq 0x7ac(%rsp), %rsi
callq 0xee60
movq %rax, 0xe0(%rsp)
jmp 0xcbad
movq 0xe0(%rsp), %rax
cmpq $0x0, %rax
jbe 0xcbea
movq 0x1a8(%rsp), %rdi
movl 0x61b87(%rip), %esi     # 0x6e750
callq 0xedf0
movl %eax, 0xdc(%rsp)
jmp 0xcbd7
movl 0xdc(%rsp), %eax
movl %eax, 0x484(%rsp)
jmp 0xcb30
movq 0x1a8(%rsp), %rdi
movl 0x7b4(%rsp), %r8d
movl 0x7ac(%rsp), %r9d
movl 0x7b0(%rsp), %ecx
movl 0x484(%rsp), %edx
movsd 0x828(%rsp), %xmm0
movq %rsp, %rax
movl %edx, (%rax)
movl %r8d, %esi
movl %r9d, %edx
callq 0xeec0
jmp 0xcc2b
jmp 0xcc2d
jmp 0xcc2f
movq 0x1a8(%rsp), %rdi
addq $0xb0, %rdi
movslq 0x7b8(%rsp), %rsi
callq 0xf1e0
movq %rax, %rdi
callq 0xf200
cmpq $0x0, %rax
jbe 0xd255
movq 0x1a8(%rsp), %rdi
movl 0x61ae5(%rip), %esi     # 0x6e750
callq 0xedf0
movl %eax, 0xd8(%rsp)
jmp 0xcc79
movl 0xd8(%rsp), %eax
movl %eax, 0x478(%rsp)
movq 0x1a8(%rsp), %rax
movq %rax, 0xc8(%rsp)
leaq 0x7b4(%rsp), %rdi
leaq 0x478(%rsp), %rsi
callq 0x8dc0
movq %rax, 0xd0(%rsp)
jmp 0xccb6
movq 0xc8(%rsp), %rdi
movq 0xd0(%rsp), %rax
movq %rax, 0x470(%rsp)
leaq 0x470(%rsp), %rsi
callq 0x8cd0
movq %rax, 0xc0(%rsp)
jmp 0xcce5
movq 0xc0(%rsp), %rdi
leaq 0x7ac(%rsp), %rsi
callq 0xee60
movq %rax, 0xb8(%rsp)
jmp 0xcd04
movq 0xb8(%rsp), %rax
cmpq $0x0, %rax
jbe 0xcd41
movq 0x1a8(%rsp), %rdi
movl 0x61a30(%rip), %esi     # 0x6e750
callq 0xedf0
movl %eax, 0xb4(%rsp)
jmp 0xcd2e
movl 0xb4(%rsp), %eax
movl %eax, 0x478(%rsp)
jmp 0xcc87
movl $0x0, 0x46c(%rsp)
movq 0x1a8(%rsp), %rdi
movslq 0x46c(%rsp), %rax
movq %rax, 0xa8(%rsp)
addq $0xb0, %rdi
movslq 0x7b8(%rsp), %rsi
callq 0xf1e0
movq %rax, %rdi
callq 0xf200
movq %rax, %rcx
movq 0xa8(%rsp), %rax
cmpq %rcx, %rax
jae 0xd253
movq 0x1a8(%rsp), %rdi
addq $0xb0, %rdi
movslq 0x7b8(%rsp), %rsi
callq 0xf1e0
movq %rax, %rdi
movslq 0x46c(%rsp), %rsi
callq 0xf220
movq %rax, %rsi
leaq 0x450(%rsp), %rdi
callq 0x8350
jmp 0xcdd2
leaq 0x42f(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0x2380
movq 0xa0(%rsp), %rdx
leaq 0xd3a4(%rip), %rsi      # 0x1a19a
leaq 0x430(%rsp), %rdi
callq 0x22c0
jmp 0xce05
leaq 0x42f(%rsp), %rdi
callq 0x2250
leaq 0x1841f(%rip), %rdi     # 0x25238
leaq 0x450(%rsp), %rsi
callq 0xf240
movq %rax, 0x98(%rsp)
jmp 0xce30
movq 0x98(%rsp), %rax
cmpq $0x0, %rax
jne 0xcfcb
leaq 0x2b0(%rsp), %rdi
callq 0x22a0
jmp 0xce51
movl $0x0, 0x2ac(%rsp)
movslq 0x2ac(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x450(%rsp), %rdi
callq 0x8450
movq %rax, %rcx
movq 0x90(%rsp), %rax
cmpq %rcx, %rax
jae 0xcf4e
movslq 0x2ac(%rsp), %rsi
leaq 0x450(%rsp), %rdi
callq 0xee40
movl (%rax), %esi
leaq 0x2b0(%rsp), %rdi
callq 0x2360
movq %rax, 0x88(%rsp)
jmp 0xcebb
movq 0x88(%rsp), %rdi
leaq 0xd243(%rip), %rsi      # 0x1a10d
callq 0x21f0
jmp 0xced1
jmp 0xced3
movl 0x2ac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2ac(%rsp)
jmp 0xce5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
leaq 0x42f(%rsp), %rdi
callq 0x2250
jmp 0xd241
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
jmp 0xd234
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
leaq 0x2b0(%rsp), %rdi
callq 0x2080
jmp 0xd234
leaq 0x288(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
callq 0x2220
jmp 0xcf65
leaq 0x430(%rsp), %rdi
leaq 0x288(%rsp), %rsi
movq %rsi, 0x78(%rsp)
callq 0x2280
movq 0x78(%rsp), %rdi
callq 0x23f8
leaq 0x182a8(%rip), %rdi     # 0x25238
leaq 0x450(%rsp), %rsi
callq 0xf2a0
movq %rax, 0x80(%rsp)
jmp 0xcfa7
movq 0x80(%rsp), %rdi
leaq 0x430(%rsp), %rsi
callq 0x2050
jmp 0xcfbe
leaq 0x2b0(%rsp), %rdi
callq 0x2080
leaq 0x18266(%rip), %rdi     # 0x25238
leaq 0x450(%rsp), %rsi
callq 0xf2a0
movq %rax, 0x70(%rsp)
jmp 0xcfe6
movq 0x70(%rsp), %rsi
leaq 0x430(%rsp), %rdi
callq 0x2050
jmp 0xcffa
movq 0x1a8(%rsp), %rdi
addq $0xb0, %rdi
movslq 0x7b8(%rsp), %rsi
callq 0xf1e0
movq %rax, %rdi
movslq 0x46c(%rsp), %rsi
callq 0xf220
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x280(%rsp)
movq $0x0, 0x278(%rsp)
leaq 0x250(%rsp), %rdi
leaq 0x430(%rsp), %rsi
leaq 0x7b0(%rsp), %rdx
callq 0x5860
jmp 0xd05f
leaq 0x18202(%rip), %rdi     # 0x25268
leaq 0x250(%rsp), %rsi
callq 0xf390
movq %rax, 0x68(%rsp)
jmp 0xd07a
leaq 0x250(%rsp), %rdi
callq 0x58a0
movq 0x68(%rsp), %rax
cmpq $0x0, %rax
jbe 0xd13d
leaq 0x228(%rsp), %rdi
leaq 0x430(%rsp), %rsi
leaq 0x7b0(%rsp), %rdx
callq 0x5860
jmp 0xd0b5
leaq 0x181ac(%rip), %rdi     # 0x25268
leaq 0x228(%rsp), %rsi
callq 0x5770
movq %rax, 0x60(%rsp)
jmp 0xd0d0
movq 0x60(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x278(%rsp)
leaq 0x228(%rsp), %rdi
callq 0x58a0
jmp 0xd13d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
leaq 0x250(%rsp), %rdi
callq 0x58a0
jmp 0xd234
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
leaq 0x228(%rsp), %rdi
callq 0x58a0
jmp 0xd234
movsd 0x278(%rsp), %xmm0
movsd 0xcefa(%rip), %xmm1     # 0x1a048
mulsd %xmm1, %xmm0
movsd 0xcef6(%rip), %xmm1     # 0x1a050
addsd %xmm1, %xmm0
movsd %xmm0, 0x278(%rsp)
movl 0x7b0(%rsp), %eax
movl %eax, 0x58(%rsp)
movl 0x478(%rsp), %eax
movl %eax, 0x5c(%rsp)
leaq 0x210(%rsp), %rdi
leaq 0x450(%rsp), %rsi
callq 0x8350
jmp 0xd194
movl 0x5c(%rsp), %edx
movl 0x58(%rsp), %esi
movq 0x1a8(%rsp), %rdi
movsd 0x828(%rsp), %xmm0
addsd %xmm0, %xmm0
movsd 0x280(%rsp), %xmm1
movsd 0x278(%rsp), %xmm2
mulsd %xmm2, %xmm1
leaq 0x210(%rsp), %rcx
callq 0xf3f0
jmp 0xd1d6
leaq 0x210(%rsp), %rdi
callq 0x5350
leaq 0x430(%rsp), %rdi
callq 0x23f8
leaq 0x450(%rsp), %rdi
callq 0x5350
movl 0x46c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x46c(%rsp)
jmp 0xcd4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
leaq 0x210(%rsp), %rdi
callq 0x5350
leaq 0x430(%rsp), %rdi
callq 0x23f8
leaq 0x450(%rsp), %rdi
callq 0x5350
jmp 0xd713
jmp 0xd255
movq 0x1a8(%rsp), %rdi
addq $0x110, %rdi            # imm = 0x110
movslq 0x7b0(%rsp), %rsi
callq 0xbb00
movq 0x1a8(%rsp), %rdi
movq %rax, %rsi
callq 0xbbe0
movq 0x1a8(%rsp), %rdi
addq $0x128, %rdi            # imm = 0x128
movslq 0x7b4(%rsp), %rsi
callq 0xbb00
movq 0x1a8(%rsp), %rdi
movq %rax, %rsi
callq 0xbbe0
movq 0x1a8(%rsp), %rdi
addq $0x128, %rdi            # imm = 0x128
movslq 0x7ac(%rsp), %rsi
callq 0xbb00
movq 0x1a8(%rsp), %rdi
movq %rax, %rsi
callq 0xbbe0
movq 0x1a8(%rsp), %rdi
addq $0x128, %rdi            # imm = 0x128
movslq 0x7bc(%rsp), %rsi
callq 0xbb00
movq 0x1a8(%rsp), %rdi
movq %rax, %rsi
callq 0xbbe0
movl 0x7ac(%rsp), %eax
movl %eax, 0x7b4(%rsp)
movl 0x7c0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7c0(%rsp)
jmp 0xbe78
movq 0x1a8(%rsp), %rdi
movq %rdi, %rsi
addq $0x110, %rsi            # imm = 0x110
addq $0xe0, %rdi
callq 0xeb30
jmp 0xd349
movq 0x1a8(%rsp), %rdi
movq %rdi, %rsi
addq $0x128, %rsi            # imm = 0x128
addq $0xf8, %rdi
callq 0xeb30
jmp 0xd369
jmp 0xd36b
movl 0x7d8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7d8(%rsp)
jmp 0xbe2f
movq 0x17c50(%rip), %rdi     # 0x24fd8
leaq 0xcddd(%rip), %rsi      # 0x1a16c
callq 0x21f0
movq %rax, 0x50(%rsp)
jmp 0xd39b
movq 0x50(%rsp), %rdi
movl 0x7dc(%rsp), %esi
callq 0x2360
movq %rax, 0x48(%rsp)
jmp 0xd3b3
movq 0x48(%rsp), %rdi
movl $0x20, %esi
callq 0x2260
movq %rax, 0x40(%rsp)
jmp 0xd3c9
movq 0x40(%rsp), %rdi
movq 0x1a8(%rsp), %rax
movsd 0x38(%rax), %xmm0
callq 0x23b0
movq %rax, 0x38(%rsp)
jmp 0xd3e7
movq 0x38(%rsp), %rdi
movl $0x20, %esi
callq 0x2260
movq %rax, 0x30(%rsp)
jmp 0xd3fd
movq 0x30(%rsp), %rdi
movq 0x1a8(%rsp), %rax
movl 0x40(%rax), %esi
callq 0x2360
movq %rax, 0x28(%rsp)
jmp 0xd419
movq 0x28(%rsp), %rdi
movq 0x17b9b(%rip), %rsi     # 0x24fc0
callq 0x2240
jmp 0xd42c
leaq 0xcd3f(%rip), %rsi      # 0x1a172
leaq 0x17f0e(%rip), %rdx     # 0x25348
leaq 0x1e8(%rsp), %rdi
callq 0x4b30
jmp 0xd449
leaq 0x1e8(%rsp), %rdi
callq 0x20e0
movq %rax, %rdi
leaq 0xcd23(%rip), %rsi      # 0x1a183
callq 0x2270
movq %rax, 0x20(%rsp)
jmp 0xd46c
leaq 0x1e8(%rsp), %rdi
callq 0x23f8
movq 0x20(%rsp), %rax
movq %rax, 0x208(%rsp)
leaq 0xccf8(%rip), %rsi      # 0x1a185
leaq 0x17eb4(%rip), %rdx     # 0x25348
leaq 0x1c0(%rsp), %rdi
callq 0x4b30
jmp 0xd4a3
leaq 0x1c0(%rsp), %rdi
callq 0x20e0
movq %rax, %rdi
leaq 0xccc9(%rip), %rsi      # 0x1a183
callq 0x2270
movq %rax, 0x18(%rsp)
jmp 0xd4c6
leaq 0x1c0(%rsp), %rdi
callq 0x23f8
movq 0x18(%rsp), %rax
movq %rax, 0x1e0(%rsp)
movl $0x0, 0x1bc(%rsp)
movl 0x1bc(%rsp), %eax
cmpl 0x61258(%rip), %eax     # 0x6e750
jge 0xd5fc
movl $0x0, 0x1b8(%rsp)
movq 0x1a8(%rsp), %rcx
movl 0x1b8(%rsp), %eax
cmpl 0x30(%rcx), %eax
jge 0xd5d0
movq 0x1a8(%rsp), %rdi
movq 0x208(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0xe0, %rdi
movslq 0x1bc(%rsp), %rsi
callq 0xbb00
movq %rax, %rdi
movslq 0x1b8(%rsp), %rsi
callq 0x4890
movq 0x10(%rsp), %rdi
movsd (%rax), %xmm0
leaq 0xcc2a(%rip), %rsi      # 0x1a194
movb $0x1, %al
callq 0x22e0
movl 0x1b8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1b8(%rsp)
jmp 0xd509
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
leaq 0x1e8(%rsp), %rdi
callq 0x23f8
jmp 0xd713
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c8(%rsp)
movl %eax, 0x7c4(%rsp)
leaq 0x1c0(%rsp), %rdi
callq 0x23f8
jmp 0xd713
movq 0x208(%rsp), %rdi
leaq 0xcbbc(%rip), %rsi      # 0x1a19b
movb $0x0, %al
callq 0x22e0
movl 0x1bc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1bc(%rsp)
jmp 0xd4eb
movl $0x0, 0x1b4(%rsp)
movl 0x1b4(%rsp), %eax
cmpl 0x61140(%rip), %eax     # 0x6e754
jge 0xd6c8
movl $0x0, 0x1b0(%rsp)
movq 0x1a8(%rsp), %rcx
movl 0x1b0(%rsp), %eax
cmpl 0x30(%rcx), %eax
jge 0xd69c
movq 0x1a8(%rsp), %rdi
movq 0x1e0(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0xf8, %rdi
movslq 0x1b4(%rsp), %rsi
callq 0xbb00
movq %rax, %rdi
movslq 0x1b0(%rsp), %rsi
callq 0x4890
movq 0x8(%rsp), %rdi
movsd (%rax), %xmm0
leaq 0xcb12(%rip), %rsi      # 0x1a194
movb $0x1, %al
callq 0x22e0
movl 0x1b0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1b0(%rsp)
jmp 0xd625
movq 0x1e0(%rsp), %rdi
leaq 0xcaf0(%rip), %rsi      # 0x1a19b
movb $0x0, %al
callq 0x22e0
movl 0x1b4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1b4(%rsp)
jmp 0xd607
movq 0x208(%rsp), %rdi
callq 0x2200
jmp 0xd6d7
movq 0x1e0(%rsp), %rdi
callq 0x2200
jmp 0xd6e6
jmp 0xd6e8
movl 0x7dc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7dc(%rsp)
jmp 0xbdf9
leaq 0x7e0(%rsp), %rdi
callq 0x48c0
addq $0x838, %rsp            # imm = 0x838
retq
leaq 0x7e0(%rsp), %rdi
callq 0x48c0
movq 0x7c8(%rsp), %rdi
callq 0x2370
nopl (%rax)