// File: arisKoutsou[P]oopproj/./src/livings/Hero.cpp
// Function: Hero::moveRight()
void Hero :: moveRight() {
  int heroY = this->getPosition().getY();
  int heroX = this->getPosition().getX();

  if (heroX == grid->getMaxX()) {
    throw HeroMoveException("You can't move right any further");    
  } else if (this->grid->getTile(heroY, heroX + 1).isNonAccessible()) {
    throw HeroMoveException("You can't move in a non accessible tile");
  } else {
    this->grid->removeLiving(heroY, heroX, this);
    this->getPosition().setX(heroX + 1);
    this->grid->addLiving(heroY, heroX + 1, this);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x29a80
movq %rax, %rdi
callq 0x29ae0
movq -0x78(%rbp), %rdi
movl %eax, -0xc(%rbp)
callq 0x29a80
movq %rax, %rdi
callq 0x29ad0
movl %eax, %ecx
movq -0x78(%rbp), %rax
movl %ecx, -0x10(%rbp)
movl -0x10(%rbp), %ecx
movl %ecx, -0x70(%rbp)
movq 0x8(%rax), %rdi
callq 0x9220
movl %eax, %ecx
movl -0x70(%rbp), %eax
cmpl %ecx, %eax
jne 0x23c6f
movb $0x1, -0x45(%rbp)
movl $0x28, %edi
callq 0x5150
movq %rax, -0x88(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x5560
movq -0x80(%rbp), %rdx
leaq 0xb261(%rip), %rsi      # 0x2ee4b
leaq -0x30(%rbp), %rdi
callq 0x7d20
jmp 0x23bf5
movq -0x88(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5e70
jmp 0x23c07
movq -0x88(%rbp), %rdi
movb $0x0, -0x45(%rbp)
leaq 0x1ba1f(%rip), %rsi     # 0x3f638
leaq -0x1dd50(%rip), %rdx    # 0x5ed0
callq 0x5530
jmp 0x23d9f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x23c4d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x55d0
leaq -0x31(%rbp), %rdi
callq 0x5350
testb $0x1, -0x45(%rbp)
jne 0x23c5e
jmp 0x23c6a
movq -0x88(%rbp), %rdi
callq 0x5220
jmp 0x23d96
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
addl $0x1, %edx
callq 0x9340
movq %rax, %rdi
callq 0x8f30
testb $0x1, %al
jne 0x23c96
jmp 0x23d4b
movb $0x1, -0x6a(%rbp)
movl $0x28, %edi
callq 0x5150
movq %rax, -0x98(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x5560
movq -0x90(%rbp), %rdx
leaq 0xb11e(%rip), %rsi      # 0x2ede7
leaq -0x68(%rbp), %rdi
callq 0x7d20
jmp 0x23cd4
movq -0x98(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x5e70
jmp 0x23ce6
movq -0x98(%rbp), %rdi
movb $0x0, -0x6a(%rbp)
leaq 0x1b940(%rip), %rsi     # 0x3f638
leaq -0x1de2f(%rip), %rdx    # 0x5ed0
callq 0x5530
jmp 0x23d9f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x23d2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x55d0
leaq -0x69(%rbp), %rdi
callq 0x5350
testb $0x1, -0x6a(%rbp)
jne 0x23d3d
jmp 0x23d49
movq -0x98(%rbp), %rdi
callq 0x5220
jmp 0x23d96
movq -0x78(%rbp), %rcx
movq 0x8(%rcx), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0x94d0
movq -0x78(%rbp), %rdi
callq 0x29a80
movq %rax, %rdi
movl -0x10(%rbp), %esi
addl $0x1, %esi
callq 0x29b00
movq -0x78(%rbp), %rcx
movq 0x8(%rcx), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
addl $0x1, %edx
callq 0x9380
jmp 0x23d8d
addq $0xa0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x5550
nop