LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::parseFromStream(Json::CharReader::Factory const&, std::istream&, Json::Value*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
bool parseFromStream(
    CharReader::Factory const& fact, JSONCPP_ISTREAM& sin,
    Value* root, JSONCPP_STRING* errs)
{
  JSONCPP_OSTRINGSTREAM ssin;
  ssin << sin.rdbuf();
  JSONCPP_STRING doc = ssin.str();
  char const* begin = doc.data();
  char const* end = begin + doc.size();
  // Note that we do not actually need a null-terminator.
  CharReaderPtr const reader(fact.newCharReader());
  return reader->parse(begin, end, root, errs);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq -0x1c0(%rbp), %r13
movq %r13, %rdi
callq 0x4490
movq (%r12), %rax
movq -0x18(%rax), %rax
movq 0xe8(%r12,%rax), %rsi
movq %r13, %rdi
callq 0x40a0
leaq -0x1b8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x4540
movq -0x48(%rbp), %r12
movq -0x40(%rbp), %r13
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq %rax, %r15
addq %r12, %r13
movq (%rax), %rax
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
movq %rbx, %r8
callq *0x10(%rax)
movl %eax, %ebx
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
leaq -0x48(%rbp), %rdi
callq 0x4170
leaq -0x1c0(%rbp), %rdi
callq 0x40b0
movl %ebx, %eax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
jmp 0xa476
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x4170
jmp 0xa486
jmp 0xa483
movq %rax, %rbx
leaq -0x1c0(%rbp), %rdi
callq 0x40b0
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::operator>>(std::istream&, Json::Value&)
JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM& sin, Value& root) {
  CharReaderBuilder b;
  JSONCPP_STRING errs;
  bool ok = parseFromStream(b, sin, &root, &errs);
  if (!ok) {
    throwRuntimeError(errs);
  }
  return sin;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x68(%rbp), %r15
movq %r15, %rdi
callq 0x937c
leaq -0x28(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x38(%rbp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xa3ae
testb %al, %al
je 0xa4ff
leaq -0x38(%rbp), %rdi
callq 0x4170
leaq -0x68(%rbp), %rdi
callq 0x9726
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x5126
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x4170
leaq -0x68(%rbp), %rdi
callq 0x9726
movq %rbx, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::ValueIteratorBase::index() const
UInt ValueIteratorBase::index() const {
  const Value::CZString czstring = (*current_).first;
  if (!czstring.data())
    return czstring.index();
  return Value::UInt(-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq (%rdi), %rsi
addq $0x20, %rsi
leaq -0x20(%rbp), %rbx
movq %rbx, %rdi
callq 0xab62
xorl %r14d, %r14d
cmpq (%rbx), %r14
sbbl %r14d, %r14d
orl 0x8(%rbx), %r14d
movq %rbx, %rdi
callq 0xabd8
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::ValueIteratorBase::name[abi:cxx11]() const
JSONCPP_STRING ValueIteratorBase::name() const {
  char const* keey;
  char const* end;
  keey = memberName(&end);
  if (!keey) return JSONCPP_STRING();
  return JSONCPP_STRING(keey, end);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x20(%rax), %rsi
testq %rsi, %rsi
je 0xa715
movl 0x28(%rax), %edx
shrl $0x2, %edx
addq %rsi, %rdx
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x126f6
jmp 0xa725
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::ValueIteratorBase::memberName(char const**) const
char const* ValueIteratorBase::memberName(char const** end) const {
  const char* cname = (*current_).first.data();
  if (!cname) {
    *end = NULL;
    return NULL;
  }
  *end = cname + (*current_).first.length();
  return cname;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rcx
movq 0x20(%rcx), %rax
testq %rax, %rax
je 0xa74b
movl 0x28(%rcx), %ecx
shrl $0x2, %ecx
addq %rax, %rcx
jmp 0xa74d
xorl %ecx, %ecx
movq %rcx, (%rsi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::duplicateStringValue(char const*, unsigned long)
static inline char* duplicateStringValue(const char* value,
                                         size_t length)
{
  // Avoid an integer overflow in the call to malloc below by limiting length
  // to a sane value.
  if (length >= static_cast<size_t>(Value::maxInt))
    length = Value::maxInt - 1;

  char* newString = static_cast<char*>(malloc(length + 1));
  if (newString == NULL) {
    throwRuntimeError(
        "in Json::Value::duplicateStringValue(): "
        "Failed to allocate string value buffer");
  }
  memcpy(newString, value, length);
  newString[length] = 0;
  return newString;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movl $0x7ffffffe, %ebx       # imm = 0x7FFFFFFE
cmpq %rbx, %rsi
cmovbq %rsi, %rbx
leaq 0x1(%rbx), %rdi
callq 0x4480
testq %rax, %rax
je 0xab0f
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x42d0
movb $0x0, (%r15,%rbx)
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf88e(%rip), %rsi      # 0x1a3a4
leaq -0x40(%rbp), %rbx
leaq -0x19(%rbp), %rdx
movq %rbx, %rdi
callq 0x4130
movq %rbx, %rdi
callq 0x5126
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x4170
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::Value::CZString::CZString(Json::Value::CZString const&)
Value::CZString::CZString(const CZString& other) {
  cstr_ = (other.storage_.policy_ != noDuplication && other.cstr_ != 0
				 ? duplicateStringValue(other.cstr_, other.storage_.length_)
				 : other.cstr_);
  storage_.policy_ = static_cast<unsigned>(other.cstr_
                 ? (static_cast<DuplicationPolicy>(other.storage_.policy_) == noDuplication
                     ? noDuplication : duplicate)
                 : static_cast<DuplicationPolicy>(other.storage_.policy_)) & 3U;
  storage_.length_ = other.storage_.length_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rsi), %esi
movq (%r14), %rax
testb $0x3, %sil
je 0xab8f
testq %rax, %rax
je 0xab8d
shrl $0x2, %esi
movq %rax, %rdi
callq 0xaac1
jmp 0xab8f
xorl %eax, %eax
movq %rax, (%rbx)
movl 0x8(%r14), %eax
xorl %ecx, %ecx
andl $0x3, %eax
setne %cl
cmpq $0x0, (%r14)
cmovel %eax, %ecx
movl 0x8(%rbx), %eax
andl $-0x4, %eax
orl %ecx, %eax
movl %eax, 0x8(%rbx)
movl 0x8(%r14), %eax
andl $-0x4, %eax
orl %ecx, %eax
movl %eax, 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::Value::CZString::operator<(Json::Value::CZString const&) const
bool Value::CZString::operator<(const CZString& other) const {
  if (!cstr_) return index_ < other.index_;
  //return strcmp(cstr_, other.cstr_) < 0;
  // Assume both are strings.
  unsigned this_len = this->storage_.length_;
  unsigned other_len = other.storage_.length_;
  unsigned min_len = std::min<unsigned>(this_len, other_len);
  JSON_ASSERT(this->cstr_ && other.cstr_);
  int comp = memcmp(this->cstr_, other.cstr_, min_len);
  if (comp < 0) return true;
  if (comp > 0) return false;
  return (this_len < other_len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rax
movq (%rdi), %rdi
movl 0x8(%rax), %ebx
testq %rdi, %rdi
je 0xac9a
movq (%rsi), %rax
testq %rax, %rax
je 0xaca9
shrl $0x2, %ebx
movl 0x8(%rsi), %r14d
shrl $0x2, %r14d
cmpl %ebx, %r14d
movl %ebx, %edx
cmovbl %r14d, %edx
movq %rax, %rsi
callq 0x4160
movl %eax, %ecx
movb $0x1, %al
testl %ecx, %ecx
js 0xaca0
sete %cl
cmpl %r14d, %ebx
setb %al
andb %cl, %al
jmp 0xaca0
cmpl 0x8(%rsi), %ebx
setb %al
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xed49(%rip), %rsi      # 0x199f9
leaq -0x38(%rbp), %rbx
leaq -0x11(%rbp), %rdx
movq %rbx, %rdi
callq 0x4130
movq %rbx, %rdi
callq 0xa947
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x4170
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::Value::Value(Json::ValueType)
Value::Value(ValueType vtype) {
  static char const emptyString[] = "";
  initBasic(vtype);
  switch (vtype) {
  case nullValue:
    break;
  case intValue:
  case uintValue:
    value_.int_ = 0;
    break;
  case realValue:
    value_.real_ = 0.0;
    break;
  case stringValue:
    // allocated_ == false, so this is safe.
    value_.string_ = const_cast<char*>(static_cast<char const*>(emptyString));
    break;
  case arrayValue:
  case objectValue:
    value_.map_ = new ObjectValues();
    break;
  case booleanValue:
    value_.bool_ = false;
    break;
  default:
    JSON_ASSERT_UNREACHABLE;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movzbl %sil, %eax
movl $0xfffffe00, %ecx       # imm = 0xFFFFFE00
andl 0x8(%rdi), %ecx
orl %eax, %ecx
movw %cx, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
andq $0x0, 0x20(%rdi)
cmpl $0x7, %esi
ja 0xadd5
movq %rdi, %rbx
movl %esi, %eax
leaq 0xe479(%rip), %rcx      # 0x19204
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
andq $0x0, (%rbx)
jmp 0xadce
pushq $0x30
popq %rdi
callq 0x4370
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
andq $0x0, 0x28(%rax)
jmp 0xadc6
leaq 0xe5ee(%rip), %rax      # 0x193b4
movq %rax, (%rbx)
jmp 0xadce
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0xec69(%rip), %rdi      # 0x19a45
leaq 0xe7ff(%rip), %rsi      # 0x195e2
leaq 0xec61(%rip), %rcx      # 0x19a4b
movl $0xb31, %edx            # imm = 0xB31
callq 0x4270
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::Value::dupMeta(Json::Value const&)
void Value::dupMeta(const Value& other) {
  if (other.comments_) {
    comments_ = new CommentInfo[numberOfCommentPlacement];
    for (int comment = 0; comment < numberOfCommentPlacement; ++comment) {
      const CommentInfo& otherComment = other.comments_[comment];
      if (otherComment.comment_)
        comments_[comment].setComment(
            otherComment.comment_, strlen(otherComment.comment_));
    }
  } else {
    comments_ = 0;
  }
  start_ = other.start_;
  limit_ = other.limit_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x0, 0x10(%rsi)
je 0xb2a5
pushq $0x20
popq %rdi
callq 0x4040
movq $0x3, (%rax)
leaq 0x8(%rax), %rcx
andq $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rcx, 0x10(%rbx)
xorl %r13d, %r13d
cmpq $0x18, %r13
je 0xb2aa
movq 0x10(%r14), %rax
movq (%rax,%r13), %r15
testq %r15, %r15
je 0xb29f
movq 0x10(%rbx), %r12
addq %r13, %r12
movq %r15, %rdi
callq 0x4150
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xa9d2
addq $0x8, %r13
jmp 0xb26f
andq $0x0, 0x10(%rbx)
movq 0x18(%r14), %rax
movq %rax, 0x18(%rbx)
movq 0x20(%r14), %rax
movq %rax, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::Value::releasePayload()
void Value::releasePayload() {
  switch (type_) {
  case nullValue:
  case intValue:
  case uintValue:
  case realValue:
  case booleanValue:
    break;
  case stringValue:
    if (allocated_)
      releasePrefixedStringValue(value_.string_);
    break;
  case arrayValue:
  case objectValue:
    delete value_.map_;
    break;
  default:
    JSON_ASSERT_UNREACHABLE;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movzwl 0x8(%rdi), %eax
cmpb $0x7, %al
ja 0xb3e4
movzbl %al, %ecx
pushq $0x2f
popq %rdx
btl %ecx, %edx
jae 0xb3a8
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl $0xc0, %edx
btl %ecx, %edx
jae 0xb3d0
movq (%rdi), %rbx
testq %rbx, %rbx
je 0xb3c2
movq %rbx, %rdi
callq 0x1208e
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4310
btl $0x8, %eax
jae 0xb3a1
movq (%rdi), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4410
leaq 0xe65a(%rip), %rdi      # 0x19a45
leaq 0xe1f0(%rip), %rsi      # 0x195e2
leaq 0xeb43(%rip), %rcx      # 0x19f3c
movl $0xdc8, %edx            # imm = 0xDC8
callq 0x4270
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::Value::isInt() const
bool Value::isInt() const {
  switch (type_) {
  case intValue:
#if defined(JSON_HAS_INT64)
    return value_.int_ >= minInt && value_.int_ <= maxInt;
#else
    return true;
#endif
  case uintValue:
    return value_.uint_ <= UInt(maxInt);
  case realValue:
    return value_.real_ >= minInt && value_.real_ <= maxInt &&
           IsIntegral(value_.real_);
  default:
    break;
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzbl 0x8(%rdi), %eax
cmpl $0x3, %eax
je 0xb8f6
cmpl $0x2, %eax
je 0xb8ea
cmpl $0x1, %eax
jne 0xb91a
movq (%rdi), %rax
movslq %eax, %rcx
cmpq %rax, %rcx
jmp 0xb8f1
movq (%rdi), %rax
shrq $0x1f, %rax
sete %al
jmp 0xb91c
movsd (%rdi), %xmm0
xorl %eax, %eax
ucomisd 0xdbfc(%rip), %xmm0     # 0x19500
jb 0xb91c
movsd 0xdbfa(%rip), %xmm1     # 0x19508
ucomisd %xmm0, %xmm1
jb 0xb91c
popq %rbp
jmp 0xd027
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::Value::isUInt() const
bool Value::isUInt() const {
  switch (type_) {
  case intValue:
#if defined(JSON_HAS_INT64)
    return value_.int_ >= 0 && LargestUInt(value_.int_) <= LargestUInt(maxUInt);
#else
    return value_.int_ >= 0;
#endif
  case uintValue:
#if defined(JSON_HAS_INT64)
    return value_.uint_ <= maxUInt;
#else
    return true;
#endif
  case realValue:
    return value_.real_ >= 0 && value_.real_ <= maxUInt &&
           IsIntegral(value_.real_);
  default:
    break;
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzbl 0x8(%rdi), %eax
cmpl $0x3, %eax
je 0xbacc
cmpl $0x2, %eax
je 0xbac3
cmpl $0x1, %eax
jne 0xbaf0
cmpl $0x0, 0x4(%rdi)
sete %al
jmp 0xbaf2
movsd (%rdi), %xmm0
xorl %eax, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0xbaf2
movsd 0xda2c(%rip), %xmm1     # 0x19510
ucomisd %xmm0, %xmm1
jb 0xbaf2
popq %rbp
jmp 0xd027
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::Value::removeMember(char const*, char const*, Json::Value*)
bool Value::removeMember(const char* key, const char* cend, Value* removed)
{
  if (type_ != objectValue) {
    return false;
  }
  CZString actualKey(key, static_cast<unsigned>(cend-key), CZString::noDuplication);
  ObjectValues::iterator it = value_.map_->find(actualKey);
  if (it == value_.map_->end())
    return false;
  if (removed)
#if JSON_HAS_RVALUE_REFERENCES
    *removed = std::move(it->second);
#else
    *removed = it->second;
#endif
  value_.map_->erase(it);
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
cmpb $0x7, 0x8(%rdi)
jne 0xcd2f
movq %rcx, %r14
movq %rdi, %rbx
subl %esi, %edx
leaq -0x38(%rbp), %rax
movq %rsi, (%rax)
shll $0x2, %edx
movl %edx, 0x8(%rax)
movq (%rdi), %rdi
movq %rax, %rsi
callq 0x14024
movq %rax, %r12
movq (%rbx), %rdi
leaq 0x8(%rdi), %rax
cmpq %rax, %r12
setne %r15b
je 0xcd24
testq %r14, %r14
je 0xcd1c
movq %r12, %rsi
addq $0x30, %rsi
leaq -0x60(%rbp), %r13
movq %r13, %rdi
callq 0xb2ca
movq %r14, %rdi
movq %r13, %rsi
callq 0xb2e6
movq %r13, %rdi
callq 0xb32e
movq (%rbx), %rdi
movq %r12, %rsi
callq 0x1406c
leaq -0x38(%rbp), %rdi
callq 0xabd8
jmp 0xcd32
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0xabd8
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::writeString[abi:cxx11](Json::StreamWriter::Factory const&, Json::Value const&)
JSONCPP_STRING writeString(StreamWriter::Factory const& builder, Value const& root) {
  JSONCPP_OSTRINGSTREAM sout;
  StreamWriterPtr const writer(builder.newStreamWriter());
  writer->write(root, &sout);
  return sout.str();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x190(%rbp), %rdi
callq 0x4490
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq %rax, %r14
movq (%rax), %rax
leaq -0x190(%rbp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq *0x10(%rax)
leaq -0x188(%rbp), %rsi
movq %rbx, %rdi
callq 0x4540
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
leaq -0x190(%rbp), %rdi
callq 0x40b0
movq %rbx, %rax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xd302
movq %rax, %rbx
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
leaq -0x190(%rbp), %rdi
callq 0x40b0
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::StyledStreamWriter::write(std::ostream&, Json::Value const&)
void StyledStreamWriter::write(JSONCPP_OSTREAM& out, const Value& root) {
  document_ = &out;
  addChildValues_ = false;
  indentString_.clear();
  indented_ = true;
  writeCommentBeforeValue(root);
  if (!indented_) writeIndent();
  indented_ = true;
  writeValue(root);
  writeCommentAfterValueOnSameLine(root);
  *document_ << "\n";
  document_ = NULL; // Forget the stream, for safety.
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movq %rsi, 0x18(%rdi)
andb $-0x2, 0x68(%rdi)
andq $0x0, 0x28(%rdi)
movq 0x20(%rdi), %rax
movb $0x0, (%rax)
orb $0x2, 0x68(%rdi)
movq %rdx, %rsi
callq 0xeda8
movb 0x68(%rbx), %al
testb $0x2, %al
jne 0xed73
movq %rbx, %rdi
callq 0xee72
movb 0x68(%rbx), %al
orb $0x2, %al
movb %al, 0x68(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xee9c
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf1b2
movq 0x18(%rbx), %rdi
leaq 0xc900(%rip), %rsi      # 0x1b699
callq 0x4340
andq $0x0, 0x18(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::BuiltStyledStreamWriter::write(Json::Value const&, std::ostream*)
int BuiltStyledStreamWriter::write(Value const& root, JSONCPP_OSTREAM* sout)
{
  sout_ = sout;
  addChildValues_ = false;
  indented_ = true;
  indentString_.clear();
  writeCommentBeforeValue(root);
  if (!indented_) writeIndent();
  indented_ = true;
  writeValue(root);
  writeCommentAfterValueOnSameLine(root);
  *sout_ << endingLineFeedSymbol_;
  sout_ = NULL;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq %rdx, 0x8(%rdi)
movb 0xd8(%rdi), %al
andb $-0x4, %al
orb $0x2, %al
movb %al, 0xd8(%rdi)
andq $0x0, 0x30(%rdi)
movq %rsi, %r14
movq 0x28(%rdi), %rax
movb $0x0, (%rax)
callq 0xf86a
movb 0xd8(%rbx), %al
testb $0x2, %al
jne 0xf830
movq %rbx, %rdi
callq 0xf944
movb 0xd8(%rbx), %al
orb $0x2, %al
movb %al, 0xd8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf976
movq %rbx, %rdi
movq %r14, %rsi
callq 0xfc9e
movq 0x8(%rbx), %rdi
leaq 0xb8(%rbx), %rsi
callq 0x4300
andq $0x0, 0x8(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::BuiltStyledStreamWriter::writeCommentBeforeValue(Json::Value const&)
void BuiltStyledStreamWriter::writeCommentBeforeValue(Value const& root) {
  if (cs_ == CommentStyle::None) return;
  if (!root.hasComment(commentBefore))
    return;

  if (!indented_) writeIndent();
  const JSONCPP_STRING& comment = root.getComment(commentBefore);
  JSONCPP_STRING::const_iterator iter = comment.begin();
  while (iter != comment.end()) {
    *sout_ << *iter;
    if (*iter == '\n' &&
       ((iter+1) != comment.end() && *(iter + 1) == '/'))
      // writeIndent();  // would write extra newline
      *sout_ << indentString_;
    ++iter;
  }
  indented_ = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
cmpl $0x0, 0x70(%rdi)
je 0xf924
movq %rsi, %r14
movq 0x10(%rsi), %rax
testq %rax, %rax
je 0xf924
cmpq $0x0, (%rax)
je 0xf924
movq %rdi, %rbx
testb $0x2, 0xd8(%rdi)
jne 0xf8af
movq %rbx, %rdi
callq 0xf944
leaq -0x38(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xd170
movq (%r15), %rax
leaq 0x28(%rbx), %r14
movq %rax, %r15
addq -0x30(%rbp), %rax
cmpq %rax, %r15
je 0xf914
movq 0x8(%rbx), %rdi
movsbl (%r15), %esi
callq 0x43f0
cmpb $0xa, (%r15)
movq -0x38(%rbp), %rax
jne 0xf90f
leaq 0x1(%r15), %rcx
movq -0x30(%rbp), %rdx
addq %rax, %rdx
cmpq %rdx, %rcx
je 0xf90f
cmpb $0x2f, (%rcx)
jne 0xf90f
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x4300
movq -0x38(%rbp), %rax
incq %r15
jmp 0xf8ca
andb $-0x3, 0xd8(%rbx)
leaq -0x38(%rbp), %rdi
callq 0x4170
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x4170
movq %rbx, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::OurCharReader::parse(char const*, char const*, Json::Value*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
bool parse(
      char const* beginDoc, char const* endDoc,
      Value* root, JSONCPP_STRING* errs) JSONCPP_OVERRIDE {
    bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_);
    if (errs) {
      *errs = reader_.getFormattedErrorMessages();
    }
    return ok;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %r8, %rbx
movq %rdi, %r15
movzbl 0x8(%rdi), %r8d
addq $0x10, %r15
movq %r15, %rdi
callq 0x6f92
movl %eax, %r14d
testq %rbx, %rbx
je 0x118f8
leaq -0x40(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x8f2c
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4430
movq %r12, %rdi
callq 0x4170
movl %r14d, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/CPU.cpp
// Function: CPU::CPU(MMU*)
CPU::CPU(MMU* m) {
    mmu = m;

    IME = 0xFF;
    halt = false;

    for (int i = 0; i < 8; i++) {
        regs[i] = 0;
    }

    programCounter = 0;
    stackPointer = 0;
    cycles = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rsi, 0x10(%rdi)
movb $-0x1, 0x9(%rdi)
movb $0x0, 0x1d(%rdi)
xorl %eax, %eax
cmpq $0x8, %rax
je 0x14cb5
movb $0x0, (%rdi,%rax)
incq %rax
jmp 0x14ca6
andl $0x0, 0x18(%rdi)
movb $0x0, 0x8(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/CPU.cpp
// Function: CPU::Get(FULL_REGISTERS)
std::uint16_t CPU::Get(FULL_REGISTERS r) {
    std::uint16_t value = 0;
    switch (r) {
        case FULL_REGISTERS::AF:
            value = regs[REGISTERS::A] << 8 | regs[REGISTERS::F];
            break;
        case FULL_REGISTERS::BC:
            value = regs[REGISTERS::B] << 8 | regs[REGISTERS::C];
            break;
        case FULL_REGISTERS::DE:
            value = regs[REGISTERS::D] << 8 | regs[REGISTERS::E];
            break;
        case FULL_REGISTERS::HL:
            value = regs[REGISTERS::H] << 8 | regs[REGISTERS::L];
            break;
    }

    return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x3, %esi
ja 0x14d2c
movl %esi, %eax
leaq 0x5bac(%rip), %rcx      # 0x1a8b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl (%rdi), %eax
jmp 0x14d26
movzwl 0x4(%rdi), %eax
jmp 0x14d26
movzwl 0x6(%rdi), %eax
jmp 0x14d2e
movzwl 0x2(%rdi), %eax
rolw $0x8, %ax
jmp 0x14d2e
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/CPU.cpp
// Function: CPU::Set(FULL_REGISTERS, unsigned short)
void CPU::Set(FULL_REGISTERS r, std::uint16_t value) {
    uint8_t hi = (uint8_t)(value >> 8);
    uint8_t lo = (uint8_t)(value);
    switch (r) {
        case FULL_REGISTERS::AF:
            regs[REGISTERS::A] = hi;
            regs[REGISTERS::F] = lo;
            break;
        case FULL_REGISTERS::BC:
            regs[REGISTERS::B] = hi;
            regs[REGISTERS::C] = lo;
            break;
        case FULL_REGISTERS::DE:
            regs[REGISTERS::D] = hi;
            regs[REGISTERS::E] = lo;
            break;
        case FULL_REGISTERS::HL:
            regs[REGISTERS::H] = hi;
            regs[REGISTERS::L] = lo;
            break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x3, %esi
ja 0x14d79
movl %edx, %eax
shrl $0x8, %eax
movl %esi, %ecx
leaq 0x5b71(%rip), %rsi      # 0x1a8c4
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
movb %al, (%rdi)
movb %dl, 0x1(%rdi)
jmp 0x14d79
movb %al, 0x4(%rdi)
movb %dl, 0x5(%rdi)
jmp 0x14d79
movb %al, 0x7(%rdi)
movb %dl, 0x6(%rdi)
jmp 0x14d79
movb %al, 0x2(%rdi)
movb %dl, 0x3(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/CPU.cpp
// Function: CPU::ReadPC16()
std::uint16_t CPU::ReadPC16() {
    std::uint8_t lo = ReadPC();
    std::uint8_t hi = ReadPC();
    std::uint16_t addr = (((uint16_t)hi) << 8) | lo;

    return addr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x14efc
movl %eax, %r14d
movq %rbx, %rdi
callq 0x14efc
movzbl %al, %ecx
shll $0x8, %ecx
movzbl %r14b, %eax
orl %ecx, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/CPU.cpp
// Function: CPU::PopSP16()
uint16_t CPU::PopSP16() {
    uint16_t addr = stackPointer++;
    stackPointer++;
    uint16_t n = mmu->Read16Bit(addr);
    //mmu->Write(addr, (uint16_t)0x00);
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0x1a(%rdi), %esi
leal 0x2(%rsi), %eax
movw %ax, 0x1a(%rdi)
movq 0x10(%rdi), %rdi
popq %rbp
jmp 0x168ec
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/CPU.cpp
// Function: CPU::PushSP(unsigned short)
void CPU::PushSP(uint16_t value) {
    uint8_t hi = (uint8_t)((value >> 8) & 0xFF);
    uint8_t lo = (uint8_t)((value) & 0xFF);
    PushSP(hi);
    PushSP(lo);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
shrl $0x8, %esi
callq 0x14f78
movzbl %bl, %esi
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x14f78
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/CPU.cpp
// Function: CPU::Read()
void CPU::Read() {
    if (!halt) {
        // uint16_t pc = programCounter;
        uint8_t opcode = ReadPC();

        // if (pc == 0xC04F) {
        //     loopCounter++;
        // }

        // if (mmu->enableDebugger && loopCounter > 5) {
        //     std::fprintf(stderr, "%.4X: %.2X\n", pc, opcode);
        // }
        CheckOpcode(opcode);
    } else {
        cycles = 4;
    }

    if (imeNext) {
        imeNext = false;
        IME = 0xFF;
    }

    if (haltNext) {
        haltNext = false;
        halt = true;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, 0x1d(%rdi)
je 0x14fcf
movb $0x4, 0x8(%rbx)
jmp 0x14fe2
movq %rbx, %rdi
callq 0x14efc
movzbl %al, %esi
movq %rbx, %rdi
callq 0x15004
cmpb $0x1, 0x1f(%rbx)
jne 0x14ff0
movb $0x0, 0x1f(%rbx)
movb $-0x1, 0x9(%rbx)
cmpb $0x1, 0x1e(%rbx)
jne 0x14ffc
movw $0x1, 0x1d(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/CPU.cpp
// Function: CPU::CheckRegisters()
void CPU::CheckRegisters() {
    if(Get(REGISTERS::A) != 0x01) { std::cout << "Failed on register a" << std::endl; exit(1); }
    if(Get(REGISTERS::B) != 0x00) { std::cout << "Failed on register b" << std::endl; exit(1); }
    if(Get(REGISTERS::C) != 0x13) { std::cout << "Failed on register c" << std::endl; exit(1); }
    if(Get(REGISTERS::D) != 0x00) { std::cout << "Failed on register d" << std::endl; exit(1); }
    if(Get(REGISTERS::E) != 0xD8) { std::cout << "Failed on register e" << std::endl; exit(1); }
    if(Get(REGISTERS::H) != 0x01) { std::cout << "Failed on register h" << std::endl; exit(1); }
    if(Get(REGISTERS::L) != 0x4D) { std::cout << "Failed on register l" << std::endl; exit(1); }
    if(stackPointer != 0xFFFE) { std::cout << "Failed on registers sp" << std::endl; exit(1); }
    if(programCounter != 0x0100) { std::cout << "Failed on registers pc" << std::endl; exit(1); }

    if (GetZ() != 0x1) { std::cout << "Failed on flag Z" << std::endl; exit(1); }
    if (GetN() != 0x0) { std::cout << "Failed on flag N" << std::endl; exit(1); }
    if (GetH() != 0x1) { std::cout << "Failed on flag H" << std::endl; exit(1); }
    if (GetCY() != 0x1) { std::cout << "Failed on flag CY" << std::endl; exit(1); }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x1, 0x7(%rdi)
jne 0x163d5
cmpb $0x0, (%rdi)
jne 0x163e8
cmpb $0x13, 0x1(%rdi)
jne 0x163fb
cmpb $0x0, 0x2(%rdi)
jne 0x1640e
cmpb $-0x28, 0x3(%rdi)
jne 0x16421
cmpb $0x1, 0x4(%rdi)
jne 0x16431
cmpb $0x4d, 0x5(%rdi)
jne 0x16441
cmpw $-0x2, 0x1a(%rdi)
jne 0x16451
cmpw $0x100, 0x18(%rdi)      # imm = 0x100
jne 0x16461
movb 0x6(%rdi), %al
testb %al, %al
jns 0x16471
testb $0x40, %al
jne 0x16481
testb $0x20, %al
je 0x16491
testb $0x10, %al
je 0x164a1
popq %rbp
retq
movq 0xfbec(%rip), %rdi      # 0x25fc8
leaq 0x4d41(%rip), %rsi      # 0x1b124
jmp 0x164af
movq 0xfbd9(%rip), %rdi      # 0x25fc8
leaq 0x4d43(%rip), %rsi      # 0x1b139
jmp 0x164af
movq 0xfbc6(%rip), %rdi      # 0x25fc8
leaq 0x4d45(%rip), %rsi      # 0x1b14e
jmp 0x164af
movq 0xfbb3(%rip), %rdi      # 0x25fc8
leaq 0x4d47(%rip), %rsi      # 0x1b163
jmp 0x164af
movq 0xfba0(%rip), %rdi      # 0x25fc8
leaq 0x4d49(%rip), %rsi      # 0x1b178
jmp 0x164af
movq 0xfb90(%rip), %rdi      # 0x25fc8
leaq 0x4d4e(%rip), %rsi      # 0x1b18d
jmp 0x164af
movq 0xfb80(%rip), %rdi      # 0x25fc8
leaq 0x4d53(%rip), %rsi      # 0x1b1a2
jmp 0x164af
movq 0xfb70(%rip), %rdi      # 0x25fc8
leaq 0x4d58(%rip), %rsi      # 0x1b1b7
jmp 0x164af
movq 0xfb60(%rip), %rdi      # 0x25fc8
leaq 0x4d5f(%rip), %rsi      # 0x1b1ce
jmp 0x164af
movq 0xfb50(%rip), %rdi      # 0x25fc8
leaq 0x4d66(%rip), %rsi      # 0x1b1e5
jmp 0x164af
movq 0xfb40(%rip), %rdi      # 0x25fc8
leaq 0x4d67(%rip), %rsi      # 0x1b1f6
jmp 0x164af
movq 0xfb30(%rip), %rdi      # 0x25fc8
leaq 0x4d68(%rip), %rsi      # 0x1b207
jmp 0x164af
movq 0xfb20(%rip), %rdi      # 0x25fc8
leaq 0x4d69(%rip), %rsi      # 0x1b218
callq 0x4340
movq %rax, %rdi
callq 0x4190
pushq $0x1
popq %rdi
callq 0x4420
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/MMU.cpp
// Function: MMU::MMU(Cartridge*)
MMU::MMU(Cartridge* crt) {
    for (uint32_t ii = 0; ii < 0x8000; ii++) {
        cart[ii] = crt->Read(ii);
    }

    palette[0] = 0;
    palette[1] = 1;
    palette[2] = 2;
    palette[3] = 3;

    readBios = true;
    enableDebugger = false;

    Write(0xFF00, (uint8_t)0x1);
    Write(0xFF41, (uint8_t)3);

    loadBootrom();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4d79(%rip), %rax      # 0x1b254
movq %rax, 0xe380(%rdi)
leaq 0x4f6c(%rip), %rax      # 0x1b455
movq %rax, 0xe388(%rdi)
leaq 0x4fbf(%rip), %rax      # 0x1b4b6
movq %rax, 0xe390(%rdi)
xorl %r15d, %r15d
cmpq $0x8000, %r15           # imm = 0x8000
je 0x1651e
movq %r14, %rdi
movl %r15d, %esi
callq 0x16ce4
movb %al, (%rbx,%r15)
incq %r15
jmp 0x16501
movl $0x3020100, 0xe39a(%rbx) # imm = 0x3020100
movw $0x1, 0xe398(%rbx)
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl $0xff00, %esi           # imm = 0xFF00
callq 0x16564
pushq $0x3
popq %rdx
movq %rbx, %rdi
movl $0xff41, %esi           # imm = 0xFF41
callq 0x16564
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x16b82
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/MMU.cpp
// Function: MMU::Read(unsigned short)
std::uint8_t MMU::Read(uint16_t addr) {
    // cartridge / bios
    if (addr <= 0x7FFF) {
        if (readBios && addr < 0xFF)
            return bios[addr];

        return cart[addr];
    }
    // sram
    else if (addr >= 0xA000 && addr <= 0xBFFF)
        return sram[addr - 0xA000];
    // video ram
    else if (addr >= 0x8000 && addr <= 0x9FFF) {
        return vram[addr - 0x8000];
    }

    // writable ram
    else if (addr >= 0xC000 && addr <= 0xDFFF)
        return wram[addr - 0xC000];

    // more writable ram
    else if (addr >= 0xE000 && addr <= 0xFDFF)
        return wram[addr - 0xE000];

    // oam
    else if (addr >= 0xFE00 && addr <= 0xFEFF)
        return oam[addr - 0xFE00];

    // io
    // this includes FFOO - user input joypad
    // timers
    // gpu

    else if (addr >= 0xFF80 && addr <= 0xFFFE)
        return hram[addr - 0xFF80];
    else if (addr >= 0xFF00 && addr <= 0xFF7F) {
        if (addr == 0xff00) return 1;
        return io[(uint8_t)(addr - 0xFF00)];
    }
    else if (addr == 0xFFFF)
        return interrupt;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testw %si, %si
js 0x1681b
cmpw $0xfe, %si
ja 0x16837
cmpb $0x0, 0xe398(%rdi)
je 0x16837
movzwl %si, %eax
movb 0xe281(%rdi,%rax), %al
jmp 0x1687c
movl %esi, %eax
andl $0xe000, %eax           # imm = 0xE000
cmpw $0xa000, %ax            # imm = 0xA000
jne 0x1683f
addl $0xffff6000, %esi       # imm = 0xFFFF6000
movb 0x8000(%rdi,%rsi), %al
jmp 0x1687c
movzwl %si, %eax
movb (%rdi,%rax), %al
jmp 0x1687c
cmpw $0x9fff, %si            # imm = 0x9FFF
ja 0x16855
addl $0xffff8000, %esi       # imm = 0xFFFF8000
movb 0xa100(%rdi,%rsi), %al
jmp 0x1687c
cmpw $0xc000, %ax            # imm = 0xC000
jne 0x16863
addl $0xffff4000, %esi       # imm = 0xFFFF4000
jmp 0x16875
leal 0x2000(%rsi), %eax
cmpw $0x1dff, %ax            # imm = 0x1DFF
ja 0x1687e
addl $0xffff2000, %esi       # imm = 0xFFFF2000
movb 0xc200(%rdi,%rsi), %al
popq %rbp
retq
movl %esi, %eax
andl $0xff00, %eax           # imm = 0xFF00
cmpw $0xfe00, %ax            # imm = 0xFE00
jne 0x1689a
addl $0xffff0200, %esi       # imm = 0xFFFF0200
movb 0xc100(%rdi,%rsi), %al
jmp 0x1687c
leal 0x80(%rsi), %eax
cmpw $0x7e, %ax
ja 0x168b5
addl $0xffff0080, %esi       # imm = 0xFFFF0080
movb 0xe200(%rdi,%rsi), %al
jmp 0x1687c
movl %esi, %eax
andl $0xff80, %eax           # imm = 0xFF80
cmpw $0xff00, %ax            # imm = 0xFF00
jne 0x168da
movb $0x1, %al
cmpw $0xff00, %si            # imm = 0xFF00
je 0x1687c
movzwl %si, %eax
andl $0x7f, %eax
movb 0xa000(%rdi,%rax), %al
jmp 0x1687c
cmpw $-0x1, %si
je 0x168e4
xorl %eax, %eax
jmp 0x1687c
movb 0xe280(%rdi), %al
jmp 0x1687c
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/MMU.cpp
// Function: MMU::Read16Bit(unsigned short)
std::uint16_t MMU::Read16Bit(uint16_t addr) {
    uint16_t value = 0;

    uint16_t lo = (uint16_t)Read(addr);
    uint16_t hi = (uint16_t)Read(addr+1);
    value = (hi << 8) | lo;
    return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0x167f6
movl %eax, %r15d
incl %ebx
movzwl %bx, %esi
movq %r14, %rdi
callq 0x167f6
movzbl %al, %ecx
shll $0x8, %ecx
movzbl %r15b, %eax
orl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/MMU.h
// Function: MMU::loadBootrom()
void loadBootrom() {
        uint16_t x = 0x0000;
        for(unsigned int i = 0; i < strlen(bootrom); i += 2) {
            uint8_t out = Utils::ParseCharsToHex(bootrom[i], bootrom[i + 1]);

            bios[x] = out;
            x++;
        }

        //loadDebugLogo();
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %r15
xorl %r12d, %r12d
leal -0x1(%r15), %r13d
movq 0xe380(%rbx), %r14
movq %r14, %rdi
callq 0x4150
cmpq %r13, %rax
jbe 0x16bf5
movb (%r14,%r13), %cl
pushq $0x39
popq %rax
cmpb $0x3a, %cl
jge 0x16bc0
xorl %eax, %eax
movl %r15d, %edx
movb (%r14,%rdx), %sil
movl $0xc9, %edx
cmpb $0x3a, %sil
jge 0x16bd7
movl $0xd0, %edx
addb %cl, %al
addb %sil, %dl
shlb $0x4, %al
orb %dl, %al
movzwl %r12w, %ecx
movb %al, 0xe281(%rbx,%rcx)
incl %r12d
addl $0x2, %r15d
jmp 0x16b9a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/Cartridge.cpp
// Function: Cartridge::Cartridge(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Cartridge::Cartridge(std::string fileName) {
    std::FILE* file;
    file = fopen (fileName.c_str() , "rb");
    if (file==NULL) {fputs ("File error",stderr); exit (1);}

    // obtain file size:
    fseek (file , 0 , SEEK_END);
    fileSize = ftell (file);
    rewind (file);

    // allocate memory to contain the whole file:
    rom = new uint8_t[fileSize];
    if (rom == NULL) {fputs ("Memory error",stderr); exit (2);}

    // copy the file into the buffer:
    uint32_t result = fread (rom,1,fileSize,file);
    if (result != fileSize) {fputs ("Reading error",stderr); exit (3);}
    fclose (file);

    printf("File loaded: %s\n", fileName.c_str());

    fileLoaded = true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rdi
leaq 0x4944(%rip), %rsi      # 0x1b563
callq 0x4400
testq %rax, %rax
je 0x16c97
movq %rax, %r15
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x43b0
movq %r15, %rdi
callq 0x4030
movl %eax, 0xc(%rbx)
movq %r15, %rdi
callq 0x4080
movl 0xc(%rbx), %r12d
movq %r12, %rdi
callq 0x4040
movq %rax, (%rbx)
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x44f0
cmpl %eax, 0xc(%rbx)
jne 0x16cb1
movq %r15, %rdi
callq 0x4350
movq (%r14), %rsi
leaq 0x48fc(%rip), %rdi      # 0x1b57f
xorl %eax, %eax
callq 0x4060
movb $0x1, 0x8(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0xf332(%rip), %rax      # 0x25fd0
movq (%rax), %rsi
leaq 0x48be(%rip), %rdi      # 0x1b566
callq 0x43c0
pushq $0x1
jmp 0x16cc9
movq 0xf318(%rip), %rax      # 0x25fd0
movq (%rax), %rsi
leaq 0x48af(%rip), %rdi      # 0x1b571
callq 0x43c0
pushq $0x3
popq %rdi
callq 0x4420
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/InterruptService.cpp
// Function: InterruptService::DisableHalt()
void InterruptService::DisableHalt() {
    uint8_t ie = mmu->Read(IE);
    uint8_t flags = mmu->Read(IFLAGS);

    // if any interrupt enable bit and corresponding flags are set
    // regardless of the IME, disable HALT
    if (((ie & flags & vBlankBit)  > 0) ||
        ((ie & flags & lcdStatBit) > 0) ||
        ((ie & flags & timerBit)   > 0) ||
        ((ie & flags & serialBit)  > 0) ||
        ((ie & flags & joyPadBit)  > 0))
    {
        if (cpu->halt) {
            cpu->AddCycles(4);
        }

        cpu->halt = false;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x167f6
movl %eax, %r14d
movq (%rbx), %rdi
movl $0xff0f, %esi           # imm = 0xFF0F
callq 0x167f6
andb %r14b, %al
testb $0x1f, %al
je 0x16d92
movq 0x8(%rbx), %rdi
cmpb $0x1, 0x1d(%rdi)
jne 0x16d8e
pushq $0x4
popq %rsi
callq 0x14e4a
movq 0x8(%rbx), %rdi
movb $0x0, 0x1d(%rdi)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/InterruptService.cpp
// Function: InterruptService::CheckInterrupts()
bool InterruptService::CheckInterrupts() {
    DisableHalt();
    if (cpu->GetIME() != 0x00) {
        uint8_t ie = mmu->Read(IE);
        uint8_t flags = mmu->Read(IFLAGS);

        // if bit0 (vBlankBit) is enable on IE and 0xFF0F
        if ((ie & flags & vBlankBit) > 0) {
            dispatch = vBlankBit;
            return true;
        }

        // if bit1 (lcdStatBit) is enable on IE and 0xFF0F
        if ((ie & flags & lcdStatBit) > 0) {
            dispatch = lcdStatBit;
            return true;
        }

        // if bit2 (timerBit) is enable on IE and 0xFF0F
        if ((ie & flags & timerBit) > 0) {
            dispatch = timerBit;
            return true;
        }

        // if bit3 (serialBit) is enable on IE and 0xFF0F
        if ((ie & flags & serialBit) > 0) {
            dispatch = serialBit;
            return true;
        }

        // if bit4 (joyPadBit) is enable on IE and 0xFF0F
        if ((ie & flags & joyPadBit) > 0) {
            dispatch = joyPadBit;
            return true;
        }
    }

    dispatch = 0xFF;
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x16d4a
movq 0x8(%rbx), %rdi
callq 0x14e22
testb %al, %al
je 0x16df9
movq (%rbx), %rdi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x167f6
movl %eax, %r14d
movq (%rbx), %rdi
movl $0xff0f, %esi           # imm = 0xFF0F
callq 0x167f6
movl %eax, %ecx
andb %r14b, %cl
movb $0x1, %al
testb $0x1, %cl
jne 0x16dff
movb $0x2, %dl
testb $0x2, %cl
jne 0x16e01
movb $0x4, %dl
testb $0x4, %cl
jne 0x16e01
movb $0x8, %dl
testb $0x8, %cl
jne 0x16e01
movb $0x10, %dl
testb $0x10, %cl
jne 0x16e01
movb $-0x1, %dl
xorl %eax, %eax
jmp 0x16e01
movb $0x1, %dl
movb %dl, 0x10(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/InterruptService.cpp
// Function: InterruptService::Dispatch()
void InterruptService::Dispatch() {
    if ((cpu->GetIME() != 0x00)) {
        switch (dispatch) {
            case vBlankBit: {
                VBlankInterrupt();
            }
                break;
            case lcdStatBit: {
                LCDStatInterrupt();
            }
                break;
            case timerBit: {
                TimerInterrupt();
            }
                break;
            case serialBit: {
                SerialInterrupt();
            }
                break;
            case joyPadBit: {
                JoyPadInterrupt();
            }
                break;
            default:
                break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x14e22
testb %al, %al
je 0x16e5d
movzbl 0x10(%rbx), %ecx
leal -0x1(%rcx), %eax
cmpl $0x7, %eax
ja 0x16e4a
leaq 0x475d(%rip), %rcx      # 0x1b590
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x16e8e
cmpl $0x10, %ecx
jne 0x16e5d
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x17016
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x16f52
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x16fb4
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x16ef0
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/InterruptService.cpp
// Function: InterruptService::VBlankInterrupt()
void InterruptService::VBlankInterrupt() {
    uint8_t flags = mmu->Read(IFLAGS);
    flags &= ~vBlankBit;
    cpu->SetIME(0x00);
    cpu->PushSP(cpu->programCounter);
    cpu->AddCycles(20);
    cpu->programCounter = vBlankISR;
    mmu->Write(IFLAGS, flags);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0xff0f, %esi           # imm = 0xFF0F
callq 0x167f6
movl %eax, %r14d
andb $-0x2, %r14b
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x14e2c
movq 0x8(%rbx), %rdi
movzwl 0x18(%rdi), %esi
callq 0x14f96
movq 0x8(%rbx), %rdi
pushq $0x14
popq %rsi
callq 0x14e4a
movq 0x8(%rbx), %rax
movw $0x40, 0x18(%rax)
movq (%rbx), %rdi
movzbl %r14b, %edx
movl $0xff0f, %esi           # imm = 0xFF0F
popq %rbx
popq %r14
popq %rbp
jmp 0x16564
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/InterruptService.cpp
// Function: InterruptService::LCDStatInterrupt()
void InterruptService::LCDStatInterrupt() {
    uint8_t flags = mmu->Read(IFLAGS);
    flags &= ~lcdStatBit;
    cpu->SetIME(0x00);
    cpu->PushSP(cpu->programCounter);
    cpu->AddCycles(20);
    cpu->programCounter = lcdStatISR;
    mmu->Write(IFLAGS, flags);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0xff0f, %esi           # imm = 0xFF0F
callq 0x167f6
movl %eax, %r14d
andb $-0x3, %r14b
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x14e2c
movq 0x8(%rbx), %rdi
movzwl 0x18(%rdi), %esi
callq 0x14f96
movq 0x8(%rbx), %rdi
pushq $0x14
popq %rsi
callq 0x14e4a
movq 0x8(%rbx), %rax
movw $0x48, 0x18(%rax)
movq (%rbx), %rdi
movzbl %r14b, %edx
movl $0xff0f, %esi           # imm = 0xFF0F
popq %rbx
popq %r14
popq %rbp
jmp 0x16564
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/InterruptService.cpp
// Function: InterruptService::SerialInterrupt()
void InterruptService::SerialInterrupt() {
    uint8_t flags = mmu->Read(IFLAGS);
    flags &= ~serialBit;
    cpu->SetIME(0x00);
    cpu->PushSP(cpu->programCounter);
    cpu->AddCycles(20);
    cpu->programCounter = serialISR;
    mmu->Write(IFLAGS, flags);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0xff0f, %esi           # imm = 0xFF0F
callq 0x167f6
movl %eax, %r14d
andb $-0x9, %r14b
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x14e2c
movq 0x8(%rbx), %rdi
movzwl 0x18(%rdi), %esi
callq 0x14f96
movq 0x8(%rbx), %rdi
pushq $0x14
popq %rsi
callq 0x14e4a
movq 0x8(%rbx), %rax
movw $0x58, 0x18(%rax)
movq (%rbx), %rdi
movzbl %r14b, %edx
movl $0xff0f, %esi           # imm = 0xFF0F
popq %rbx
popq %r14
popq %rbp
jmp 0x16564
nop
// File: /workspace/github_cpp_makefile_star2_O2/RegulusImpact[P]sadboy/src/TimerService.cpp
// Function: TimerService::Increment()
void TimerService::Increment() {
    uint16_t cycles = cpu->GetCycles();

    // counter mess
    timaClock += cycles;
    CheckTima();

    // divider clock
    divClock += cycles;
    CheckDiv();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x14e36
movzbl %al, %r14d
addl %r14d, 0x10(%rbx)
movq %rbx, %rdi
callq 0x17136
addl %r14d, 0xc(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x17196
nop