// File: 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
subq $0x580, %rsp            # imm = 0x580
movq %rdi, -0x538(%rbp)
movq %rdi, %rax
movq %rax, -0x530(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x528(%rbp)
movl $0x8, %edi
movl $0x4, %esi
callq 0xa750
movq -0x528(%rbp), %rsi
movl %eax, %edx
leaq -0x220(%rbp), %rdi
callq 0x76b0
leaq -0x280(%rbp), %rdi
callq 0xa770
jmp 0x7fe4
leaq -0x240(%rbp), %rax
movq %rax, -0x540(%rbp)
leaq -0x338(%rbp), %rdi
movl $0xf, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0xa810
jmp 0x800a
movq -0x540(%rbp), %rdi
xorl %eax, %eax
movl %eax, %r8d
leaq -0x338(%rbp), %rsi
movq $-0x1, %rcx
movq %rcx, %rdx
callq 0xa7c0
jmp 0x802e
leaq -0x338(%rbp), %rdi
callq 0xa920
leaq -0x240(%rbp), %rdi
leaq -0x220(%rbp), %rsi
movq $-0x1, %rcx
movq %rcx, %rdx
callq 0xa960
jmp 0x8059
leaq -0x450(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x76e0
jmp 0x806e
leaq -0x478(%rbp), %rdi
callq 0x74e0
movq -0x538(%rbp), %rdi
movb $0x0, -0x479(%rbp)
callq 0xa660
movl $0x0, -0x480(%rbp)
leaq -0x450(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0x7070
movq %rax, -0x548(%rbp)
jmp 0x80b3
movq -0x548(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x7480
movb %al, -0x549(%rbp)
jmp 0x80d1
movb -0x549(%rbp), %al
testb $0x1, %al
jne 0x80e0
jmp 0x84e3
leaq -0x4a1(%rbp), %rdi
movq %rdi, -0x558(%rbp)
callq 0x7680
movq -0x558(%rbp), %rdx
leaq 0x12f6c(%rip), %rsi     # 0x1b06d
leaq -0x4a0(%rbp), %rdi
callq 0xa470
jmp 0x810f
leaq -0x478(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
callq 0x85a0
movb %al, -0x559(%rbp)
jmp 0x812a
leaq -0x4a0(%rbp), %rdi
callq 0x7738
leaq -0x4a1(%rbp), %rdi
callq 0x73c0
movb -0x559(%rbp), %al
testb $0x1, %al
jne 0x8151
jmp 0x82ae
movl -0x480(%rbp), %eax
cltd
idivl -0x14(%rbp)
cmpl $0x0, %edx
jne 0x829f
leaq -0x4c0(%rbp), %rdi
leaq -0x478(%rbp), %rsi
movl $0x22, %edx
callq 0x7c40
jmp 0x817e
leaq -0x4c0(%rbp), %rdi
movl $0x3, %esi
callq 0xa9b0
movq %rax, %rdi
callq 0x7190
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x74c0
movq -0x538(%rbp), %rdi
movss %xmm0, -0x454(%rbp)
leaq -0x454(%rbp), %rsi
callq 0xa680
jmp 0x81c0
leaq -0x4c0(%rbp), %rdi
callq 0xa600
jmp 0x829f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x857d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x8571
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
leaq -0x338(%rbp), %rdi
callq 0xa920
jmp 0x8571
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x854d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x826b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
leaq -0x4a0(%rbp), %rdi
callq 0x7738
leaq -0x4a1(%rbp), %rdi
callq 0x73c0
jmp 0x854d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
leaq -0x4c0(%rbp), %rdi
callq 0xa600
jmp 0x854d
movl -0x480(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x480(%rbp)
leaq -0x4e1(%rbp), %rdi
movq %rdi, -0x568(%rbp)
callq 0x7680
movq -0x568(%rbp), %rdx
leaq 0x12db5(%rip), %rsi     # 0x1b084
leaq -0x4e0(%rbp), %rdi
callq 0xa470
jmp 0x82dd
leaq -0x478(%rbp), %rdi
leaq -0x4e0(%rbp), %rsi
callq 0x85a0
movb %al, -0x569(%rbp)
jmp 0x82f8
leaq -0x4e0(%rbp), %rdi
callq 0x7738
leaq -0x4e1(%rbp), %rdi
callq 0x73c0
movb -0x569(%rbp), %al
testb $0x1, %al
jne 0x831f
jmp 0x84de
leaq -0x500(%rbp), %rdi
leaq -0x478(%rbp), %rsi
movl $0x22, %edx
callq 0x7c40
jmp 0x8339
leaq -0x500(%rbp), %rdi
movl $0x29, %esi
callq 0xa9b0
movq %rax, %rsi
leaq -0x518(%rbp), %rdi
movl $0x2f, %edx
callq 0x7c40
jmp 0x8360
leaq -0x518(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa9b0
movq %rax, %rdi
callq 0x7190
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x74c0
movss %xmm0, -0x570(%rbp)
leaq -0x518(%rbp), %rdi
movl $0x1, %esi
callq 0xa9b0
movq %rax, %rdi
callq 0x7190
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x74c0
movaps %xmm0, %xmm1
movss -0x570(%rbp), %xmm0
divss %xmm1, %xmm0
movss %xmm0, -0x51c(%rbp)
movss 0x20fd8(%rip), %xmm0    # 0x293a8
movss 0x12c30(%rip), %xmm1    # 0x1b008
ucomiss %xmm1, %xmm0
jne 0x83e4
jp 0x83e4
jmp 0x84a6
movss 0x20fbc(%rip), %xmm0    # 0x293a8
ucomiss -0x51c(%rbp), %xmm0
jne 0x83fc
jp 0x83fc
jmp 0x84a6
movq 0x20bad(%rip), %rdi     # 0x28fb0
leaq 0x12c8a(%rip), %rsi     # 0x1b094
callq 0x7370
movq %rax, -0x578(%rbp)
jmp 0x8418
movq -0x578(%rbp), %rdi
movq 0x20b5a(%rip), %rsi     # 0x28f80
callq 0x73a0
jmp 0x842d
jmp 0x84a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x8461
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
leaq -0x4e0(%rbp), %rdi
callq 0x7738
leaq -0x4e1(%rbp), %rdi
callq 0x73c0
jmp 0x854d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x84d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
leaq -0x518(%rbp), %rdi
callq 0xa600
jmp 0x84d0
movss -0x51c(%rbp), %xmm0
movss %xmm0, 0x20ef2(%rip)    # 0x293a8
leaq -0x518(%rbp), %rdi
callq 0xa600
leaq -0x500(%rbp), %rdi
callq 0xa600
jmp 0x84de
leaq -0x500(%rbp), %rdi
callq 0xa600
jmp 0x854d
jmp 0x8097
leaq -0x220(%rbp), %rdi
callq 0x7080
jmp 0x84f1
movb $0x1, -0x479(%rbp)
testb $0x1, -0x479(%rbp)
jne 0x850d
movq -0x538(%rbp), %rdi
callq 0xa6f0
leaq -0x478(%rbp), %rdi
callq 0x7738
leaq -0x450(%rbp), %rdi
callq 0x7630
leaq -0x280(%rbp), %rdi
callq 0xa9d0
leaq -0x220(%rbp), %rdi
callq 0x70b0
movq -0x530(%rbp), %rax
addq $0x580, %rsp            # imm = 0x580
popq %rbp
retq
movq -0x538(%rbp), %rdi
callq 0xa6f0
leaq -0x478(%rbp), %rdi
callq 0x7738
leaq -0x450(%rbp), %rdi
callq 0x7630
leaq -0x280(%rbp), %rdi
callq 0xa9d0
leaq -0x220(%rbp), %rdi
callq 0x70b0
movq -0x288(%rbp), %rdi
callq 0x7660
nopw %cs:(%rax,%rax)