// File: /workspace/github_cpp_makefile_star2_O3/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), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x2220
leaq 0xa8(%rsp), %rdi
callq 0x2060
xorl %ebp, %ebp
testb %al, %al
je 0x285d
movq 0x30(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %ecx
leaq 0x30(%rsp), %rbx
leaq 0x3c0(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
callq 0x2230
leaq 0x3c0(%rsp), %r14
movzbl 0x3c0(%rsp), %eax
cmpl $0x25, %eax
jne 0x24d3
movq 0x30(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %ecx
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2230
jmp 0x249b
cmpl $0x70, %eax
jne 0x2508
leaq 0x3b41(%rip), %rsi      # 0x6020
leaq 0x5c76(%rip), %r8       # 0x815c
leaq 0x5c73(%rip), %r9       # 0x8160
leaq 0x3c0(%rsp), %rdi
leaq 0x26(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
xorl %eax, %eax
callq 0x2170
jmp 0x2531
leaq 0x3b1d(%rip), %rsi      # 0x602c
leaq 0x5c46(%rip), %rcx      # 0x815c
leaq 0x5c43(%rip), %r8       # 0x8160
leaq 0x3c0(%rsp), %rdi
leaq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0x2170
movl 0x5c28(%rip), %r13d     # 0x8160
leaq (,%r13,4), %r14
movq %r14, %rdi
callq 0x2030
movq %rax, 0x5c19(%rip)      # 0x8168
leaq (,%r13,8), %rdi
callq 0x2030
movq %rax, 0x5c0d(%rip)      # 0x8170
movq %r14, %rdi
callq 0x2030
movq %rax, 0x5c06(%rip)      # 0x8178
movq %r14, %rdi
callq 0x2030
movq %rax, 0x5bff(%rip)      # 0x8180
movl 0x5bd4(%rip), %r14d     # 0x815c
leaq (,%r14,4), %r15
movq %r15, %rdi
callq 0x2030
movq %rax, 0x5be9(%rip)      # 0x8188
movq %r15, %rdi
callq 0x2030
movq %rax, 0x5be2(%rip)      # 0x8190
leaq (,%r14,8), %r12
movq %r12, %rdi
callq 0x2030
movq %rax, 0x5bd3(%rip)      # 0x8198
movq %r12, %rdi
callq 0x2030
movq %rax, 0x5bcc(%rip)      # 0x81a0
movq %r15, %rdi
callq 0x2030
movq %rax, 0x5bc5(%rip)      # 0x81a8
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x20e0
movq %r14, %rdi
callq 0x2030
movq %rax, 0x5bb1(%rip)      # 0x81b0
movq %r15, %rdi
callq 0x2030
movq %rax, 0x5baa(%rip)      # 0x81b8
movq %r15, %rdi
callq 0x2030
movq %rax, 0x5ba3(%rip)      # 0x81c0
movq %r14, %rdi
callq 0x2030
movq %rax, 0x5b9c(%rip)      # 0x81c8
testq %r13, %r13
je 0x273e
xorl %ebp, %ebp
leaq 0x3c0(%rsp), %r12
leaq 0x238(%rsp), %r13
leaq 0xc(%rsp), %r14
movq 0x596d(%rip), %r15      # 0x7fc0
movq 0x30(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %ecx
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2230
movq %r13, %rdi
callq 0x2120
movq %r12, %rdi
callq 0x20d0
leaq 0x248(%rsp), %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x2180
cmpb $0x65, 0x3c0(%rsp)
movq %r13, %rax
jne 0x26b9
movq %r13, %rdi
leaq 0x17(%rsp), %rsi
callq 0x21a0
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x2200
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
movl 0x10(%rsp), %eax
decl %eax
movl %eax, 0x10(%rsp)
decl 0xc(%rsp)
movq 0x5ac2(%rip), %rcx      # 0x81a8
incl (%rcx,%rax,4)
movl 0xc(%rsp), %eax
incl (%rcx,%rax,4)
movl 0x10(%rsp), %eax
movq 0x5a75(%rip), %rcx      # 0x8170
movl %eax, (%rcx,%rbp,8)
movl 0xc(%rsp), %eax
movl %eax, 0x4(%rcx,%rbp,8)
movq 0x5a5b(%rip), %rax      # 0x8168
movl $0x0, (%rax,%rbp,4)
movq %r13, %rdi
movq %r15, %rsi
callq 0x2130
leaq 0x2b8(%rsp), %rdi
callq 0x2090
incq %rbp
movl 0x5a2b(%rip), %eax      # 0x8160
cmpq %rax, %rbp
jb 0x2653
leaq 0x30(%rsp), %rdi
callq 0x2050
movl 0x5a0e(%rip), %ebx      # 0x815c
movl $0x0, 0x18(%rsp)
testq %rbx, %rbx
je 0x27a5
movq 0x5a46(%rip), %r15      # 0x81a8
movq 0x5a37(%rip), %r12      # 0x81a0
movq 0x5a28(%rip), %r13      # 0x8198
xorl %ebp, %ebp
movl (%r15,%rbp,4), %r14d
shlq $0x2, %r14
movq %r14, %rdi
callq 0x2030
movq %rax, (%r12,%rbp,8)
movq %r14, %rdi
callq 0x2030
movq %rax, (%r13,%rbp,8)
incq %rbp
movl %ebp, 0x18(%rsp)
cmpq %rbp, %rbx
jne 0x2772
shlq $0x2, %rbx
jmp 0x27a7
xorl %ebx, %ebx
movq %rbx, %rdi
callq 0x2030
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x20e0
cmpl $0x0, 0x599a(%rip)      # 0x8160
je 0x2850
movq 0x599d(%rip), %rax      # 0x8170
movq 0x59be(%rip), %rcx      # 0x8198
movq 0x59bf(%rip), %rdx      # 0x81a0
xorl %esi, %esi
movl (%rax,%rsi,8), %edi
movl %edi, 0x10(%rsp)
movl 0x4(%rax,%rsi,8), %r8d
movl %r8d, 0xc(%rsp)
movq (%rcx,%rdi,8), %r8
movslq (%r14,%rdi,4), %rdi
movl %esi, (%r8,%rdi,4)
movl 0xc(%rsp), %edi
movq (%rcx,%rdi,8), %r8
movslq (%r14,%rdi,4), %rdi
movl %esi, (%r8,%rdi,4)
movl 0xc(%rsp), %edi
movl 0x10(%rsp), %r8d
movq (%rdx,%r8,8), %r9
movslq (%r14,%r8,4), %r8
movl %edi, (%r9,%r8,4)
movl 0x10(%rsp), %r8d
movq (%rdx,%rdi,8), %r9
movslq (%r14,%rdi,4), %rdi
movl %r8d, (%r9,%rdi,4)
incl (%r14,%r8,4)
movl 0xc(%rsp), %edi
incl (%r14,%rdi,4)
incq %rsi
movl 0x5915(%rip), %edi      # 0x8160
cmpq %rdi, %rsi
jb 0x27e3
movq %r14, %rdi
callq 0x2190
movl $0x1, %ebp
leaq 0x30(%rsp), %rdi
callq 0x2070
movl %ebp, %eax
addq $0x7c8, %rsp            # imm = 0x7C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2885
jmp 0x2885
jmp 0x2885
jmp 0x2885
jmp 0x2885
movq %rax, %rbx
jmp 0x28ae
movq %rax, %rbx
movq 0x572c(%rip), %rsi      # 0x7fc0
leaq 0x238(%rsp), %rdi
callq 0x2130
leaq 0x2b8(%rsp), %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2210