LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: interimadd[P]M5Stack-PixelArt/test/lib/googletest/googletest/src/gtest-port.cc
// Function: int testing::internal::(anonymous namespace)::ReadProcFileField<int>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
T ReadProcFileField(const string& filename, int field) {
  std::string dummy;
  std::ifstream file(filename.c_str());
  while (field-- > 0) {
    file >> dummy;
  }
  T output = 0;
  file >> output;
  return output;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x52960
movq -0x8(%rbp), %rdi
callq 0x52230
movq %rax, %rsi
leaq -0x238(%rbp), %rdi
movl $0x8, %edx
callq 0x52c50
jmp 0x85e1a
jmp 0x85e1c
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0xc(%rbp)
cmpl $0x0, %eax
jle 0x85e74
leaq -0x238(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x528a0
jmp 0x85e3e
jmp 0x85e1c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x85ec3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x52160
jmp 0x85ec3
movl $0x0, -0x248(%rbp)
leaq -0x238(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x52390
jmp 0x85e93
movl -0x248(%rbp), %eax
movl %eax, -0x24c(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x52160
leaq -0x30(%rbp), %rdi
callq 0x52d38
movl -0x24c(%rbp), %eax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x52d38
movq -0x240(%rbp), %rdi
callq 0x52bc0
nopl (%rax,%rax)
// File: interimadd[P]M5Stack-PixelArt/test/lib/googletest/googletest/src/gtest-printers.cc
// Function: testing::internal::PrintTo(wchar_t const*, std::ostream*)
void PrintTo(const wchar_t* s, ostream* os) {
  if (s == NULL) {
    *os << "NULL";
  } else {
    *os << ImplicitCast_<const void*>(s) << " pointing to ";
    PrintCharsAsStringTo(s, std::wcslen(s), os);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x86cb9
movq -0x10(%rbp), %rdi
leaq 0x24314(%rip), %rsi     # 0xaafc6
callq 0x525b0
jmp 0x86d06
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x916c0
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x52480
movq %rax, %rdi
leaq 0x242eb(%rip), %rsi     # 0xaafcb
callq 0x525b0
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x524c0
movq -0x18(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rdx
callq 0x86d10
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: interimadd[P]M5Stack-PixelArt/test/lib/googletest/googletest/src/gtest-typed-test.cc
// Function: testing::internal::SplitIntoTestNames[abi:cxx11](char const*)
static std::vector<std::string> SplitIntoTestNames(const char* src) {
  std::vector<std::string> name_vec;
  src = SkipSpaces(src);
  for (; src != NULL; src = SkipComma(src)) {
    name_vec.push_back(StripTrailingSpaces(GetPrefixUntilComma(src)));
  }
  return name_vec;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x80(%rbp)
movq %rdi, %rax
movq %rax, -0x78(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x88e10
movq -0x10(%rbp), %rdi
callq 0x88250
movq %rax, -0x70(%rbp)
jmp 0x87736
movq -0x70(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x877e3
movq -0x10(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x98780
jmp 0x87758
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x986c0
jmp 0x87767
movq -0x80(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x89850
jmp 0x87776
leaq -0x48(%rbp), %rdi
callq 0x52d38
leaq -0x68(%rbp), %rdi
callq 0x52d38
movq -0x10(%rbp), %rdi
callq 0x988a0
movq %rax, -0x88(%rbp)
jmp 0x8779a
movq -0x88(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x8773e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x87803
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x877d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x52d38
leaq -0x68(%rbp), %rdi
callq 0x52d38
jmp 0x87803
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x877f6
movq -0x80(%rbp), %rdi
callq 0x88e30
movq -0x78(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x88e30
movq -0x20(%rbp), %rdi
callq 0x52bc0
nopw %cs:(%rax,%rax)
// File: interimadd[P]M5Stack-PixelArt/test/lib/googletest/googletest/src/gtest.cc
// Function: testing::internal::edit_distance::(anonymous namespace)::Hunk::PrintHeader(std::ostream*) const
void PrintHeader(std::ostream* ss) const {
    *ss << "@@ ";
    if (removes_) {
      *ss << "-" << left_start_ << "," << (removes_ + common_);
    }
    if (removes_ && adds_) {
      *ss << " ";
    }
    if (adds_) {
      *ss << "+" << right_start_ << "," << (adds_ + common_);
    }
    *ss << " @@\n";
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x2388f(%rip), %rsi     # 0xab172
callq 0x525b0
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x87935
movq -0x10(%rbp), %rdi
leaq 0x230b4(%rip), %rsi     # 0xaa9b2
callq 0x525b0
movq %rax, %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x52130
movq %rax, %rdi
leaq 0x2385a(%rip), %rsi     # 0xab176
callq 0x525b0
movq %rax, %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
addq 0x20(%rax), %rsi
callq 0x52130
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x8795b
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x8795b
movq -0x10(%rbp), %rdi
leaq 0x2330d(%rip), %rsi     # 0xaac63
callq 0x525b0
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x879a9
movq -0x10(%rbp), %rdi
leaq 0x23807(%rip), %rsi     # 0xab178
callq 0x525b0
movq %rax, %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x52130
movq %rax, %rdi
leaq 0x237e6(%rip), %rsi     # 0xab176
callq 0x525b0
movq %rax, %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
addq 0x20(%rax), %rsi
callq 0x52130
movq -0x10(%rbp), %rdi
leaq 0x237c6(%rip), %rsi     # 0xab17a
callq 0x525b0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: interimadd[P]M5Stack-PixelArt/test/lib/googletest/googletest/src/gtest.cc
// Function: testing::internal::CreateCodePointFromUtf16SurrogatePair(wchar_t, wchar_t)
inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first,
                                                    wchar_t second) {
  const UInt32 mask = (1 << 10) - 1;
  return (sizeof(wchar_t) == 2) ?
      (((first & mask) << 10) | (second & mask)) + 0x10000 :
      // This function should not be called when the condition is
      // false, but we provide a sensible default in case it is.
      static_cast<UInt32>(first);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl $0x3ff, -0xc(%rbp)      # imm = 0x3FF
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: interimadd[P]M5Stack-PixelArt/test/lib/googletest/googletest/src/gtest.cc
// Function: void testing::internal::InitGoogleTestImpl<char>(int*, char**)
void InitGoogleTestImpl(int* argc, CharType** argv) {
  // We don't want to run the initialization code twice.
  if (GTestIsInitialized()) return;

  if (*argc <= 0) return;

  g_argvs.clear();
  for (int i = 0; i != *argc; i++) {
    g_argvs.push_back(StreamableToString(argv[i]));
  }

  ParseGoogleTestFlagsOnly(argc, argv);
  GetUnitTestImpl()->PostFlagParsingInit();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x7e7b0
testb $0x1, %al
jne 0x9029b
jmp 0x902a0
jmp 0x9033c
movq -0x8(%rbp), %rax
cmpl $0x0, (%rax)
jg 0x902ae
jmp 0x9033c
leaq 0x41673(%rip), %rdi     # 0xd1928
callq 0xa5640
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
je 0x90322
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
leaq (%rax,%rcx,8), %rsi
leaq -0x38(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0xa54d0
movq -0x50(%rbp), %rsi
leaq 0x41638(%rip), %rdi     # 0xd1928
callq 0x89850
jmp 0x902f7
leaq -0x38(%rbp), %rdi
callq 0x52d38
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x902c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x52d38
jmp 0x90342
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x7fe40
callq 0x89160
movq %rax, %rdi
callq 0x7e380
addq $0x50, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x52bc0
nopl (%rax,%rax)
// File: interimadd[P]M5Stack-PixelArt/test/lib/googletest/googletest/include/gtest/internal/gtest-port.h
// Function: testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::TraceInfo>>>::GetOrCreateValue() const
T* GetOrCreateValue() const {
    ThreadLocalValueHolderBase* const holder =
        static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
    if (holder != NULL) {
      return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
    }

    ValueHolder* const new_holder = default_factory_->MakeNewHolder();
    ThreadLocalValueHolderBase* const holder_base = new_holder;
    GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
    return new_holder->pointer();
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movl (%rax), %edi
callq 0x52a30
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x955d0
movq -0x18(%rbp), %rdi
callq 0x956c0
movq %rax, %rdi
callq 0x957b0
movq %rax, -0x8(%rbp)
jmp 0x956a0
movq -0x48(%rbp), %rdi
addq $0x8, %rdi
callq 0x957d0
movq %rax, %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movl (%rax), %edi
movq -0x28(%rbp), %rsi
callq 0x520f0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x95693
leaq 0x15a84(%rip), %rdx     # 0xab09c
leaq -0x30(%rbp), %rdi
movq %rdi, -0x58(%rbp)
movl $0x3, %esi
movl $0x824, %ecx            # imm = 0x824
callq 0x86240
movq -0x58(%rbp), %rdi
callq 0x88d20
movq %rax, %rdi
leaq 0x15ccc(%rip), %rsi     # 0xab30e
callq 0x525b0
movq %rax, -0x50(%rbp)
jmp 0x9564d
movq -0x50(%rbp), %rdi
leaq 0x15ae9(%rip), %rsi     # 0xab141
callq 0x525b0
movq %rax, -0x60(%rbp)
jmp 0x95663
movq -0x60(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x52ba0
jmp 0x95671
leaq -0x30(%rbp), %rdi
callq 0x86380
jmp 0x95693
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x86380
jmp 0x956aa
movq -0x20(%rbp), %rdi
callq 0x957b0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x52bc0
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: interimadd[P]M5Stack-PixelArt/test/lib/googletest/googletest/include/gtest/internal/gtest-port.h
// Function: testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::TraceInfo>>>::ValueHolder* testing::internal::CheckedDowncastToActualType<testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::TraceInfo>>>::ValueHolder, testing::internal::ThreadLocalValueHolderBase>(testing::internal::ThreadLocalValueHolderBase*)
Derived* CheckedDowncastToActualType(Base* base) {
#if GTEST_HAS_RTTI
  GTEST_CHECK_(typeid(*base) == typeid(Derived));
#endif

#if GTEST_HAS_DOWNCAST_
  return ::down_cast<Derived*>(base);
#elif GTEST_HAS_RTTI
  return dynamic_cast<Derived*>(base);  // NOLINT
#else
  return static_cast<Derived*>(base);  // Poor man's downcast.
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x956df
callq 0x526d0
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rdi
leaq 0x3b39f(%rip), %rsi     # 0xd0a90
callq 0x957f0
movzbl %al, %edi
andl $0x1, %edi
callq 0x6c920
testb $0x1, %al
jne 0x95707
jmp 0x95709
jmp 0x95763
leaq 0x1598c(%rip), %rdx     # 0xab09c
leaq -0xc(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movl $0x3, %esi
movl $0x572, %ecx            # imm = 0x572
callq 0x86240
movq -0x30(%rbp), %rdi
callq 0x88d20
movq %rax, %rdi
leaq 0x15bfb(%rip), %rsi     # 0xab335
callq 0x525b0
jmp 0x95741
leaq -0xc(%rbp), %rdi
callq 0x86380
jmp 0x95763
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0xc(%rbp), %rdi
callq 0x86380
jmp 0x957a4
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x95792
movq -0x38(%rbp), %rdi
leaq 0x3b304(%rip), %rsi     # 0xd0a80
leaq 0x3b30d(%rip), %rdx     # 0xd0a90
xorl %eax, %eax
movl %eax, %ecx
callq 0x52730
movq %rax, -0x40(%rbp)
jmp 0x9579a
xorl %eax, %eax
movq %rax, -0x40(%rbp)
jmp 0x9579a
movq -0x40(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x52bc0
nopl (%rax)
// File: interimadd[P]M5Stack-PixelArt/test/lib/googletest/googletest/include/gtest/internal/gtest-port.h
// Function: testing::internal::StripTrailingSpaces(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
inline std::string StripTrailingSpaces(std::string str) {
  std::string::iterator it = str.end();
  while (it != str.begin() && IsSpace(*--it))
    it = str.erase(it);
  return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rsi, -0x48(%rbp)
movq %rdi, %rax
movq -0x48(%rbp), %rdi
movq %rax, -0x40(%rbp)
movq %rax, %rcx
movq %rcx, -0x38(%rbp)
movq %rax, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
callq 0x52370
movq %rax, -0x18(%rbp)
movq -0x48(%rbp), %rdi
callq 0x52500
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x98940
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x49(%rbp)
jne 0x98717
jmp 0x98733
leaq -0x18(%rbp), %rdi
callq 0x98980
movq %rax, %rdi
callq 0x989a0
movsbl (%rax), %edi
callq 0x98910
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x9873c
jmp 0x98764
leaq -0x30(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x989c0
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x52830
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x986ef
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdi
callq 0x52380
movq -0x38(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: chen3feng[P]error-handling/result.cpp
// Function: ParseInt(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Result<int, ErrnoError> ParseInt(const std::string& s) {
    errno = 0;
    char* end = const_cast<char*>(s.c_str());
    long n = strtol(s.c_str(), &end, 0);
    if (errno == 0) {
        if (*end != '\0') {
            errno = EINVAL;
        } else if (n > INT_MAX || n < INT_MIN) {
            errno = ERANGE;
        } else {
            return static_cast<int>(n);
        }
    }
    return ErrnoError(ErrnoType(errno));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x50(%rbp)
movq %rdi, %rax
movq %rax, -0x48(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x2040
movl $0x0, (%rax)
movq -0x10(%rbp), %rdi
callq 0x20a0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20a0
movq %rax, %rdi
leaq -0x18(%rbp), %rsi
xorl %edx, %edx
callq 0x2210
movq %rax, -0x20(%rbp)
callq 0x2040
cmpl $0x0, (%rax)
jne 0x27f7
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x27c1
callq 0x2040
movl $0x16, (%rax)
jmp 0x27f5
cmpq $0x7fffffff, -0x20(%rbp) # imm = 0x7FFFFFFF
jg 0x27d5
cmpq $-0x80000000, -0x20(%rbp) # imm = 0x80000000
jge 0x27e2
callq 0x2040
movl $0x22, (%rax)
jmp 0x27f3
movq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %esi
callq 0x3720
jmp 0x284f
jmp 0x27f5
jmp 0x27f7
callq 0x2040
movl (%rax), %esi
leaq 0x4814(%rip), %rdx      # 0x7019
leaq 0x4821(%rip), %r8       # 0x702d
leaq -0x30(%rbp), %rdi
movq %rdi, -0x58(%rbp)
movl $0x11a, %ecx            # imm = 0x11A
callq 0x3690
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x3750
jmp 0x282d
leaq -0x30(%rbp), %rdi
callq 0x3700
jmp 0x284f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3700
jmp 0x2859
movq -0x48(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x2270
nopw %cs:(%rax,%rax)
// File: mh0fm4[P]SCDC/test/units/dataprov_hook/hook_direct.c
// Function: hookdemo_dataset_cmd
scdcint_t hookdemo_dataset_cmd(void *dataprov, void *dataset, const char *cmd, const char *params, scdc_dataset_input_t *input, scdc_dataset_output_t *output, scdc_result_t *result)
{
  printf(PREFIX "dataset_cmd:\n");
  printf(PREFIX "  dataprov: '%p'\n", dataprov);
  printf(PREFIX "  dataset: '%p'\n", dataset);
  printf(PREFIX "  cmd: '%s'\n", cmd);
  printf(PREFIX "  params: '%s'\n", params);

  printf(PREFIX "  "); scdc_dataset_input_print(input); printf("\n");

  printf(PREFIX "  "); scdc_dataset_output_print(output); printf("\n");

  printf(PREFIX "\n");

  return SCDC_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
leaq 0x7c7e9(%rip), %rdi     # 0x8a004
movb $0x0, %al
callq 0xcd10
movq -0x8(%rbp), %rsi
leaq 0x7c7f2(%rip), %rdi     # 0x8a01f
movb $0x0, %al
callq 0xcd10
movq -0x10(%rbp), %rsi
leaq 0x7c7ff(%rip), %rdi     # 0x8a03e
movb $0x0, %al
callq 0xcd10
movq -0x18(%rbp), %rsi
leaq 0x7c80b(%rip), %rdi     # 0x8a05c
movb $0x0, %al
callq 0xcd10
movq -0x20(%rbp), %rsi
leaq 0x7c813(%rip), %rdi     # 0x8a076
movb $0x0, %al
callq 0xcd10
leaq 0x7c822(%rip), %rdi     # 0x8a093
movb $0x0, %al
callq 0xcd10
movq -0x28(%rbp), %rdi
callq 0x2f970
leaq 0x7c828(%rip), %rdi     # 0x8a0b0
movb $0x0, %al
callq 0xcd10
leaq 0x7c7fd(%rip), %rdi     # 0x8a093
movb $0x0, %al
callq 0xcd10
movq -0x30(%rbp), %rdi
callq 0x2f9a0
leaq 0x7c803(%rip), %rdi     # 0x8a0b0
movb $0x0, %al
callq 0xcd10
leaq 0x7c7e8(%rip), %rdi     # 0x8a0a3
movb $0x0, %al
callq 0xcd10
movl $0x1, %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: mh0fm4[P]SCDC/test/units/dataprov_hook/hook_direct.c
// Function: main
int main(int argc, char *argv[])
{
  scdc_dataprov_t dp_hook = SCDC_DATAPROV_NULL;


  printf(PREFIX "start hook demo direct\n");
  printf(PREFIX "\n");

  scdc_init(SCDC_INIT_DEFAULT);

  dp_hook = scdc_dataprov_open("hookdemo", "hook", &hookdemo);

  scdc_dataset_input_t input;
  scdc_dataset_output_t output;

  scdc_dataset_input_unset(&input);
  scdc_dataset_output_unset(&output);

/*
  char format[SCDC_FORMAT_MAX_SIZE];
  scdcint_t buf_size;
  void *buf;
  scdcint_t total_size, current_size;
  char total_size_given;
  scdc_dataset_inout_next_f *next;
  void *data;
*/

  scdc_dataset_cmd(SCDC_DATASET_NULL, "scdc:/hookdemo CMD PARAM1 PARAM2 PARAM3", &input, &output);

  scdc_dataprov_close(dp_hook);

  scdc_release();

  printf(PREFIX "quit hook demo direct\n");
  printf(PREFIX "\n");

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
leaq 0x7c7ba(%rip), %rdi     # 0x8a0b2
movb $0x0, %al
callq 0xcd10
leaq 0x7c79d(%rip), %rdi     # 0x8a0a3
movb $0x0, %al
callq 0xcd10
leaq 0x7d16b(%rip), %rdi     # 0x8aa7f
movb $0x0, %al
callq 0xe3c0
leaq 0x7c7b5(%rip), %rdi     # 0x8a0d7
leaq 0x7f33d(%rip), %rsi     # 0x8cc66
leaq 0xa41f0(%rip), %rdx     # 0xb1b20
movb $0x0, %al
callq 0xe8f0
movq %rax, -0x18(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x2fac0
leaq -0xc8(%rbp), %rdi
callq 0x2fae0
xorl %eax, %eax
movl %eax, %edi
leaq 0x7c785(%rip), %rsi     # 0x8a0e0
leaq -0x70(%rbp), %rdx
leaq -0xc8(%rbp), %rcx
movb $0x0, %al
callq 0x10470
movq -0x18(%rbp), %rdi
callq 0xe9c0
callq 0xe570
leaq 0x7c786(%rip), %rdi     # 0x8a108
movb $0x0, %al
callq 0xcd10
leaq 0x7c713(%rip), %rdi     # 0x8a0a3
movb $0x0, %al
callq 0xcd10
xorl %eax, %eax
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: mh0fm4[P]SCDC/test/units/dataprov_hook/hook.c
// Function: hook_open
void *hook_open(const char *conf, va_list ap)
{
  void *param = NULL;

  param = va_arg(ap, void *);

  printf("hook_open: conf: '%s', args: '%p'\n", conf, param);

  return (hook_dataprov_t) 0xDEADBEEF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x28, %eax
ja 0xd9f3
movq -0x28(%rbp), %rcx
movl -0x1c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x30(%rbp)
jmp 0xda0a
movq -0x28(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x7c708(%rip), %rdi     # 0x8a12c
movb $0x0, %al
callq 0xcd10
movl $0xdeadbeef, %eax       # imm = 0xDEADBEEF
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mh0fm4[P]SCDC/test/units/dataprov_hook/hook.c
// Function: hook_config
scdcint_t hook_config(void *dataprov, const char *cmd, const char *param, const char *input, scdcint_t input_size, scdc_result_t *result)
{
  if (strncmp(cmd, "ls", 2) == 0)
  {
    printf("hook_config: listing parameters\n");

    SCDC_RESULT_SET_STR(result, "param0,param1,param2");

  } else if (strncmp(cmd, "put", 3) == 0)
  {
    printf("hook_config: setting '%s' to '%.*s'\n", param, (int) input_size, input);

  } else if (strncmp(cmd, "get", 3) == 0)
  {
    printf("hook_config: getting '%s'\n", param);

    snprintf(SCDC_RESULT_STR(result), SCDC_RESULT_SIZE(result), "%s_VAL", param);

  } else
  {
    return SCDC_FAILURE;
  }

  printf("%s: return %" scdcint_fmt ", result: '%s'\n", __func__, SCDC_SUCCESS, SCDC_RESULT_STR(result));

  return SCDC_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x7d570(%rip), %rsi     # 0x8b00b
movl $0x2, %edx
callq 0xc2d0
cmpl $0x0, %eax
jne 0xdadc
leaq 0x7c6ba(%rip), %rdi     # 0x8a16b
movb $0x0, %al
callq 0xcd10
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rdx
subq $0x1, %rdx
leaq 0x7c6ba(%rip), %rsi     # 0x8a18c
callq 0xc320
jmp 0xdb71
movq -0x18(%rbp), %rdi
leaq 0x7d547(%rip), %rsi     # 0x8b02e
movl $0x3, %edx
callq 0xc2d0
cmpl $0x0, %eax
jne 0xdb14
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rax
movl %eax, %edx
movq -0x28(%rbp), %rcx
leaq 0x7c696(%rip), %rdi     # 0x8a1a1
movb $0x0, %al
callq 0xcd10
jmp 0xdb6f
movq -0x18(%rbp), %rdi
leaq 0x7d587(%rip), %rsi     # 0x8b0a6
movl $0x3, %edx
callq 0xc2d0
cmpl $0x0, %eax
jne 0xdb63
movq -0x20(%rbp), %rsi
leaq 0x7c68d(%rip), %rdi     # 0x8a1c6
movb $0x0, %al
callq 0xcd10
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rcx
leaq 0x7c687(%rip), %rdx     # 0x8a1e1
movb $0x0, %al
callq 0xcad0
jmp 0xdb6d
movq $0x0, -0x8(%rbp)
jmp 0xdb9b
jmp 0xdb6f
jmp 0xdb71
movq -0x38(%rbp), %rcx
addq $0x8, %rcx
leaq 0x7c668(%rip), %rdi     # 0x8a1e8
leaq 0x7cc48(%rip), %rsi     # 0x8a7cf
movl $0x1, %edx
movb $0x0, %al
callq 0xcd10
movq $0x1, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mh0fm4[P]SCDC/test/units/dataprov_hook/hook.c
// Function: hook_dataset_open
void *hook_dataset_open(void *dataprov, const char *path, scdc_result_t *result)
{
  hook_dataset_t *dataset_hook;
  
  union { void *dataprov; hook_dataset_t dataset_hook; } z;


  printf("hook_dataset_open: dataprov: '%p', path: '%s'\n", dataprov, path);

  dataset_hook = (hook_dataset_t *) malloc(sizeof(hook_dataset_t));

  z.dataprov = dataprov;

  *dataset_hook = ((char *) z.dataset_hook) + 1;

  SCDC_RESULT_SET_STR(result, "result of hook_dataset_open");

  printf("hook_dataset_open: return '%p' (%p), result: '%s'\n", dataset_hook, *dataset_hook, SCDC_RESULT_STR(result));

  return dataset_hook;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq 0x7c634(%rip), %rdi     # 0x8a207
movb $0x0, %al
callq 0xcd10
movl $0x8, %edi
callq 0xc8f0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
addq $0x1, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
subq $0x1, %rdx
leaq 0x7c61d(%rip), %rsi     # 0x8a236
callq 0xc320
movq -0x20(%rbp), %rsi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
movq -0x18(%rbp), %rcx
addq $0x8, %rcx
leaq 0x7c61a(%rip), %rdi     # 0x8a252
movb $0x0, %al
callq 0xcd10
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: mh0fm4[P]SCDC/test/units/dataprov_hook/hook.c
// Function: hook_dataset_close
scdcint_t hook_dataset_close(void *dataprov, void *dataset, scdc_result_t *result)
{
  hook_dataset_t *dataset_hook = (hook_dataset_t *) dataset;


  printf("hook_dataset_close: dataprov: '%p', dataset: '%p' (%p)\n", dataprov, dataset_hook, *dataset_hook);

  free(dataset_hook);

  SCDC_RESULT_SET_STR(result, "result of hook_dataset_close");

  printf("hook_dataset_close: return '%" scdcint_fmt "', result: '%s'\n", SCDC_SUCCESS, SCDC_RESULT_STR(result));
  
  return SCDC_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rax
movq (%rax), %rcx
leaq 0x7c603(%rip), %rdi     # 0x8a285
movb $0x0, %al
callq 0xcd10
movq -0x20(%rbp), %rdi
callq 0xc820
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
subq $0x1, %rdx
leaq 0x7c611(%rip), %rsi     # 0x8a2bd
callq 0xc320
movq -0x18(%rbp), %rdx
addq $0x8, %rdx
leaq 0x7c61a(%rip), %rdi     # 0x8a2da
movl $0x1, %esi
movb $0x0, %al
callq 0xcd10
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: mh0fm4[P]SCDC/test/units/dataprov_hook/hook.c
// Function: hook_dataset_open_read_state
void *hook_dataset_open_read_state(void *dataprov, const void *state, scdcint_t state_size, scdc_result_t *result)
{
  hook_dataset_t *dataset_hook;


  printf("hook_dataset_open_read_state: dataprov: '%p', state: '%.*s'\n", dataprov, (int) state_size, (const char *) state);

  dataset_hook = (hook_dataset_t *) malloc(sizeof(hook_dataset_t));

  z_snscanf(state, state_size, "%p", dataset_hook);

  SCDC_RESULT_SET_STR(result, "result of hook_dataset_open_read_state");

  printf("hook_dataset_open_read_state: return: '%p' (%p), result: '%s'\n", dataset_hook, *dataset_hook, SCDC_RESULT_STR(result));

  return dataset_hook;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rcx
leaq 0x7c5fe(%rip), %rdi     # 0x8a30b
movb $0x0, %al
callq 0xcd10
movl $0x8, %edi
callq 0xc8f0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rcx
leaq 0x7d9c7(%rip), %rdx     # 0x8b6fc
movb $0x0, %al
callq 0x42110
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
subq $0x1, %rdx
leaq 0x7c5f2(%rip), %rsi     # 0x8a348
callq 0xc320
movq -0x28(%rbp), %rsi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
movq -0x20(%rbp), %rcx
addq $0x8, %rcx
leaq 0x7c5fa(%rip), %rdi     # 0x8a36f
movb $0x0, %al
callq 0xcd10
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mh0fm4[P]SCDC/test/units/dataprov_hook/hook.c
// Function: hook_dataset_close_write_state
scdcint_t hook_dataset_close_write_state(void *dataprov, void *dataset, void *state, scdcint_t state_size, scdc_result_t *result)
{
  scdcint_t n;
  hook_dataset_t *dataset_hook = (hook_dataset_t *) dataset;


  printf("hook_dataset_close_write_state: dataset: '%p' (%p)\n", dataset_hook, *dataset_hook);

  n = snprintf(state, state_size, "%p", *dataset_hook);

  free(dataset_hook);

  SCDC_RESULT_SET_STR(result, "result of hook_dataset_close_write_state");

  printf("hook_dataset_close_write_state: return: '%" scdcint_fmt "', result: '%s', state: '%.*s'\n", n, SCDC_RESULT_STR(result), (int) state_size, (const char *) state);

  return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rsi
movq -0x38(%rbp), %rax
movq (%rax), %rdx
leaq 0x7c5e8(%rip), %rdi     # 0x8a3ae
movb $0x0, %al
callq 0xcd10
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x38(%rbp), %rax
movq (%rax), %rcx
leaq 0x7d919(%rip), %rdx     # 0x8b6fc
movb $0x0, %al
callq 0xcad0
cltq
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rdi
callq 0xc820
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
subq $0x1, %rdx
leaq 0x7c5cf(%rip), %rsi     # 0x8a3e2
callq 0xc320
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
addq $0x8, %rdx
movq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %r8
leaq 0x7c5d6(%rip), %rdi     # 0x8a40b
movb $0x0, %al
callq 0xcd10
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: mh0fm4[P]SCDC/test/units/dataprov_hook/hook.c
// Function: hook_dataset_get_next
scdcint_t hook_dataset_get_next(scdc_dataset_output_t *output, scdc_result_t *result)
{
  ptrdiff_t x;


  printf("hook_dataset_get_next: output: '%p'\n", output);
  print_dataset_output("hook_dataset_get_next: ", output);

  x = (ptrdiff_t) output->data;

  SCDC_DATASET_INOUT_BUF_CURRENT(output) = z_min(SCDC_DATASET_INOUT_BUF_SIZE(output), DEFAULT_GET_SIZE);

#if 0
  memset(SCDC_DATASET_INOUT_BUF_PTR(output), 'x', SCDC_DATASET_INOUT_BUF_CURRENT(output) - 1);
  ((char *) SCDC_DATASET_INOUT_BUF_PTR(output))[SCDC_DATASET_INOUT_BUF_CURRENT(output) - 1] = '\0';
#else
  memset(SCDC_DATASET_INOUT_BUF_PTR(output), 'x', SCDC_DATASET_INOUT_BUF_CURRENT(output));
#endif

  --x;

  output->next = (x > 0)?hook_dataset_get_next:NULL;
  output->data = (void *) x;

  return SCDC_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rsi
leaq 0x7c568(%rip), %rdi     # 0x8a473
movb $0x0, %al
callq 0xcd10
movq -0x8(%rbp), %rsi
leaq 0x7c57b(%rip), %rdi     # 0x8a498
callq 0xdea0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq $0xd, 0x18(%rax)
jge 0xdf47
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0xdf52
movl $0xd, %eax
movq %rax, -0x20(%rbp)
jmp 0xdf52
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdx
movl $0x78, %esi
callq 0xc350
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
leaq -0xa3(%rip), %rax       # 0xdef0
cmpq $0x0, %rdx
cmovgq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x40(%rax)
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: mh0fm4[P]SCDC/test/units/dataprov_hook/hook.c
// Function: clear_output
static void clear_output(scdc_dataset_output_t *output)
{
  if (!output) return;

  SCDC_DATASET_INOUT_BUF_CURRENT(output) = 0;
  output->total_size = 0;
  output->total_size_given = SCDC_DATASET_INOUT_TOTAL_SIZE_GIVEN_NONE;
  output->data = 0;
  output->next = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xe281
jmp 0xe2b9
movq -0x8(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x8(%rbp), %rax
movb $0x6e, 0x30(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x38(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: mh0fm4[P]SCDC/test/units/dataprov_hook/hook.c
// Function: consume_input
static void consume_input(const char *prefix, scdc_dataset_input_t *input)
{
  while (input)
  {
    printf("%sinput content: '%.*s'\n", prefix, (int) SCDC_DATASET_INOUT_BUF_CURRENT(input), (char *) SCDC_DATASET_INOUT_BUF_PTR(input));
    if (!input->next) break;
    printf("%snext input\n", prefix);
    input->next(input, 0);
    print_dataset_input(prefix, input);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xe33b
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
leaq 0x7c2fa(%rip), %rdi     # 0x8a5ee
movb $0x0, %al
callq 0xcd10
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0xe308
jmp 0xe33b
movq -0x8(%rbp), %rsi
leaq 0x7c2f4(%rip), %rdi     # 0x8a607
movb $0x0, %al
callq 0xcd10
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xde50
jmp 0xe2d0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: kmyk[P]topcoder-marathon-match-100-same-color-pairs/./SameColorPairs.cpp
// Function: with_landscape(int, int, int, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>> const&, std::function<std::vector<std::array<int, 4ul>, std::allocator<std::array<int, 4ul>>> (int, int, int, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>> const&)>)
vector<array<int, 4> > with_landscape(int H, int W, int C, vector<vector<int> > const & board, function<vector<array<int, 4> > (int, int, int, vector<vector<int> > const &)> cont) {
    if (H > W) {
        return with_transpose(H, W, C, board, cont);
    } else {
        return cont(H, W, C, board);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %r9, -0x70(%rbp)
movq %rdi, -0x68(%rbp)
movq %rdi, %rax
movq %rax, -0x60(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jle 0x30c2
movq -0x70(%rbp), %rsi
movl -0xc(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x88(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x84(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x71d0
movq -0x68(%rbp), %rdi
movl -0x8c(%rbp), %esi
movl -0x88(%rbp), %edx
movl -0x84(%rbp), %ecx
movq -0x80(%rbp), %r8
movq -0x78(%rbp), %r9
callq 0x2cf0
jmp 0x30a0
leaq -0x48(%rbp), %rdi
callq 0x7280
jmp 0x30dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x7280
jmp 0x30ea
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdi
movl -0xc(%rbp), %edx
movl -0x10(%rbp), %ecx
movl -0x14(%rbp), %r8d
movq -0x20(%rbp), %r9
callq 0x6f40
movq -0x60(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x2340
nopw %cs:(%rax,%rax)
// File: kmyk[P]topcoder-marathon-match-100-same-color-pairs/./SameColorPairs.cpp
// Function: is_valid_pair(int, std::array<signed char, 10000ul> const&, std::pair<int, int> const&, std::pair<int, int> const&)
bool is_valid_pair(int W, array<int8_t, MAX_H * MAX_W> const & board, pair<int, int> const & p1, pair<int, int> const & p2) {
    int y1, x1; tie(y1, x1) = p1;
    int y2, x2; tie(y2, x2) = p2;
    int c = board[y1 * W + x1];
    if (y1 > y2) swap(y1, y2);
    if (x1 > x2) swap(x1, x2);
    REP3 (y, y1, y2 + 1) {
        for (int x = x1; x < x2 + 1; ) {
            if (board[y * W + x] < 0) {
                x -= board[y * W + x];
            } else if (board[y * W + x] == c) {
                ++ x;
            } else {
                return false;
            }
        }
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x24(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x7380
movq -0x70(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x73c0
movq -0x20(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x7380
movq -0x68(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x73c0
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %eax
imull -0x8(%rbp), %eax
addl -0x28(%rbp), %eax
movslq %eax, %rsi
callq 0x7420
movsbl (%rax), %eax
movl %eax, -0x54(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jle 0x3744
leaq -0x24(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x71a0
movl -0x28(%rbp), %eax
cmpl -0x40(%rbp), %eax
jle 0x3759
leaq -0x28(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x71a0
movl -0x24(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
movl -0x3c(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x380a
movl -0x28(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movl -0x40(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x37fa
movq -0x10(%rbp), %rdi
movl -0x58(%rbp), %eax
imull -0x8(%rbp), %eax
addl -0x5c(%rbp), %eax
movslq %eax, %rsi
callq 0x7420
movsbl (%rax), %eax
cmpl $0x0, %eax
jge 0x37c4
movq -0x10(%rbp), %rdi
movl -0x58(%rbp), %eax
imull -0x8(%rbp), %eax
addl -0x5c(%rbp), %eax
movslq %eax, %rsi
callq 0x7420
movsbl (%rax), %ecx
movl -0x5c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x5c(%rbp)
jmp 0x37f5
movq -0x10(%rbp), %rdi
movl -0x58(%rbp), %eax
imull -0x8(%rbp), %eax
addl -0x5c(%rbp), %eax
movslq %eax, %rsi
callq 0x7420
movsbl (%rax), %eax
cmpl -0x54(%rbp), %eax
jne 0x37ed
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x37f3
movb $0x0, -0x1(%rbp)
jmp 0x380e
jmp 0x37f5
jmp 0x3776
jmp 0x37fc
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x375f
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)
// File: kmyk[P]topcoder-marathon-match-100-same-color-pairs/./SameColorPairs.cpp
// Function: split_to_chunks(int, int)
vector<int> split_to_chunks(int w, int k) {
    vector<int> ws(k + 1);
    REP (i, k) {
        ws[i + 1] = w * (i + 1) / k;
    }
    return ws;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x40(%rbp)
movq %rdi, %rax
movq %rax, -0x48(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
movl -0x10(%rbp), %eax
incl %eax
cltq
movq %rax, -0x38(%rbp)
leaq -0x12(%rbp), %rdi
movq %rdi, -0x30(%rbp)
callq 0x6d30
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x6d50
jmp 0x386c
leaq -0x12(%rbp), %rdi
callq 0x6ee0
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x38d0
movq -0x40(%rbp), %rdi
movl -0xc(%rbp), %eax
movl -0x28(%rbp), %ecx
addl $0x1, %ecx
imull %ecx, %eax
cltd
idivl -0x10(%rbp)
movl %eax, -0x4c(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x6f00
movl -0x4c(%rbp), %ecx
movl %ecx, (%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x387c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x12(%rbp), %rdi
callq 0x6ee0
jmp 0x38ed
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x38e3
movq -0x40(%rbp), %rdi
callq 0x6e80
movq -0x48(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x2340
nopw %cs:(%rax,%rax)
// File: kmyk[P]topcoder-marathon-match-100-same-color-pairs/main.cpp
// Function: main
int main() {
    SameColorPairs scp;
    int H;
    cin >> H;
    vector<string> board(H);
    getVector(board);

    vector<string> ret = scp.removePairs(board);
    cout << ret.size() << endl;
    for (int i = 0; i < (int)ret.size(); ++i)
        cout << ret[i] << endl;
    cout.flush();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl $0x0, -0x4(%rbp)
movq 0x204bf(%rip), %rdi     # 0x24fd8
leaq -0xc(%rbp), %rsi
callq 0x2100
movslq -0xc(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x7cd0
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
leaq -0x28(%rbp), %rdi
callq 0x7cf0
jmp 0x4b50
leaq -0x29(%rbp), %rdi
callq 0x7d60
leaq -0x28(%rbp), %rdi
callq 0x7d80
jmp 0x4b64
leaq -0x70(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x85d0
jmp 0x4b73
leaq -0x58(%rbp), %rdi
leaq -0x5(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x7de0
jmp 0x4b86
leaq -0x70(%rbp), %rdi
callq 0x86c0
leaq -0x58(%rbp), %rdi
callq 0x8720
movq %rax, %rsi
movq 0x20426(%rip), %rdi     # 0x24fc8
callq 0x2040
movq %rax, -0x90(%rbp)
jmp 0x4bb0
movq -0x90(%rbp), %rdi
movq 0x203fa(%rip), %rsi     # 0x24fb8
callq 0x2230
jmp 0x4bc5
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
movl %eax, -0x94(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x8720
movq %rax, %rcx
movl -0x94(%rbp), %eax
cmpl %ecx, %eax
jge 0x4c89
movslq -0x74(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x8740
movq %rax, %rsi
movq 0x203c2(%rip), %rdi     # 0x24fc8
callq 0x21d0
movq %rax, -0xa0(%rbp)
jmp 0x4c14
movq -0xa0(%rbp), %rdi
movq 0x20396(%rip), %rsi     # 0x24fb8
callq 0x2230
jmp 0x4c29
jmp 0x4c2b
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x4bcc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x7d60
jmp 0x4cbe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4cb5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x86c0
jmp 0x4cb5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x86c0
jmp 0x4cb5
movq 0x20338(%rip), %rdi     # 0x24fc8
callq 0x2130
jmp 0x4c97
leaq -0x58(%rbp), %rdi
callq 0x86c0
leaq -0x28(%rbp), %rdi
callq 0x86c0
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x86c0
movq -0x38(%rbp), %rdi
callq 0x2340
nopw (%rax,%rax)
// File: kmyk[P]topcoder-marathon-match-100-same-color-pairs/./SameColorPairs.cpp
// Function: void apply_rects<__gnu_cxx::__normal_iterator<std::array<int, 4ul>*, std::vector<std::array<int, 4ul>, std::allocator<std::array<int, 4ul>>>>>(std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, __gnu_cxx::__normal_iterator<std::array<int, 4ul>*, std::vector<std::array<int, 4ul>, std::allocator<std::array<int, 4ul>>>>, __gnu_cxx::__normal_iterator<std::array<int, 4ul>*, std::vector<std::array<int, 4ul>, std::allocator<std::array<int, 4ul>>>>)
void apply_rects(vector<vector<int> > & board, InputIterator first, InputIterator last) {
    for (; first != last; ++ first) {
        int y1 = (*first)[0];
        int x1 = (*first)[1];
        int y2 = (*first)[2];
        int x2 = (*first)[3];
        board[y1][x1] = -1;
        board[y2][x2] = -1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x7010
testb $0x1, %al
jne 0x7a1a
jmp 0x7ad1
leaq -0x8(%rbp), %rdi
callq 0x7050
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7070
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x7050
movq %rax, %rdi
movl $0x1, %esi
callq 0x7070
movl (%rax), %eax
movl %eax, -0x20(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x7050
movq %rax, %rdi
movl $0x2, %esi
callq 0x7070
movl (%rax), %eax
movl %eax, -0x24(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x7050
movq %rax, %rdi
movl $0x3, %esi
callq 0x7070
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x6f20
movq %rax, %rdi
movslq -0x20(%rbp), %rsi
callq 0x6f00
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rdi
movslq -0x24(%rbp), %rsi
callq 0x6f20
movq %rax, %rdi
movslq -0x28(%rbp), %rsi
callq 0x6f00
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq -0x8(%rbp), %rdi
callq 0x70a0
jmp 0x7a04
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: kmyk[P]topcoder-marathon-match-100-same-color-pairs/./SameColorPairs.cpp
// Function: xor_shift_128::set_seed(unsigned int)
void set_seed(uint32_t seed) {
        a = seed = 1812433253u * (seed ^ (seed >> 30));
        b = seed = 1812433253u * (seed ^ (seed >> 30)) + 1;
        c = seed = 1812433253u * (seed ^ (seed >> 30)) + 2;
        d = seed = 1812433253u * (seed ^ (seed >> 30)) + 3;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movl -0xc(%rbp), %edx
shrl $0x1e, %edx
xorl %edx, %ecx
imull $0x6c078965, %ecx, %ecx # imm = 0x6C078965
movl %ecx, -0xc(%rbp)
movl %ecx, (%rax)
movl -0xc(%rbp), %ecx
movl -0xc(%rbp), %edx
shrl $0x1e, %edx
xorl %edx, %ecx
imull $0x6c078965, %ecx, %ecx # imm = 0x6C078965
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movl %ecx, 0x4(%rax)
movl -0xc(%rbp), %ecx
movl -0xc(%rbp), %edx
shrl $0x1e, %edx
xorl %edx, %ecx
imull $0x6c078965, %ecx, %ecx # imm = 0x6C078965
addl $0x2, %ecx
movl %ecx, -0xc(%rbp)
movl %ecx, 0x8(%rax)
movl -0xc(%rbp), %ecx
movl -0xc(%rbp), %edx
shrl $0x1e, %edx
xorl %edx, %ecx
imull $0x6c078965, %ecx, %ecx # imm = 0x6C078965
addl $0x3, %ecx
movl %ecx, -0xc(%rbp)
movl %ecx, 0xc(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: kmyk[P]topcoder-marathon-match-100-same-color-pairs/./SameColorPairs.cpp
// Function: void apply_rects<__gnu_cxx::__normal_iterator<std::array<int, 4ul>*, std::vector<std::array<int, 4ul>, std::allocator<std::array<int, 4ul>>>>>(int, std::array<signed char, 10000ul>&, __gnu_cxx::__normal_iterator<std::array<int, 4ul>*, std::vector<std::array<int, 4ul>, std::allocator<std::array<int, 4ul>>>>, __gnu_cxx::__normal_iterator<std::array<int, 4ul>*, std::vector<std::array<int, 4ul>, std::allocator<std::array<int, 4ul>>>>)
void apply_rects(int W, array<int8_t, MAX_H * MAX_W> & board, InputIterator first, InputIterator last) {
    for (; first != last; ++ first) {
        int y1 = (*first)[0];
        int x1 = (*first)[1];
        int y2 = (*first)[2];
        int x2 = (*first)[3];
        board[y1 * W + x1] = -1;
        board[y2 * W + x2] = -1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdx, -0x8(%rbp)
movq %rcx, -0x10(%rbp)
movl %edi, -0x14(%rbp)
movq %rsi, -0x20(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x7010
testb $0x1, %al
jne 0x11d1d
jmp 0x11dc8
leaq -0x8(%rbp), %rdi
callq 0x7050
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7070
movl (%rax), %eax
movl %eax, -0x24(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x7050
movq %rax, %rdi
movl $0x1, %esi
callq 0x7070
movl (%rax), %eax
movl %eax, -0x28(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x7050
movq %rax, %rdi
movl $0x2, %esi
callq 0x7070
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x7050
movq %rax, %rdi
movl $0x3, %esi
callq 0x7070
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %eax
imull -0x14(%rbp), %eax
addl -0x28(%rbp), %eax
movslq %eax, %rsi
callq 0x72a0
movb $-0x1, (%rax)
movq -0x20(%rbp), %rdi
movl -0x2c(%rbp), %eax
imull -0x14(%rbp), %eax
addl -0x30(%rbp), %eax
movslq %eax, %rsi
callq 0x72a0
movb $-0x1, (%rax)
leaq -0x8(%rbp), %rdi
callq 0x70a0
jmp 0x11d07
addq $0x30, %rsp
popq %rbp
retq
nop