// File: wenleix[P]EdgePPR/src/CreateObjGraph.cpp
// Function: readNewPaper(_IO_FILE*)
Publication* readNewPaper(FILE* file) {
    if (fgets(lineBuf, MaxLineLen, file) == NULL)
        return NULL;

    Publication *p = new Publication();
    p->title = string(ParseAttrLine(lineBuf, "Title"));
    p->id = atoi(ParseNextLine(file, "ID"));
    p->authors = string(ParseNextLine(file, "Authors"));
    p->year = atoi(ParseNextLine(file, "Year"));
    p->forum = string(ParseNextLine(file, "Conf"));		//	TODO: hmm
    p->refs.resize(atoi(ParseNextLine(file, "NumRef")));

    istringstream iss(ParseNextLine(file, "Refs"));
    for (int i = 0; i < p->refs.size(); i++) {
    	iss >> p->refs[i];
//        assert((iss >> p->refs[i]) != NULL);
    }

    assert(fgets(lineBuf, MaxLineLen, file) != NULL);
    lineBuf[strlen(lineBuf) - 1] = 0;   //  Delete the last '\n'
    assert(lineBuf[0] == 0);

    char yearbuf[100];
    sprintf(yearbuf, "@%d", p->year);
    p->conf = p->forum + yearbuf;

    return p;
}

// Assembly:
subq $0x378, %rsp            # imm = 0x378
movq %rdi, 0x368(%rsp)
movq 0x368(%rsp), %rdx
leaq 0x10902(%rip), %rdi     # 0x131b0
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x2270
cmpq $0x0, %rax
jne 0x28cf
movq $0x0, 0x370(%rsp)
jmp 0x2e37
movl $0xa8, %edi
callq 0x21a0
movq %rax, %rdi
movq %rdi, 0x88(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x90(%rdi)
movaps %xmm0, 0x80(%rdi)
movaps %xmm0, 0x70(%rdi)
movaps %xmm0, 0x60(%rdi)
movaps %xmm0, 0x50(%rdi)
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
movq $0x0, 0xa0(%rdi)
callq 0x4600
movq 0x88(%rsp), %rax
movq %rax, 0x360(%rsp)
leaq 0x10870(%rip), %rdi     # 0x131b0
leaq 0xa7ca(%rip), %rsi      # 0xd111
callq 0x2790
movq %rax, 0x90(%rsp)
leaq 0x33f(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0x22d0
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
leaq 0x340(%rsp), %rdi
callq 0x2210
jmp 0x2988
movq 0x360(%rsp), %rdi
leaq 0x340(%rsp), %rsi
movq %rsi, 0x58(%rsp)
callq 0x21d0
movq 0x58(%rsp), %rdi
callq 0x2120
leaq 0x33f(%rsp), %rdi
callq 0x21b0
movq 0x368(%rsp), %rdi
leaq 0xa74f(%rip), %rsi      # 0xd117
callq 0x2820
movq %rax, %rdi
callq 0x2260
movl %eax, %ecx
movq 0x360(%rsp), %rax
movl %ecx, 0x88(%rax)
movq 0x368(%rsp), %rdi
leaq 0xa726(%rip), %rsi      # 0xd11a
callq 0x2820
movq %rax, 0x60(%rsp)
leaq 0x307(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x22d0
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
leaq 0x308(%rsp), %rdi
callq 0x2210
jmp 0x2a29
movq 0x360(%rsp), %rdi
addq $0x20, %rdi
leaq 0x308(%rsp), %rsi
movq %rsi, 0x40(%rsp)
callq 0x21d0
movq 0x40(%rsp), %rdi
callq 0x2120
leaq 0x307(%rsp), %rdi
callq 0x21b0
movq 0x368(%rsp), %rdi
leaq 0xa6b5(%rip), %rsi      # 0xd122
callq 0x2820
movq %rax, %rdi
callq 0x2260
movl %eax, %ecx
movq 0x360(%rsp), %rax
movl %ecx, 0x40(%rax)
movq 0x368(%rsp), %rdi
leaq 0xa691(%rip), %rsi      # 0xd127
callq 0x2820
movq %rax, 0x48(%rsp)
leaq 0x2df(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x22d0
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0x2e0(%rsp), %rdi
callq 0x2210
jmp 0x2acb
movq 0x360(%rsp), %rdi
addq $0x48, %rdi
leaq 0x2e0(%rsp), %rsi
movq %rsi, 0x20(%rsp)
callq 0x21d0
movq 0x20(%rsp), %rdi
callq 0x2120
leaq 0x2df(%rsp), %rdi
callq 0x21b0
movq 0x360(%rsp), %rax
addq $0x90, %rax
movq %rax, 0x28(%rsp)
movq 0x368(%rsp), %rdi
leaq 0xa60a(%rip), %rsi      # 0xd12c
callq 0x2820
movq %rax, %rdi
callq 0x2260
movq 0x28(%rsp), %rdi
movslq %eax, %rsi
callq 0x4660
movq 0x368(%rsp), %rdi
leaq 0xa5e8(%rip), %rsi      # 0xd133
callq 0x2820
movq %rax, 0x30(%rsp)
leaq 0x137(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x22d0
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x138(%rsp), %rdi
callq 0x2210
jmp 0x2b80
leaq 0x158(%rsp), %rdi
leaq 0x138(%rsp), %rsi
movl $0x8, %edx
callq 0x22b0
jmp 0x2b9c
leaq 0x138(%rsp), %rdi
callq 0x2120
leaq 0x137(%rsp), %rdi
callq 0x21b0
movl $0x0, 0x130(%rsp)
movslq 0x130(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x360(%rsp), %rdi
addq $0x90, %rdi
callq 0x4700
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jae 0x2d17
movq 0x360(%rsp), %rdi
addq $0x90, %rdi
movslq 0x130(%rsp), %rsi
callq 0x4720
movq %rax, %rsi
leaq 0x158(%rsp), %rdi
callq 0x2110
jmp 0x2c21
jmp 0x2c23
movl 0x130(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x130(%rsp)
jmp 0x2bc1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0x33f(%rsp), %rdi
callq 0x21b0
jmp 0x2e47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0x307(%rsp), %rdi
callq 0x21b0
jmp 0x2e47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0x2df(%rsp), %rdi
callq 0x21b0
jmp 0x2e47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
jmp 0x2cdf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0x138(%rsp), %rdi
callq 0x2120
leaq 0x137(%rsp), %rdi
callq 0x21b0
jmp 0x2e47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x330(%rsp)
movl %eax, 0x32c(%rsp)
leaq 0x158(%rsp), %rdi
callq 0x20c0
jmp 0x2e47
movq 0x368(%rsp), %rdx
leaq 0x1048a(%rip), %rdi     # 0x131b0
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x2270
movq %rax, 0x10(%rsp)
jmp 0x2d37
movq 0x10(%rsp), %rax
cmpq $0x0, %rax
je 0x2d44
jmp 0x2d63
leaq 0xa373(%rip), %rdi      # 0xd0be
leaq 0xa2c4(%rip), %rsi      # 0xd016
movl $0x78, %edx
leaq 0xa3da(%rip), %rcx      # 0xd138
callq 0x2130
leaq 0x10446(%rip), %rdi     # 0x131b0
callq 0x20a0
movq %rax, %rcx
subq $0x1, %rcx
leaq 0x10433(%rip), %rax     # 0x131b0
movb $0x0, (%rax,%rcx)
movsbl 0x10428(%rip), %eax     # 0x131b0
cmpl $0x0, %eax
jne 0x2d8f
jmp 0x2dae
leaq 0xa3c4(%rip), %rdi      # 0xd15a
leaq 0xa279(%rip), %rsi      # 0xd016
movl $0x7a, %edx
leaq 0xa38f(%rip), %rcx      # 0xd138
callq 0x2130
movq 0x360(%rsp), %rax
movl 0x40(%rax), %edx
leaq 0xa3aa(%rip), %rsi      # 0xd16a
xorl %eax, %eax
leaq 0xc0(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x2030
movq 0x8(%rsp), %rdx
movq 0x360(%rsp), %rsi
addq $0x48, %rsi
leaq 0xa0(%rsp), %rdi
callq 0x4740
jmp 0x2df4
movq 0x360(%rsp), %rdi
addq $0x68, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x21d0
leaq 0xa0(%rsp), %rdi
callq 0x2120
movq 0x360(%rsp), %rax
movq %rax, 0x370(%rsp)
leaq 0x158(%rsp), %rdi
callq 0x20c0
movq 0x370(%rsp), %rax
addq $0x378, %rsp            # imm = 0x378
retq
movq 0x330(%rsp), %rdi
callq 0x22c0
nopw %cs:(%rax,%rax)