LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: IncredibleHannes[P]QMUL-ChessGame/src/Model/Chessman/StraightLineMover.cpp
// Function: StraightLineMover::checkMove(Board const&, std::__cxx11::list<Move, std::allocator<Move>>&, bool&, int, int) const
void StraightLineMover::checkMove(const Board &board, std::list<Move> &moves,
                                  bool &direction, int dx, int dy) const {
  int x = this->getCurrentPosition().getX();
  int y = this->getCurrentPosition().getY();

  if (!direction) { return; }
  Position p = Position(x + dx, y + dy);
  if (!p.isValid()) {
    direction = false;
    return;
  }
  if (board.getChessman(p) != nullptr) {
    direction = false;
    if (board.getChessman(p)->getColour() != this->colour) {
      moves.push_back(Move(Position(x, y), p));
    }
  } else {
    moves.push_back(Move(Position(x, y), p));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x5910
movq %rax, -0x34(%rbp)
leaq -0x34(%rbp), %rdi
callq 0x2ee0
movq -0xd0(%rbp), %rdi
movl %eax, -0x2c(%rbp)
callq 0x5910
movq %rax, -0x40(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x2ef0
movl %eax, -0x38(%rbp)
movq -0x20(%rbp), %rax
testb $0x1, (%rax)
jne 0x48ad
jmp 0x4a4c
movl -0x2c(%rbp), %esi
addl -0x24(%rbp), %esi
movl -0x38(%rbp), %edx
addl -0x28(%rbp), %edx
leaq -0x48(%rbp), %rdi
callq 0x2e50
leaq -0x48(%rbp), %rdi
callq 0x2f10
testb $0x1, %al
jne 0x48db
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
jmp 0x4a4c
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rsi
callq 0x7de0
cmpq $0x0, %rax
je 0x49c0
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rsi
callq 0x7de0
movq %rax, %rdi
callq 0x5790
movq -0xd0(%rbp), %rcx
andb $0x1, %al
movzbl %al, %eax
movb 0x8(%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x49bb
movq -0x18(%rbp), %rax
movq %rax, -0xe0(%rbp)
movl -0x2c(%rbp), %esi
movl -0x38(%rbp), %edx
leaq -0x80(%rbp), %rdi
callq 0x2e50
movq -0x48(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rsi
movq -0x88(%rbp), %rdx
leaq -0x78(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x68b0
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x3ca0
jmp 0x4990
leaq -0x78(%rbp), %rdi
callq 0x69d0
jmp 0x49bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x69d0
jmp 0x4a55
jmp 0x4a4c
movq -0x18(%rbp), %rax
movq %rax, -0xf0(%rbp)
movl -0x2c(%rbp), %esi
movl -0x38(%rbp), %edx
leaq -0xc0(%rbp), %rdi
callq 0x2e50
movq -0x48(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
leaq -0xb8(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x68b0
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rsi
callq 0x3ca0
jmp 0x4a1e
leaq -0xb8(%rbp), %rdi
callq 0x69d0
jmp 0x4a4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x69d0
jmp 0x4a55
addq $0xf0, %rsp
popq %rbp
retq
movq -0x90(%rbp), %rdi
callq 0x2260
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: IncredibleHannes[P]QMUL-ChessGame/src/Model/Chessman/Rook.cpp
// Function: Rook::getPossibleMoves[abi:cxx11](Board const&) const
std::list<Move> Rook::getPossibleMoves(const Board &board) const {
  std::list<Move> moves;
  if (!isCaptured()) {
    bool top = true;
    bool right = true;
    bool bottom = true;
    bool left = true;
    int i = 1;

    while (top || right || bottom || left) {
      checkMove(board, moves, top, i, 0);
      checkMove(board, moves, right, 0, i);
      checkMove(board, moves, bottom, -i, 0);
      checkMove(board, moves, left, 0, -i);
      i++;
    }
  }
  return moves;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x50(%rbp)
movq %rdi, %rax
movq %rax, -0x48(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x3220
movq -0x40(%rbp), %rdi
callq 0x57d0
movb %al, -0x35(%rbp)
jmp 0x558e
movb -0x35(%rbp), %al
testb $0x1, %al
jne 0x568a
jmp 0x559b
movb $0x1, -0x2d(%rbp)
movb $0x1, -0x2e(%rbp)
movb $0x1, -0x2f(%rbp)
movb $0x1, -0x30(%rbp)
movl $0x1, -0x34(%rbp)
movb $0x1, %al
testb $0x1, -0x2d(%rbp)
movb %al, -0x51(%rbp)
jne 0x55d9
movb $0x1, %al
testb $0x1, -0x2e(%rbp)
movb %al, -0x51(%rbp)
jne 0x55d9
movb $0x1, %al
testb $0x1, -0x2f(%rbp)
movb %al, -0x51(%rbp)
jne 0x55d9
movb -0x30(%rbp), %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x55e5
jmp 0x5688
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x34(%rbp), %r8d
leaq -0x2d(%rbp), %rcx
xorl %r9d, %r9d
callq 0x4840
jmp 0x5603
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x34(%rbp), %r9d
leaq -0x2e(%rbp), %rcx
xorl %r8d, %r8d
callq 0x4840
jmp 0x5621
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x34(%rbp), %r8d
negl %r8d
leaq -0x2f(%rbp), %rcx
xorl %r9d, %r9d
callq 0x4840
jmp 0x5642
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x34(%rbp), %r9d
negl %r9d
leaq -0x30(%rbp), %rcx
xorl %r8d, %r8d
callq 0x4840
jmp 0x5663
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x55b2
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3240
jmp 0x56a7
jmp 0x568a
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x569d
movq -0x50(%rbp), %rdi
callq 0x3240
movq -0x48(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x2260
// File: IncredibleHannes[P]QMUL-ChessGame/src/Model/Chessman/Chessman.cpp
// Function: Chessman::isMoveValid(Board const&, Move const&) const
bool Chessman::isMoveValid(const Board &board, const Move &move) const {
  std::list<Move> moves = this->getPossibleMoves(board);
  for (std::list<Move>::iterator it = moves.begin(); it != moves.end(); it++) {
    if (*it == move)
    { return true; }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq (%rsi), %rax
leaq -0x38(%rbp), %rdi
callq *0x18(%rax)
leaq -0x38(%rbp), %rdi
callq 0x5990
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x44f0
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x59c0
testb $0x1, %al
jne 0x5863
jmp 0x58bd
leaq -0x40(%rbp), %rdi
callq 0x59f0
movq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x6ad0
movb %al, -0x61(%rbp)
jmp 0x587d
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x5886
jmp 0x58aa
movb $0x1, -0x1(%rbp)
movl $0x1, -0x58(%rbp)
jmp 0x58c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3240
jmp 0x58dc
jmp 0x58ac
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x5a10
movq %rax, -0x60(%rbp)
jmp 0x5843
movb $0x0, -0x1(%rbp)
movl $0x1, -0x58(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3240
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x2260
nopw %cs:(%rax,%rax)
// File: IncredibleHannes[P]QMUL-ChessGame/src/Model/Move.cpp
// Function: Move::Move(Move const&)
Move::Move(const Move &move)
  : origin(move.origin), target(move.target), type(move.type), capturedChessman(){
    if(move.getCapturedChessman() == nullptr) {
      this->capturedChessman = nullptr;
    } else {
      this->capturedChessman = move.getCapturedChessman()->clone();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movl 0x10(%rcx), %ecx
movl %ecx, 0x10(%rax)
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rdi
callq 0x69b0
cmpq $0x0, %rax
jne 0x698d
movq -0x18(%rbp), %rax
movq $0x0, 0x18(%rax)
jmp 0x69a9
movq -0x10(%rbp), %rdi
callq 0x69b0
movq %rax, %rdi
movq (%rdi), %rax
callq *(%rax)
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: IncredibleHannes[P]QMUL-ChessGame/src/Model/Board.cpp
// Function: Board::Board(std::__cxx11::list<Move*, std::allocator<Move*>>)
Board::Board(std::list<Move *> moves)
  : currentColour(Chessman::Colour::White) {
  this->board = createStartBoard();
  while (moves.size() != 0) {
    applyMove(moves.front());
    delete moves.front();
    moves.pop_front();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rsi, -0x48(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movb $0x1, 0x8(%rdi)
addq $0x10, %rdi
movq %rdi, -0x40(%rbp)
callq 0x9130
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
movq %rdi, -0x38(%rbp)
callq 0x9150
movq -0x30(%rbp), %rdi
callq 0x6bf0
movq %rax, -0x28(%rbp)
jmp 0x747d
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, (%rax)
movq -0x48(%rbp), %rdi
callq 0x9190
cmpq $0x0, %rax
je 0x7501
movq -0x48(%rbp), %rdi
callq 0x91c0
movq -0x30(%rbp), %rdi
movq (%rax), %rsi
callq 0x7510
jmp 0x74ae
movq -0x48(%rbp), %rdi
callq 0x91c0
movq (%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0x74d6
movq -0x50(%rbp), %rdi
callq 0x69d0
movq -0x50(%rbp), %rdi
callq 0x2140
movq -0x48(%rbp), %rdi
callq 0x91f0
jmp 0x7488
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x2bb0
movq -0x40(%rbp), %rdi
callq 0x9170
jmp 0x7507
addq $0x50, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x2260
// File: IncredibleHannes[P]QMUL-ChessGame/src/Model/Board.cpp
// Function: Board::~Board()
Board::~Board() {
  for (int x = 0; x < 8; x++) {
    for (int y = 0; y < 8; y++) {
      if (this->board[x][y] != nullptr) {
        delete this->board[x][y];
      }
    }
  }
  for (int i = 0; i < 8; i++) {
    delete[] this->board[i];
  }
  delete[] this->board;
  for(Chessman* c : this->capturedChessmen) {
    delete c;
  }
  for(Move* m : this->previousMoves) {
    delete m;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x8, -0xc(%rbp)
jge 0x7ed2
movl $0x0, -0x10(%rbp)
cmpl $0x8, -0x10(%rbp)
jge 0x7ec5
movq -0x60(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x7eb8
movq -0x60(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, %rax
je 0x7eb6
movq -0x68(%rbp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x7eb8
jmp 0x7eba
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x7e6b
jmp 0x7ec7
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7e5e
movl $0x0, -0x14(%rbp)
cmpl $0x8, -0x14(%rbp)
jge 0x7f0e
movq -0x60(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, %rax
je 0x7f01
movq -0x70(%rbp), %rdi
callq 0x21d0
jmp 0x7f03
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x7ed9
movq -0x60(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, %rax
je 0x7f28
movq -0x78(%rbp), %rdi
callq 0x21d0
movq -0x60(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x9460
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x9490
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x94c0
testb $0x1, %al
jne 0x7f61
jmp 0x7f96
leaq -0x28(%rbp), %rdi
callq 0x94f0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, %rax
je 0x7f89
movq -0x80(%rbp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x7f8b
leaq -0x28(%rbp), %rdi
callq 0x9510
jmp 0x7f4e
movq -0x60(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x9530
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x9560
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x9590
testb $0x1, %al
jne 0x7fcf
jmp 0x8015
leaq -0x48(%rbp), %rdi
callq 0x95c0
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, %rax
je 0x8008
movq -0x88(%rbp), %rdi
callq 0x69d0
movq -0x88(%rbp), %rdi
callq 0x2140
jmp 0x800a
leaq -0x48(%rbp), %rdi
callq 0x95e0
jmp 0x7fbc
movq -0x60(%rbp), %rdi
addq $0x28, %rdi
callq 0x2bb0
movq -0x60(%rbp), %rdi
addq $0x10, %rdi
callq 0x9170
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: IncredibleHannes[P]QMUL-ChessGame/src/Model/Board.cpp
// Function: Board::getAllPossibleMoves[abi:cxx11](Chessman::Colour) const
std::list<Move> Board::getAllPossibleMoves(Chessman::Colour colour) const {
  std::list<Move> list;
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 8; j++) {
      if (this->board[i][j] != nullptr && this->board[i][j]->getColour() == colour) {
        list.splice(list.end(), this->board[i][j]->getPossibleMoves(*this));
      }
    }
  }
  return list;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x70(%rbp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, -0x68(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movb $0x0, -0x12(%rbp)
callq 0x3220
movl $0x0, -0x18(%rbp)
cmpl $0x8, -0x18(%rbp)
jge 0x817f
movl $0x0, -0x1c(%rbp)
cmpl $0x8, -0x1c(%rbp)
jge 0x816f
movq -0x60(%rbp), %rax
movq (%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x815f
movq -0x60(%rbp), %rax
movq (%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x5790
movb %al, -0x71(%rbp)
jmp 0x80d7
movb -0x71(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movb -0x11(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x815f
movq -0x70(%rbp), %rdi
callq 0x44f0
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x96c0
movq -0x60(%rbp), %rdx
movq (%rdx), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq (%rsi), %rax
movq 0x18(%rax), %rax
leaq -0x58(%rbp), %rdi
callq *%rax
jmp 0x812c
movq -0x70(%rbp), %rdi
movq -0x38(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x9600
leaq -0x58(%rbp), %rdi
callq 0x3240
jmp 0x815f
movq -0x70(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3240
jmp 0x819f
jmp 0x8161
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x808e
jmp 0x8171
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x807d
movb $0x1, -0x12(%rbp)
testb $0x1, -0x12(%rbp)
jne 0x8192
movq -0x70(%rbp), %rdi
callq 0x3240
movq -0x68(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x2260
nopl (%rax,%rax)
// File: IncredibleHannes[P]QMUL-ChessGame/src/Model/Board.cpp
// Function: Board::isCheck() const
bool Board::isCheck() const {
  std::list<Move> moves = getAllPossibleMoves(!this->currentColour);
  for (Move m : moves) {
    Chessman *target = board[m.getTarget().getX()][m.getTarget().getY()];
    if (target != nullptr
        && target->getType() == Chessman::FigureType::King
        && target->getColour() == this->currentColour) {
      return true;
    }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movb 0x8(%rax), %al
andb $0x1, %al
movzbl %al, %edi
callq 0x5970
movq -0x98(%rbp), %rsi
movzbl %al, %edx
andl $0x1, %edx
leaq -0x28(%rbp), %rdi
callq 0x8040
leaq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x5990
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0x44f0
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x59c0
testb $0x1, %al
jne 0x8255
jmp 0x83cd
leaq -0x38(%rbp), %rdi
callq 0x59f0
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0x6930
jmp 0x826c
movq -0x98(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x6a30
movq %rax, -0xa0(%rbp)
jmp 0x828f
movq -0xa0(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x2ee0
movl %eax, -0xac(%rbp)
jmp 0x82ab
movq -0xa8(%rbp), %rax
movl -0xac(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xc0(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x6a30
movq %rax, -0xb8(%rbp)
jmp 0x82d8
movq -0xb8(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x2ef0
movl %eax, -0xc4(%rbp)
jmp 0x82fa
movq -0xc0(%rbp), %rax
movl -0xc4(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x839e
movq -0x78(%rbp), %rdi
callq 0x58f0
movl %eax, -0xc8(%rbp)
jmp 0x832e
movl -0xc8(%rbp), %eax
cmpl $0x0, %eax
jne 0x839e
movq -0x78(%rbp), %rdi
callq 0x5790
movb %al, -0xc9(%rbp)
jmp 0x834a
movq -0x98(%rbp), %rcx
movb -0xc9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movb 0x8(%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x839e
movb $0x1, -0x1(%rbp)
movl $0x1, -0x8c(%rbp)
jmp 0x83a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x83f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x69d0
jmp 0x83f2
movl $0x0, -0x8c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x69d0
movl -0x8c(%rbp), %eax
testl %eax, %eax
jne 0x83db
jmp 0x83bd
jmp 0x83bf
leaq -0x38(%rbp), %rdi
callq 0x98e0
jmp 0x823f
movb $0x0, -0x1(%rbp)
movl $0x1, -0x8c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x3240
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xd0, %rsp
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x3240
movq -0x68(%rbp), %rdi
callq 0x2260
nopw %cs:(%rax,%rax)
// File: IncredibleHannes[P]QMUL-ChessGame/src/Model/Board.cpp
// Function: Board::changeCurrentColour()
void Board::changeCurrentColour() {
  if (this->currentColour == Chessman::Colour::White) {
    this->currentColour = Chessman::Colour::Black;
  } else {
    this->currentColour = Chessman::Colour::White;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movb 0x8(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x8657
movq -0x10(%rbp), %rax
movb $0x0, 0x8(%rax)
jmp 0x865f
movq -0x10(%rbp), %rax
movb $0x1, 0x8(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: IncredibleHannes[P]QMUL-ChessGame/src/Model/Board.cpp
// Function: Board::isCheckmate() const
bool Board::isCheckmate() const {
  if (!this->isCheck()) {
    return false;
  }
  std::list<Move> moves = getAllPossibleMoves(this->currentColour);
  Board *b = new Board(*this);
  for (Move m : moves) {
    Move *m2 = new Move(m);
    if (b->applyMove(m2)) {
      delete b;
      delete m2;
      return false;
    }
    delete m2;
    b->undoLastMove();
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x81e0
testb $0x1, %al
jne 0x8d6c
movb $0x0, -0x1(%rbp)
jmp 0x8fa6
movq -0x90(%rbp), %rsi
movzbl 0x8(%rsi), %edx
andl $0x1, %edx
leaq -0x28(%rbp), %rdi
callq 0x8040
movl $0x40, %edi
callq 0x2160
movq %rax, -0x98(%rbp)
jmp 0x8d96
movq -0x90(%rbp), %rsi
movq -0x98(%rbp), %rdi
callq 0x7aa0
jmp 0x8dab
movq -0x98(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x5990
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
callq 0x44f0
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x59c0
testb $0x1, %al
jne 0x8dee
jmp 0x8f82
leaq -0x50(%rbp), %rdi
callq 0x59f0
movq %rax, %rsi
leaq -0x78(%rbp), %rdi
callq 0x6930
jmp 0x8e05
movl $0x20, %edi
callq 0x2160
movq %rax, -0xa0(%rbp)
jmp 0x8e18
movq -0xa0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x6930
jmp 0x8e2a
movq -0xa0(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x7510
movb %al, -0xa1(%rbp)
jmp 0x8e4a
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x8e59
jmp 0x8f14
movq -0x30(%rbp), %rax
movq %rax, -0xb0(%rbp)
cmpq $0x0, %rax
je 0x8e82
movq -0xb0(%rbp), %rdi
callq 0x7e40
movq -0xb0(%rbp), %rdi
callq 0x2140
movq -0x80(%rbp), %rax
movq %rax, -0xb8(%rbp)
cmpq $0x0, %rax
je 0x8eab
movq -0xb8(%rbp), %rdi
callq 0x69d0
movq -0xb8(%rbp), %rdi
callq 0x2140
movb $0x0, -0x1(%rbp)
movl $0x1, -0x84(%rbp)
jmp 0x8f52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x8f9b
movq -0x98(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x2140
jmp 0x8f9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x8f77
movq -0xa0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x2140
jmp 0x8f77
movq -0x80(%rbp), %rax
movq %rax, -0xc0(%rbp)
cmpq $0x0, %rax
je 0x8f3d
movq -0xc0(%rbp), %rdi
callq 0x69d0
movq -0xc0(%rbp), %rdi
callq 0x2140
movq -0x30(%rbp), %rdi
callq 0x8670
jmp 0x8f48
movl $0x0, -0x84(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x69d0
movl -0x84(%rbp), %eax
testl %eax, %eax
jne 0x8f90
jmp 0x8f67
jmp 0x8f69
leaq -0x50(%rbp), %rdi
callq 0x98e0
jmp 0x8dd8
leaq -0x78(%rbp), %rdi
callq 0x69d0
jmp 0x8f9b
movb $0x1, -0x1(%rbp)
movl $0x1, -0x84(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x8fa6
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x8fb4
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xc0, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x2260
nopl (%rax)
// File: IncredibleHannes[P]QMUL-ChessGame/src/Model/Board.cpp
// Function: Board::isPromotion(Move*) const
bool Board::isPromotion(Move *move) const {
  Chessman *currentChessman = getChessman(move->getTarget());
  if (currentChessman == nullptr) {
    return false;
  }
  if (currentChessman->getType() != Chessman::Pawn) {
    return false;
  }
  if (move->getTarget().getX() == 0 || move->getTarget().getX() == 7) {
    move->addType(Move::Promotion);
    return true;
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6a30
movq -0x40(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
callq 0x7de0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x90a3
movb $0x0, -0x1(%rbp)
jmp 0x9119
movq -0x20(%rbp), %rdi
callq 0x58f0
cmpl $0x2, %eax
je 0x90b7
movb $0x0, -0x1(%rbp)
jmp 0x9119
movq -0x18(%rbp), %rdi
callq 0x6a30
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2ee0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x41(%rbp)
je 0x90f8
movq -0x18(%rbp), %rdi
callq 0x6a30
movq %rax, -0x38(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x2ee0
cmpl $0x7, %eax
sete %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x9101
jmp 0x9115
movq -0x18(%rbp), %rdi
movl $0x4, %esi
callq 0x6a50
movb $0x1, -0x1(%rbp)
jmp 0x9119
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: IncredibleHannes[P]QMUL-ChessGame/src/View/View.cpp
// Function: View::printBoard(Board const*) const
void View::printBoard(Board const *board) const {
  printBoardLabel();
  printTopBoardLine();
  for (int i = 0; i < 8; i ++) {

    std::cout << i + 1 << " │ ";
    for (int j = 0; j < 8; j ++) {
      printChessman(board->getChessman(Position(i, j)));
      std::cout << " │ ";
    }
    std::cout << " "  << i + 1 << std::endl;
    if (i < 7) {
      printBoardLine();
    }
  }
  printBottomBoardLine();
  printBoardLabel();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0xac40
movq -0x28(%rbp), %rdi
callq 0xac80
movl $0x0, -0x14(%rbp)
cmpl $0x8, -0x14(%rbp)
jge 0xac22
movl -0x14(%rbp), %esi
addl $0x1, %esi
movq 0x746c(%rip), %rdi      # 0x11fd0
callq 0x2250
movq %rax, %rdi
leaq 0x159d(%rip), %rsi      # 0xc110
callq 0x2150
movl $0x0, -0x18(%rbp)
cmpl $0x8, -0x18(%rbp)
jge 0xabd3
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
leaq -0x20(%rbp), %rdi
callq 0x2e50
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x7de0
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0xacc0
movq 0x7414(%rip), %rdi      # 0x11fd0
leaq 0x154d(%rip), %rsi      # 0xc110
callq 0x2150
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xab7f
movq 0x73f6(%rip), %rdi      # 0x11fd0
leaq 0x179f(%rip), %rsi      # 0xc380
callq 0x2150
movq %rax, %rdi
movl -0x14(%rbp), %esi
addl $0x1, %esi
callq 0x2250
movq %rax, %rdi
movq 0x73c2(%rip), %rsi      # 0x11fc0
callq 0x2180
cmpl $0x7, -0x14(%rbp)
jge 0xac12
movq -0x28(%rbp), %rdi
callq 0xae70
jmp 0xac14
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xab4d
movq -0x28(%rbp), %rdi
callq 0xaeb0
movq -0x28(%rbp), %rdi
callq 0xac40
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: IncredibleHannes[P]QMUL-ChessGame/src/View/View.cpp
// Function: View::getPromotionType() const
Chessman::FigureType View::getPromotionType() const {
  while (true) {
    std::cout << "Please specify the figure you want your pawn be promoted to:" << std::endl;
    std::cout << "Q(Queen), K(Knight), R(Rook), B(Bishop)" << std::endl;
    std::string type;
    std::cin >> type;
    switch (toupper(type[0])) {
      case 'Q':
        return Chessman::Queen;
      case 'K':
        return Chessman::Knight;
      case 'R':
        return Chessman::Rook;
      case 'B':
        return Chessman::Bishop;
      default:
        continue;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq 0x700d(%rip), %rdi      # 0x11fd0
movq %rdi, -0x58(%rbp)
leaq 0x1336(%rip), %rsi      # 0xc304
callq 0x2150
movq %rax, %rdi
movq 0x6fe3(%rip), %rsi      # 0x11fc0
movq %rsi, -0x50(%rbp)
callq 0x2180
movq -0x58(%rbp), %rdi
leaq 0x1350(%rip), %rsi      # 0xc341
callq 0x2150
movq -0x50(%rbp), %rsi
movq %rax, %rdi
callq 0x2180
leaq -0x30(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x21e0
movq -0x48(%rbp), %rsi
movq 0x6fc6(%rip), %rdi      # 0x11fe0
callq 0x21c0
jmp 0xb021
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x2290
movq %rax, -0x60(%rbp)
jmp 0xb034
movq -0x60(%rbp), %rax
movsbl (%rax), %edi
callq 0x2280
addl $-0x42, %eax
movl %eax, %ecx
movq %rcx, -0x68(%rbp)
subl $0x10, %eax
ja 0xb0b9
movq -0x68(%rbp), %rax
leaq 0x104b(%rip), %rcx      # 0xc0a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x20f0
jmp 0xb0e1
movl $0x1, -0x4(%rbp)
movl $0x1, -0x40(%rbp)
jmp 0xb0c0
movl $0x3, -0x4(%rbp)
movl $0x1, -0x40(%rbp)
jmp 0xb0c0
movl $0x4, -0x4(%rbp)
movl $0x1, -0x40(%rbp)
jmp 0xb0c0
movl $0x5, -0x4(%rbp)
movl $0x1, -0x40(%rbp)
jmp 0xb0c0
movl $0x2, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x20f0
movl -0x40(%rbp), %eax
subl $0x1, %eax
je 0xb0d8
jmp 0xb0d3
jmp 0xafbc
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x2260
nopw (%rax,%rax)
// File: IncredibleHannes[P]QMUL-ChessGame/src/View/View.cpp
// Function: View::saveToFile(std::__cxx11::list<Move*, std::allocator<Move*>>) const
void View::saveToFile(std::list<Move*> moves) const {
  std::ofstream myStream("./SaveFile.txt");
  if(myStream.is_open()) {
    for(Move *m : moves){
      myStream << (char) ('A' + m->getOrigin().getY()) << m->getOrigin().getX() + 1 << " "
        << (char) ('A' + m->getTarget().getY()) << m->getTarget().getX() + 1 << std::endl;
    }
  }
  myStream.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movq %rsi, -0x278(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xafa(%rip), %rsi       # 0xc43b
leaq -0x210(%rbp), %rdi
movq %rdi, -0x270(%rbp)
movl $0x10, %edx
callq 0x2190
movq -0x270(%rbp), %rdi
callq 0x2110
movb %al, -0x261(%rbp)
jmp 0xb96d
movb -0x261(%rbp), %al
testb $0x1, %al
jne 0xb97c
jmp 0xbba0
movq -0x278(%rbp), %rax
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rdi
callq 0x9530
movq %rax, -0x230(%rbp)
movq -0x228(%rbp), %rdi
callq 0x9560
movq %rax, -0x238(%rbp)
leaq -0x230(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x9590
testb $0x1, %al
jne 0xb9cc
jmp 0xbb9e
leaq -0x230(%rbp), %rdi
callq 0x95c0
movq (%rax), %rax
movq %rax, -0x240(%rbp)
movq -0x240(%rbp), %rdi
callq 0x6a10
movq %rax, -0x280(%rbp)
jmp 0xb9f7
movq -0x280(%rbp), %rax
movq %rax, -0x248(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x2ef0
movl %eax, -0x284(%rbp)
jmp 0xba19
movl -0x284(%rbp), %eax
addl $0x41, %eax
movsbl %al, %esi
leaq -0x210(%rbp), %rdi
callq 0x21a0
movq %rax, -0x290(%rbp)
jmp 0xba3a
movq -0x240(%rbp), %rdi
callq 0x6a10
movq %rax, -0x298(%rbp)
jmp 0xba4f
movq -0x298(%rbp), %rax
movq %rax, -0x250(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x2ee0
movl %eax, -0x29c(%rbp)
jmp 0xba71
movq -0x290(%rbp), %rdi
movl -0x29c(%rbp), %esi
incl %esi
callq 0x2250
movq %rax, -0x2a8(%rbp)
jmp 0xba8e
movq -0x2a8(%rbp), %rdi
leaq 0x8e4(%rip), %rsi       # 0xc380
callq 0x2150
movq %rax, -0x2b0(%rbp)
jmp 0xbaaa
movq -0x240(%rbp), %rdi
callq 0x6a30
movq %rax, -0x2b8(%rbp)
jmp 0xbabf
movq -0x2b8(%rbp), %rax
movq %rax, -0x258(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x2ef0
movl %eax, -0x2bc(%rbp)
jmp 0xbae1
movq -0x2b0(%rbp), %rdi
movl -0x2bc(%rbp), %eax
addl $0x41, %eax
movsbl %al, %esi
callq 0x21a0
movq %rax, -0x2c8(%rbp)
jmp 0xbb02
movq -0x240(%rbp), %rdi
callq 0x6a30
movq %rax, -0x2d0(%rbp)
jmp 0xbb17
movq -0x2d0(%rbp), %rax
movq %rax, -0x260(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x2ee0
movl %eax, -0x2d4(%rbp)
jmp 0xbb39
movq -0x2c8(%rbp), %rdi
movl -0x2d4(%rbp), %esi
incl %esi
callq 0x2250
movq %rax, -0x2e0(%rbp)
jmp 0xbb56
movq -0x2e0(%rbp), %rdi
movq 0x645c(%rip), %rsi      # 0x11fc0
callq 0x2180
jmp 0xbb6b
jmp 0xbb6d
leaq -0x230(%rbp), %rdi
callq 0x95e0
jmp 0xb9b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x2200
jmp 0xbbc3
jmp 0xbba0
leaq -0x210(%rbp), %rdi
callq 0x21f0
jmp 0xbbae
leaq -0x210(%rbp), %rdi
callq 0x2200
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
movq -0x218(%rbp), %rdi
callq 0x2260
nop
// File: shuwenyue[P]MD_code_cell_list/box.cpp
// Function: box::boundaries(double, double)
double box::boundaries (double length, double BoxLength)
{

	while (length > (BoxLength/2))
	{
		length = length - BoxLength;
	}

	while (length < (-BoxLength/2))
	{
		length = length + BoxLength;
	}
			
	return length;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movsd %xmm0, -0x10(%rsp)
movsd %xmm1, -0x18(%rsp)
movsd -0x10(%rsp), %xmm0
movsd -0x18(%rsp), %xmm1
movsd 0x90b(%rip), %xmm2      # 0x9230
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x8943
movsd -0x10(%rsp), %xmm0
subsd -0x18(%rsp), %xmm0
movsd %xmm0, -0x10(%rsp)
jmp 0x8911
jmp 0x8945
movsd -0x10(%rsp), %xmm1
movsd -0x18(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x8c0(%rip), %xmm2      # 0x9230
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x898e
movsd -0x10(%rsp), %xmm0
addsd -0x18(%rsp), %xmm0
movsd %xmm0, -0x10(%rsp)
jmp 0x8945
movsd -0x10(%rsp), %xmm0
retq
nopw %cs:(%rax,%rax)
// File: shuwenyue[P]MD_code_cell_list/box.cpp
// Function: box::pbc(double, double)
double box::pbc (double position, double BoxLength)
{
	if (position > BoxLength)
    {
        position = position - BoxLength;                                    
    }

	if (position < 0)
    {
        position = position + BoxLength;                                    
    }
	
	return position;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movsd %xmm0, -0x10(%rsp)
movsd %xmm1, -0x18(%rsp)
movsd -0x10(%rsp), %xmm0
ucomisd -0x18(%rsp), %xmm0
jbe 0x89d1
movsd -0x10(%rsp), %xmm0
subsd -0x18(%rsp), %xmm0
movsd %xmm0, -0x10(%rsp)
xorps %xmm0, %xmm0
ucomisd -0x10(%rsp), %xmm0
jbe 0x89ee
movsd -0x10(%rsp), %xmm0
addsd -0x18(%rsp), %xmm0
movsd %xmm0, -0x10(%rsp)
movsd -0x10(%rsp), %xmm0
retq
// File: mh0fm4[P]SCDC/test/units/dataprov_relay/relay.c
// Function: main
int main(int argc, char *argv[])
{
  --argc; ++argv;

  scdc_init(SCDC_INIT_DEFAULT);

  scdc_dataprov_t dp = scdc_dataprov_open("relay_service", "relay");

  /* configure relay from (local) 'scdc+tcp://.../relay_service/local_path' to (target)'scdc+tcp://target_hostname/target_path' */
  const char *cmd = "scdc:/relay_service/CONFIG put relay local_path scdc+tcp://target_hostname/target_path";

  scdc_dataset_cmd(SCDC_DATASET_NULL, cmd, NULL, NULL);

  scdc_nodeport_t np = scdc_nodeport_open("tcp");

  scdc_nodeport_start(np, SCDC_NODEPORT_START_ASYNC_UNTIL_CANCEL);

  printf("running: ENTER to exit");
  getchar();
  printf("quiting\n");

  scdc_nodeport_stop(np);

  scdc_nodeport_close(np);

  scdc_dataprov_close(dp);

  scdc_release();

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
leaq 0x7bd02(%rip), %rdi     # 0x89524
movb $0x0, %al
callq 0xd940
leaq 0x7b7d4(%rip), %rdi     # 0x89004
leaq 0x7bbc3(%rip), %rsi     # 0x893fa
movb $0x0, %al
callq 0xde70
movq %rax, -0x18(%rbp)
leaq 0x7b7c9(%rip), %rax     # 0x89012
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdi
movq %rcx, %rdx
movb $0x0, %al
callq 0xf9f0
leaq 0x7d116(%rip), %rdi     # 0x8a97f
movb $0x0, %al
callq 0xe0b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movl $0x4, %esi
callq 0xe1c0
leaq 0x7b7e0(%rip), %rdi     # 0x89069
movb $0x0, %al
callq 0xcd10
callq 0xc950
leaq 0x7b7e4(%rip), %rdi     # 0x89080
movb $0x0, %al
callq 0xcd10
movq -0x28(%rbp), %rdi
callq 0xe220
movq -0x28(%rbp), %rdi
callq 0xe180
movq -0x18(%rbp), %rdi
callq 0xdf40
callq 0xdaf0
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: Eba-M[P]E3DC-Control/RscpExampleMain.cpp
// Function: WriteLog()
int WriteLog()
{
  static time_t t,t_alt = 0;
    int day,hour;
    char fname[256];
    time(&t);
    FILE *fp;
    struct tm * ptm;
    ptm = gmtime(&t);

    day = (t%(24*3600*4))/(24*3600);
    hour = (t%(24*3600))/(3600*4)*4;

    if (e3dc_config.debug) {

    if (hour!=t_alt) // neuer Tag
    {
//        int tt = (t%(24*3600)+12*3600);
        snprintf(fname,sizeof(fname),"%s.%i.%i.txt",e3dc_config.logfile,day,hour);
        fp = fopen(fname,"w");       // altes logfile löschen
        fclose(fp);
    }
        sprintf(fname,"%s.%i.%i.txt",e3dc_config.logfile,day,hour);
        fp = fopen(fname, "a");
    if(!fp)
        fp = fopen(fname, "w");
    if(fp)
    fprintf(fp,"%s\n",Log);
        fclose(fp);}
        t_alt = hour;
;
return(0);
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
leaq 0x6cfea(%rip), %rdi     # 0x6fbb8
callq 0x2280
leaq 0x6cfde(%rip), %rdi     # 0x6fbb8
callq 0x2250
movq %rax, (%rsp)
movq 0x6cfce(%rip), %rax     # 0x6fbb8
movl $0x54600, %ecx          # imm = 0x54600
cqto
idivq %rcx
movq %rdx, %rax
movl $0x15180, %ecx          # imm = 0x15180
cqto
idivq %rcx
movl %eax, 0x114(%rsp)
movq 0x6cfa9(%rip), %rax     # 0x6fbb8
movl $0x15180, %ecx          # imm = 0x15180
cqto
idivq %rcx
movq %rdx, %rax
movl $0x3840, %ecx           # imm = 0x3840
cqto
idivq %rcx
shlq $0x2, %rax
movl %eax, 0x110(%rsp)
testb $0x1, 0x6c229(%rip)     # 0x6ee61
je 0x2d35
movslq 0x110(%rsp), %rax
cmpq 0x6cf73(%rip), %rax     # 0x6fbc0
je 0x2ca5
leaq 0x10(%rsp), %rdi
movl 0x114(%rsp), %r8d
movl 0x110(%rsp), %r9d
movl $0x100, %esi            # imm = 0x100
leaq 0x5d690(%rip), %rdx     # 0x60300
leaq 0x6bcbd(%rip), %rcx     # 0x6e934
addq $0x29c, %rcx            # imm = 0x29C
movb $0x0, %al
callq 0x2460
leaq 0x10(%rsp), %rdi
leaq 0x5d67c(%rip), %rsi     # 0x6030d
callq 0x2300
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
callq 0x22c0
leaq 0x10(%rsp), %rdi
movl 0x114(%rsp), %ecx
movl 0x110(%rsp), %r8d
leaq 0x5d640(%rip), %rsi     # 0x60300
leaq 0x6bc6d(%rip), %rdx     # 0x6e934
addq $0x29c, %rdx            # imm = 0x29C
movb $0x0, %al
callq 0x2060
leaq 0x10(%rsp), %rdi
leaq 0x5ddae(%rip), %rsi     # 0x60a8f
callq 0x2300
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x2d09
leaq 0x10(%rsp), %rdi
leaq 0x5d60e(%rip), %rsi     # 0x6030d
callq 0x2300
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x2d2b
movq 0x8(%rsp), %rdi
leaq 0x5f0ce(%rip), %rsi     # 0x61deb
leaq 0x6c2dc(%rip), %rdx     # 0x6f000
movb $0x0, %al
callq 0x23e0
movq 0x8(%rsp), %rdi
callq 0x22c0
movslq 0x110(%rsp), %rax
movq %rax, 0x6ce7c(%rip)     # 0x6fbc0
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
retq
nop
// File: Eba-M[P]E3DC-Control/RscpExampleMain.cpp
// Function: WriteSoC()
int WriteSoC()
{
    char fname[256];
    sprintf(fname,"soc.txt");

    FILE *fp;
        fp = fopen(fname,"a");       // altes logfile löschen
    if(!fp)
        fp = fopen(fname, "w");
    if(fp)
    {
        fprintf(fp,"%s\n",Log);
        fclose(fp);
    }
return(0);
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
leaq 0x10(%rsp), %rdi
leaq 0x5d5ac(%rip), %rsi     # 0x6030f
movb $0x0, %al
callq 0x2060
leaq 0x10(%rsp), %rdi
leaq 0x5dd19(%rip), %rsi     # 0x60a8f
callq 0x2300
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x2d9e
leaq 0x10(%rsp), %rdi
leaq 0x5d579(%rip), %rsi     # 0x6030d
callq 0x2300
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x2dca
movq 0x8(%rsp), %rdi
leaq 0x5f039(%rip), %rsi     # 0x61deb
leaq 0x6c247(%rip), %rdx     # 0x6f000
movb $0x0, %al
callq 0x23e0
movq 0x8(%rsp), %rdi
callq 0x22c0
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
retq
nopw %cs:(%rax,%rax)
// File: Eba-M[P]E3DC-Control/RscpExampleMain.cpp
// Function: MQTTsend(char*, char*)
int MQTTsend(char host[20],char buffer[127])

{
    char cbuf[128];
    if (strcmp(host,"0.0.0.0")!=0) //gültige hostadresse
    {
        sprintf(cbuf, "mosquitto_pub -r -h %s -t %s", host,buffer);
        int ret = system(cbuf);
        return ret;
    } else
    return(-1);
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0x98(%rsp)
movq %rsi, 0x90(%rsp)
movq 0x98(%rsp), %rdi
leaq 0x5d511(%rip), %rsi     # 0x60317
callq 0x23c0
cmpl $0x0, %eax
je 0x2e4e
leaq 0x10(%rsp), %rdi
movq 0x98(%rsp), %rdx
movq 0x90(%rsp), %rcx
leaq 0x5d4f3(%rip), %rsi     # 0x6031f
movb $0x0, %al
callq 0x2060
leaq 0x10(%rsp), %rdi
callq 0x2240
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0xa4(%rsp)
jmp 0x2e59
movl $0xffffffff, 0xa4(%rsp) # imm = 0xFFFFFFFF
movl 0xa4(%rsp), %eax
addq $0xa8, %rsp
retq
nopl (%rax,%rax)
// File: Eba-M[P]E3DC-Control/RscpExampleMain.cpp
// Function: CheckConfig()
bool CheckConfig()
{
    struct stat stats;
    time_t  tm_dt;
     stat(e3dc_config.conffile,&stats);
     tm_dt = *(&stats.st_mtime);
    if (tm_dt==tm_CONF_dt)
        return false; else return true;
}

// Assembly:
subq $0xa8, %rsp
leaq 0x6b6e6(%rip), %rdi     # 0x6e934
addq $0x31c, %rdi            # imm = 0x31C
leaq 0x10(%rsp), %rsi
callq 0x2270
movq 0x68(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq 0x6c97b(%rip), %rax     # 0x6fbf0
jne 0x3281
movb $0x0, 0xa7(%rsp)
jmp 0x3289
movb $0x1, 0xa7(%rsp)
movb 0xa7(%rsp), %al
andb $0x1, %al
addq $0xa8, %rsp
retq
nopw (%rax,%rax)
// File: Eba-M[P]E3DC-Control/RscpExampleMain.cpp
// Function: iRelayEin(char const*)
int iRelayEin(const char * cmd)
{
//    if (isocket >= 0&&int32_t(e3dc_config.BWWP_ip)>0);
  {
    relay_ip = e3dc_config.BWWP_ip;
    int iPort = e3dc_config.BWWP_port;
    send.resize(2);
    receive.resize(8);
    memcpy(&send[0],&cmd[0],2);
    isocket = SocketConnect(relay_ip, iPort);
//      isocket = SocketConnect_noblock(relay_ip, iPort);
    if (isocket > 0){
        SocketSendData(isocket,&send[0],2);
    sleep(1);
       iLength = SocketRecvData(isocket,&receive[0],receive.size());
        SocketClose(isocket);
    }
  }
    return receive[0];
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
leaq 0x674e4(%rip), %rax     # 0x6e934
addq $0xa0, %rax
movq %rax, 0x6881b(%rip)     # 0x6fc78
movl 0x675e9(%rip), %eax     # 0x6ea4c
movl %eax, 0x1c(%rsp)
leaq 0x68812(%rip), %rdi     # 0x6fc80
movl $0x2, %esi
callq 0x1cb60
leaq 0x68819(%rip), %rdi     # 0x6fc98
movl $0x8, %esi
callq 0x1cb60
leaq 0x687f0(%rip), %rdi     # 0x6fc80
xorl %eax, %eax
movl %eax, %esi
callq 0x1cc00
movq 0x20(%rsp), %rcx
movw (%rcx), %cx
movw %cx, (%rax)
movq 0x687cd(%rip), %rdi     # 0x6fc78
movl 0x1c(%rsp), %esi
callq 0x360d0
movl %eax, 0x688ce(%rip)     # 0x6fd88
cmpl $0x0, 0x688c7(%rip)     # 0x6fd88
jle 0x754b
movl 0x688bb(%rip), %eax     # 0x6fd88
movl %eax, 0x8(%rsp)
leaq 0x687a8(%rip), %rdi     # 0x6fc80
xorl %eax, %eax
movl %eax, %esi
callq 0x1cc00
movl 0x8(%rsp), %edi
movq %rax, %rsi
movl $0x2, %edx
callq 0x364e0
movl $0x1, %edi
callq 0x21e0
movl 0x68886(%rip), %eax     # 0x6fd88
movl %eax, 0xc(%rsp)
leaq 0x6878b(%rip), %rdi     # 0x6fc98
xorl %eax, %eax
movl %eax, %esi
callq 0x1cc00
movq %rax, 0x10(%rsp)
leaq 0x68776(%rip), %rdi     # 0x6fc98
callq 0x1cc20
movl 0xc(%rsp), %edi
movq 0x10(%rsp), %rsi
movl %eax, %edx
callq 0x36590
cltq
movq %rax, 0x68720(%rip)     # 0x6fc60
movl 0x68842(%rip), %edi     # 0x6fd88
callq 0x364b0
leaq 0x68746(%rip), %rdi     # 0x6fc98
xorl %eax, %eax
movl %eax, %esi
callq 0x1cc00
movzbl (%rax), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: Eba-M[P]E3DC-Control/RscpExampleMain.cpp
// Function: mqtt()
int mqtt()
{
if ((e3dc_config.MQTTavl > 0)&&(tE3DC % e3dc_config.MQTTavl) == 0)
{
    
    char buf[127];
//    sprintf(buf,"E3DC-Control/Avl -m %i",iAvalPower);
    sprintf(buf,"E3DC-Control/Aval -m '%i' ",ireq_Heistab);
    MQTTsend(e3dc_config.mqtt2_ip,buf);
    sprintf(buf,"E3DC-Control/BattL -m '%i' ",iBattLoad);
    MQTTsend(e3dc_config.mqtt2_ip,buf);
    sprintf(buf,"E3DC-Control/Grid -m '%0.2f %0.2f %0.2f %0.2f %0.2f'",fPower_Grid,fBatt_SOC,float(iPower_Bat),fcurrentGrid,fsollGrid);
    MQTTsend(e3dc_config.mqtt2_ip,buf);

    if (e3dc_config.debug) printf("D4b\n");

}
    return 0;
}

// Assembly:
subq $0x88, %rsp
cmpl $0x0, 0x66efe(%rip)     # 0x6eecc
jle 0x80be
movq 0x68f3d(%rip), %rax     # 0x70f18
movslq 0x66eea(%rip), %rcx     # 0x6eecc
cqto
idivq %rcx
cmpq $0x0, %rdx
jne 0x80be
movq %rsp, %rdi
movl 0x68f26(%rip), %edx     # 0x70f20
leaq 0x58abf(%rip), %rsi     # 0x60ac0
movb $0x0, %al
callq 0x2060
movq %rsp, %rsi
leaq 0x66922(%rip), %rdi     # 0x6e934
addq $0x50, %rdi
callq 0x2de0
movq %rsp, %rdi
movl 0x68f00(%rip), %edx     # 0x70f24
leaq 0x58ab0(%rip), %rsi     # 0x60adb
movb $0x0, %al
callq 0x2060
movq %rsp, %rsi
leaq 0x668f8(%rip), %rdi     # 0x6e934
addq $0x50, %rdi
callq 0x2de0
movq %rsp, %rdi
movss 0x68ed8(%rip), %xmm0    # 0x70f28
cvtss2sd %xmm0, %xmm0
movss 0x662f4(%rip), %xmm1    # 0x6e350
cvtss2sd %xmm1, %xmm1
cvtsi2ssl 0x68ec4(%rip), %xmm2 # 0x70f2c
cvtss2sd %xmm2, %xmm2
movss 0x68ebc(%rip), %xmm3    # 0x70f30
cvtss2sd %xmm3, %xmm3
movss 0x68eb4(%rip), %xmm4    # 0x70f34
cvtss2sd %xmm4, %xmm4
leaq 0x58a6c(%rip), %rsi     # 0x60af7
movb $0x5, %al
callq 0x2060
movq %rsp, %rsi
leaq 0x66898(%rip), %rdi     # 0x6e934
addq $0x50, %rdi
callq 0x2de0
testb $0x1, 0x66db5(%rip)     # 0x6ee61
je 0x80bc
leaq 0x58a77(%rip), %rdi     # 0x60b2c
movb $0x0, %al
callq 0x2040
jmp 0x80be
xorl %eax, %eax
addq $0x88, %rsp
retq
nopl (%rax,%rax)
// File: Eba-M[P]E3DC-Control/RscpExampleMain.cpp
// Function: tasmotastatus(int)
int tasmotastatus(int ch)
{
    //           Test zur Abfrage des Tesmota Relais
    if (strcmp(e3dc_config.mqtt_ip,"0.0.0.0")!=0)
    {
        
        char buf[1024];
        static int WP_status = -1;
        int status;
        char path[1024];
//        if (WP_status < 2)
        {
            if (e3dc_config.debug) printf("W1\n");
            mfp == NULL;
            sprintf(buf,"mosquitto_sub -h %s -t stat/tasmota/POWER%i -W 1 -C 1",e3dc_config.mqtt_ip,ch);
            mfp = popen(buf, "r");
//            int fd = fileno(mfp);
//            int flags = fcntl(fd, F_GETFL, 0);
//            flags |= O_NONBLOCK;
//            fcntl(fd, F_SETFL, flags);
            WP_status = 2;
        }
        if (e3dc_config.debug) printf("W2\n");
        if (mfp != NULL)
        if (fgets(path, 1024, mfp) != NULL)
        {
            if (strcmp(path,"ON\n")==0)
                WP_status = 1;
            if (strcmp(path,"OFF\n")==0)
                WP_status = 0;
        }
//        if (WP_status < 2)
        if (mfp != NULL)
        {
            status = pclose(mfp);
            mfp = NULL;
        }
        if (e3dc_config.debug) printf("W2a\n");
        return WP_status;
}
    return 0;
}

// Assembly:
subq $0x818, %rsp            # imm = 0x818
movl %edi, 0x810(%rsp)
leaq 0x6688b(%rip), %rdi     # 0x6e970
leaq 0x5822b(%rip), %rsi     # 0x60317
callq 0x23c0
cmpl $0x0, %eax
je 0x8227
testb $0x1, 0x66d60(%rip)     # 0x6ee61
je 0x8111
leaq 0x59db3(%rip), %rdi     # 0x61ebd
movb $0x0, %al
callq 0x2040
leaq 0x410(%rsp), %rdi
movl 0x810(%rsp), %ecx
leaq 0x58a0a(%rip), %rsi     # 0x60b31
leaq 0x66806(%rip), %rdx     # 0x6e934
addq $0x3c, %rdx
movb $0x0, %al
callq 0x2060
leaq 0x410(%rsp), %rdi
leaq 0x586bb(%rip), %rsi     # 0x60803
callq 0x20b0
movq %rax, 0x68de4(%rip)     # 0x70f38
movl $0x2, 0x661f6(%rip)     # 0x6e354
testb $0x1, 0x66cfc(%rip)     # 0x6ee61
je 0x8175
leaq 0x59e0d(%rip), %rdi     # 0x61f7b
movb $0x0, %al
callq 0x2040
cmpq $0x0, 0x68dbb(%rip)     # 0x70f38
je 0x81d9
movq %rsp, %rdi
movq 0x68daf(%rip), %rdx     # 0x70f38
movl $0x400, %esi            # imm = 0x400
callq 0x2450
cmpq $0x0, %rax
je 0x81d7
movq %rsp, %rdi
leaq 0x589c4(%rip), %rsi     # 0x60b67
callq 0x23c0
cmpl $0x0, %eax
jne 0x81b7
movl $0x1, 0x6619d(%rip)     # 0x6e354
movq %rsp, %rdi
leaq 0x589aa(%rip), %rsi     # 0x60b6b
callq 0x23c0
cmpl $0x0, %eax
jne 0x81d5
movl $0x0, 0x6617f(%rip)     # 0x6e354
jmp 0x81d7
jmp 0x81d9
cmpq $0x0, 0x68d57(%rip)     # 0x70f38
je 0x8201
movq 0x68d4e(%rip), %rdi     # 0x70f38
callq 0x23d0
movl %eax, 0x40c(%rsp)
movq $0x0, 0x68d37(%rip) # 0x70f38
testb $0x1, 0x66c59(%rip)     # 0x6ee61
je 0x8218
leaq 0x5895f(%rip), %rdi     # 0x60b70
movb $0x0, %al
callq 0x2040
movl 0x66136(%rip), %eax     # 0x6e354
movl %eax, 0x814(%rsp)
jmp 0x8232
movl $0x0, 0x814(%rsp)
movl 0x814(%rsp), %eax
addq $0x818, %rsp            # imm = 0x818
retq
nopw %cs:(%rax,%rax)
// File: Eba-M[P]E3DC-Control/RscpExampleMain.cpp
// Function: tasmotaon(int)
int tasmotaon(int ch)
{
    char buf[127];
    if (e3dc_config.tasmota)
    {
        sprintf(buf,"cmnd/tasmota/POWER%i -m 1",ch);
        MQTTsend(e3dc_config.mqtt_ip,buf);
        tasmota_status[ch-1] = 1;
    }    return 0;
}

// Assembly:
subq $0x88, %rsp
movl %edi, 0x84(%rsp)
testb $0x1, 0x66851(%rip)     # 0x6ee66
je 0x865d
movq %rsp, %rdi
movl 0x84(%rsp), %edx
leaq 0x585ba(%rip), %rsi     # 0x60be2
movb $0x0, %al
callq 0x2060
movq %rsp, %rsi
leaq 0x662fb(%rip), %rdi     # 0x6e934
addq $0x3c, %rdi
callq 0x2de0
movl 0x84(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x65cda(%rip), %rax     # 0x6e330
movl $0x1, (%rax,%rcx,4)
xorl %eax, %eax
addq $0x88, %rsp
retq
nopw (%rax,%rax)
// File: Eba-M[P]E3DC-Control/RscpExampleMain.cpp
// Function: tasmotaoff(int)
int tasmotaoff(int ch)
{
    char buf[127];
    if (e3dc_config.tasmota)
    {
        sprintf(buf,"cmnd/tasmota/POWER%i -m 0",ch);
        MQTTsend(e3dc_config.mqtt_ip,buf);
        tasmota_status[ch-1] = 0;
    }    return 0;
}

// Assembly:
subq $0x88, %rsp
movl %edi, 0x84(%rsp)
testb $0x1, 0x667e1(%rip)     # 0x6ee66
je 0x86cd
movq %rsp, %rdi
movl 0x84(%rsp), %edx
leaq 0x58564(%rip), %rsi     # 0x60bfc
movb $0x0, %al
callq 0x2060
movq %rsp, %rsi
leaq 0x6628b(%rip), %rdi     # 0x6e934
addq $0x3c, %rdi
callq 0x2de0
movl 0x84(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x65c6a(%rip), %rax     # 0x6e330
movl $0x0, (%rax,%rcx,4)
xorl %eax, %eax
addq $0x88, %rsp
retq
nopw (%rax,%rax)