// File: /workspace/github_cpp_makefile_star2_O2/IdelCoder[P]PTransE-ag/Train_PTransE-pos.cpp
// Function: prepare()
void prepare()
{

    FILE* f1 = fopen(("../" + dir + "/entity2id.txt").c_str(),"r");
	FILE* f2 = fopen(("../" + dir + "/relation2id.txt").c_str(),"r");
	int x;

	while (fscanf(f1,"%s%d",buf,&x)==2)
	{
		string st=buf;
        // map<string,int> key是实体名，value是实体id。
		entity2id[st]=x;
        // map<int,string> key是id，value是实体名
		id2entity[x]=st;
		entity_num++;
	}
	while (fscanf(f2,"%s%d",buf,&x)==2)
	{
		string st=buf;
		relation2id[st]=x;
        // key是id,value是关系名
		id2relation[x]=st;
        // id加上1345，对应到“-关系名”，1345表示有1345个关系（应该是针对于数据集FB15k的）
		id2relation[x+1345] = "-"+st;
		relation_num++;
	}
    FILE* f_train = fopen(("../" + dir + "/train.txt").c_str(), "r");
    //cout << "getting train data" << endl;
    while (fscanf(f_train, "%s", buf) == 1) {
         string head = buf;
         //cout << "start: " << buf << endl;
         fscanf(f_train,"%s",buf);
         string tail = buf;
          fscanf(f_train,"%s",buf);
          string rel = buf;
        // 头结点和关系组合
        string headRel = to_string(entity2id[head]) + "_" + to_string(relation2id[rel]);
       // cout << headRel << endl;
        map<string, vector<int> >::iterator iter = givenHeadRel.find(headRel);
        if(iter == givenHeadRel.end()) {
            // key不存在
            vector<int> value = vector<int>();
            value.push_back(entity2id[tail]);
            givenHeadRel.insert(pair<string, vector<int> >(headRel, value));
        } else {
            iter->second.push_back(entity2id[tail]);
        }

        // 尾节点和关系组合

        string tailRel = to_string(entity2id[tail]) + "_" + to_string(relation2id[rel]);
        //cout << tailRel << endl;
        iter = givenTailRel.find(tailRel);
        if(iter == givenTailRel.end()) {
            // key不存在
            vector<int> value = vector<int>();
            value.push_back(entity2id[head]);
            givenTailRel.insert(pair<string, vector<int> >(tailRel, value));
        } else {
            iter->second.push_back(entity2id[head]);
        }

        // 头结点和尾节点组合
        string headTail = to_string(entity2id[head]) + "_" + to_string(entity2id[tail]);
        //cout << headTail << endl;
        iter = givenHeadTail.find(headTail);
        if(iter == givenHeadTail.end()) {
            // key不存在
            vector<int> value = vector<int>();
            value.push_back(relation2id[rel]);
            givenHeadTail.insert(pair<string, vector<int> >(headTail, value));
        } else {
            iter->second.push_back(relation2id[rel]);
        }

    }

    FILE* f_kb = fopen(("../" + dir + "/train_pra.txt").c_str(),"r");
	while (fscanf(f_kb,"%s",buf)==1)
    {
        string s1=buf;
        fscanf(f_kb,"%s",buf);
        string s2=buf;
        if (entity2id.count(s1)==0)
        {
            cout<<"miss entity:"<<s1<<endl;
        }
        if (entity2id.count(s2)==0)
        {
            cout<<"miss entity:"<<s2<<endl;
        }
        int e1 = entity2id[s1];
        int e2 = entity2id[s2];
        int rel;
        // rel是关系id
		fscanf(f_kb,"%d",&rel);
        // 就是实体之间的路径的数目
		fscanf(f_kb,"%d",&x);
        // pair<路径，精度>
		vector<pair<vector<int>,double> > b;
		b.clear();
		for (int i = 0; i<x; i++)
		{
			int y,z;
			vector<int> rel_path;
			rel_path.clear();
            // y是某条路径的长度（关系数）
			fscanf(f_kb,"%d",&y);
			for (int j=0; j<y; j++)
			{
                // 读取y所指的路径的关系，
				fscanf(f_kb,"%d",&z);
				rel_path.push_back(z);
			}
			double pr;
            // 读取这条路径的精度
			fscanf(f_kb,"%lf",&pr);
			b.push_back(make_pair(rel_path,pr));
		}
		//cout<<e1<<' '<<e2<<' '<<rel<<' '<<b.size()<<endl;
        // 训练需要的参数：头实体，尾实体，直连关系，（路径加精度）
        train.add(e1,e2,rel,b);
    }
    // 以上就是训练过程
    // 关系数目，包括了逆关系
	relation_num*=2;

    cout<<"relation_num="<<relation_num<<endl;
    cout<<"entity_num="<<entity_num<<endl;
	// confidence存放的是每条路径对于每个关系的置信度。比如e1-r1-e2，直连的关系是r1，e3-r2-e4的直连关系是r2。
    // 假设图中只有e1-e2和e3-e4之间存在路径r3-r4。那么，r3-r4只对r1和r2存在置信度，且均是0.5。
	FILE* f_confidence = fopen(("../" + dir + "/confidence.txt").c_str(),"r");
	while (fscanf(f_confidence,"%d",&x)==1)
	{
        // x是路径的长度
		string s = "";
		for (int i=0; i<x; i++)
		{
            // 读取路径中的关系
			fscanf(f_confidence,"%s",buf);
            // 拼接各个关系，组成路径字符串（每个关系是用id表示的）
			s = s + string(buf)+" ";
		}
        // 涉及到的关系数（如上注释的情况，就会是2）
		fscanf(f_confidence,"%d",&x);
		for (int i=0; i<x; i++)
		{
			int y;
			double pr;
            // 读取涉及到的关系以及其置信度
			fscanf(f_confidence,"%d%lf",&y,&pr);
		//	cout<<s<<' '<<y<<' '<<pr<<endl;
            // map<pair<string,int>,double> map<pair<路径字符串，涉及关系id>, 置信度>
			path_confidence[make_pair(s,y)] = pr;
		}
	}
	fclose(f_confidence);
    fclose(f_kb);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
leaq 0x678c(%rip), %rsi      # 0x90aa
leaq 0xb9b3(%rip), %rdx      # 0xe2d8
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x383d
leaq 0x6775(%rip), %rdx      # 0x90ae
leaq 0x78(%rsp), %rdi
movq %rbx, %rsi
callq 0x381e
leaq 0x78(%rsp), %rbx
movq (%rbx), %rdi
leaq 0x6768(%rip), %rsi      # 0x90bd
callq 0x21f0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2368
leaq 0x10(%rsp), %rdi
callq 0x2368
leaq 0x6734(%rip), %rsi      # 0x90aa
leaq 0xb95b(%rip), %rdx      # 0xe2d8
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x383d
leaq 0x672e(%rip), %rdx      # 0x90bf
leaq 0x78(%rsp), %rdi
movq %rbx, %rsi
callq 0x381e
leaq 0x78(%rsp), %r15
movq (%r15), %rdi
leaq 0x6710(%rip), %rsi      # 0x90bd
callq 0x21f0
movq %rax, 0x8(%rsp)
movq %r15, %rdi
callq 0x2368
leaq 0x10(%rsp), %rdi
callq 0x2368
leaq 0xb950(%rip), %rbp      # 0xe320
leaq 0x4(%rsp), %rbx
leaq 0x54d8c(%rip), %r13     # 0x57768
movq %r14, %rdi
leaq 0x66ea(%rip), %rsi      # 0x90d0
movq %rbp, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2320
cmpl $0x2, %eax
jne 0x2a45
movq %r15, %rdi
movq %rbp, %rsi
leaq 0x10(%rsp), %rdx
callq 0x20a0
movl 0x4(%rsp), %r12d
leaq 0x54d24(%rip), %rdi     # 0x57738
movq %r15, %rsi
callq 0x38b4
movl %r12d, (%rax)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x391a
movq %rax, %rdi
movq %r15, %rsi
callq 0x20f0
incl 0x54cc9(%rip)           # 0x57704
movq %r15, %rdi
callq 0x2368
jmp 0x29dc
leaq 0xb8d4(%rip), %r15      # 0xe320
leaq 0x4(%rsp), %r12
leaq 0x78(%rsp), %r13
leaq 0x10(%rsp), %rbp
leaq 0x54d36(%rip), %r14     # 0x57798
movq 0x8(%rsp), %rdi
leaq 0x6662(%rip), %rsi      # 0x90d0
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x2320
cmpl $0x2, %eax
jne 0x2b11
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x20a0
movl 0x4(%rsp), %ebx
leaq 0x54c6b(%rip), %rdi     # 0x57708
movq %r13, %rsi
callq 0x38b4
movl %ebx, (%rax)
movq %r14, %rdi
movq %r12, %rsi
callq 0x391a
movq %rax, %rdi
movq %r13, %rsi
callq 0x20f0
movq %rbp, %rdi
leaq 0x660e(%rip), %rsi      # 0x90d5
movq %r13, %rdx
callq 0x383d
movl 0x4(%rsp), %eax
movl $0x541, %ecx            # imm = 0x541
addl %ecx, %eax
movl %eax, 0x58(%rsp)
movq %r14, %rdi
leaq 0x58(%rsp), %rsi
callq 0x3968
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2200
movq %rbp, %rdi
callq 0x2368
incl 0x54bfc(%rip)           # 0x57700
movq %r13, %rdi
callq 0x2368
jmp 0x2a62
leaq 0x6592(%rip), %rsi      # 0x90aa
leaq 0xb7b9(%rip), %rdx      # 0xe2d8
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x383d
leaq 0x65a4(%rip), %rdx      # 0x90d7
leaq 0x78(%rsp), %rdi
movq %rbx, %rsi
callq 0x381e
leaq 0x78(%rsp), %rbx
movq (%rbx), %rdi
leaq 0x656e(%rip), %rsi      # 0x90bd
callq 0x21f0
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
callq 0x2368
leaq 0x10(%rsp), %rdi
callq 0x2368
leaq 0xb7ae(%rip), %r13      # 0xe320
leaq 0x110(%rsp), %rbp
leaq 0xb0(%rsp), %r12
leaq 0xf0(%rsp), %r14
movq 0x8(%rsp), %rdi
leaq 0x654c(%rip), %rsi      # 0x90e2
movq %r13, %rdx
xorl %eax, %eax
callq 0x2320
cmpl $0x1, %eax
jne 0x2f81
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x20a0
movq 0x8(%rsp), %rdi
leaq 0x651d(%rip), %rsi      # 0x90e2
movq %r13, %rdx
xorl %eax, %eax
callq 0x2320
leaq 0x58(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x20a0
movq 0x8(%rsp), %rdi
leaq 0x64f7(%rip), %rsi      # 0x90e2
movq %r13, %rdx
xorl %eax, %eax
callq 0x2320
leaq 0x30(%rsp), %rdi
movq %r13, %r15
movq %r13, %rsi
movq %rbx, %rdx
callq 0x20a0
leaq 0x54b29(%rip), %rdi     # 0x57738
leaq 0x10(%rsp), %rsi
callq 0x38b4
movl (%rax), %esi
movq %rbp, %rdi
callq 0x3a1d
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0x64b5(%rip), %rdx      # 0x90e5
callq 0x381e
leaq 0x54acc(%rip), %rdi     # 0x57708
leaq 0x30(%rsp), %rsi
callq 0x38b4
movl (%rax), %esi
movq %r12, %rdi
callq 0x3a1d
leaq 0xd0(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x39b6
movq %r12, %rdi
callq 0x2368
movq %rbx, %rdi
callq 0x2368
movq %rbp, %rdi
callq 0x2368
leaq 0xb5c3(%rip), %rdi      # 0xe248
movq %r13, %rsi
callq 0x7fc0
movq %rax, %r13
leaq 0xb5b9(%rip), %rax      # 0xe250
cmpq %rax, %r13
je 0x2cbe
leaq 0x54a95(%rip), %rdi     # 0x57738
leaq 0x58(%rsp), %rsi
callq 0x38b4
addq $0x40, %r13
movq %r13, %rdi
movq %rax, %rsi
callq 0x3a76
jmp 0x2d20
xorps %xmm0, %xmm0
movaps %xmm0, 0x110(%rsp)
andq $0x0, 0x120(%rsp)
leaq 0x54a5f(%rip), %rdi     # 0x57738
leaq 0x58(%rsp), %rsi
callq 0x38b4
movq %rbp, %rdi
movq %rax, %rsi
callq 0x3a76
movq %rbx, %rdi
leaq 0xd0(%rsp), %rsi
movq %rbp, %rdx
callq 0x3a94
leaq 0xb540(%rip), %rdi      # 0xe248
movq %rbx, %rsi
callq 0x7ffe
movq %rbx, %rdi
callq 0x3aca
movq %rbp, %rdi
callq 0x4498
leaq 0x54a11(%rip), %rdi     # 0x57738
leaq 0x58(%rsp), %rsi
callq 0x38b4
movl (%rax), %esi
movq %r12, %rdi
callq 0x3a1d
movq %rbx, %rdi
movq %r12, %rsi
leaq 0x639d(%rip), %rdx      # 0x90e5
callq 0x381e
leaq 0x549b4(%rip), %rdi     # 0x57708
leaq 0x30(%rsp), %rsi
callq 0x38b4
movl (%rax), %esi
movq %r14, %rdi
callq 0x3a1d
movq %rbp, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x39b6
movq %r14, %rdi
callq 0x2368
movq %rbx, %rdi
callq 0x2368
movq %r12, %rdi
callq 0x2368
leaq 0xb4e3(%rip), %rdi      # 0xe278
movq %rbp, %rsi
callq 0x7fc0
movq %rax, %r13
leaq 0xb4d9(%rip), %rax      # 0xe280
cmpq %rax, %r13
je 0x2dce
leaq 0x54985(%rip), %rdi     # 0x57738
leaq 0x10(%rsp), %rsi
callq 0x38b4
addq $0x40, %r13
movq %r13, %rdi
movq %rax, %rsi
callq 0x3a76
jmp 0x2e2b
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
andq $0x0, 0xc0(%rsp)
leaq 0x5494f(%rip), %rdi     # 0x57738
leaq 0x10(%rsp), %rsi
callq 0x38b4
movq %r12, %rdi
movq %rax, %rsi
callq 0x3a76
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x3a94
leaq 0xb465(%rip), %rdi      # 0xe278
movq %rbx, %rsi
callq 0x7ffe
movq %rbx, %rdi
callq 0x3aca
movq %r12, %rdi
callq 0x4498
leaq 0x54906(%rip), %rdi     # 0x57738
leaq 0x10(%rsp), %rsi
callq 0x38b4
movl (%rax), %esi
movq %r14, %rdi
callq 0x3a1d
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x6292(%rip), %rdx      # 0x90e5
callq 0x381e
leaq 0x548d9(%rip), %rdi     # 0x57738
leaq 0x58(%rsp), %rsi
callq 0x38b4
leaq 0x148(%rsp), %r13
movl (%rax), %esi
movq %r13, %rdi
callq 0x3a1d
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x39b6
movq %r13, %rdi
callq 0x2368
movq %rbx, %rdi
callq 0x2368
movq %r14, %rdi
callq 0x2368
leaq 0xb400(%rip), %rdi      # 0xe2a8
movq %r12, %rsi
callq 0x7fc0
movq %rax, %r13
leaq 0xb3f6(%rip), %rax      # 0xe2b0
cmpq %rax, %r13
je 0x2ee1
leaq 0x54842(%rip), %rdi     # 0x57708
leaq 0x30(%rsp), %rsi
callq 0x38b4
addq $0x40, %r13
movq %r13, %rdi
movq %rax, %rsi
callq 0x3a76
jmp 0x2f3e
xorps %xmm0, %xmm0
movaps %xmm0, 0xf0(%rsp)
andq $0x0, 0x100(%rsp)
leaq 0x5480c(%rip), %rdi     # 0x57708
leaq 0x30(%rsp), %rsi
callq 0x38b4
movq %r14, %rdi
movq %rax, %rsi
callq 0x3a76
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x3a94
leaq 0xb382(%rip), %rdi      # 0xe2a8
movq %rbx, %rsi
callq 0x7ffe
movq %rbx, %rdi
callq 0x3aca
movq %r14, %rdi
callq 0x4498
movq %r12, %rdi
callq 0x2368
movq %rbp, %rdi
callq 0x2368
leaq 0xd0(%rsp), %rdi
callq 0x2368
leaq 0x30(%rsp), %rdi
callq 0x2368
leaq 0x58(%rsp), %rdi
callq 0x2368
leaq 0x10(%rsp), %rdi
callq 0x2368
movq %r15, %r13
jmp 0x2b8a
leaq 0x6122(%rip), %rsi      # 0x90aa
leaq 0xb349(%rip), %rdx      # 0xe2d8
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x383d
leaq 0x6144(%rip), %rdx      # 0x90e7
leaq 0x78(%rsp), %rdi
movq %rbx, %rsi
callq 0x381e
leaq 0x78(%rsp), %r14
movq (%r14), %rdi
leaq 0x60fe(%rip), %rsi      # 0x90bd
callq 0x21f0
movq %rax, %rbx
movq %r14, %rdi
callq 0x2368
leaq 0x10(%rsp), %rdi
callq 0x2368
leaq 0xb340(%rip), %r12      # 0xe320
leaq 0x54751(%rip), %rbp     # 0x57738
leaq 0x60e4(%rip), %r13      # 0x90d2
leaq 0x148(%rsp), %r15
leaq 0xd0(%rsp), %r14
movq %rbx, %rdi
leaq 0x60da(%rip), %rsi      # 0x90e2
movq %r12, %rdx
xorl %eax, %eax
callq 0x2320
cmpl $0x1, %eax
jne 0x3261
leaq 0x78(%rsp), %rdi
movq %r12, %rsi
leaq 0x10(%rsp), %rdx
callq 0x20a0
movq %rbx, %rdi
leaq 0x60ab(%rip), %rsi      # 0x90e2
movq %r12, %rdx
xorl %eax, %eax
callq 0x2320
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
leaq 0x58(%rsp), %rdx
callq 0x20a0
movq %rbp, %rdi
leaq 0x78(%rsp), %rsi
callq 0x3ae0
testq %rax, %rax
jne 0x308d
movq 0xaf6c(%rip), %rdi      # 0xdfd8
leaq 0x6083(%rip), %rsi      # 0x90f6
callq 0x2190
movq %rax, %rdi
leaq 0x78(%rsp), %rsi
callq 0x2150
movq %rax, %rdi
callq 0x20d0
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x3ae0
testq %rax, %rax
jne 0x30c7
movq 0xaf32(%rip), %rdi      # 0xdfd8
leaq 0x6049(%rip), %rsi      # 0x90f6
callq 0x2190
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x2150
movq %rax, %rdi
callq 0x20d0
movq %rbp, %rdi
leaq 0x78(%rsp), %rsi
callq 0x38b4
movl (%rax), %r12d
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x38b4
movl %r12d, 0x8(%rsp)
movl (%rax), %eax
movl %eax, 0x50(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
leaq 0xb0(%rsp), %rdx
xorl %eax, %eax
callq 0x2320
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x4(%rsp), %rdx
xorl %eax, %eax
callq 0x2320
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x3afa
xorl %r12d, %r12d
cmpl 0x4(%rsp), %r12d
jge 0x31f3
xorps %xmm0, %xmm0
movaps %xmm0, 0xd0(%rsp)
andq $0x0, 0xe0(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
leaq 0xf0(%rsp), %rdx
xorl %eax, %eax
callq 0x2320
xorl %ebp, %ebp
cmpl 0xf0(%rsp), %ebp
jge 0x318f
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2320
movq %r14, %rdi
movq %r15, %rsi
callq 0x3a76
incl %ebp
jmp 0x3167
movq %rbx, %rdi
leaq 0x5f98(%rip), %rsi      # 0x9131
leaq 0x110(%rsp), %rdx
xorl %eax, %eax
callq 0x2320
leaq 0x58(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0x444a
movsd 0x110(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0x81b4
movq %rbp, %rdi
callq 0x4498
movq %r14, %rdi
callq 0x4498
incl %r12d
leaq 0x5454a(%rip), %rbp     # 0x57738
jmp 0x3131
movl 0xb0(%rsp), %r12d
leaq 0x130(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3ba6
leaq 0x545cc(%rip), %rdi     # 0x577e0
movl 0x8(%rsp), %esi
movl 0x50(%rsp), %edx
movl %r12d, %ecx
leaq 0x130(%rsp), %r12
movq %r12, %r8
callq 0x3b02
movq %r12, %rdi
callq 0x3bfa
leaq 0x30(%rsp), %rdi
callq 0x3bfa
leaq 0x10(%rsp), %rdi
callq 0x2368
leaq 0x78(%rsp), %rdi
callq 0x2368
leaq 0xb0c4(%rip), %r12      # 0xe320
jmp 0x2ffe
shll 0x54499(%rip)           # 0x57700
movq 0xad6a(%rip), %r14      # 0xdfd8
leaq 0x5e8e(%rip), %rsi      # 0x9103
movq %r14, %rdi
callq 0x2190
movl 0x5447d(%rip), %esi     # 0x57700
movq %rax, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x20d0
leaq 0x5e77(%rip), %rsi      # 0x9111
movq %r14, %rdi
callq 0x2190
movl 0x5445c(%rip), %esi     # 0x57704
movq %rax, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x20d0
leaq 0x5deb(%rip), %rsi      # 0x90aa
leaq 0xb012(%rip), %rdx      # 0xe2d8
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x383d
leaq 0x5e43(%rip), %rdx      # 0x911d
leaq 0x78(%rsp), %rdi
movq %r14, %rsi
callq 0x381e
leaq 0x78(%rsp), %r14
movq (%r14), %rdi
leaq 0x5dc7(%rip), %rsi      # 0x90bd
callq 0x21f0
movq %rax, 0x8(%rsp)
movq %r14, %rdi
callq 0x2368
leaq 0x10(%rsp), %rdi
callq 0x2368
leaq 0x30(%rsp), %r13
leaq 0x58(%rsp), %rbp
movq 0x8(%rsp), %rdi
leaq 0x5daa(%rip), %rsi      # 0x90d2
leaq 0x4(%rsp), %rdx
xorl %eax, %eax
callq 0x2320
cmpl $0x1, %eax
jne 0x346e
leaq 0x10(%rsp), %rdi
leaq 0x5e71(%rip), %rsi      # 0x91ba
movq %r14, %rdx
callq 0x20a0
xorl %r12d, %r12d
cmpl 0x4(%rsp), %r12d
jge 0x33da
movq 0x8(%rsp), %rdi
leaq 0x5d7b(%rip), %rsi      # 0x90e2
leaq 0xafb2(%rip), %r15      # 0xe320
movq %r15, %rdx
xorl %eax, %eax
callq 0x2320
movq %r13, %rdi
movq %r15, %rsi
leaq 0xd0(%rsp), %rdx
callq 0x20a0
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
movq %r13, %rdx
callq 0x3c1b
movq %r14, %rdi
movq %rbp, %rsi
leaq 0x5d85(%rip), %rdx      # 0x912d
callq 0x381e
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x2200
movq %r14, %rdi
callq 0x2368
movq %rbp, %rdi
callq 0x2368
movq %r13, %rdi
callq 0x2368
incl %r12d
jmp 0x3354
movq 0x8(%rsp), %rdi
leaq 0x5cec(%rip), %rsi      # 0x90d2
leaq 0x4(%rsp), %rdx
xorl %eax, %eax
callq 0x2320
xorl %r12d, %r12d
cmpl 0x4(%rsp), %r12d
jge 0x345f
movq 0x8(%rsp), %rdi
leaq 0x5d27(%rip), %rsi      # 0x912f
movq %r13, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2320
movsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x2250
movl 0x30(%rsp), %eax
movl %eax, 0x98(%rsp)
leaq 0xadd8(%rip), %rdi      # 0xe218
movq %r14, %rsi
callq 0x3c40
movsd 0x50(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r14, %rdi
callq 0x2368
incl %r12d
jmp 0x33f5
leaq 0x10(%rsp), %rdi
callq 0x2368
jmp 0x331c
movq 0x8(%rsp), %rdi
callq 0x21a0
movq %rbx, %rdi
callq 0x21a0
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x36ba
jmp 0x36ba
jmp 0x36ba
jmp 0x36ba
jmp 0x36ba
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3aca
jmp 0x34e1
jmp 0x34de
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3aca
jmp 0x34f6
jmp 0x34f3
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3aca
jmp 0x350b
jmp 0x3508
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0x4498
jmp 0x35eb
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x4498
jmp 0x361b
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0x4498
jmp 0x363f
jmp 0x36ba
jmp 0x35e0
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0x3bfa
jmp 0x36e9
movq %rax, %rbx
jmp 0x36e9
jmp 0x3687
jmp 0x3682
jmp 0x3687
jmp 0x35e0
jmp 0x3682
jmp 0x35e8
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x2368
jmp 0x35ff
movq %rax, %rbx
jmp 0x3609
jmp 0x3618
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0x2368
jmp 0x3628
movq %rax, %rbx
jmp 0x3632
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x2368
jmp 0x3662
movq %rax, %rbx
jmp 0x366c
jmp 0x35c0
movq %rax, %rbx
jmp 0x3656
jmp 0x36ba
jmp 0x36ba
jmp 0x35e0
jmp 0x3687
jmp 0x3682
jmp 0x35e0
movq %rax, %rbx
jmp 0x3707
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
jmp 0x3611
jmp 0x3618
jmp 0x3687
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x2368
leaq 0xf0(%rsp), %rdi
callq 0x2368
jmp 0x361b
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
jmp 0x363a
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x2368
leaq 0xb0(%rsp), %rdi
callq 0x2368
leaq 0xd0(%rsp), %rdi
callq 0x2368
leaq 0x30(%rsp), %rdi
callq 0x2368
leaq 0x58(%rsp), %rdi
jmp 0x36b1
jmp 0x367b
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x2368
leaq 0x110(%rsp), %rdi
jmp 0x3647
movq %rax, %rbx
jmp 0x364c
movq %rax, %rbx
jmp 0x363f
jmp 0x3682
movq %rax, %rbx
jmp 0x36fd
movq %rax, %rbx
jmp 0x36f3
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
jmp 0x36b1
jmp 0x36ba
jmp 0x36ba
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x2368
jmp 0x36ac
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2368
jmp 0x36bd
jmp 0x36ba
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x3702
jmp 0x36d9
jmp 0x36d9
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x4498
jmp 0x36dc
jmp 0x36d9
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x4498
leaq 0x30(%rsp), %rdi
callq 0x3bfa
leaq 0x10(%rsp), %rdi
callq 0x2368
leaq 0x78(%rsp), %rdi
callq 0x2368
movq %rbx, %rdi
callq 0x2300