// File: JenTus[P]TCEM/src_TCEM/allocator.cc
// Function: Cide::allocator::readGraphNodes()
void allocator::readGraphNodes() {

        //string probGraphFile = opt->getValue("probGraphFile");
        ifstream myfile (probGraphFile.c_str(), ios::in);

        //double *itemProbs; //item-specific influence probabilities

        int nrEdges = 0;
        int nrNodes = 0;

        if (myfile.is_open()) {
            while (! myfile.eof() )	{
                std::string line;
                getline (myfile,line);
                if (line.empty()) continue;

                std::vector<std::string> nodeids;
                split1(line, nodeids);
                 int u1 = strToInt(nodeids[0]);
                 int u2 = strToInt(nodeids[1]);
            
                if (u1 == u2)
                    continue;

                nrEdges++;
                // for control

                if(u1>nrNodes){
                    nrNodes = u1;
                }
                if(u2>nrNodes){
                    nrNodes = u2;
                }

            }

            myfile.close();
        }

        n = nrNodes +1;
        m = nrEdges;
        cout << "total number of nodes " << n << endl;
        cout << "total number of edges " << nrEdges << endl;
    }

// Assembly:
subq $0x318, %rsp            # imm = 0x318
movq %rdi, 0x310(%rsp)
movq 0x310(%rsp), %rdi
movq %rdi, 0x48(%rsp)
addq $0x20, %rdi
callq 0x4130
movq %rax, %rsi
leaq 0x108(%rsp), %rdi
movq %rdi, 0x50(%rsp)
movl $0x8, %edx
callq 0x46b0
movq 0x50(%rsp), %rdi
movl $0x0, 0x104(%rsp)
movl $0x0, 0x100(%rsp)
callq 0x45c0
movb %al, 0x5f(%rsp)
jmp 0x5bb5
movb 0x5f(%rsp), %al
testb $0x1, %al
jne 0x5bc2
jmp 0x5e62
jmp 0x5bc4
movq 0x108(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x108(%rsp,%rax), %rdi
callq 0x46c0
movb %al, 0x47(%rsp)
jmp 0x5be3
movb 0x47(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5bf2
jmp 0x5e51
leaq 0xd0(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x4500
movq 0x38(%rsp), %rsi
leaq 0x108(%rsp), %rdi
callq 0x40a0
jmp 0x5c18
leaq 0xd0(%rsp), %rdi
callq 0x4600
testb $0x1, %al
jne 0x5c2b
jmp 0x5c6d
movl $0x2, 0xcc(%rsp)
jmp 0x5e0e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
jmp 0x5f1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
jmp 0x5e3f
leaq 0xb0(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xf0c0
movq 0x30(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0xf0d0
jmp 0x5c93
xorl %eax, %eax
movl %eax, %esi
leaq 0xb0(%rsp), %rdi
callq 0xf330
movq %rax, %rsi
leaq 0x88(%rsp), %rdi
callq 0x4140
jmp 0x5cb6
leaq 0x88(%rsp), %rdi
callq 0xf1f0
movl %eax, 0x2c(%rsp)
jmp 0x5cc9
leaq 0x88(%rsp), %rdi
callq 0x41f0
movl 0x2c(%rsp), %eax
movl %eax, 0xac(%rsp)
leaq 0xb0(%rsp), %rdi
movl $0x1, %esi
callq 0xf330
movq %rax, %rsi
leaq 0x60(%rsp), %rdi
callq 0x4140
jmp 0x5d02
leaq 0x60(%rsp), %rdi
callq 0xf1f0
movl %eax, 0x28(%rsp)
jmp 0x5d12
leaq 0x60(%rsp), %rdi
callq 0x41f0
movl 0x28(%rsp), %eax
movl %eax, 0x84(%rsp)
movl 0xac(%rsp), %eax
cmpl 0x84(%rsp), %eax
jne 0x5da9
movl $0x2, 0xcc(%rsp)
jmp 0x5e01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
jmp 0x5e32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x41f0
jmp 0x5e32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x41f0
jmp 0x5e32
movl 0x104(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x104(%rsp)
movl 0xac(%rsp), %eax
cmpl 0x100(%rsp), %eax
jle 0x5dd8
movl 0xac(%rsp), %eax
movl %eax, 0x100(%rsp)
movl 0x84(%rsp), %eax
cmpl 0x100(%rsp), %eax
jle 0x5df6
movl 0x84(%rsp), %eax
movl %eax, 0x100(%rsp)
movl $0x0, 0xcc(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0xf350
leaq 0xd0(%rsp), %rdi
callq 0x41f0
movl 0xcc(%rsp), %eax
testl %eax, %eax
je 0x5e2d
jmp 0x5e28
jmp 0x5bc4
jmp 0x5bc4
leaq 0xb0(%rsp), %rdi
callq 0xf350
leaq 0xd0(%rsp), %rdi
callq 0x41f0
jmp 0x5f1d
leaq 0x108(%rsp), %rdi
callq 0x40b0
jmp 0x5e60
jmp 0x5e62
movq 0x48(%rsp), %rax
movl 0x100(%rsp), %ecx
incl %ecx
movl %ecx, 0x68(%rax)
movl 0x104(%rsp), %ecx
movl %ecx, 0x6c(%rax)
movq 0x29154(%rip), %rdi     # 0x2efd8
leaq 0x1e4d2(%rip), %rsi     # 0x2435d
callq 0x4370
movq %rax, 0x20(%rsp)
jmp 0x5e97
movq 0x20(%rsp), %rdi
movq 0x48(%rsp), %rax
movl 0x68(%rax), %esi
callq 0x4650
movq %rax, 0x18(%rsp)
jmp 0x5eb0
movq 0x18(%rsp), %rdi
movq 0x2910c(%rip), %rsi     # 0x2efc8
callq 0x43c0
jmp 0x5ec3
movq 0x2910e(%rip), %rdi     # 0x2efd8
leaq 0x1e4a3(%rip), %rsi     # 0x24374
callq 0x4370
movq %rax, 0x10(%rsp)
jmp 0x5edd
movq 0x10(%rsp), %rdi
movl 0x104(%rsp), %esi
callq 0x4650
movq %rax, 0x8(%rsp)
jmp 0x5ef5
movq 0x8(%rsp), %rdi
movq 0x290c7(%rip), %rsi     # 0x2efc8
callq 0x43c0
jmp 0x5f08
leaq 0x108(%rsp), %rdi
callq 0x40d0
addq $0x318, %rsp            # imm = 0x318
retq
leaq 0x108(%rsp), %rdi
callq 0x40d0
movq 0xf8(%rsp), %rdi
callq 0x4680
nopw (%rax,%rax)