// File: JenTus[P]TCEM/src_TCEM/allocator.cc
// Function: Cide::allocator::readTICGraph()
void allocator::readTICGraph() {
        
        //string probGraphFile = opt->getValue("probGraphFile");
        cout << "Reading file " << probGraphFile << endl;
        ifstream myfile (probGraphFile.c_str(), ios::in);
        //double *itemProbs; //item-specific influence probabilities

        int nrEdges = 0;
        set<int> nodes; // for control
        
        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]);
                double u3 = strToDouble(nodeids[2]); // the probability
                double u4 = strToDouble(nodeids[3]);
                
                if (u1 == u2)
                    continue;

                nodeDegree[u1] = nodeDegree[u1] + 1.0;

                nrEdges++;
                
                graphT[u2].push_back(u1); //insert to the transposed graph
                
                // for control
                nodes.insert(u1);
                nodes.insert(u2);

                rcList->at(0)->probT[u2].push_back(u3); // insert the probabilty
                rcList->at(1)->probT[u2].push_back(u4);

            }


            myfile.close();
        }
        
        else
            cout << "Can't open input graph file " << probGraphFile << endl;
        
        cout << "graph import complete " << endl;
        
    }

// Assembly:
subq $0x408, %rsp            # imm = 0x408
movq %rdi, 0x400(%rsp)
movq 0x400(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x289d2(%rip), %rdi     # 0x2efd8
leaq 0x1ddb5(%rip), %rsi     # 0x243c2
callq 0x4370
movq 0x90(%rsp), %rsi
movq %rax, %rdi
addq $0x20, %rsi
movq %rsi, 0x98(%rsp)
callq 0x4310
movq %rax, %rdi
movq 0x28990(%rip), %rsi     # 0x2efc8
callq 0x43c0
movq 0x98(%rsp), %rdi
callq 0x4130
movq %rax, %rsi
leaq 0x1f8(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
movl $0x8, %edx
callq 0x46b0
movl $0x0, 0x1f4(%rsp)
leaq 0x1c0(%rsp), %rdi
callq 0xe2f0
movq 0xa0(%rsp), %rdi
callq 0x45c0
movb %al, 0xaf(%rsp)
jmp 0x6695
movb 0xaf(%rsp), %al
testb $0x1, %al
jne 0x66a5
jmp 0x6b90
jmp 0x66a7
movq 0x1f8(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x1f8(%rsp,%rax), %rdi
callq 0x46c0
movb %al, 0x8f(%rsp)
jmp 0x66c9
movb 0x8f(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x66db
jmp 0x6b7f
leaq 0x190(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x4500
movq 0x80(%rsp), %rsi
leaq 0x1f8(%rsp), %rdi
callq 0x40a0
jmp 0x6707
leaq 0x190(%rsp), %rdi
callq 0x4600
testb $0x1, %al
jne 0x671a
jmp 0x675c
movl $0x2, 0x18c(%rsp)
jmp 0x6b3c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x6c2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x6b6d
leaq 0x170(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0xf0c0
movq 0x78(%rsp), %rsi
leaq 0x190(%rsp), %rdi
callq 0xf0d0
jmp 0x6782
xorl %eax, %eax
movl %eax, %esi
leaq 0x170(%rsp), %rdi
callq 0xf330
movq %rax, %rsi
leaq 0x148(%rsp), %rdi
callq 0x4140
jmp 0x67a5
leaq 0x148(%rsp), %rdi
callq 0xf1f0
movl %eax, 0x74(%rsp)
jmp 0x67b8
leaq 0x148(%rsp), %rdi
callq 0x41f0
movl 0x74(%rsp), %eax
movl %eax, 0x16c(%rsp)
leaq 0x170(%rsp), %rdi
movl $0x1, %esi
callq 0xf330
movq %rax, %rsi
leaq 0x120(%rsp), %rdi
callq 0x4140
jmp 0x67f4
leaq 0x120(%rsp), %rdi
callq 0xf1f0
movl %eax, 0x70(%rsp)
jmp 0x6807
leaq 0x120(%rsp), %rdi
callq 0x41f0
movl 0x70(%rsp), %eax
movl %eax, 0x144(%rsp)
leaq 0x170(%rsp), %rdi
movl $0x2, %esi
callq 0xf330
movq %rax, %rsi
leaq 0xf8(%rsp), %rdi
callq 0x4140
jmp 0x6843
leaq 0xf8(%rsp), %rdi
callq 0xda30
movsd %xmm0, 0x68(%rsp)
jmp 0x6858
leaq 0xf8(%rsp), %rdi
callq 0x41f0
movsd 0x68(%rsp), %xmm0
movsd %xmm0, 0x118(%rsp)
leaq 0x170(%rsp), %rdi
movl $0x3, %esi
callq 0xf330
movq %rax, %rsi
leaq 0xd0(%rsp), %rdi
callq 0x4140
jmp 0x6898
leaq 0xd0(%rsp), %rdi
callq 0xda30
movsd %xmm0, 0x60(%rsp)
jmp 0x68ad
leaq 0xd0(%rsp), %rdi
callq 0x41f0
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0xf0(%rsp)
movl 0x16c(%rsp), %eax
cmpl 0x144(%rsp), %eax
jne 0x699e
movl $0x2, 0x18c(%rsp)
jmp 0x6b2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x6b60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x148(%rsp), %rdi
callq 0x41f0
jmp 0x6b60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x120(%rsp), %rdi
callq 0x41f0
jmp 0x6b60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x41f0
jmp 0x6b60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x41f0
jmp 0x6b60
movq 0x90(%rsp), %rdi
addq $0xd8, %rdi
movq %rdi, 0x50(%rsp)
movslq 0x16c(%rsp), %rsi
callq 0xe170
movq 0x50(%rsp), %rdi
movsd (%rax), %xmm0
movsd 0x1d720(%rip), %xmm1    # 0x240f0
addsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movslq 0x16c(%rsp), %rsi
callq 0xe170
movsd 0x58(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x1f4(%rsp), %eax
incl %eax
movl %eax, 0x1f4(%rsp)
movslq 0x144(%rsp), %rsi
leaq 0x289b0(%rip), %rdi     # 0x2f3c0
callq 0xe110
movq %rax, %rdi
leaq 0x16c(%rsp), %rsi
callq 0xe060
jmp 0x6a27
leaq 0x1c0(%rsp), %rdi
leaq 0x16c(%rsp), %rsi
callq 0xe4a0
movb %dl, 0x47(%rsp)
movq %rax, 0x48(%rsp)
jmp 0x6a47
movb 0x47(%rsp), %al
movq 0x48(%rsp), %rcx
movq %rcx, 0xc0(%rsp)
movb %al, 0xc8(%rsp)
leaq 0x1c0(%rsp), %rdi
leaq 0x144(%rsp), %rsi
callq 0xe4a0
movb %dl, 0x37(%rsp)
movq %rax, 0x38(%rsp)
jmp 0x6a7f
movq 0x90(%rsp), %rax
movb 0x37(%rsp), %cl
movq 0x38(%rsp), %rdx
movq %rdx, 0xb0(%rsp)
movb %cl, 0xb8(%rsp)
movq 0xae8(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xe0d0
movq %rax, 0x28(%rsp)
jmp 0x6ab6
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movslq 0x144(%rsp), %rsi
callq 0xf3d0
movq %rax, %rdi
leaq 0x118(%rsp), %rsi
callq 0xe500
jmp 0x6add
movq 0x90(%rsp), %rax
movq 0xae8(%rax), %rdi
movl $0x1, %esi
callq 0xe0d0
movq %rax, 0x20(%rsp)
jmp 0x6afd
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movslq 0x144(%rsp), %rsi
callq 0xf3d0
movq %rax, %rdi
leaq 0xf0(%rsp), %rsi
callq 0xe500
jmp 0x6b24
movl $0x0, 0x18c(%rsp)
leaq 0x170(%rsp), %rdi
callq 0xf350
leaq 0x190(%rsp), %rdi
callq 0x41f0
movl 0x18c(%rsp), %eax
testl %eax, %eax
je 0x6b5b
jmp 0x6b56
jmp 0x66a7
jmp 0x66a7
leaq 0x170(%rsp), %rdi
callq 0xf350
leaq 0x190(%rsp), %rdi
callq 0x41f0
jmp 0x6c2b
leaq 0x1f8(%rsp), %rdi
callq 0x40b0
jmp 0x6b8e
jmp 0x6bdc
movq 0x28441(%rip), %rdi     # 0x2efd8
leaq 0x1d832(%rip), %rsi     # 0x243d0
callq 0x4370
movq %rax, 0x18(%rsp)
jmp 0x6baa
movq 0x18(%rsp), %rdi
movq 0x90(%rsp), %rsi
addq $0x20, %rsi
callq 0x4310
movq %rax, 0x10(%rsp)
jmp 0x6bc7
movq 0x10(%rsp), %rdi
movq 0x283f5(%rip), %rsi     # 0x2efc8
callq 0x43c0
jmp 0x6bda
jmp 0x6bdc
movq 0x283f5(%rip), %rdi     # 0x2efd8
leaq 0x1d803(%rip), %rsi     # 0x243ed
callq 0x4370
movq %rax, 0x8(%rsp)
jmp 0x6bf6
movq 0x8(%rsp), %rdi
movq 0x283c6(%rip), %rsi     # 0x2efc8
callq 0x43c0
jmp 0x6c09
leaq 0x1c0(%rsp), %rdi
callq 0xeaf0
leaq 0x1f8(%rsp), %rdi
callq 0x40d0
addq $0x408, %rsp            # imm = 0x408
retq
leaq 0x1c0(%rsp), %rdi
callq 0xeaf0
leaq 0x1f8(%rsp), %rdi
callq 0x40d0
movq 0x1b8(%rsp), %rdi
callq 0x4680
nopw %cs:(%rax,%rax)