// File: /workspace/github_c_makefile_star2_O0/MAGI003769[P]EE450-Socket-Project/serverC.c
// Function: parse_data2
int parse_data2(char *args[], char *data, char *edges, int *vertices) {
    char *end_str;
    char *token = strtok_r(data, "\n", &end_str);
    int i = 0;

    while (token != NULL) {
        char *end_token;
        //printf("debug: check line -- %s\n", token);
        if(i == 0) {
            split_args2(args, token);
        } else if (i < 4) {
            args[i+2] = token;
        } else {
            strcat(edges, token);
            strcat(edges, "\n");
            char *token2 = strtok_r(token, " ", &end_token);
            int j = 0;
            while (token2 != NULL && j < 2) {
                for(int k = 0; k < MAXNUMVERTICES; k++) {
                    if(vertices[k] == atoi(token2)) {
                        break;
                    } else if(vertices[k] == -1) {
                        vertices[k] = atoi(token2);
                        break;
                    }
                }
                token2 = strtok_r(NULL, " ", &end_token);
                j++;
            }
        }
        token = strtok_r(NULL, "\n", &end_str);
        i++;
    }

    int vtx_num = 0;
    while(vertices[vtx_num] != -1 && vtx_num < MAXNUMVERTICES) {
        vtx_num++;
    }
    return vtx_num;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x1e55(%rip), %rsi      # 0x31a8
leaq -0x28(%rbp), %rdx
callq 0x10a0
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x14bc
cmpl $0x0, -0x34(%rbp)
jne 0x138a
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x12c0
jmp 0x1496
cmpl $0x4, -0x34(%rbp)
jge 0x13aa
movq -0x30(%rbp), %rdx
movq -0x8(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x1494
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x1120
movq -0x18(%rbp), %rdi
leaq 0x1de6(%rip), %rsi      # 0x31a8
callq 0x1120
movq -0x30(%rbp), %rdi
leaq 0x1c36(%rip), %rsi      # 0x3008
leaq -0x40(%rbp), %rdx
callq 0x10a0
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x48(%rbp)
movb %al, -0x55(%rbp)
je 0x13fc
cmpl $0x2, -0x4c(%rbp)
setl %al
movb %al, -0x55(%rbp)
movb -0x55(%rbp), %al
testb $0x1, %al
jne 0x1408
jmp 0x1492
movl $0x0, -0x50(%rbp)
cmpl $0xf, -0x50(%rbp)
jge 0x146c
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x5c(%rbp)
movq -0x48(%rbp), %rdi
callq 0x1110
movl %eax, %ecx
movl -0x5c(%rbp), %eax
cmpl %ecx, %eax
jne 0x1437
jmp 0x146c
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
cmpl $-0x1, (%rax,%rcx,4)
jne 0x145d
movq -0x48(%rbp), %rdi
callq 0x1110
movl %eax, %edx
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x146c
jmp 0x145f
jmp 0x1461
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x140f
xorl %eax, %eax
movl %eax, %edi
leaq 0x1b91(%rip), %rsi      # 0x3008
leaq -0x40(%rbp), %rdx
callq 0x10a0
movq %rax, -0x48(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x13e6
jmp 0x1494
jmp 0x1496
xorl %eax, %eax
movl %eax, %edi
leaq 0x1d07(%rip), %rsi      # 0x31a8
leaq -0x28(%rbp), %rdx
callq 0x10a0
movq %rax, -0x30(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1367
movl $0x0, -0x54(%rbp)
movq -0x20(%rbp), %rcx
movslq -0x54(%rbp), %rdx
xorl %eax, %eax
cmpl $-0x1, (%rcx,%rdx,4)
movb %al, -0x5d(%rbp)
je 0x14e0
cmpl $0xf, -0x54(%rbp)
setl %al
movb %al, -0x5d(%rbp)
movb -0x5d(%rbp), %al
testb $0x1, %al
jne 0x14e9
jmp 0x14f4
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x14c3
movl -0x54(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)