// File: /workspace/github_cpp_makefile_star2_O1/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 0x2867
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 0x3b31(%rip), %rsi      # 0x6010
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 0x3b0d(%rip), %rsi      # 0x601c
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), %r15d     # 0x8160
leaq (,%r15,4), %r14
movq %r14, %rdi
callq 0x2030
movq %rax, 0x5c19(%rip)      # 0x8168
shlq $0x3, %r15
movq %r15, %rdi
callq 0x2030
movq %rax, 0x5c0e(%rip)      # 0x8170
movq %r14, %rdi
callq 0x2030
movq %rax, 0x5c07(%rip)      # 0x8178
movq %r14, %rdi
callq 0x2030
movq %rax, 0x5c00(%rip)      # 0x8180
movl 0x5bd5(%rip), %r14d     # 0x815c
leaq (,%r14,4), %r15
movq %r15, %rdi
callq 0x2030
movq %rax, 0x5bea(%rip)      # 0x8188
movq %r15, %rdi
callq 0x2030
movq %rax, 0x5be3(%rip)      # 0x8190
leaq (,%r14,8), %r12
movq %r12, %rdi
callq 0x2030
movq %rax, 0x5bd4(%rip)      # 0x8198
movq %r12, %rdi
callq 0x2030
movq %rax, 0x5bcd(%rip)      # 0x81a0
movq %r15, %rdi
callq 0x2030
movq %rax, 0x5bc6(%rip)      # 0x81a8
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x20e0
movq %r14, %rdi
callq 0x2030
movq %rax, 0x5bb2(%rip)      # 0x81b0
movq %r15, %rdi
callq 0x2030
movq %rax, 0x5bab(%rip)      # 0x81b8
movq %r15, %rdi
callq 0x2030
movq %rax, 0x5ba4(%rip)      # 0x81c0
movq %r14, %rdi
callq 0x2030
movq %rax, 0x5b9d(%rip)      # 0x81c8
cmpl $0x0, 0x5b2e(%rip)      # 0x8160
je 0x2741
xorl %ebp, %ebp
leaq 0x3c0(%rsp), %r12
leaq 0x238(%rsp), %r13
leaq 0xc(%rsp), %r14
movq 0x596a(%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 0x26bc
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 0x5abf(%rip), %rcx      # 0x81a8
incl (%rcx,%rax,4)
movl 0xc(%rsp), %eax
incl (%rcx,%rax,4)
movl 0x10(%rsp), %eax
movq 0x5a72(%rip), %rcx      # 0x8170
movl %eax, (%rcx,%rbp,8)
movl 0xc(%rsp), %eax
movl %eax, 0x4(%rcx,%rbp,8)
movq 0x5a58(%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 0x5a28(%rip), %eax      # 0x8160
cmpq %rax, %rbp
jb 0x2656
leaq 0x30(%rsp), %rdi
callq 0x2050
movl 0x5a0b(%rip), %ebx      # 0x815c
movl $0x0, 0x18(%rsp)
testq %rbx, %rbx
je 0x27a5
movq 0x5a43(%rip), %r14      # 0x81a8
movq 0x5a34(%rip), %r15      # 0x81a0
movq 0x5a25(%rip), %r12      # 0x8198
xorl %r13d, %r13d
movl (%r14,%r13,4), %edi
shlq $0x2, %rdi
callq 0x2030
movq %rax, (%r15,%r13,8)
movl (%r14,%r13,4), %edi
shlq $0x2, %rdi
callq 0x2030
movq %rax, (%r12,%r13,8)
incq %r13
movl %r13d, 0x18(%rsp)
cmpq %r13, %rbx
jne 0x2776
shlq $0x2, %rbx
movq %rbx, %rdi
callq 0x2030
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x20e0
cmpl $0x0, 0x5998(%rip)      # 0x8160
je 0x285a
movq 0x599b(%rip), %rax      # 0x8170
movq 0x59bc(%rip), %rcx      # 0x8198
movq 0x59bd(%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), %edi
movl 0xc(%rsp), %r8d
movq (%rdx,%r8,8), %r9
movslq (%r14,%r8,4), %r8
movl %edi, (%r9,%r8,4)
movl 0x10(%rsp), %edi
incl (%r14,%rdi,4)
movl 0xc(%rsp), %edi
incl (%r14,%rdi,4)
incq %rsi
movl 0x590b(%rip), %edi      # 0x8160
cmpq %rdi, %rsi
jb 0x27e5
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 0x288f
jmp 0x288f
jmp 0x288f
jmp 0x288f
jmp 0x288f
movq %rax, %rbx
jmp 0x28b8
movq %rax, %rbx
movq 0x5722(%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