// File: iu-vail[P]iprimal/Assignment.cpp
// Function: Assignment::ImportVec(std::basic_ifstream<char, std::char_traits<char>>&, std::vector<unsigned int, std::allocator<unsigned int>>&)
void
Assignment::ImportVec(ifstream& input_file, vector<uint>& vec){

  string line;

  if (input_file.is_open())
  {
    while (!input_file.eof() )
    {
      uint num_cols = 0;
      vec.clear();
      getline (input_file,line);
      string word;

      stringstream parse(line);
      while(parse >> word){
	//if comment line, ignore it
	if(word[0] == '#')
	  break;
	vec.push_back(atoi(word.c_str()));  //if not number, convert to zero
	num_cols++;
      } //end inner while

      if(num_cols > 0)
        break;

    } //end out layer while

    input_file.close();

  } //end outmost if
  else{ 
    cerr <<endl<<"Error: Unable to open file! Stopped."<<endl<<endl; 
    exit(0);
  }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3390
movq -0x10(%rbp), %rdi
callq 0x3420
movb %al, -0x1f9(%rbp)
jmp 0x3e11
movb -0x1f9(%rbp), %al
testb $0x1, %al
jne 0x3e20
jmp 0x3ffa
jmp 0x3e22
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x34d0
movb %al, -0x1fa(%rbp)
jmp 0x3e3d
movb -0x1fa(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3e4e
jmp 0x3fed
movl $0x0, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x45b0
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3060
jmp 0x3e6d
leaq -0x68(%rbp), %rdi
callq 0x3390
movl $0x10, %edi
movl $0x8, %esi
callq 0x4420
movl %eax, -0x200(%rbp)
jmp 0x3e8d
movl -0x200(%rbp), %edx
leaq -0x1f0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3410
jmp 0x3ea5
jmp 0x3ea7
leaq -0x1f0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3360
movq %rax, -0x208(%rbp)
jmp 0x3ec0
movq -0x208(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3350
movb %al, -0x209(%rbp)
jmp 0x3ede
movb -0x209(%rbp), %al
testb $0x1, %al
jne 0x3eed
jmp 0x3f9b
xorl %eax, %eax
movl %eax, %esi
leaq -0x68(%rbp), %rdi
callq 0x3510
movq %rax, -0x218(%rbp)
jmp 0x3f03
movq -0x218(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x3f56
jmp 0x3f9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x407c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3fdf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x31e0
jmp 0x3fdf
movq -0x18(%rbp), %rax
movq %rax, -0x220(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3100
movq %rax, %rdi
callq 0x3400
movq -0x220(%rbp), %rdi
movl %eax, -0x1f4(%rbp)
leaq -0x1f4(%rbp), %rsi
callq 0x45d0
jmp 0x3f8d
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x3ea7
cmpl $0x0, -0x48(%rbp)
jbe 0x3fad
movl $0x3, -0x1f8(%rbp)
jmp 0x3fb7
movl $0x0, -0x1f8(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x31e0
leaq -0x68(%rbp), %rdi
callq 0x3180
movl -0x1f8(%rbp), %eax
testl %eax, %eax
je 0x3fda
jmp 0x3fd8
jmp 0x3fed
jmp 0x3e22
leaq -0x68(%rbp), %rdi
callq 0x3180
jmp 0x407c
movq -0x10(%rbp), %rdi
callq 0x3070
jmp 0x3ff8
jmp 0x406a
movq 0x22fef(%rip), %rdi     # 0x26ff0
movq 0x22fa8(%rip), %rsi     # 0x26fb0
callq 0x32b0
movq %rax, -0x228(%rbp)
jmp 0x4016
movq -0x228(%rbp), %rdi
leaq 0x16006(%rip), %rsi     # 0x1a02a
callq 0x3270
movq %rax, -0x230(%rbp)
jmp 0x4032
movq -0x230(%rbp), %rdi
movq 0x22f70(%rip), %rsi     # 0x26fb0
callq 0x32b0
movq %rax, -0x238(%rbp)
jmp 0x404e
movq -0x238(%rbp), %rdi
movq 0x22f54(%rip), %rsi     # 0x26fb0
callq 0x32b0
jmp 0x4063
xorl %edi, %edi
callq 0x3320
leaq -0x38(%rbp), %rdi
callq 0x3180
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x3180
movq -0x40(%rbp), %rdi
callq 0x3490
nop