// File: /workspace/github_cpp_makefile_star2_O3/wenleix[P]EdgePPR/src/CreateObjGraph.cpp
// Function: main
int main(int argv, char** argc) {
    paper_newid.reserve(10000000);

    if (argv != 3) {
        fprintf(stderr, "Usage: %s [BigRedFormatFile] [GraphName]\n", argc[0]);
        return 1;
    }

    FILE *wenleiFile = fopen(argc[1], "r");
    FILE *graphFile = fopen(argc[2], "w");

    while (true) {
        Publication *paper = readNewPaper(wenleiFile);
        if (paper == NULL) 
            break;
        papers.push_back(paper);
        if (paper->id >= paper_newid.size()) {
            paper_newid.resize(paper->id + 1, -1);
        }
        paper_newid[paper->id] = papers.size() - 1;
    }

    vector< pair<int, int> > paper_author;
    vector< pair<int, int> > paper_conf;        //  Note, paper_id to conf_id, need offset to generate global id.
    vector< pair<int, int> > conf_forum;

    //  Set up (paper, author) and (paper, venueyear) pairs.
    for (int i = 0; i < papers.size(); i++) {
        Publication* p = papers[i];
        int confId = GetOrCreateID(p->conf, conf_id, conf_name);
        int forumId = GetOrCreateID(p->forum, forum_id, forum_name);
        paper_conf.push_back(make_pair(i, confId));
        conf_forum.push_back(make_pair(confId, forumId));

        vector<string> authors;
        split(p->authors, ',', authors);
        for (string& a : authors) {
        	int aid = GetOrCreateID(a, author_id, author_name);
            paper_author.push_back(make_pair(i, aid));
        }
    }

    //	Unique Conf - Forum edges
    sort(conf_forum.begin(), conf_forum.end());
    conf_forum.resize(unique(conf_forum.begin(), conf_forum.end()) - conf_forum.begin());

    fprintf(stdout, "INFO: # Papers = %lu.\n", papers.size());
    fprintf(stdout, "INFO: # Authors = %lu.\n", author_name.size());
    fprintf(stdout, "INFO: # Conf = %lu.\n", conf_name.size());
    fprintf(stdout, "INFO: # Forum = %lu.\n", forum_name.size());

    fprintf(stdout, "INFO: #Paper-Author = %lu.\n", paper_author.size());
    fprintf(stdout, "INFO: #Paper-Conf = %lu.\n", paper_conf.size());
    fprintf(stdout, "INFO: #Conf-Forum = %lu.\n", conf_forum.size());

    //  Citation edges
    int missingCite = 0;
    int existCite = 0;
    int selfCite = 0;
    for (int i = 0; i < papers.size(); i++) {
        Publication *p = papers[i];
        for (auto rid : p->refs) {
            int newID = paper_newid[rid];
            if (i == newID) {
//            	fprintf(stderr, "Ignore self-loop: %d. \n", i);
            	selfCite++;
            	continue;
            }
            if (newID == -1) {
//                fprintf(stderr, "Debug: Paper ID %d is not occurred.\n", rid);
                missingCite++;
                continue;
            }
            outEdge[i].push_back(Edge(newID, 0 /* Cite */));
            existCite++;
        }
    }
    fprintf(stdout, "INFO: missingCite = %d, existCite = %d, selfCite = %d.\n", missingCite, existCite, selfCite);

    //  Make up the edges!
    int author_offset = papers.size();
    int conf_offset = author_offset + author_name.size();
    int forum_offset = conf_offset + conf_name.size();

    //  written_by and author_write
    for (pair<int, int> pa : paper_author) {
        int paperID = pa.first;
        int g_authorID = author_offset + pa.second;			//	GlobalID for this author
        outEdge[paperID].push_back(Edge(g_authorID, 1 /* written_by */));
        outEdge[g_authorID].push_back(Edge(paperID, 2 /* author_write */));
    }

    //  published_in and conf_publish_paper
    for (pair<int, int> pc : paper_conf) {
        int paperID = pc.first;
        int g_confID = conf_offset + pc.second;				//	GlobalID for this conf
        outEdge[paperID].push_back(Edge(g_confID, 3 /* published_in */ ));
        outEdge[g_confID].push_back(Edge(paperID, 4 /* conf_publish_paper */ ));
    }

    //	conf_calledby_forum and forum_call_conf
    for (pair<int, int> cf : conf_forum) {
    	int g_confID = conf_offset + cf.first;
    	int g_forumID = forum_offset + cf.second;
    	outEdge[g_confID].push_back(Edge(g_forumID, 5 /* conf_calledby_forum */ ));
    	outEdge[g_forumID].push_back(Edge(g_confID, 6 /* forum_call_conf */ ));
    }

    int numVertex = papers.size() + author_name.size() + conf_name.size() + forum_name.size();
    int numEdge = 0;
    for (int i = 0; i < numVertex; i++)
        numEdge += outEdge[i].size();

    fprintf(stderr, "# Vertices = %d, # Edges = %d.\n", numVertex, numEdge);
    fprintf(graphFile, "%d %d\n", numVertex, numEdge);
    //  Paper vertex
    for (int i = 0; i < papers.size(); i++) {
        fprintf(graphFile, "%d 0 %lu %s\n", i, outEdge[i].size(), papers[i]->title.c_str());
        WriteOutEdges(graphFile, outEdge[i]);
    }
    //  Author vertex
    for (int i = 0; i < author_name.size(); i++) {
        int g_authorID = author_offset + i;
        fprintf(graphFile, "%d 1 %lu %s\n", g_authorID, outEdge[g_authorID].size(), 
                                            author_name[i].c_str());
        WriteOutEdges(graphFile, outEdge[g_authorID]);
    }
    //  Conf vertex
    for (int i = 0; i < conf_name.size(); i++) {
        int g_confID = conf_offset + i;
        fprintf(graphFile, "%d 2 %lu %s\n", g_confID, outEdge[g_confID].size(),
                                            conf_name[i].c_str());
        WriteOutEdges(graphFile, outEdge[g_confID]);
    }
    //  Forum vertex
    for (int i = 0; i < forum_name.size(); i++) {
        int g_forumID = forum_offset + i;
        fprintf(graphFile, "%d 3 %lu %s\n", g_forumID, outEdge[g_forumID].size(),
                                            forum_name[i].c_str());
        WriteOutEdges(graphFile, outEdge[g_forumID]);
    }

    fclose(wenleiFile);
    fclose(graphFile);

    for (Publication* p : papers) 
        delete p;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0xfa84b(%rip), %rdi     # 0xfd4a0
movl $0x989680, %esi         # imm = 0x989680
callq 0x38ce
cmpl $0x3, %ebp
jne 0x2dac
movq 0x8(%rbx), %rdi
leaq 0x34fa(%rip), %rsi      # 0x616d
callq 0x2190
movq %rax, %r13
movq 0x10(%rbx), %rdi
leaq 0x3561(%rip), %rsi      # 0x61e7
callq 0x2190
movq %rax, 0xa0(%rsp)
movq %r13, %rdi
callq 0x27cd
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x2d67
leaq 0xfa808(%rip), %rbx     # 0xfd4b8
leaq 0x50(%rsp), %r14
leaq 0xfa7e4(%rip), %r15     # 0xfd4a0
leaq 0x70(%rsp), %r12
movq 0xfa7f8(%rip), %rsi     # 0xfd4c0
cmpq 0xfa7f9(%rip), %rsi     # 0xfd4c8
je 0x2cde
movq %rax, (%rsi)
addq $0x8, 0xfa7e4(%rip)     # 0xfd4c0
jmp 0x2ce9
movq %rbx, %rdi
movq %r14, %rdx
callq 0x42c8
movq 0x50(%rsp), %rax
movslq 0x88(%rax), %rax
movq 0xfa7ac(%rip), %rdx     # 0xfd4a8
movq 0xfa79d(%rip), %rcx     # 0xfd4a0
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rax, %rdx
ja 0x2d3a
incl %eax
movslq %eax, %rsi
movl $0xffffffff, 0x70(%rsp) # imm = 0xFFFFFFFF
movq %r15, %rdi
movq %r12, %rdx
callq 0x3960
movq 0x50(%rsp), %rax
movslq 0x88(%rax), %rax
movq 0xfa766(%rip), %rcx     # 0xfd4a0
movq 0xfa77f(%rip), %rdx     # 0xfd4c0
subq 0xfa770(%rip), %rdx     # 0xfd4b8
shrq $0x3, %rdx
decl %edx
movl %edx, (%rcx,%rax,4)
movq %r13, %rdi
callq 0x27cd
movq %rax, 0x50(%rsp)
testq %rax, %rax
jne 0x2cc1
xorl %eax, %eax
movq %rax, 0x60(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq %rax, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movq %rax, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq 0xfa724(%rip), %rax     # 0xfd4b8
cmpq %rax, 0xfa725(%rip)     # 0xfd4c0
movq %r13, 0xa8(%rsp)
jne 0x2dbe
xorl %ebx, %ebx
jmp 0x2f5b
movq %rbx, %rdi
callq 0x22a0
movl $0x1, %eax
jmp 0x377c
xorl %r13d, %r13d
leaq 0xfa5e8(%rip), %r14     # 0xfd3b0
leaq 0xfa689(%rip), %r15     # 0xfd458
movq (%rax,%r13,8), %rbp
leaq 0x68(%rbp), %rdi
leaq 0xfa60a(%rip), %rsi     # 0xfd3e8
leaq 0xfa68b(%rip), %rdx     # 0xfd470
callq 0x2ba3
movl %eax, %r12d
leaq 0x48(%rbp), %rdi
leaq 0xfa628(%rip), %rsi     # 0xfd420
leaq 0xfa689(%rip), %rdx     # 0xfd488
callq 0x2ba3
movl %eax, %ebx
movl %r12d, %r12d
movq %r12, %rax
shlq $0x20, %rax
orq %r13, %rax
movq %rax, (%rsp)
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0x2e31
movq %rax, (%rsi)
addq $0x8, 0x78(%rsp)
jmp 0x2e3e
leaq 0x70(%rsp), %rdi
movq %rsp, %rdx
callq 0x497a
shlq $0x20, %rbx
orq %r12, %rbx
movq %rbx, (%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x2e63
movq %rbx, (%rsi)
addq $0x8, 0x38(%rsp)
movq %rsp, %r12
jmp 0x2e73
leaq 0x30(%rsp), %rdi
movq %rsp, %r12
movq %r12, %rdx
callq 0x497a
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
addq $0x20, %rbp
movq %rbp, %rdi
movl $0x2c, %esi
movq %r12, %rdx
callq 0x260c
movq (%rsp), %rbp
movq 0x8(%rsp), %rbx
cmpq %rbx, %rbp
je 0x2ef1
movq %rbp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2ba3
shlq $0x20, %rax
orq %r13, %rax
movq %rax, 0xb0(%rsp)
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x2ed9
movq %rax, (%rsi)
addq $0x8, 0x58(%rsp)
jmp 0x2eeb
leaq 0x50(%rsp), %rdi
leaq 0xb0(%rsp), %rdx
callq 0x497a
addq $0x20, %rbp
jmp 0x2ea0
movq %r12, %rdi
callq 0x37f8
incq %r13
movq 0xfa5bd(%rip), %rcx     # 0xfd4c0
movq 0xfa5ae(%rip), %rax     # 0xfd4b8
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r13, %rcx
ja 0x2dcf
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r14
cmpq %r14, %rbx
je 0x2f5b
movq %r14, %rax
subq %rbx, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4ab7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4b6a
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x4f2d
leaq 0x30(%rsp), %rdi
subq (%rdi), %rax
sarq $0x3, %rax
movq %rax, %rsi
callq 0x3994
movq 0x6035(%rip), %rbx      # 0x8fb8
movq (%rbx), %rdi
movq 0xfa533(%rip), %rdx     # 0xfd4c0
subq 0xfa524(%rip), %rdx     # 0xfd4b8
sarq $0x3, %rdx
leaq 0x324a(%rip), %rsi      # 0x61e9
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x21d0
movq (%rbx), %rdi
movq 0xfa4ae(%rip), %rdx     # 0xfd460
subq 0xfa49f(%rip), %rdx     # 0xfd458
sarq $0x5, %rdx
leaq 0x323c(%rip), %rsi      # 0x6200
xorl %eax, %eax
callq 0x21d0
movq (%rbx), %rdi
movq 0xfa4a3(%rip), %rdx     # 0xfd478
subq 0xfa494(%rip), %rdx     # 0xfd470
sarq $0x5, %rdx
leaq 0x3231(%rip), %rsi      # 0x6218
xorl %eax, %eax
callq 0x21d0
movq (%rbx), %rdi
movq 0xfa498(%rip), %rdx     # 0xfd490
subq 0xfa489(%rip), %rdx     # 0xfd488
sarq $0x5, %rdx
leaq 0x3223(%rip), %rsi      # 0x622d
xorl %eax, %eax
callq 0x21d0
movq (%rbx), %rdi
movq 0x58(%rsp), %rdx
subq 0x50(%rsp), %rdx
sarq $0x3, %rdx
leaq 0x321a(%rip), %rsi      # 0x6243
xorl %eax, %eax
callq 0x21d0
movq (%rbx), %rdi
movq 0x78(%rsp), %rdx
subq 0x70(%rsp), %rdx
sarq $0x3, %rdx
leaq 0x3217(%rip), %rsi      # 0x625f
xorl %eax, %eax
callq 0x21d0
movq (%rbx), %rdi
movq 0x38(%rsp), %rdx
subq 0x30(%rsp), %rdx
sarq $0x3, %rdx
leaq 0x3212(%rip), %rsi      # 0x6279
xorl %eax, %eax
callq 0x21d0
movq 0xfa44b(%rip), %rax     # 0xfd4c0
movq 0xfa43c(%rip), %rcx     # 0xfd4b8
movl $0x0, %ebx
movl $0x0, 0x20(%rsp)
cmpq %rcx, %rax
je 0x3153
xorl %r13d, %r13d
movl $0x0, 0x20(%rsp)
xorl %ebx, %ebx
xorl %ebp, %ebp
movq (%rcx,%r13,8), %rdx
movq 0x90(%rdx), %r15
movq 0x98(%rdx), %r14
cmpq %r14, %r15
je 0x313d
leaq (,%r13,2), %rax
addq %r13, %rax
leaq 0xfa402(%rip), %rcx     # 0xfd4d0
leaq (%rcx,%rax,8), %r12
movslq (%r15), %rax
movq 0xfa3c4(%rip), %rcx     # 0xfd4a0
movl (%rcx,%rax,4), %eax
cmpq %rax, %r13
jne 0x30e8
incl %ebp
jmp 0x3126
cmpl $-0x1, %eax
je 0x3113
movl %eax, (%rsp)
movl $0x0, 0x4(%rsp)
movq 0x8(%r12), %rsi
cmpq 0x10(%r12), %rsi
je 0x3119
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%r12)
jmp 0x3124
incl 0x20(%rsp)
jmp 0x3126
movq %r12, %rdi
movq %rsp, %rdx
callq 0x5076
incl %ebx
addq $0x4, %r15
cmpq %r14, %r15
jne 0x30d2
movq 0xfa38a(%rip), %rax     # 0xfd4c0
movq 0xfa37b(%rip), %rcx     # 0xfd4b8
incq %r13
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %r13, %rdx
ja 0x30a1
movq 0x5e5e(%rip), %rax      # 0x8fb8
movq (%rax), %rdi
leaq 0x312f(%rip), %rsi      # 0x6293
movl 0x20(%rsp), %edx
movl %ebx, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x21d0
movq 0xfa345(%rip), %rcx     # 0xfd4c0
subq 0xfa336(%rip), %rcx     # 0xfd4b8
movq %rcx, 0x98(%rsp)
movq 0xfa2cf(%rip), %rax     # 0xfd460
subq 0xfa2c0(%rip), %rax     # 0xfd458
movq %rax, 0x28(%rsp)
movq 0xfa2d4(%rip), %rax     # 0xfd478
subq 0xfa2c5(%rip), %rax     # 0xfd470
movq %rax, 0x90(%rsp)
sarq $0x3, %rcx
movq %rcx, 0x20(%rsp)
movq 0x50(%rsp), %r15
movq 0x58(%rsp), %rbp
cmpq %rbp, %r15
je 0x3267
movslq 0x20(%rsp), %r12
leaq 0xfa2f5(%rip), %r13     # 0xfd4d0
movslq (%r15), %r14
movslq 0x4(%r15), %rbx
addq %r12, %rbx
leaq (%r14,%r14,2), %rax
leaq (,%rax,8), %rdi
addq %r13, %rdi
movl %ebx, (%rsp)
movl $0x1, 0x4(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x3217
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x321f
movq %rsp, %rdx
callq 0x5076
leaq (%rbx,%rbx,2), %rax
leaq (,%rax,8), %rdi
addq %r13, %rdi
movl %r14d, (%rsp)
movl $0x2, 0x4(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x3252
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x325a
movq %rsp, %rdx
callq 0x5076
addq $0x8, %r15
cmpq %rbp, %r15
jne 0x31db
movq 0x28(%rsp), %rax
sarq $0x5, %rax
addq 0x20(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x70(%rsp), %r14
movq 0x78(%rsp), %r15
cmpq %r15, %r14
je 0x3325
movslq 0x28(%rsp), %r12
leaq 0xfa237(%rip), %r13     # 0xfd4d0
movslq (%r14), %rbp
movslq 0x4(%r14), %rbx
addq %r12, %rbx
leaq (,%rbp,2), %rax
addq %rbp, %rax
leaq (%r13,%rax,8), %rdi
movl %ebx, (%rsp)
movl $0x3, 0x4(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x32d6
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x32de
movq %rsp, %rdx
callq 0x5076
leaq (%rbx,%rbx,2), %rax
leaq (,%rax,8), %rdi
addq %r13, %rdi
movl %ebp, (%rsp)
movl $0x4, 0x4(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x3310
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x3318
movq %rsp, %rdx
callq 0x5076
addq $0x8, %r14
cmpq %r15, %r14
jne 0x3299
movq 0x90(%rsp), %rax
shrq $0x5, %rax
addq 0x28(%rsp), %rax
movq 0x30(%rsp), %r14
movq 0x38(%rsp), %rcx
movq %rcx, 0x20(%rsp)
cmpq %rcx, %r14
movq %rax, 0x90(%rsp)
je 0x33f6
movslq 0x28(%rsp), %rbp
movslq %eax, %r12
leaq 0xfa16b(%rip), %r13     # 0xfd4d0
movslq (%r14), %rbx
movslq 0x4(%r14), %r15
addq %rbp, %rbx
addq %r12, %r15
leaq (%rbx,%rbx,2), %rax
leaq (,%rax,8), %rdi
addq %r13, %rdi
movl %r15d, (%rsp)
movl $0x5, 0x4(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x33a5
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x33ad
movq %rsp, %rdx
callq 0x5076
leaq (%r15,%r15,2), %rax
leaq (,%rax,8), %rdi
addq %r13, %rdi
movl %ebx, (%rsp)
movl $0x6, 0x4(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x33df
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x33e7
movq %rsp, %rdx
callq 0x5076
addq $0x8, %r14
cmpq 0x20(%rsp), %r14
jne 0x3365
movq 0xfa0c3(%rip), %rax     # 0xfd4c0
subq 0xfa0b4(%rip), %rax     # 0xfd4b8
shrq $0x3, %rax
movq 0xfa051(%rip), %rcx     # 0xfd460
subq 0xfa042(%rip), %rcx     # 0xfd458
shrq $0x5, %rcx
addq %rax, %rcx
movq 0xfa054(%rip), %rax     # 0xfd478
subq 0xfa045(%rip), %rax     # 0xfd470
shrq $0x5, %rax
movq 0xfa05a(%rip), %rbx     # 0xfd490
subq 0xfa04b(%rip), %rbx     # 0xfd488
shrq $0x5, %rbx
addq %rax, %rbx
addq %rcx, %rbx
xorl %ebp, %ebp
testl %ebx, %ebx
jle 0x3476
movl %ebx, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
negq %rax
xorl %ebp, %ebp
leaq 0xfa078(%rip), %rcx     # 0xfd4d8
movq (%rcx), %rdx
subq -0x8(%rcx), %rdx
shrq $0x3, %rdx
addl %edx, %ebp
addq $0x18, %rcx
incq %rax
jne 0x3460
movq 0x5b63(%rip), %rax      # 0x8fe0
movq (%rax), %rdi
leaq 0x2e44(%rip), %rsi      # 0x62cb
movl %ebx, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x21d0
leaq 0x2d1d(%rip), %rsi      # 0x61b6
movq 0xa0(%rsp), %r12
movq %r12, %rdi
movl %ebx, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x21d0
movq 0xfa002(%rip), %rax     # 0xfd4b8
cmpq %rax, 0xfa003(%rip)     # 0xfd4c0
je 0x351e
leaq 0xfa00a(%rip), %rbx     # 0xfd4d0
leaq 0x2e1e(%rip), %r14      # 0x62eb
xorl %r15d, %r15d
movq 0x8(%rbx), %rcx
subq (%rbx), %rcx
sarq $0x3, %rcx
movq (%rax,%r15,8), %rax
movq (%rax), %r8
movq %r12, %rdi
movq %r14, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x21d0
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2bf1
incq %r15
movq 0xf9fb9(%rip), %rcx     # 0xfd4c0
movq 0xf9faa(%rip), %rax     # 0xfd4b8
subq %rax, %rcx
sarq $0x3, %rcx
addq $0x18, %rbx
cmpq %r15, %rcx
ja 0x34d0
movq 0xf9f33(%rip), %rax     # 0xfd458
cmpq %rax, 0xf9f34(%rip)     # 0xfd460
movq %r12, %rbp
movq 0x98(%rsp), %r13
je 0x35ac
shrq $0x3, %r13
movslq %r13d, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0xf9f85(%rip), %rdx     # 0xfd4d0
leaq (%rdx,%rcx,8), %rbx
leaq 0x2da2(%rip), %r14      # 0x62f8
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%rbx), %rcx
subq (%rbx), %rcx
sarq $0x3, %rcx
movq (%rax,%r15), %r8
leal (%r12,%r13), %edx
movq %rbp, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x21d0
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2bf1
incq %r12
movq 0xf9ecf(%rip), %rcx     # 0xfd460
movq 0xf9ec0(%rip), %rax     # 0xfd458
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %r15
addq $0x18, %rbx
cmpq %r12, %rcx
ja 0x355c
movq 0xf9ebd(%rip), %rax     # 0xfd470
cmpq %rax, 0xf9ebe(%rip)     # 0xfd478
movq 0x28(%rsp), %r13
je 0x3630
movslq %r13d, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0xf9f01(%rip), %rdx     # 0xfd4d0
leaq (%rdx,%rcx,8), %rbx
leaq 0x2d2b(%rip), %r14      # 0x6305
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%rbx), %rcx
subq (%rbx), %rcx
sarq $0x3, %rcx
movq (%rax,%r15), %r8
leal (%r12,%r13), %edx
movq %rbp, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x21d0
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2bf1
incq %r12
movq 0xf9e63(%rip), %rcx     # 0xfd478
movq 0xf9e54(%rip), %rax     # 0xfd470
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %r15
addq $0x18, %rbx
cmpq %r12, %rcx
ja 0x35e0
movq 0xf9e51(%rip), %rax     # 0xfd488
cmpq %rax, 0xf9e52(%rip)     # 0xfd490
movq 0x90(%rsp), %r13
je 0x36b7
movslq %r13d, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0xf9e7a(%rip), %rdx     # 0xfd4d0
leaq (%rdx,%rcx,8), %rbx
leaq 0x2cb1(%rip), %r14      # 0x6312
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%rbx), %rcx
subq (%rbx), %rcx
sarq $0x3, %rcx
movq (%rax,%r15), %r8
leal (%r12,%r13), %edx
movq %rbp, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x21d0
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2bf1
incq %r12
movq 0xf9df4(%rip), %rcx     # 0xfd490
movq 0xf9de5(%rip), %rax     # 0xfd488
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %r15
addq $0x18, %rbx
cmpq %r12, %rcx
ja 0x3667
movq 0xa8(%rsp), %rdi
callq 0x2160
movq %rbp, %rdi
callq 0x2160
movq 0xf9de5(%rip), %r14     # 0xfd4b8
movq 0xf9de6(%rip), %r15     # 0xfd4c0
cmpq %r15, %r14
je 0x374d
movq (%r14), %rbx
testq %rbx, %rbx
je 0x373f
movq 0x90(%rbx), %rdi
testq %rdi, %rdi
je 0x36f8
callq 0x2150
movq 0x68(%rbx), %rdi
leaq 0x78(%rbx), %rax
cmpq %rax, %rdi
je 0x370a
callq 0x2150
movq 0x48(%rbx), %rdi
leaq 0x58(%rbx), %rax
cmpq %rax, %rdi
je 0x371c
callq 0x2150
movq 0x20(%rbx), %rdi
leaq 0x30(%rbx), %rax
cmpq %rax, %rdi
je 0x372e
callq 0x2150
movq (%rbx), %rdi
leaq 0x10(%rbx), %rax
cmpq %rax, %rdi
je 0x373f
callq 0x2150
movq %rbx, %rdi
callq 0x2150
addq $0x8, %r14
jmp 0x36da
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x375c
callq 0x2150
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x376b
callq 0x2150
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x377a
callq 0x2150
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x37aa
jmp 0x37aa
jmp 0x37aa
jmp 0x37aa
jmp 0x37aa
jmp 0x37aa
jmp 0x37aa
jmp 0x37aa
jmp 0x37aa
jmp 0x37aa
jmp 0x37aa
jmp 0x37b1
jmp 0x37aa
jmp 0x37aa
movq %rax, %rbx
jmp 0x37bc
jmp 0x37b1
movq %rax, %rbx
movq %rsp, %rdi
callq 0x37f8
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x37cb
callq 0x2150
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x37da
callq 0x2150
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x37e9
callq 0x2150
movq %rbx, %rdi
callq 0x2250
nop