// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rdi, %r14
movq 0x20(%rdi), %rsi
leaq 0x90(%rsp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x35f0
leaq 0x108(%rsp), %rdi
callq 0x30a0
xorl %ebx, %ebx
movl $0x0, %ebp
testb %al, %al
je 0x4917
movq %r14, 0x48(%rsp)
movq 0x90(%rsp), %rax
movq -0x18(%rax), %rcx
xorl %ebx, %ebx
testb $0x2, 0xb0(%rsp,%rcx)
movl $0x0, 0xc(%rsp)
jne 0x4901
addq $-0x18, %rax
movl $0x0, 0xc(%rsp)
leaq 0x70(%rsp), %r13
leaq 0x50(%rsp), %rbp
xorl %ebx, %ebx
leaq 0x20(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
movq (%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %edx
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x3600
cmpq $0x0, 0x18(%rsp)
je 0x48cf
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xb203
movq 0x30(%rsp), %rax
leaq 0x80(%rsp), %rcx
movq %rcx, 0x70(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xb732
movq %r13, %r14
movq %r13, %rdi
callq 0xb2f9
movl %eax, %r13d
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x4867
callq 0x32c0
movq 0x30(%rsp), %rax
leaq 0x60(%rsp), %rcx
movq %rcx, 0x50(%rsp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0xb732
movq %rbp, %r12
movq %rbp, %rdi
callq 0xb2f9
movl %eax, %ebp
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x48aa
callq 0x32c0
cmpl %ebp, %r13d
je 0x48bf
incl 0xc(%rsp)
cmpl %ebx, %r13d
cmovgl %r13d, %ebx
cmpl %ebx, %ebp
cmovgl %ebp, %ebx
movq %r14, %r13
movq %r12, %rbp
leaq 0x30(%rsp), %rdi
callq 0xb404
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x48e3
callq 0x32c0
movq 0x90(%rsp), %rax
movq -0x18(%rax), %rcx
addq $-0x18, %rax
testb $0x2, 0xb0(%rsp,%rcx)
je 0x47ba
leaq 0x90(%rsp), %rdi
callq 0x3090
movl 0xc(%rsp), %ebp
movq 0x48(%rsp), %r14
incl %ebx
movl %ebx, 0x68(%r14)
movl %ebp, 0x6c(%r14)
movq 0x136b0(%rip), %rdi     # 0x17fd8
leaq 0xda7e(%rip), %rsi      # 0x123ad
movl $0x16, %edx
callq 0x3340
movl 0x68(%r14), %esi
movq 0x13694(%rip), %rdi     # 0x17fd8
callq 0x3580
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31e0
movq 0x1365e(%rip), %rdi     # 0x17fd8
leaq 0xda43(%rip), %rsi      # 0x123c4
movl $0x16, %edx
callq 0x3340
movq 0x13646(%rip), %rdi     # 0x17fd8
movl %ebp, %esi
callq 0x3580
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31e0
leaq 0x90(%rsp), %rdi
callq 0x30b0
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
jmp 0x4a05
jmp 0x4a11
jmp 0x4a11
movq %rax, %rbx
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x4a14
callq 0x32c0
jmp 0x4a14
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xb404
jmp 0x4a28
movq %rax, %rbx
jmp 0x4a3c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x4a3c
callq 0x32c0
leaq 0x90(%rsp), %rdi
callq 0x30b0
movq %rbx, %rdi
callq 0x35c0
nop