// File: dtsaras[P]GCW/rwgraph.cpp
// Function: Graph::read_similarities(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
void Graph::read_similarities(string filename, int P){
    ifstream infile(filename);
    int num_nodes;
    int max_P;
    double tmp;
    stringstream tmp_s;
    int node_id;
    string a;
    infile >> num_nodes >> max_P;
    for (int v = 1; v <= getSize(); v++){
        A[v].clear();
        // infile.getline(tmp_s, 256, "\n");
        infile >> node_id;
        for (int p = 0; p < max_P; p++){
            if (p < P){
                infile >> setprecision(16) >> tmp;
                similarities[v][p] = tmp;
                A[v].insert(pair<double, int>(-similarities[v][p], p));
                tsim_V_p[p] += similarities[v][p];
            }
            else{
                infile >> setprecision(16) >> tmp;
            }
        }
        // infile.seekg(sizeof(double) * (max_P - P) * 2, infile.cur);
        // infile.ignore(max_P - P, "\n");
        // for (int i = 0; i < max_P - P; i++)
        //     infile.ignore(max_P - P, "\n");
    }
}

// Assembly:
subq $0x478, %rsp            # imm = 0x478
movq %rdi, 0x470(%rsp)
movq %rsi, 0x468(%rsp)
movl %edx, 0x464(%rsp)
movq 0x470(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x258(%rsp), %rdi
movl $0x8, %edx
callq 0x45d0
leaq 0xc0(%rsp), %rdi
callq 0x42d0
jmp 0x1efac
leaq 0x90(%rsp), %rdi
callq 0x4510
leaq 0x258(%rsp), %rdi
leaq 0x254(%rsp), %rsi
callq 0x4250
movq %rax, 0x48(%rsp)
jmp 0x1efd5
movq 0x48(%rsp), %rdi
leaq 0x250(%rsp), %rsi
callq 0x4250
jmp 0x1efe9
movl $0x1, 0x8c(%rsp)
movq 0x50(%rsp), %rdi
movl 0x8c(%rsp), %eax
movl %eax, 0x44(%rsp)
callq 0x1db70
movl %eax, %ecx
movl 0x44(%rsp), %eax
cmpl %ecx, %eax
jg 0x1f2c4
movq 0x50(%rsp), %rax
movq 0xaf8(%rax), %rdi
movslq 0x8c(%rsp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x248b0
leaq 0x258(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x4250
jmp 0x1f052
movl $0x0, 0x88(%rsp)
movl 0x88(%rsp), %eax
cmpl 0x250(%rsp), %eax
jge 0x1f2ac
movl 0x88(%rsp), %eax
cmpl 0x464(%rsp), %eax
jge 0x1f250
movl $0x10, %edi
callq 0xfc00
movl %eax, 0x40(%rsp)
jmp 0x1f095
movl 0x40(%rsp), %eax
movl %eax, 0x84(%rsp)
movl 0x84(%rsp), %esi
leaq 0x258(%rsp), %rdi
callq 0x46b0
movq %rax, 0x38(%rsp)
jmp 0x1f0bb
movq 0x38(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x4350
jmp 0x1f0cf
movq 0x50(%rsp), %rdi
movsd 0x248(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
addq $0xae0, %rdi            # imm = 0xAE0
movq %rdi, 0x28(%rsp)
movslq 0x8c(%rsp), %rsi
callq 0xf180
movq %rax, %rdi
movslq 0x88(%rsp), %rsi
callq 0xeb00
movsd 0x20(%rsp), %xmm0
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movq 0x50(%rsp), %rax
movsd %xmm0, (%rcx)
movq 0xaf8(%rax), %rax
movslq 0x8c(%rsp), %rsi
leaq (%rsi,%rsi,2), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x30(%rsp)
callq 0xf180
movq %rax, %rdi
movslq 0x88(%rsp), %rsi
callq 0xeb00
movsd (%rax), %xmm0
movaps 0x1349e(%rip), %xmm1    # 0x32600
pxor %xmm1, %xmm0
movlpd %xmm0, 0x68(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x248f0
jmp 0x1f185
movq 0x30(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x248c0
movq %rax, 0x18(%rsp)
jmp 0x1f19b
movq 0x50(%rsp), %rdi
movq 0x18(%rsp), %rax
movq %rax, 0x60(%rsp)
addq $0xae0, %rdi            # imm = 0xAE0
movslq 0x8c(%rsp), %rsi
callq 0xf180
movq %rax, %rdi
movslq 0x88(%rsp), %rsi
callq 0xeb00
movq 0x50(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
addq $0xb00, %rdi            # imm = 0xB00
movslq 0x88(%rsp), %rsi
callq 0xeb00
movsd 0x10(%rsp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x1f294
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x1f2f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x4260
leaq 0xc0(%rsp), %rdi
callq 0x4300
jmp 0x1f2f3
movl $0x10, %edi
callq 0xfc00
movl %eax, 0xc(%rsp)
jmp 0x1f260
movl 0xc(%rsp), %eax
movl %eax, 0x5c(%rsp)
movl 0x5c(%rsp), %esi
leaq 0x258(%rsp), %rdi
callq 0x46b0
movq %rax, (%rsp)
jmp 0x1f27f
movq (%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x4350
jmp 0x1f292
jmp 0x1f294
jmp 0x1f296
movl 0x88(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x88(%rsp)
jmp 0x1f05d
jmp 0x1f2ae
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0x1eff4
leaq 0x90(%rsp), %rdi
callq 0x4260
leaq 0xc0(%rsp), %rdi
callq 0x4300
leaq 0x258(%rsp), %rdi
callq 0x4100
addq $0x478, %rsp            # imm = 0x478
retq
leaq 0x258(%rsp), %rdi
callq 0x4100
movq 0xb8(%rsp), %rdi
callq 0x4690
nopl (%rax)