// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x58(%rsp), %rdi
movl $0x8, %edx
callq 0x3530
leaq 0x260(%rsp), %rdi
callq 0x3260
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x58(%rsp), %rdi
leaq 0x24(%rsp), %rsi
callq 0x31e0
leaq 0xc(%rsp), %rsi
movq %rax, %rdi
callq 0x31e0
cmpl $0x0, 0x9c8(%rbx)
jle 0xeccf
movslq %ebp, %rbp
movl $0x1, %eax
leaq 0x58(%rsp), %r14
movq %rax, 0x18(%rsp)
leaq (%rax,%rax,2), %r13
movq %r13, %r15
shlq $0x4, %r15
movq 0xaf8(%rbx), %rdi
addq %r15, %rdi
callq 0x13350
movq %r14, %rdi
leaq 0x20(%rsp), %rsi
callq 0x31e0
cmpl $0x0, 0xc(%rsp)
jle 0xecb6
xorl %r12d, %r12d
movq 0x58(%rsp), %rax
movq -0x18(%rax), %rax
movq $0x10, 0x60(%rsp,%rax)
cmpq %rbp, %r12
jge 0xec98
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x3220
movsd 0x10(%rsp), %xmm0
movq 0xae0(%rbx), %rax
movq (%rax,%r13,8), %rax
movsd %xmm0, (%rax,%r12,8)
movq 0xaf8(%rbx), %rdi
addq %r15, %rdi
xorps 0x8a62(%rip), %xmm0     # 0x176c0
movlps %xmm0, 0x28(%rsp)
movl %r12d, 0x30(%rsp)
leaq 0x28(%rsp), %rsi
callq 0x133b4
movq 0xae0(%rbx), %rax
movq 0xb00(%rbx), %rcx
movq (%rax,%r13,8), %rax
movsd (%rax,%r12,8), %xmm0
addsd (%rcx,%r12,8), %xmm0
movsd %xmm0, (%rcx,%r12,8)
jmp 0xeca5
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x3220
incq %r12
movslq 0xc(%rsp), %rax
cmpq %rax, %r12
jl 0xec12
movq 0x18(%rsp), %rdx
leaq 0x1(%rdx), %rax
movslq 0x9c8(%rbx), %rcx
cmpq %rcx, %rdx
jl 0xebd8
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0xece3
callq 0x3340
movq 0xf2be(%rip), %rsi      # 0x1dfa8
leaq 0x260(%rsp), %rdi
callq 0x3290
leaq 0x2e0(%rsp), %rdi
callq 0x3120
leaq 0x58(%rsp), %rdi
callq 0x30d0
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xed63
jmp 0xed2b
jmp 0xed2b
jmp 0xed2b
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0xed42
callq 0x3340
movq 0xf25f(%rip), %rsi      # 0x1dfa8
leaq 0x260(%rsp), %rdi
callq 0x3290
leaq 0x2e0(%rsp), %rdi
callq 0x3120
leaq 0x58(%rsp), %rdi
callq 0x30d0
movq %rbx, %rdi
callq 0x35c0
nop