LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/moyix[P]pandalog_taint_parser/plog.pb.cc
// Function: panda::TaintedInstrSummary::MergeFrom(panda::TaintedInstrSummary const&)
void TaintedInstrSummary::MergeFrom(const TaintedInstrSummary& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:panda.TaintedInstrSummary)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      asid_ = from.asid_;
    }
    if (cached_has_bits & 0x00000002u) {
      pc_ = from.pc_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpq %rdi, %rsi
jne 0x1347e
leaq 0x6d45(%rip), %rdx      # 0x1a186
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x3, %esi
movl $0x14f9, %ecx           # imm = 0x14F9
callq 0x6530
leaq 0x6d32(%rip), %rsi      # 0x1a191
movq %r15, %rdi
callq 0x6580
leaq 0x7(%rsp), %rdi
movq %rax, %rsi
callq 0x6450
leaq 0x8(%rsp), %rdi
callq 0x65a0
movq 0x8(%r14), %rsi
testb $0x1, %sil
je 0x13499
leaq 0x8(%rbx), %rdi
andq $-0x2, %rsi
addq $0x8, %rsi
callq 0x183fa
movl 0x10(%r14), %eax
testb $0x3, %al
je 0x134bc
testb $0x1, %al
je 0x134ad
movq 0x18(%r14), %rcx
movq %rcx, 0x18(%rbx)
testb $0x2, %al
je 0x134b9
movq 0x20(%r14), %rcx
movq %rcx, 0x20(%rbx)
orl %eax, 0x10(%rbx)
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x134c8
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x65a0
movq %rbx, %rdi
callq 0x65b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/moyix[P]pandalog_taint_parser/plog.pb.cc
// Function: panda::TaintedInstrSummary::InternalSwap(panda::TaintedInstrSummary*)
void TaintedInstrSummary::InternalSwap(TaintedInstrSummary* other) {
  using std::swap;
  _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(TaintedInstrSummary, pc_)
      + sizeof(TaintedInstrSummary::pc_)
      - PROTOBUF_FIELD_OFFSET(TaintedInstrSummary, asid_)>(
          reinterpret_cast<char*>(&asid_),
          reinterpret_cast<char*>(&other->asid_));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %rsi
testb $0x1, 0x8(%rdi)
jne 0x13556
testb $0x1, %sil
jne 0x1355c
jmp 0x1356d
testb $0x1, %sil
je 0x13595
andq $-0x2, %rsi
addq $0x8, %rsi
leaq 0x8(%r14), %rdi
callq 0x1845c
movl 0x10(%r14), %eax
movl 0x10(%rbx), %ecx
movl %ecx, 0x10(%r14)
movl %eax, 0x10(%rbx)
movups 0x18(%r14), %xmm0
movups 0x18(%rbx), %xmm1
movups %xmm1, 0x18(%r14)
movups %xmm0, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x8(%rbx), %rdi
callq 0x18284
movq %rax, %rsi
jmp 0x13564
nop
// File: /workspace/github_cpp_makefile_star2_O3/moyix[P]pandalog_taint_parser/plog.pb.cc
// Function: panda::LogEntry::MergeFrom(google::protobuf::Message const&)
void LogEntry::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:panda.LogEntry)
  GOOGLE_DCHECK_NE(&from, this);
  const LogEntry* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<LogEntry>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:panda.LogEntry)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:panda.LogEntry)
    MergeFrom(*source);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rdi, %rsi
jne 0x15d06
leaq 0x44bd(%rip), %rdx      # 0x1a186
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x3, %esi
movl $0x18c1, %ecx           # imm = 0x18C1
callq 0x6530
leaq 0x44aa(%rip), %rsi      # 0x1a191
movq %r15, %rdi
callq 0x6580
leaq 0x7(%rsp), %rdi
movq %rax, %rsi
callq 0x6450
leaq 0x8(%rsp), %rdi
callq 0x65a0
leaq 0xde3b(%rip), %rax      # 0x23b48
cmpq %rax, (%rbx)
je 0x15d1f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6330
jmp 0x15d2a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x15d4c
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x15d36
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x65a0
movq %rbx, %rdi
callq 0x65b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/moyix[P]pandalog_taint_parser/plog.pb.cc
// Function: panda::LogEntry::InternalSwap(panda::LogEntry*)
void LogEntry::InternalSwap(LogEntry* other) {
  using std::swap;
  _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  process_name_.Swap(&other->process_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(LogEntry, total_instr_)
      + sizeof(LogEntry::total_instr_)
      - PROTOBUF_FIELD_OFFSET(LogEntry, call_stack_)>(
          reinterpret_cast<char*>(&call_stack_),
          reinterpret_cast<char*>(&other->call_stack_));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %r15
movq 0x8(%rsi), %rsi
testb $0x1, %r15b
jne 0x168b9
testb $0x1, %sil
jne 0x168c3
movl 0x10(%r14), %eax
movl 0x10(%rbx), %ecx
movl %ecx, 0x10(%r14)
movl %eax, 0x10(%rbx)
jmp 0x168f0
testb $0x1, %sil
je 0x1699f
andq $-0x2, %rsi
addq $0x8, %rsi
leaq 0x8(%r14), %rdi
callq 0x1845c
movq 0x8(%r14), %r15
movl 0x10(%r14), %eax
movl 0x10(%rbx), %ecx
movl %ecx, 0x10(%r14)
movl %eax, 0x10(%rbx)
testb $0x1, %r15b
jne 0x16993
leaq 0x18(%rbx), %r12
movq 0x18(%r14), %r13
cmpq 0xd6c1(%rip), %r13      # 0x23fc0
jne 0x16928
movq (%r12), %rax
cmpq 0xd6b4(%rip), %rax      # 0x23fc0
je 0x16953
leaq 0x18(%r14), %r13
movq 0xd6a7(%rip), %rdx      # 0x23fc0
movq %r13, %rdi
movq %r15, %rsi
callq 0x17ff2
movq (%r13), %r13
movq (%r12), %rsi
cmpq 0xd68d(%rip), %rsi      # 0x23fc0
jne 0x1694b
movq 0xd684(%rip), %rdx      # 0x23fc0
movq %r12, %rdi
movq %r15, %rsi
callq 0x17ff2
movq (%r12), %rsi
movq %r13, %rdi
callq 0x6220
movups 0x20(%r14), %xmm0
movups 0x20(%rbx), %xmm1
movups %xmm1, 0x20(%r14)
movups %xmm0, 0x20(%rbx)
movups 0x30(%r14), %xmm0
movups 0x30(%rbx), %xmm1
movups %xmm1, 0x30(%r14)
movups %xmm0, 0x30(%rbx)
addq $0x40, %r14
addq $0x40, %rbx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x18807
andq $-0x2, %r15
movq (%r15), %r15
jmp 0x168f0
leaq 0x8(%rbx), %rdi
callq 0x18284
movq %rax, %rsi
jmp 0x168cb
// File: /workspace/github_cpp_makefile_star2_O3/moyix[P]pandalog_taint_parser/plog.pb.cc
// Function: panda::DwarfCall::SharedDtor()
void DwarfCall::SharedDtor() {
  GOOGLE_DCHECK(GetArena() == nullptr);
  file_callee_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  function_name_callee_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  file_caller_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rax
testb $0x1, %al
jne 0x17423
testq %rax, %rax
je 0x17379
leaq 0x2e4a(%rip), %rdx      # 0x1a186
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0x3, %esi
movl $0x3bd, %ecx            # imm = 0x3BD
callq 0x6530
leaq 0x316c(%rip), %rsi      # 0x1a4c6
movq %r14, %rdi
callq 0x6580
leaq 0xf(%rsp), %rdi
movq %rax, %rsi
callq 0x6450
leaq 0x10(%rsp), %rdi
callq 0x65a0
movq 0x18(%rbx), %r14
cmpq 0xcc3c(%rip), %r14      # 0x23fc0
je 0x173af
testq %r14, %r14
je 0x173a2
movq (%r14), %rdi
leaq 0x10(%r14), %rax
cmpq %rax, %rdi
je 0x173a2
movq (%rax), %rsi
incq %rsi
callq 0x6370
movl $0x20, %esi
movq %r14, %rdi
callq 0x6370
movq 0x20(%rbx), %r14
cmpq 0xcc06(%rip), %r14      # 0x23fc0
je 0x173e5
testq %r14, %r14
je 0x173d8
movq (%r14), %rdi
leaq 0x10(%r14), %rax
cmpq %rax, %rdi
je 0x173d8
movq (%rax), %rsi
incq %rsi
callq 0x6370
movl $0x20, %esi
movq %r14, %rdi
callq 0x6370
movq 0x28(%rbx), %rbx
cmpq 0xcbd0(%rip), %rbx      # 0x23fc0
je 0x1741b
testq %rbx, %rbx
je 0x1740e
movq (%rbx), %rdi
leaq 0x10(%rbx), %rax
cmpq %rax, %rdi
je 0x1740e
movq (%rax), %rsi
incq %rsi
callq 0x6370
movl $0x20, %esi
movq %rbx, %rdi
callq 0x6370
addq $0x48, %rsp
popq %rbx
popq %r14
retq
andq $-0x2, %rax
movq (%rax), %rax
jmp 0x17330
jmp 0x17431
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x65a0
movq %rbx, %rdi
callq 0x65b0
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/main.cpp
// Function: main
int main(){
    sparty.initialize();
    while(1) {
        sparty.updateADC();
        sparty.updateSensors();
        sparty.updatePressurePID();
        sparty.updatePWM();
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x6bef(%rip), %rbx      # 0x91f8
movq %rbx, %rdi
callq 0x3834
movq %rbx, %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x31e8
movq %rbx, %rdi
callq 0x35b8
movq %rbx, %rdi
callq 0x36ae
jmp 0x2611
nop
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/exosuit.cpp
// Function: ExoSuit::updateADC()
void ExoSuit::updateADC(void){
    adcValues.clear();
    std::vector<std::string> str = cvt.splitString(board.getADC(), ',');
    for(int i = 0; i < str.size(); i++) {
        adcValues.push_back(cvt.stringToInt(str[i]));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x318(%rdi), %rax
cmpq %rax, 0x320(%rdi)
je 0x30eb
movq %rax, 0x320(%rbx)
leaq 0x48(%rbx), %r14
leaq 0x50(%rbx), %rsi
leaq -0x60(%rbp), %r15
movq %r15, %rdi
callq 0x4e38
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
movq %r15, %rdx
movl $0x2c, %ecx
callq 0x5276
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x312c
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x40(%rbp), %rsi
cmpq %rsi, -0x38(%rbp)
je 0x3197
leaq 0x318(%rbx), %r15
xorl %r13d, %r13d
xorl %r12d, %r12d
addq %r13, %rsi
movq %r14, %rdi
callq 0x53a2
movl %eax, -0x60(%rbp)
movq 0x320(%rbx), %rsi
cmpq 0x328(%rbx), %rsi
je 0x3170
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x320(%rbx)
jmp 0x317c
movq %r15, %rdi
leaq -0x60(%rbp), %rdx
callq 0x3dc0
incq %r12
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rax
subq %rsi, %rax
sarq $0x5, %rax
addq $0x20, %r13
cmpq %r12, %rax
ja 0x3143
leaq -0x40(%rbp), %rdi
callq 0x3050
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x31d9
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x21e0
jmp 0x31d9
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x3050
movq %rbx, %rdi
callq 0x2360
nop
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/exosuit.cpp
// Function: ExoSuit::updatePressurePID()
void ExoSuit::updatePressurePID(void){
    outputStates.clear();
    for(int i = 0; i < pressurePID.size(); i++) {
        pressurePID[i].inputValue = pressureStates[i];
        pressurePID[i].setPoint = setpointValue;
        pressurePID[i].computeValues();
        outputStates.push_back(pressurePID[i].outputValue);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x410(%rdi), %rax
cmpq %rax, 0x418(%rdi)
je 0x35e0
movq %rax, 0x418(%rbx)
movq 0x470(%rbx), %rax
cmpq %rax, 0x478(%rbx)
je 0x369f
leaq 0x410(%rbx), %r14
xorl %r15d, %r15d
movabsq $-0xf0f0f0f0f0f0f0f, %r12 # imm = 0xF0F0F0F0F0F0F0F1
xorl %r13d, %r13d
movq 0x378(%rbx), %rcx
movsd (%rcx,%r13,8), %xmm0
leaq (%rax,%r15), %rdi
movsd %xmm0, 0x28(%rax,%r15)
movsd 0x408(%rbx), %xmm0
movsd %xmm0, 0x40(%rax,%r15)
callq 0x588c
movq 0x418(%rbx), %rsi
movq 0x470(%rbx), %rax
leaq (%rax,%r15), %rdx
addq $0x30, %rdx
cmpq 0x420(%rbx), %rsi
je 0x366b
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x418(%rbx)
jmp 0x367a
movq %r14, %rdi
callq 0x4026
movq 0x470(%rbx), %rax
incq %r13
movq 0x478(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
imulq %r12, %rcx
addq $0x88, %r15
cmpq %r13, %rcx
ja 0x360b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/exosuit.cpp
// Function: ExoSuit::updatePWM()
void ExoSuit::updatePWM(void){
    dutyCycleStates.clear();
    dutyCycles.clear();
    for(int i = 0; i < outputStates.size(); i++) {
        dutyCycleStates.push_back((int)std::round(outputStates[i]));
        dutyCycles.push_back(cvt.intToString(dutyCycleStates[i]));
    }
    board.setPWM(dutyCycles);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq 0x440(%rdi), %rax
cmpq %rax, 0x448(%rdi)
je 0x36d9
movq %rax, 0x448(%rbx)
leaq 0x458(%rbx), %rdi
movq 0x458(%rbx), %rsi
movq %rdi, -0x30(%rbp)
callq 0x4106
movq 0x410(%rbx), %rax
cmpq %rax, 0x418(%rbx)
je 0x37aa
leaq 0x440(%rbx), %r15
leaq 0x48(%rbx), %r12
xorl %r14d, %r14d
leaq -0x50(%rbp), %r13
movsd (%rax,%r14,8), %xmm0
callq 0x20c0
cvttsd2si %xmm0, %eax
movl %eax, -0x50(%rbp)
movq 0x448(%rbx), %rsi
cmpq 0x450(%rbx), %rsi
je 0x3747
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x448(%rbx)
jmp 0x3752
movq %r15, %rdi
movq %r13, %rdx
callq 0x4158
movq (%r15), %rax
movl (%rax,%r14,4), %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x551e
movq -0x30(%rbp), %rdi
movq %r13, %rsi
callq 0x4298
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3789
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21e0
incq %r14
movq 0x410(%rbx), %rax
movq 0x418(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
ja 0x3716
addq $0x50, %rbx
leaq -0x68(%rbp), %r15
movq %r15, %rdi
movq -0x30(%rbp), %rsi
callq 0x3bb0
leaq -0x88(%rbp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x50cc
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x37e9
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x21e0
leaq -0x68(%rbp), %rdi
callq 0x3050
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x3050
jmp 0x382b
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x382b
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x2360
nop
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/arduinomicro.cpp
// Function: ArduinoMicro::createPacket(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
std::string ArduinoMicro::createPacket(std::string command, std::vector<std::string> parameters = {}){
    std::string message = "";
    message.reserve(message.capacity() * 10); // Increase message capacity for appending parameters
    message.append(command);
    if(!parameters.empty()) {
        for(int i = 0; i < parameters.size(); i++) {
            message.append(PacketDelimiterString);
            message.append(parameters[i]);
        }
    }
    message.append(PacketTerminatorString);
    return message;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r13
movq %r13, (%rdi)
leaq 0x15a0(%rip), %rdx      # 0x62fc
movq %rdx, %rsi
callq 0x2f16
movq 0x10(%rbx), %rax
addq %rax, %rax
movq %r13, -0x30(%rbp)
cmpq %r13, (%rbx)
leaq (%rax,%rax,4), %rax
movl $0x96, %esi
cmovneq %rax, %rsi
movq %rbx, %rdi
callq 0x2300
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %rbx, %rdi
callq 0x2070
movq (%r15), %rax
cmpq 0x8(%r15), %rax
je 0x4deb
movl $0x8, %r12d
xorl %r13d, %r13d
movq 0x1a0(%r14), %rsi
movq 0x1a8(%r14), %rdx
movq %rbx, %rdi
callq 0x2070
movq (%r15), %rax
movq -0x8(%rax,%r12), %rsi
movq (%rax,%r12), %rdx
movq %rbx, %rdi
callq 0x2070
movq 0x8(%r15), %rax
subq (%r15), %rax
incq %r13
sarq $0x5, %rax
addq $0x20, %r12
cmpq %r13, %rax
ja 0x4daa
movq 0x1c0(%r14), %rsi
movq 0x1c8(%r14), %rdx
movq %rbx, %rdi
callq 0x2070
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4e15
movq %rax, %r14
movq (%rbx), %rdi
cmpq -0x30(%rbp), %rdi
je 0x4e30
movq -0x30(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x21e0
movq %r14, %rdi
callq 0x2360
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/arduinomicro.cpp
// Function: ArduinoMicro::getADC[abi:cxx11]()
std::string ArduinoMicro::getADC(void){
    packet = this->createPacket(GetADCValuesString).c_str();
    arduinoPort.writePort(packet);
    usleep(waitTime * 1000); // Delay before reading buffer
    data = arduinoPort.readPort();
    return std::string(data);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x1e0(%rsi), %rsi
movq 0x1e8(%r14), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x45a4
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rcx
movaps %xmm0, (%rcx)
movq $0x0, 0x10(%rcx)
leaq -0x80(%rbp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4d34
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
movq %rdi, 0x168(%r14)
cmpq %rax, %rdi
je 0x4eb6
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21e0
leaq -0x60(%rbp), %rdi
callq 0x3050
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x4ed4
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21e0
movq 0x168(%r14), %rsi
movq %r14, %rdi
callq 0x5dba
imull $0x3e8, 0x160(%r14), %edi # imm = 0x3E8
callq 0x2280
movq %r14, %rdi
callq 0x5e3c
movq %rax, %r15
leaq 0x170(%r14), %r12
movq 0x178(%r14), %r13
movq %rax, %rdi
callq 0x20d0
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x22f0
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x170(%r14), %rsi
movq 0x178(%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x45a4
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x3050
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x4f7a
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x2360
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/arduinomicro.cpp
// Function: ArduinoMicro::getGPIO[abi:cxx11]()
std::string ArduinoMicro::getGPIO(void){
    packet = this->createPacket(GetGPIOValuesString).c_str();
    arduinoPort.writePort(packet);
    usleep(waitTime * 1000); // Delay before reading buffer
    data = arduinoPort.readPort();
    return std::string(data);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x200(%rsi), %rsi
movq 0x208(%r14), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x45a4
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rcx
movaps %xmm0, (%rcx)
movq $0x0, 0x10(%rcx)
leaq -0x80(%rbp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4d34
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
movq %rdi, 0x168(%r14)
cmpq %rax, %rdi
je 0x5000
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21e0
leaq -0x60(%rbp), %rdi
callq 0x3050
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x501e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21e0
movq 0x168(%r14), %rsi
movq %r14, %rdi
callq 0x5dba
imull $0x3e8, 0x160(%r14), %edi # imm = 0x3E8
callq 0x2280
movq %r14, %rdi
callq 0x5e3c
movq %rax, %r15
leaq 0x170(%r14), %r12
movq 0x178(%r14), %r13
movq %rax, %rdi
callq 0x20d0
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x22f0
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x170(%r14), %rsi
movq 0x178(%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x45a4
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x3050
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x50c4
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x2360
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/arduinomicro.cpp
// Function: ArduinoMicro::setPWM(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
std::string ArduinoMicro::setPWM(std::vector<std::string> dutyCycles){
    packet = this->createPacket(SetPWMDutyCycleString, dutyCycles).c_str();
    arduinoPort.writePort(packet);
    usleep(waitTime * 1000); // Delay before reading buffer
    data = arduinoPort.readPort();
    return std::string(data);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x280(%rsi), %rsi
movq 0x288(%r14), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x45a4
leaq -0x60(%rbp), %rdi
movq %r15, %rsi
callq 0x3bb0
leaq -0x80(%rbp), %rdi
leaq -0x48(%rbp), %rdx
leaq -0x60(%rbp), %rcx
movq %r14, %rsi
callq 0x4d34
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
movq %rdi, 0x168(%r14)
cmpq %rax, %rdi
je 0x5149
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21e0
leaq -0x60(%rbp), %rdi
callq 0x3050
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5167
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21e0
movq 0x168(%r14), %rsi
movq %r14, %rdi
callq 0x5dba
imull $0x3e8, 0x160(%r14), %edi # imm = 0x3E8
callq 0x2280
movq %r14, %rdi
callq 0x5e3c
movq %rax, %r15
leaq 0x170(%r14), %r12
movq 0x178(%r14), %r13
movq %rax, %rdi
callq 0x20d0
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x22f0
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x170(%r14), %rsi
movq 0x178(%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x45a4
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x3050
jmp 0x51fd
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5212
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x2360
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/arduinomicro.cpp
// Function: ArduinoMicro::setupSerial(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
void ArduinoMicro::setupSerial(std::string portName, int baudRate){
    arduinoPort.portName = portName.c_str();
    arduinoPort.baudRate = baudRate;
    arduinoPort.openPort();
    arduinoPort.setPort();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %rax
movq %rax, 0x118(%rdi)
movl %edx, 0x10(%rdi)
callq 0x5b74
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5bc6
nop
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/converter.cpp
// Function: Converter::splitString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char)
std::vector<std::string> Converter::splitString(const std::string &str, char delimiter){
    std::vector<std::string> tokens = {};
    std::string token = "";
    std::stringstream stream(str);
    while(std::getline(stream, token, delimiter)) {
        tokens.push_back(token);
    }
    return tokens;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movl %ecx, %r14d
movq %rdx, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x104c(%rip), %rdx      # 0x62fc
leaq -0x48(%rbp), %rdi
movq %rdx, %rsi
callq 0x2f16
leaq -0x1d0(%rbp), %rdi
movq %r15, %rsi
movl $0x18, %edx
callq 0x2310
movsbl %r14b, %r14d
leaq -0x1d0(%rbp), %r15
leaq -0x48(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl %r14d, %edx
callq 0x2380
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x5308
movq %rbx, %rdi
movq %r12, %rsi
callq 0x55c8
jmp 0x52df
movq 0x3ca9(%rip), %rsi      # 0x8fb8
leaq -0x1d0(%rbp), %rdi
callq 0x2150
leaq -0x150(%rbp), %rdi
callq 0x2080
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x533c
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x537d
movq %rax, %r14
jmp 0x5392
movq %rax, %r14
movq 0x3c53(%rip), %rsi      # 0x8fb8
leaq -0x1d0(%rbp), %rdi
callq 0x2150
leaq -0x150(%rbp), %rdi
callq 0x2080
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x5392
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x3050
movq %r14, %rdi
callq 0x2360
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/pid.cpp
// Function: PID::computeValues()
bool PID::computeValues(void){
    if(!inAuto) return false;
    unsigned long currentTime = this->millis();
    unsigned long elapsedTime = currentTime - lastTime;
    if(elapsedTime >= sampleTime) {
        errorValue = setPoint - inputValue;
        iTerm += kiGain * errorValue;
        if(iTerm > outMax) iTerm = outMax;
        else if(iTerm < outMin) iTerm = outMin;
        dInput = inputValue - lastInput;
        // PID Equation
        outputValue = (kpGain * errorValue) + (iTerm) - (kdGain * dInput);
        //
        if(outputValue > outMax) outputValue = outMax;
        else if(outputValue < outMin) outputValue = outMin;
        lastInput = inputValue;
        lastTime = currentTime;
        return true;
    }
    else return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
cmpb $0x1, 0x10(%rdi)
jne 0x5983
movq %rdi, %rbx
xorl %r14d, %r14d
leaq -0x28(%rbp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2330
imulq $0x3e8, (%r15), %rcx    # imm = 0x3E8
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%r15)
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
addq %rcx, %rdx
movq %rdx, %rax
subq 0x20(%rbx), %rax
cmpq 0x18(%rbx), %rax
jb 0x5986
movsd 0x28(%rbx), %xmm0
movsd 0x40(%rbx), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x38(%rbx)
movsd 0x68(%rbx), %xmm3
mulsd %xmm1, %xmm3
addsd 0x48(%rbx), %xmm3
movsd %xmm3, 0x48(%rbx)
movsd 0x80(%rbx), %xmm2
ucomisd %xmm2, %xmm3
movapd %xmm2, %xmm4
ja 0x5931
movsd 0x78(%rbx), %xmm4
ucomisd %xmm3, %xmm4
jbe 0x593a
movsd %xmm4, 0x48(%rbx)
movapd %xmm4, %xmm3
movapd %xmm0, %xmm4
subsd 0x58(%rbx), %xmm4
movsd %xmm4, 0x50(%rbx)
mulsd 0x60(%rbx), %xmm1
addsd %xmm3, %xmm1
mulsd 0x70(%rbx), %xmm4
subsd %xmm4, %xmm1
movsd %xmm1, 0x30(%rbx)
ucomisd %xmm2, %xmm1
ja 0x5970
movsd 0x78(%rbx), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x5975
movsd %xmm2, 0x30(%rbx)
movsd %xmm0, 0x58(%rbx)
movq %rdx, 0x20(%rbx)
movb $0x1, %r14b
jmp 0x5986
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/pid.cpp
// Function: PID::setTunings(double, double, double)
void PID::setTunings(double Kp, double Ki, double Kd){
    if(Kp < 0 || Ki < 0 || Kd < 0) return;
    double sampleTimeInSec = ((double)sampleTime) / 1000;
    kpGain = Kp;
    kiGain = Ki * sampleTimeInSec;
    kdGain = Kd / sampleTimeInSec;
    if(controllerDirection == REVERSE) {
        kpGain = (0 - kpGain);
        kiGain = (0 - kiGain);
        kdGain = (0 - kdGain);
    }
}

// Assembly:
xorpd %xmm3, %xmm3
ucomisd %xmm0, %xmm3
ja 0x5a1d
ucomisd %xmm1, %xmm3
ja 0x5a1d
ucomisd %xmm2, %xmm3
ja 0x5a1d
pushq %rbp
movq %rsp, %rbp
movsd 0x18(%rdi), %xmm3
unpcklps 0x856(%rip), %xmm3      # xmm3 = xmm3[0],mem[0],xmm3[1],mem[1]
subpd 0x85e(%rip), %xmm3      # 0x6220
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
addsd %xmm3, %xmm4
divsd 0x85a(%rip), %xmm4      # 0x6230
movsd %xmm0, 0x60(%rdi)
mulsd %xmm4, %xmm1
movsd %xmm1, 0x68(%rdi)
divsd %xmm4, %xmm2
movsd %xmm2, 0x70(%rdi)
movl 0x14(%rdi), %eax
cmpl 0xc(%rdi), %eax
jne 0x5a1c
xorpd %xmm3, %xmm3
xorpd %xmm4, %xmm4
subsd %xmm0, %xmm4
movsd %xmm4, 0x60(%rdi)
xorpd %xmm0, %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rdi)
subsd %xmm2, %xmm3
movsd %xmm3, 0x70(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/pid.cpp
// Function: PID::setSampleTime(int)
void PID::setSampleTime(int newSampleTime){
    if(newSampleTime > 0) {
        double ratio = newSampleTime / sampleTime;
        kiGain *= ratio;
        kdGain /= ratio;
        sampleTime = newSampleTime;
    }
}

// Assembly:
testl %esi, %esi
jle 0x5a57
pushq %rbp
movq %rsp, %rbp
movl %esi, %ecx
movq %rcx, %rax
xorl %edx, %edx
divq 0x18(%rdi)
cvtsi2sd %rax, %xmm0
movsd 0x68(%rdi), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x68(%rdi)
movsd 0x70(%rdi), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x70(%rdi)
movq %rcx, 0x18(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/pid.cpp
// Function: PID::setOutputLimits(double, double)
void PID::setOutputLimits(double Min, double Max){
    if(Min >= Max) return;
    outMin = Min;
    outMax = Max;
    if(inAuto) {
        if(outputValue > outMax) outputValue = outMax;
        else if(outputValue < outMin) outputValue = outMin;
        if(iTerm > outMax) iTerm = outMax;
        else if(iTerm < outMin) iTerm = outMin;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
ucomisd %xmm1, %xmm0
jae 0x5aad
movsd %xmm0, 0x78(%rdi)
movsd %xmm1, 0x80(%rdi)
cmpb $0x1, 0x10(%rdi)
jne 0x5aad
movsd 0x30(%rdi), %xmm3
ucomisd %xmm1, %xmm3
movapd %xmm1, %xmm2
ja 0x5a8e
ucomisd %xmm3, %xmm0
movapd %xmm0, %xmm2
jbe 0x5a93
movsd %xmm2, 0x30(%rdi)
movsd 0x48(%rdi), %xmm2
ucomisd %xmm1, %xmm2
ja 0x5aa8
ucomisd %xmm2, %xmm0
movapd %xmm0, %xmm1
jbe 0x5aad
movsd %xmm1, 0x48(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/pid.cpp
// Function: PID::setMode(int)
void PID::setMode(int Mode){
    bool newAuto = Mode == AUTOMATIC;
    if(newAuto && !inAuto) {
        this->initialize();
    }
    inAuto = newAuto;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x4(%rdi), %eax
cmpl %esi, %eax
jne 0x5af3
cmpb $0x0, 0x10(%rdi)
jne 0x5af3
movsd 0x28(%rdi), %xmm0
movsd 0x30(%rdi), %xmm1
movsd %xmm0, 0x58(%rdi)
movsd %xmm1, 0x48(%rdi)
movsd 0x80(%rdi), %xmm0
ucomisd %xmm0, %xmm1
ja 0x5aee
movsd 0x78(%rdi), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x5af3
movsd %xmm0, 0x48(%rdi)
cmpl %esi, %eax
sete 0x10(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/pid.cpp
// Function: PID::initialize()
void PID::initialize(void){
    lastInput = inputValue;
    iTerm = outputValue;
    if(iTerm > outMax) iTerm = outMax;
    else if(iTerm < outMin) iTerm = outMin;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movsd 0x28(%rdi), %xmm0
movsd 0x30(%rdi), %xmm1
movsd %xmm0, 0x58(%rdi)
movsd %xmm1, 0x48(%rdi)
movsd 0x80(%rdi), %xmm0
ucomisd %xmm0, %xmm1
ja 0x5b2d
movsd 0x78(%rdi), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x5b32
movsd %xmm0, 0x48(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/pid.cpp
// Function: PID::setControllerDirection(int)
void PID::setControllerDirection(int Direction){
    if(inAuto && Direction != controllerDirection) {
        kpGain = (0 - kpGain);
        kiGain = (0 - kiGain);
        kdGain = (0 - kdGain);
    }
    controllerDirection = Direction;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x1, 0x10(%rdi)
jne 0x5b6d
cmpl %esi, 0x14(%rdi)
je 0x5b6d
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
subsd 0x60(%rdi), %xmm1
movsd %xmm1, 0x60(%rdi)
xorpd %xmm1, %xmm1
subsd 0x68(%rdi), %xmm1
movsd %xmm1, 0x68(%rdi)
subsd 0x70(%rdi), %xmm0
movsd %xmm0, 0x70(%rdi)
movl %esi, 0x14(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/serial.cpp
// Function: SerialPort::openPort()
void SerialPort::openPort(void){
    fileDescriptor = open(portName, O_RDWR | O_NOCTTY);
    // portName = Name of serial port
    // O_RDWR = Allows read/write access to serial port
    // O_NOCTTY = No terminal will control the process
    // O_NDELAY = Non blocking mode (do not care about the DCD line status)
    if (fileDescriptor == -1) {
        perror("\nOpen_Port: Unable to open serial port =");
    }
    else{
        printf("\nPort %s opened successfully!\n", portName);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x118(%rdi), %rdi
movl $0x102, %esi            # imm = 0x102
xorl %eax, %eax
callq 0x2140
movl %eax, 0x4(%rbx)
cmpl $-0x1, %eax
je 0x5bb3
movq 0x118(%rbx), %rsi
leaq 0x6bb(%rip), %rdi       # 0x6261
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2050
leaq 0x67e(%rip), %rdi       # 0x6238
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x21a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/msu-starx[P]starx/serial.cpp
// Function: SerialPort::writePort(char const*)
void SerialPort::writePort(const char* bufferWrite){
    bytesWrite = write(fileDescriptor, bufferWrite, strlen(bufferWrite));
    if(bytesWrite < 0) {
        fputs("write() of bytes failed!\n", stderr);
    }
    //*// Debug SerialPort::writePort
    if(bytesWrite > 0) {
        printf("Sent: %s", bufferWrite);
        printf("\n");
    }//*/
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rdi), %r15d
movq %rsi, %rdi
callq 0x20d0
movl %r15d, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2090
movl %eax, 0x8(%r14)
testl %eax, %eax
js 0x5e20
testl %eax, %eax
jle 0x5e15
leaq 0x506(%rip), %rdi       # 0x62fd
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2050
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2260
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x31b1(%rip), %rax      # 0x8fd8
movq (%rax), %rsi
leaq 0x4b2(%rip), %rdi       # 0x62e3
callq 0x2210
movl 0x8(%r14), %eax
jmp 0x5dec
// File: /workspace/github_cpp_makefile_star2_O3/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::PaxosNode(message*)
PaxosNode (message *m){
		if (m->type != MSG_INIT) {
			exit (1);
		}
		id = m->sender;
		role = m->receiver;
		num_nodes = m->value;
		n = 0;
		v = NO_VALUE;
		state = NO_VALUE;
		log = new PaxosNodeLogger (id);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movb $0x0, 0x18(%rdi)
addq $0x28, %rdi
leaq 0x78(%r14), %rbx
movl $0xa0, %edx
xorl %esi, %esi
callq 0x2110
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2a1a
xorps %xmm0, %xmm0
movups %xmm0, 0xe8(%r14)
movups %xmm0, 0xd8(%r14)
movups %xmm0, 0xc8(%r14)
movabsq $0x200000005, %rax      # imm = 0x200000005
movq %rax, 0xf8(%r14)
cmpl $0x0, 0x10(%r15)
jne 0x28ed
movl (%r15), %r12d
movl %r12d, (%r14)
movl 0x4(%r15), %eax
movl %eax, 0x8(%r14)
movl 0x8(%r15), %eax
movl %eax, 0x4(%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0xc(%r14)
movl $0xffffffff, 0x14(%r14) # imm = 0xFFFFFFFF
movl $0x228, %edi            # imm = 0x228
callq 0x2200
movq %rax, %r13
movq %rax, %rdi
movl %r12d, %esi
callq 0x3fd0
movq %r13, 0x20(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x2250
movq %rax, %r15
movq %r13, %rdi
callq 0x21d0
movq 0xe0(%r14), %rdi
testq %rdi, %rdi
je 0x2918
callq 0x21d0
jmp 0x2918
movq %rax, %r15
addq $0xc8, %r14
movq (%r14), %rdi
testq %rdi, %rdi
je 0x292c
callq 0x21d0
movq %rbx, %rdi
callq 0x2ba2
movq %r15, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O3/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::run()
void run (){
		std::thread t ([this]{ this->network_listener(); });
		message *m;
		while (true){
			m = NULL;
			queue_lock.lock ();
			if (!messages.empty ()){
				m = messages.front ();
				messages.pop ();
			}
			queue_lock.unlock ();
			
			process_message (m);
			proposer_state_update ();
			check_consensus ();
			check_timeout ();	
		}

	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq -0x30(%rbp), %rsi
movq %rdi, (%rsi)
leaq -0x28(%rbp), %rdi
callq 0x2bfc
leaq 0x50(%rbx), %r14
leaq 0x78(%rbx), %r15
movq %r14, %rdi
callq 0x22b0
testl %eax, %eax
jne 0x29bf
movq 0x88(%rbx), %rax
cmpq %rax, 0xa8(%rbx)
je 0x298f
movq (%rax), %r12
movq %r15, %rdi
callq 0x335e
jmp 0x2992
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x2160
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2c92
movq %rbx, %rdi
callq 0x2efc
movq %rbx, %rdi
callq 0x2f52
movq %rbx, %rdi
callq 0x3046
jmp 0x2966
movl %eax, %edi
callq 0x2120
jmp 0x29c8
cmpq $0x0, -0x28(%rbp)
jne 0x29d7
movq %rax, %rdi
callq 0x2320
callq 0x2070
// File: /workspace/github_cpp_makefile_star2_O3/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::proposer_state_update()
void proposer_state_update () {
		if ((role & PROPOSER)){
			if (prepare_acks.size () == 0 && state == NO_VALUE){
				prepare ();
			} else if (votes.size () == 0 && state == PREPARING) {
				propose ();
			}

		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testb $0x1, 0x8(%rdi)
jne 0x2f08
popq %rbp
retq
movq 0xe8(%rdi), %rax
cmpq 0xe0(%rdi), %rax
sete %cl
movl 0x14(%rdi), %eax
cmpl $-0x1, %eax
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x2f2f
popq %rbp
jmp 0x3dd6
movq 0xd0(%rdi), %rcx
cmpq 0xc8(%rdi), %rcx
sete %cl
cmpl $-0x4, %eax
sete %al
andb %cl, %al
cmpb $0x1, %al
jne 0x2f06
popq %rbp
jmp 0x3e96
// File: /workspace/github_cpp_makefile_star2_O3/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::check_consensus()
void check_consensus () {
		if ((role & LEARNER)&& (role & PROPOSER) &&
			state == PROPOSING) {
			int valid_votes = 0;
			for (int i = 0; i < votes.size (); i++){
				if (votes [i]->v == v && votes [i]->n == n){
					valid_votes++;
				}
			}
			if (valid_votes > (num_nodes % 2 == 0 ? num_nodes / 2 : 1 + (num_nodes / 2))) {
				message cons (id, -1, v, n, MSG_CONSENSUS);
				network_lock.lock ();
				send_message (0, &cons);
				network_lock.unlock ();
				safe_exit (&cons);
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl 0x8(%rdi), %eax
notl %eax
testb $0x3, %al
jne 0x3033
movq %rdi, %rbx
cmpl $-0x5, 0x14(%rdi)
jne 0x3033
movq 0xc8(%rbx), %rcx
movq 0xd0(%rbx), %rdx
subq %rcx, %rdx
je 0x2fc5
sarq $0x3, %rdx
movl 0xc(%rbx), %esi
movl 0x10(%rbx), %edi
cmpq $0x1, %rdx
adcq $0x0, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
movq (%rcx,%r8,8), %r9
cmpl %esi, 0x8(%r9)
jne 0x2fbb
xorl %r10d, %r10d
cmpl %edi, 0x4(%r9)
sete %r10b
addl %r10d, %eax
incq %r8
cmpq %r8, %rdx
jne 0x2fa3
jmp 0x2fc7
xorl %eax, %eax
movl 0x4(%rbx), %ecx
testb $0x1, %cl
jne 0x2fd3
sarl %ecx
jmp 0x2fe0
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
incl %edx
movl %edx, %ecx
cmpl %ecx, %eax
jle 0x3033
movl (%rbx), %eax
movq 0xc(%rbx), %rcx
movl %eax, -0x38(%rbp)
movl $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
movq %rcx, -0x30(%rbp)
movl $0x6, -0x28(%rbp)
leaq 0x28(%rbx), %r14
movq %r14, %rdi
callq 0x22b0
testl %eax, %eax
jne 0x303e
leaq -0x38(%rbp), %r15
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x33b2
movq %r14, %rdi
callq 0x2160
movq %rbx, %rdi
movq %r15, %rsi
callq 0x37fc
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x2120
nop
// File: /workspace/github_cpp_makefile_star2_O3/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::check_timeout()
void check_timeout (){
		if (role & PROPOSER){
			time_t timeStamp = time(0);
			if (timeStamp - timeout  > TIMEOUT) {
				clear_responses ();
				proposer_state_update ();
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testb $0x1, 0x8(%rdi)
je 0x307f
movq %rdi, %rbx
xorl %edi, %edi
callq 0x21c0
subq 0x100(%rbx), %rax
cmpq $0x9, %rax
jl 0x307f
movq %rbx, %rdi
callq 0x375a
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2efc
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::network_listener()
void network_listener (){
		message *m;
		while (true){
			network_lock.lock ();
			m = receive_packet (1);
			network_lock.unlock ();
			if (m != NULL){
				queue_lock.lock ();
				messages.push (m);
				queue_lock.unlock ();
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
movq %r14, %rdi
callq 0x22b0
testl %eax, %eax
jne 0x314d
leaq 0x50(%rbx), %r15
leaq 0x78(%rbx), %r12
leaq -0x30(%rbp), %r13
movl $0x1, %edi
callq 0x24bc
movq %rax, -0x30(%rbp)
movq %r14, %rdi
callq 0x2160
cmpq $0x0, -0x30(%rbp)
je 0x3141
movq %r15, %rdi
callq 0x22b0
testl %eax, %eax
jne 0x314d
movq 0xa8(%rbx), %rax
movq 0xb8(%rbx), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x312e
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
addq $0x8, 0xa8(%rbx)
jmp 0x3139
movq %r12, %rdi
movq %r13, %rsi
callq 0x3154
movq %r15, %rdi
callq 0x2160
movq %r14, %rdi
callq 0x22b0
testl %eax, %eax
je 0x30dd
movl %eax, %edi
callq 0x2120
// File: /workspace/github_cpp_makefile_star2_O3/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::clear_responses()
void clear_responses (){
		if (role & LEARNER){
			for (int i = 0; i < votes.size (); i++){
				free (votes [i]);
			}
			votes.clear ();
		}
		prepare_acks.clear ();
		state = NO_VALUE;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
testb $0x2, 0x8(%rdi)
je 0x37b5
movq 0xc8(%rbx), %rax
movq 0xd0(%rbx), %rcx
cmpq %rax, %rcx
je 0x37a9
xorl %r14d, %r14d
movq (%rax,%r14,8), %rdi
callq 0x2240
incq %r14
movq 0xc8(%rbx), %rax
movq 0xd0(%rbx), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r14, %rdx
ja 0x3780
cmpq %rax, %rcx
je 0x37b5
movq %rax, 0xd0(%rbx)
movq 0xe0(%rbx), %rax
cmpq %rax, 0xe8(%rbx)
je 0x37cc
movq %rax, 0xe8(%rbx)
movl $0xffffffff, 0x14(%rbx) # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::safe_exit(message*)
void safe_exit (message *m) {
		log->CloseLogFile ();
		m->type = MSG_TEARDOWN;
		network_lock.lock ();
		send_message (0, m);
		while (true){
			m = receive_packet (1);
			if (m != NULL){
				if (m->type == MSG_TEARDOWN){
					network_lock.unlock ();
					exit (0);
				}
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq 0x20(%rdi), %rdi
callq 0x451e
movl $0x8, 0x10(%r14)
leaq 0x28(%r15), %rbx
movq %rbx, %rdi
callq 0x22b0
testl %eax, %eax
jne 0x385e
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x33b2
movl $0x1, %edi
callq 0x24bc
testq %rax, %rax
je 0x383a
cmpl $0x8, 0x10(%rax)
jne 0x383a
movq %rbx, %rdi
callq 0x2c88
xorl %edi, %edi
callq 0x2250
movl %eax, %edi
callq 0x2120
nop
// File: /workspace/github_cpp_makefile_star2_O3/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::simulate_crash()
void simulate_crash (){
		int c = rand () % 100;
		int crash_type = rand () % 100;
		if (c < p_crash){
			/* Don't sleep while holding locks. It's fine
			   to just modify system state accordingly when
			   waking up. */
			network_lock.lock ();
			log->Crash ();
			notify_crash (CRASH_ENTRY);
			network_lock.unlock ();

			int crash_duration = (rand () % (CRASH_DUR * 3) ) + 1;
			sleep (crash_duration);

			network_lock.lock ();
			queue_lock.lock ();
			while (!messages.empty ()) {
				message *m = messages.front ();
				messages.pop ();
				free (m);
			}
			queue_lock.unlock ();
			/* Machine Failure. Clear all current
			   state and then recover from log. */
			if (crash_type < crash_dist) {
				clear_responses ();
			}


			clear_network ();
			log->ResumeFromCrash ();
			notify_crash (RESUME_ENTRY);
			network_lock.unlock ();
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2060
movslq %eax, %r14
imulq $0x51eb851f, %r14, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
imull $0x64, %eax, %eax
subl %eax, %r14d
callq 0x2060
cmpl 0xf8(%rbx), %r14d
jge 0x39d6
movl %eax, %r15d
leaq 0x28(%rbx), %r14
movq %r14, %rdi
callq 0x22b0
testl %eax, %eax
jne 0x39e5
movq 0x20(%rbx), %rdi
callq 0x49a0
movq %rbx, %rdi
movl $0x2, %esi
callq 0x3d6e
movq %r14, %rdi
callq 0x2160
callq 0x2060
cltq
imulq $0x2aaaaaab, %rax, %rcx # imm = 0x2AAAAAAB
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,2), %ecx
negl %ecx
leal (%rax,%rcx), %edi
incl %edi
callq 0x2150
movq %r14, %rdi
callq 0x22b0
testl %eax, %eax
jne 0x39e5
movq %r14, -0x30(%rbp)
leaq 0x50(%rbx), %r12
movq %r12, %rdi
callq 0x22b0
testl %eax, %eax
jne 0x39e5
movslq %r15d, %r14
imulq $0x51eb851f, %r14, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
imull $0x64, %eax, %eax
subl %eax, %r14d
movq 0x88(%rbx), %rax
cmpq %rax, 0xa8(%rbx)
je 0x3988
leaq 0x78(%rbx), %r15
movq (%rax), %r13
movq %r15, %rdi
callq 0x335e
movq %r13, %rdi
callq 0x2240
movq 0x88(%rbx), %rax
cmpq %rax, 0xa8(%rbx)
jne 0x3965
movq %r12, %rdi
callq 0x2160
cmpl 0xfc(%rbx), %r14d
jge 0x39a1
movq %rbx, %rdi
callq 0x375a
movq %rbx, %rdi
callq 0x3db6
movq 0x20(%rbx), %rdi
callq 0x4a82
movq %rbx, %rdi
movl $0x3, %esi
callq 0x3d6e
movq -0x30(%rbp), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2160
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x2120
// File: /workspace/github_cpp_makefile_star2_O3/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::clear_network()
void clear_network () {
		message *m;
		while (true){
			m = receive_packet (1);
			if (m == NULL){
				break;
			} else {
				free (m);
			}
		}

	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x1, %edi
callq 0x24bc
testq %rax, %rax
je 0x3dd3
movq %rax, %rdi
callq 0x2240
jmp 0x3dba
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::prepare()
void prepare (){
		if (role & PROPOSER){
			n += 1;
			message m (id, -1, -1, n, MSG_PREPARE);

			clear_responses ();
			network_lock.lock ();
			send_message (0, &m);
			network_lock.unlock ();
			prepare_acks.push_back (id);
			state = PREPARING;
			timeout = time(0);
			simulate_crash ();

		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
testb $0x1, 0x8(%rdi)
je 0x3e85
movq %rdi, %rbx
movl 0x10(%rdi), %eax
incl %eax
movl %eax, 0x10(%rdi)
movl (%rdi), %ecx
movl %ecx, -0x30(%rbp)
movq $-0x1, -0x2c(%rbp)
movl %eax, -0x24(%rbp)
movl $0x1, -0x20(%rbp)
callq 0x375a
leaq 0x28(%rbx), %r14
movq %r14, %rdi
callq 0x22b0
testl %eax, %eax
jne 0x3e8e
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x33b2
movq %r14, %rdi
callq 0x2160
movq 0xe8(%rbx), %rsi
cmpq 0xf0(%rbx), %rsi
je 0x3e59
movl (%rbx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xe8(%rbx)
jmp 0x3e68
leaq 0xe0(%rbx), %rdi
movq %rbx, %rdx
callq 0x3afc
movl $0xfffffffc, 0x14(%rbx) # imm = 0xFFFFFFFC
xorl %edi, %edi
callq 0x21c0
movq %rax, 0x100(%rbx)
movq %rbx, %rdi
callq 0x3866
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl %eax, %edi
callq 0x2120
nop