// File: /workspace/github_cpp_makefile_star2_O1/yuang-chen[P]paraGCN/src/parser.cpp
// Function: Parser::parseNode()
void Parser::parseNode() {
    string line;
    int max_idx = 0, max_label = 0;

    auto &feature_sparse_index = this->gcnData->feature_index;
    auto &feature_val = this->gcnData->feature_value;
    auto &labels = this->gcnData->label;

    feature_sparse_index.indptr.push_back(0);

    while(!svmlight_file.eof()) {
        getline(svmlight_file, line);
        feature_sparse_index.indptr.push_back(feature_sparse_index.indptr.back());

        istringstream ss(line);
        int label;
        ss >> label;
        labels.push_back(label);
        max_label = max(max_label, label);
        string target_value;
        while(ss >> target_value) {
            istringstream tv_ss(target_value);
            int target;
            char col;
            float value;
            tv_ss >> target >> col >> value;

            feature_val.push_back(value);
            feature_sparse_index.indices.push_back(target);
            feature_sparse_index.indptr.back() += 1;
            max_idx = max(max_idx, target);
        }        
    }
    gcnParams->input_dim = max_idx + 1;
    gcnParams->output_dim = max_label + 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
movq %rdi, %rbx
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x620(%rdi), %r14
leaq 0x18(%r14), %r15
movl $0x0, 0x88(%rsp)
movq 0x20(%r14), %rsi
cmpq 0x28(%r14), %rsi
je 0x5674
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x20(%r14)
jmp 0x5684
leaq 0x88(%rsp), %rdx
movq %r15, %rdi
callq 0x5cfa
movq 0x410(%rbx), %rax
movq -0x18(%rax), %rax
movl $0x1, %r13d
testb $0x2, 0x430(%rbx,%rax)
movl $0x1, %ecx
jne 0x5911
movq %r15, 0x78(%rsp)
leaq 0x90(%r14), %rcx
movq %rcx, 0x80(%rsp)
leaq 0x78(%r14), %rcx
movq %rcx, 0x70(%rsp)
leaq 0x410(%rbx), %rcx
movq %rcx, 0x20(%rsp)
movq %rbx, 0x68(%rsp)
leaq 0x410(%rbx,%rax), %rdi
movl $0x0, 0xc(%rsp)
leaq 0x28(%rsp), %r15
leaq 0x208(%rsp), %rbp
leaq 0x18(%rsp), %r12
leaq 0x1c(%rsp), %rbx
xorl %r13d, %r13d
movl $0xa, %esi
callq 0x31e0
movsbl %al, %edx
movq 0x20(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x3390
movq 0x20(%r14), %rsi
cmpq 0x28(%r14), %rsi
je 0x5735
movl -0x4(%rsi), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x20(%r14)
jmp 0x5743
leaq -0x4(%rsi), %rdx
movq 0x78(%rsp), %rdi
callq 0x5e1a
leaq 0x88(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movl $0x8, %edx
callq 0x3340
leaq 0x88(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3160
movq 0x80(%r14), %rsi
cmpq 0x88(%r14), %rsi
je 0x578f
movl 0x10(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x80(%r14)
jmp 0x579e
movq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x5e1a
movl 0x10(%rsp), %eax
movl 0xc(%rsp), %ecx
cmpl %eax, %ecx
cmovlel %eax, %ecx
movl %ecx, 0xc(%rsp)
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
leaq 0x88(%rsp), %rdi
movq %r15, %rsi
callq 0x3240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x58ab
movq %rbp, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x3340
movq %rbp, %rdi
movq %r12, %rsi
callq 0x3160
movq %rax, %rdi
leaq 0x17(%rsp), %rsi
callq 0x3260
movq %rax, %rdi
movq %rbx, %rsi
callq 0x33c0
movq 0x98(%r14), %rsi
cmpq 0xa0(%r14), %rsi
je 0x5843
movss 0x1c(%rsp), %xmm0
movss %xmm0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x98(%r14)
jmp 0x5853
movq 0x80(%rsp), %rdi
movq %rbx, %rdx
callq 0x5ef6
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x586d
movl 0x18(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x5878
movq %r14, %rdi
movq %r12, %rdx
callq 0x5e1a
movq 0x20(%r14), %rax
incl -0x4(%rax)
movl 0x18(%rsp), %eax
cmpl %eax, %r13d
cmovlel %eax, %r13d
movq %rbp, %rdi
movq 0x6734(%rip), %rsi      # 0xbfc8
callq 0x32a0
leaq 0x280(%rsp), %rdi
callq 0x30e0
jmp 0x57c7
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x58c7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3200
leaq 0x88(%rsp), %rdi
movq 0x66f2(%rip), %rsi      # 0xbfc8
callq 0x32a0
leaq 0x100(%rsp), %rdi
callq 0x30e0
movq 0x20(%rsp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rax
leaq (%rcx,%rax), %rdi
testb $0x2, 0x20(%rcx,%rax)
je 0x5700
incl %r13d
movl 0xc(%rsp), %ecx
incl %ecx
movq 0x68(%rsp), %rbx
movq 0x618(%rbx), %rax
movl %r13d, 0x4(%rax)
movl %ecx, 0xc(%rax)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x593b
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3200
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5956
jmp 0x5956
movq %rax, %rbx
jmp 0x59a2
movq %rax, %rbx
jmp 0x59c3
jmp 0x595d
movq %rax, %rbx
jmp 0x5986
movq %rax, %rbx
movq 0x665c(%rip), %rsi      # 0xbfc8
leaq 0x208(%rsp), %rdi
callq 0x32a0
leaq 0x280(%rsp), %rdi
callq 0x30e0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x59a2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x661f(%rip), %rsi      # 0xbfc8
leaq 0x88(%rsp), %rdi
callq 0x32a0
leaq 0x100(%rsp), %rdi
callq 0x30e0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x59df
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x3360
nop