// File: /workspace/github_cpp_makefile_star2_O2/NFAcz[P]compareQC/main.cpp
// Function: load(char const*, int)
std::vector<float> load(const char *filename, const int jump){

  std::ifstream file(filename, std::ios_base::in | std::ios_base::binary);
  boost::iostreams::filtering_streambuf<boost::iostreams::input> inbuf;
  inbuf.push(boost::iostreams::gzip_decompressor());
  inbuf.push(file);

  std::istream instream(&inbuf);

  float Y;
  std::string line;
  std::vector<float> tmp;

  int counter = 0;

  while(std::getline(instream, line)) {

    if(is_match(line,"lavfi.signalstats.YAVG")){
      if(counter%jump==0){
        std::vector<string> ttmp = split(line,'\"');
        Y = float(strtof(ttmp[3].c_str(),NULL));
        tmp.push_back(Y);
      }
      counter++;
    }

    if(is_match(line,"stream index=\"0")){
      std::vector<string> ttmp = split(line,'\"');
      std::vector<string> fracc = split(ttmp[41],'/'); // some older versions the index is 39!
      float frac = float(strtof(fracc[0].c_str(),NULL)) / float(strtof(fracc[1].c_str(),NULL)) ;
      if(FPS!=-1 && FPS!=frac){
        std::cout << "warning source FPS differs!" << std::endl;
      }
      FPS = frac;

    }
  }
  file.close();

  return tmp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f8, %rsp            # imm = 0x3F8
movl %edx, -0x3c(%rbp)
movq %rdi, -0x38(%rbp)
leaq -0x418(%rbp), %rdi
pushq $0xc
popq %rdx
callq 0x64b0
leaq -0xf8(%rbp), %rdi
callq 0x7b46
leaq -0x210(%rbp), %rdi
pushq $0xf
popq %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x7b70
movq -0xb0(%rbp), %rdi
leaq -0x210(%rbp), %rsi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0xa044
leaq -0xb8(%rbp), %rbx
leaq -0x210(%rbp), %rdi
callq 0x7c20
leaq -0x418(%rbp), %rsi
pushq $-0x1
popq %rcx
movq %rbx, %rdi
movq %rcx, %rdx
callq 0x7c50
leaq -0x210(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x64d0
leaq -0x88(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq -0x38(%rbp), %rax
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
xorl %r15d, %r15d
leaq -0x98(%rbp), %r13
leaq -0x78(%rbp), %r14
leaq -0x58(%rbp), %rbx
leaq -0x210(%rbp), %rdi
movq %r13, %rsi
callq 0x6050
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x6bb7
movq %r14, %rdi
leaq 0x65ec(%rip), %rsi      # 0xd05d
movq %rbx, %rdx
callq 0x7a78
movq %r13, %rdi
movq %r14, %rsi
callq 0x6c94
movl %eax, %r12d
movq %r14, %rdi
callq 0x6508
testb %r12b, %r12b
je 0x6ad9
movl %r15d, %eax
cltd
idivl -0x3c(%rbp)
testl %edx, %edx
jne 0x6ad6
movq %r14, %rdi
movq %r13, %rsi
pushq $0x22
popq %rdx
callq 0x6781
movq -0x78(%rbp), %rax
movq 0x60(%rax), %rdi
xorl %esi, %esi
callq 0x6340
movss %xmm0, -0x40(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x7b1c
movq %r14, %rdi
callq 0x7af0
incl %r15d
movq %r14, %rdi
leaq 0x6591(%rip), %rsi      # 0xd074
movq %rbx, %rdx
callq 0x7a78
movq %r13, %rdi
movq %r14, %rsi
callq 0x6c94
movl %eax, %r12d
movq %r14, %rdi
callq 0x6508
testb %r12b, %r12b
je 0x6a46
movq %r14, %rdi
movq %r13, %rsi
pushq $0x22
popq %rdx
callq 0x6781
movq -0x78(%rbp), %rsi
movl $0x520, %eax            # imm = 0x520
addq %rax, %rsi
movq %rbx, %rdi
pushq $0x2f
popq %rdx
callq 0x6781
movq -0x58(%rbp), %rax
movq (%rax), %rdi
xorl %esi, %esi
callq 0x6340
movss %xmm0, -0x2c(%rbp)
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
callq 0x6340
movss -0x2c(%rbp), %xmm1
divss %xmm0, %xmm1
movss %xmm1, -0x2c(%rbp)
movss 0xf729(%rip), %xmm0     # 0x16290
ucomiss 0x6496(%rip), %xmm0     # 0xd004
jne 0x6b72
jnp 0x6b95
ucomiss -0x2c(%rbp), %xmm0
jne 0x6b7a
jnp 0x6b95
movq 0xf42f(%rip), %rdi      # 0x15fb0
leaq 0x64fc(%rip), %rsi      # 0xd084
callq 0x6290
movq %rax, %rdi
callq 0x6140
movss -0x2c(%rbp), %xmm0
movss %xmm0, 0xf6ee(%rip)     # 0x16290
movq %rbx, %rdi
callq 0x7af0
movq %r14, %rdi
callq 0x7af0
jmp 0x6a46
leaq -0x418(%rbp), %rdi
callq 0x6060
leaq -0x98(%rbp), %rdi
callq 0x6508
leaq -0x210(%rbp), %rdi
callq 0x6440
leaq -0xf8(%rbp), %rdi
callq 0x7c6e
leaq -0x418(%rbp), %rdi
callq 0x6080
movq -0x38(%rbp), %rax
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6c50
jmp 0x6c20
jmp 0x6c20
movq %rax, %rbx
leaq -0x210(%rbp), %rdi
callq 0x7c20
jmp 0x6c74
movq %rax, %rbx
jmp 0x6c74
movq %rax, %rbx
jmp 0x6c80
jmp 0x6c50
jmp 0x6c3c
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x7af0
jmp 0x6c3f
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x7af0
jmp 0x6c53
jmp 0x6c50
jmp 0x6c50
jmp 0x6c50
movq %rax, %rbx
movq -0x38(%rbp), %rdi
callq 0x81f2
leaq -0x98(%rbp), %rdi
callq 0x6508
leaq -0x210(%rbp), %rdi
callq 0x6440
leaq -0xf8(%rbp), %rdi
callq 0x7c6e
leaq -0x418(%rbp), %rdi
callq 0x6080
movq %rbx, %rdi
callq 0x6470