// File: /workspace/github_cpp_makefile_star2_O2/quancs[P]EAVC/./eavc.h
// Function: build_instance(char*)
int build_instance(char *filename) {
    char line[1024];
    char tempstr1[10];
    char tempstr2[10];
    unsigned int  v, e;

    char	tmp;
    unsigned int  v1, v2;

    ifstream infile(filename);
    if (!infile.is_open()) return 0;

    /*** build problem data structures of the instance ***/
    infile.getline(line, 1024);
    while (line[0] == '%') infile.getline(line, 1024);
    if (line[0] == 'p')
        sscanf(line, "%s %s %d %d", tempstr1, tempstr2, &vNum, &eNum);
    else
        sscanf(line, "%d %d %d", &v, &vNum, &eNum);

    eTimestamp = new unsigned int[eNum];
    edges = new Edge [eNum];							//be initialized here
    uncovEdges = new unsigned int[eNum];                      //only need to initialized uncov_stack_fill_pointer, has been done in init_sol()
    uncovEdgeIndexes = new unsigned int [eNum];             //the same as above
    dscore = new int [vNum];                       //be initialized in init_sol()
    vTimestamp = new unsigned int [vNum];             //be initialized in init_sol()
    vEdges = new unsigned int *[vNum];                     //be initialized here
    vAdj = new unsigned int *[vNum];                       //the same as above
    vDegree = new unsigned int [vNum];                     //the same as above
    memset(vDegree, 0, sizeof(unsigned int) * vNum);
    vInC = new VerticeStatus [vNum];                      //be initialized in init_sol()
    cVertexes = new unsigned int [vNum];                  //be initialized in reset_remove_cand() in init_sol()
    cVertexIndexes = new unsigned int [vNum];         //the same as above
    vInBest = new VerticeStatus [vNum];                 //be initialized in update_best_sol() in init_sol()

    for (e = 0; e < eNum; e++) {
        infile.getline(line, 1024);
        stringstream ss;
        ss << line;
        if (line[0] == 'e')
            ss >> tmp >> v1 >> v2;
        else
            ss >> v1 >> v2;

        v1 = v1 - 1;
        v2 = v2 - 1;

        vDegree[v1]++;
        vDegree[v2]++;

        edges[e].v1 = v1;
        edges[e].v2 = v2;
        eTimestamp[e] = 0;
    }
    infile.close();

    /* build v_adj and v_edges arrays */
    for (v = 0; v < vNum; v++) {
        vAdj[v] = new unsigned int[vDegree[v]];
        vEdges[v] = new unsigned int[vDegree[v]];
    }

    //for(v=1; v<=v_num; v++) v_degree_tmp[v]=0;

    //	int v_degree_tmp[MAXV];
    int *vDegreeTmp = new int [vNum];
    memset(vDegreeTmp, 0, sizeof(int) *vNum);
    for (e = 0; e < eNum; e++) {
        v1 = edges[e].v1;
        v2 = edges[e].v2;

        vEdges[v1][vDegreeTmp[v1]] = e;
        vEdges[v2][vDegreeTmp[v2]] = e;

        vAdj[v1][vDegreeTmp[v1]] = v2;
        vAdj[v2][vDegreeTmp[v2]] = v1;

        vDegreeTmp[v1]++;
        vDegreeTmp[v2]++;
    }
    delete[] vDegreeTmp;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7c8, %rsp            # imm = 0x7C8
movq %rdi, %rsi
leaq 0x30(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x21f0
leaq 0xa8(%rsp), %rdi
callq 0x2050
xorl %ebx, %ebx
testb %al, %al
je 0x276a
leaq 0x30(%rsp), %rdi
leaq 0x3c0(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x2080
leaq 0x30(%rsp), %rbx
leaq 0x3c0(%rsp), %r14
movzbl 0x3c0(%rsp), %eax
cmpl $0x25, %eax
jne 0x2445
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2080
jmp 0x2426
cmpl $0x70, %eax
jne 0x247a
leaq 0x2bbf(%rip), %rsi      # 0x5010
leaq 0x4ce4(%rip), %r8       # 0x713c
leaq 0x4ce1(%rip), %r9       # 0x7140
leaq 0x3c0(%rsp), %rdi
leaq 0x26(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
xorl %eax, %eax
callq 0x2140
jmp 0x24a3
leaq 0x2b9b(%rip), %rsi      # 0x501c
leaq 0x4cb4(%rip), %rcx      # 0x713c
leaq 0x4cb1(%rip), %r8       # 0x7140
leaq 0x3c0(%rsp), %rdi
leaq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0x2140
movl 0x4c97(%rip), %ebx      # 0x7140
leaq (,%rbx,4), %r14
movq %r14, %rdi
callq 0x2030
movq %rax, 0x4c88(%rip)      # 0x7148
leaq (,%rbx,8), %rdi
callq 0x2030
movq %rax, 0x4c7c(%rip)      # 0x7150
movq %r14, %rdi
callq 0x2030
movq %rax, 0x4c75(%rip)      # 0x7158
movq %r14, %rdi
callq 0x2030
movq %rax, 0x4c6e(%rip)      # 0x7160
movl 0x4c43(%rip), %r12d     # 0x713c
leaq (,%r12,4), %r14
movq %r14, %rdi
callq 0x2030
movq %rax, 0x4c58(%rip)      # 0x7168
movq %r14, %rdi
callq 0x2030
movq %rax, 0x4c51(%rip)      # 0x7170
leaq (,%r12,8), %r15
movq %r15, %rdi
callq 0x2030
movq %rax, 0x4c42(%rip)      # 0x7178
movq %r15, %rdi
callq 0x2030
movq %rax, 0x4c3b(%rip)      # 0x7180
movq %r14, %rdi
callq 0x2030
movq %rax, 0x4c34(%rip)      # 0x7188
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x20d0
movq %r12, %rdi
callq 0x2030
movq %rax, 0x4c20(%rip)      # 0x7190
movq %r14, %rdi
callq 0x2030
movq %rax, 0x4c19(%rip)      # 0x7198
movq %r14, %rdi
callq 0x2030
movq %rax, 0x4c12(%rip)      # 0x71a0
movq %r12, %rdi
callq 0x2030
movq %rax, 0x4c0b(%rip)      # 0x71a8
xorl %r14d, %r14d
leaq 0x3c0(%rsp), %r15
leaq 0x238(%rsp), %r12
leaq 0x10(%rsp), %rbp
leaq 0xc(%rsp), %r13
movl %ebx, %eax
cmpq %rax, %r14
jae 0x2678
movl $0x400, %edx            # imm = 0x400
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x2080
movq %r12, %rdi
callq 0x2100
leaq 0x248(%rsp), %rdi
movq %r15, %rsi
callq 0x2150
cmpb $0x65, 0x3c0(%rsp)
movq %r12, %rax
jne 0x2609
movq %r12, %rdi
leaq 0x17(%rsp), %rsi
callq 0x2180
movq %rax, %rdi
movq %rbp, %rsi
callq 0x21d0
movq %rax, %rdi
movq %r13, %rsi
callq 0x21d0
movl 0x10(%rsp), %eax
decl %eax
movl %eax, 0x10(%rsp)
decl 0xc(%rsp)
movq 0x4b54(%rip), %rcx      # 0x7188
incl (%rcx,%rax,4)
movl 0xc(%rsp), %eax
incl (%rcx,%rax,4)
movl 0x10(%rsp), %eax
movq 0x4b07(%rip), %rcx      # 0x7150
movl %eax, (%rcx,%r14,8)
movl 0xc(%rsp), %eax
movl %eax, 0x4(%rcx,%r14,8)
movq 0x4aeb(%rip), %rax      # 0x7148
andl $0x0, (%rax,%r14,4)
movq %r12, %rdi
callq 0x2110
incq %r14
movl 0x4acd(%rip), %ebx      # 0x7140
jmp 0x25ba
leaq 0x30(%rsp), %rdi
callq 0x2040
movl 0x4ab4(%rip), %ebx      # 0x713c
movq 0x4af9(%rip), %r13      # 0x7188
movq 0x4aea(%rip), %r15      # 0x7180
movq 0x4adb(%rip), %r12      # 0x7178
xorl %ebp, %ebp
movl %ebp, 0x18(%rsp)
cmpq %rbp, %rbx
je 0x26ce
movl (%r13,%rbp,4), %r14d
shlq $0x2, %r14
movq %r14, %rdi
callq 0x2030
movq %rax, (%r15,%rbp,8)
movq %r14, %rdi
callq 0x2030
movq %rax, (%r12,%rbp,8)
incq %rbp
jmp 0x269f
shlq $0x2, %rbx
movq %rbx, %rdi
callq 0x2030
movq %rax, %r14
xorl %r13d, %r13d
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x20d0
movq 0x4a5c(%rip), %rax      # 0x7150
movl 0x4a46(%rip), %ecx      # 0x7140
cmpq %rcx, %r13
jae 0x275f
movl (%rax,%r13,8), %ecx
movl %ecx, 0x10(%rsp)
movl 0x4(%rax,%r13,8), %edx
movl %edx, 0xc(%rsp)
movq (%r12,%rcx,8), %rdx
movslq (%r14,%rcx,4), %rcx
movl %r13d, (%rdx,%rcx,4)
movl 0xc(%rsp), %ecx
movq (%r12,%rcx,8), %rdx
movslq (%r14,%rcx,4), %rcx
movl %r13d, (%rdx,%rcx,4)
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %edx
movq (%r15,%rdx,8), %rsi
movslq (%r14,%rdx,4), %rdx
movl %ecx, (%rsi,%rdx,4)
movl 0x10(%rsp), %edx
movq (%r15,%rcx,8), %rsi
movslq (%r14,%rcx,4), %rcx
movl %edx, (%rsi,%rcx,4)
incl (%r14,%rdx,4)
movl 0xc(%rsp), %ecx
incl (%r14,%rcx,4)
incq %r13
jmp 0x26f4
movq %r14, %rdi
callq 0x2170
pushq $0x1
popq %rbx
leaq 0x30(%rsp), %rdi
callq 0x2060
movl %ebx, %eax
addq $0x7c8, %rsp            # imm = 0x7C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2792
jmp 0x2792
jmp 0x2792
jmp 0x2792
jmp 0x2792
movq %rax, %rbx
jmp 0x27a7
movq %rax, %rbx
leaq 0x238(%rsp), %rdi
callq 0x2110
leaq 0x30(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x21e0