// File: 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
movq %rsp, %rbp
subq $0x3e0, %rsp            # imm = 0x3E0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x3a0(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x3340
movq -0x3a0(%rbp), %rax
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movq 0x620(%rax), %rcx
movq %rcx, -0x38(%rbp)
movq 0x620(%rax), %rcx
addq $0x90, %rcx
movq %rcx, -0x40(%rbp)
movq 0x620(%rax), %rax
addq $0x78, %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
movl $0x0, -0x4c(%rbp)
leaq -0x4c(%rbp), %rsi
callq 0xa6c0
jmp 0xa08e
jmp 0xa090
movq -0x3a0(%rbp), %rax
movq 0x410(%rax), %rcx
movq -0x18(%rcx), %rcx
leaq 0x410(%rax,%rcx), %rdi
callq 0x3460
movb %al, -0x3a1(%rbp)
jmp 0xa0b7
movb -0x3a1(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xa0c8
jmp 0xa310
movq -0x3a0(%rbp), %rdi
addq $0x410, %rdi            # imm = 0x410
leaq -0x28(%rbp), %rsi
callq 0x3090
jmp 0xa0e1
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
movq %rdi, -0x3b0(%rbp)
callq 0xa760
movq -0x3b0(%rbp), %rdi
movq %rax, %rsi
callq 0xa6f0
jmp 0xa106
leaq -0x1e0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x8, %edx
callq 0x33f0
jmp 0xa11d
leaq -0x1e0(%rbp), %rdi
leaq -0x1e4(%rbp), %rsi
callq 0x3190
jmp 0xa132
movq -0x48(%rbp), %rdi
leaq -0x1e4(%rbp), %rsi
callq 0xa6f0
jmp 0xa144
leaq -0x30(%rbp), %rdi
leaq -0x1e4(%rbp), %rsi
callq 0xa7a0
movq %rax, -0x3b8(%rbp)
jmp 0xa15d
movq -0x3b8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x30(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x3340
leaq -0x1e0(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x3310
movq %rax, -0x3c0(%rbp)
jmp 0xa191
movq -0x3c0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3300
movb %al, -0x3c1(%rbp)
jmp 0xa1af
movb -0x3c1(%rbp), %al
testb $0x1, %al
jne 0xa1be
jmp 0xa2d9
leaq -0x388(%rbp), %rdi
leaq -0x208(%rbp), %rsi
movl $0x8, %edx
callq 0x33f0
jmp 0xa1d8
leaq -0x388(%rbp), %rdi
leaq -0x38c(%rbp), %rsi
callq 0x3190
movq %rax, -0x3d0(%rbp)
jmp 0xa1f4
movq -0x3d0(%rbp), %rdi
leaq -0x38d(%rbp), %rsi
callq 0x3330
movq %rax, -0x3d8(%rbp)
jmp 0xa210
movq -0x3d8(%rbp), %rdi
leaq -0x394(%rbp), %rsi
callq 0x30a0
jmp 0xa225
movq -0x40(%rbp), %rdi
leaq -0x394(%rbp), %rsi
callq 0xa7e0
jmp 0xa237
movq -0x38(%rbp), %rdi
leaq -0x38c(%rbp), %rsi
callq 0xa6f0
jmp 0xa249
movq -0x38(%rbp), %rdi
addq $0x18, %rdi
callq 0xa760
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
leaq -0x2c(%rbp), %rdi
leaq -0x38c(%rbp), %rsi
callq 0xa7a0
movq %rax, -0x3e0(%rbp)
jmp 0xa275
movq -0x3e0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
leaq -0x388(%rbp), %rdi
callq 0x3140
jmp 0xa175
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xa349
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xa302
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xa2f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x388(%rbp), %rdi
callq 0x3140
jmp 0xa2f6
leaq -0x208(%rbp), %rdi
callq 0x31a0
leaq -0x1e0(%rbp), %rdi
callq 0x3140
jmp 0xa090
leaq -0x208(%rbp), %rdi
callq 0x31a0
leaq -0x1e0(%rbp), %rdi
callq 0x3140
jmp 0xa349
movq -0x3a0(%rbp), %rax
movl -0x2c(%rbp), %edx
addl $0x1, %edx
movq 0x618(%rax), %rcx
movl %edx, 0x4(%rcx)
movl -0x30(%rbp), %ecx
addl $0x1, %ecx
movq 0x618(%rax), %rax
movl %ecx, 0xc(%rax)
leaq -0x28(%rbp), %rdi
callq 0x31a0
addq $0x3e0, %rsp            # imm = 0x3E0
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x31a0
movq -0x58(%rbp), %rdi
callq 0x3420
nopl (%rax,%rax)