// File: jBlinden[P]private-codis/protocol.cpp
// Function: ReadInConfigFile(std::basic_ifstream<char, std::char_traits<char>>&, unsigned int&)
uint8_t* ReadInConfigFile(ifstream& in, uint32_t &C){
  string line1;
  getline(in, line1);
  string strC = line1.substr(line1.find("=") + 1, line1.length());
  C = atoi(strC.c_str());
  
  uint8_t *out_bits_per_component = new uint8_t[C];

  string line2;
  getline(in, line2);
  string strBits = line2.substr(line2.find("=") + 1, line2.length());
  stringstream ss(strBits);

  int index = 0;
  for (int i; ss >> i;) {
    out_bits_per_component[index] = i;
    index++;
    if (ss.peek() == ',' || ss.peek() == ' ')
      ss.ignore();
    }

  return out_bits_per_component;
}

// Assembly:
subq $0x298, %rsp            # imm = 0x298
movq %rdi, 0x290(%rsp)
movq %rsi, 0x288(%rsp)
leaq 0x268(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x33c0
movq 0x58(%rsp), %rsi
movq 0x290(%rsp), %rdi
callq 0x3080
jmp 0x73fd
leaq 0x2eed(%rip), %rsi      # 0xa2f1
xorl %eax, %eax
movl %eax, %edx
leaq 0x268(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x34d0
movq 0x48(%rsp), %rdi
incq %rax
movq %rax, 0x50(%rsp)
callq 0x33f0
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %rax, %rcx
leaq 0x238(%rsp), %rdi
callq 0x32e0
jmp 0x7448
leaq 0x238(%rsp), %rdi
callq 0x3120
movq %rax, %rdi
callq 0x3410
movl %eax, %ecx
movq 0x288(%rsp), %rax
movl %ecx, (%rax)
movq 0x288(%rsp), %rax
movl (%rax), %eax
movl %eax, %edi
callq 0x3030
movq %rax, 0x40(%rsp)
jmp 0x7481
movq 0x40(%rsp), %rax
movq %rax, 0x230(%rsp)
leaq 0x210(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x33c0
movq 0x38(%rsp), %rsi
movq 0x290(%rsp), %rdi
callq 0x3080
jmp 0x74b4
leaq 0x2e36(%rip), %rsi      # 0xa2f1
xorl %eax, %eax
movl %eax, %edx
leaq 0x210(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x34d0
movq 0x28(%rsp), %rdi
incq %rax
movq %rax, 0x30(%rsp)
callq 0x33f0
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rax, %rcx
leaq 0x1f0(%rsp), %rdi
callq 0x32e0
jmp 0x74ff
movl $0x10, %edi
movl $0x8, %esi
callq 0x5150
movl %eax, 0x24(%rsp)
jmp 0x7514
movl 0x24(%rsp), %edx
leaq 0x68(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x3420
jmp 0x752c
movl $0x0, 0x64(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x3190
movq %rax, 0x18(%rsp)
jmp 0x754a
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3350
movb %al, 0x17(%rsp)
jmp 0x7564
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x7571
jmp 0x765c
movb 0x60(%rsp), %dl
movq 0x230(%rsp), %rax
movslq 0x64(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0x64(%rsp), %eax
incl %eax
movl %eax, 0x64(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x3110
movl %eax, 0x10(%rsp)
jmp 0x759f
movl 0x10(%rsp), %eax
cmpl $0x2c, %eax
je 0x75c5
leaq 0x68(%rsp), %rdi
callq 0x3110
movl %eax, 0xc(%rsp)
jmp 0x75b8
movl 0xc(%rsp), %eax
cmpl $0x20, %eax
jne 0x7657
leaq 0x68(%rsp), %rdi
callq 0x3490
jmp 0x75d1
jmp 0x7657
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x260(%rsp)
movl %eax, 0x25c(%rsp)
jmp 0x76d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x260(%rsp)
movl %eax, 0x25c(%rsp)
jmp 0x76cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x260(%rsp)
movl %eax, 0x25c(%rsp)
jmp 0x76bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x260(%rsp)
movl %eax, 0x25c(%rsp)
jmp 0x76b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x260(%rsp)
movl %eax, 0x25c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x31e0
jmp 0x76b2
jmp 0x7534
movq 0x230(%rsp), %rax
movq %rax, (%rsp)
leaq 0x68(%rsp), %rdi
callq 0x31e0
leaq 0x1f0(%rsp), %rdi
callq 0x31a0
leaq 0x210(%rsp), %rdi
callq 0x31a0
leaq 0x238(%rsp), %rdi
callq 0x31a0
leaq 0x268(%rsp), %rdi
callq 0x31a0
movq (%rsp), %rax
addq $0x298, %rsp            # imm = 0x298
retq
leaq 0x1f0(%rsp), %rdi
callq 0x31a0
leaq 0x210(%rsp), %rdi
callq 0x31a0
leaq 0x238(%rsp), %rdi
callq 0x31a0
leaq 0x268(%rsp), %rdi
callq 0x31a0
movq 0x260(%rsp), %rdi
callq 0x3460
nopw %cs:(%rax,%rax)