// File: XxAdi101xX[P]ChamberCrawler/Character/Character.cc
// Function: Character::addHP(int)
void Character::addHP(int amount) {
	int HPToBeAdded = amount;
	// if amount added exceeds HPMax
	if (amount > this->HPMax - this->getHP()) {
		HPToBeAdded = this->HPMax - this->getHP();

	}

	// adds HP
	this->HP += HPToBeAdded;

	// reports how much HP was gained/lost
	this->addAction(makeMsg(this->name, HPToBeAdded >= 0
		? WORD_GAIN_PAST_TENSE : WORD_LOSE_PAST_TENSE,
		to_string(HPToBeAdded >= 0 ? HPToBeAdded : -1 * HPToBeAdded)
		+ " " + WORD_HP_NOUN));

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0xe4(%rbp)
movl 0x30(%rdi), %eax
movl %eax, -0xe8(%rbp)
callq 0x2eb40
movl -0xe8(%rbp), %ecx
movl %eax, %edx
movl -0xe4(%rbp), %eax
subl %edx, %ecx
cmpl %ecx, %eax
jle 0x2f430
movq -0xf0(%rbp), %rdi
movl 0x30(%rdi), %eax
movl %eax, -0xf4(%rbp)
callq 0x2eb40
movl %eax, %ecx
movl -0xf4(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x10(%rbp)
movq -0xf0(%rbp), %rsi
movl -0x10(%rbp), %eax
addl 0x34(%rsi), %eax
movl %eax, 0x34(%rsi)
addq $0x88, %rsi
leaq -0x50(%rbp), %rdi
callq 0x6160
cmpl $0x0, -0x10(%rbp)
jl 0x2f466
leaq 0x39ebb(%rip), %rax     # 0x69318
movq %rax, -0x100(%rbp)
jmp 0x2f476
leaq 0x39f2b(%rip), %rax     # 0x69398
movq %rax, -0x100(%rbp)
jmp 0x2f476
movq -0x100(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x6160
jmp 0x2f488
cmpl $0x0, -0x10(%rbp)
jl 0x2f499
movl -0x10(%rbp), %eax
movl %eax, -0x104(%rbp)
jmp 0x2f4a6
imull $0xffffffff, -0x10(%rbp), %eax # imm = 0xFFFFFFFF
movl %eax, -0x104(%rbp)
movl -0x104(%rbp), %esi
leaq -0xe0(%rbp), %rdi
callq 0x31790
jmp 0x2f4ba
leaq 0x156be(%rip), %rdx     # 0x44b7f
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x19360
jmp 0x2f4d6
leaq 0x39d5b(%rip), %rdx     # 0x69238
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x315f0
jmp 0x2f4f2
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x70(%rbp), %rdx
leaq -0xa0(%rbp), %rcx
callq 0x343f0
jmp 0x2f50c
movq -0xf0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x2eb60
jmp 0x2f51e
leaq -0x30(%rbp), %rdi
callq 0x65e8
leaq -0xa0(%rbp), %rdi
callq 0x65e8
leaq -0xc0(%rbp), %rdi
callq 0x65e8
leaq -0xe0(%rbp), %rdi
callq 0x65e8
leaq -0x70(%rbp), %rdi
callq 0x65e8
leaq -0x50(%rbp), %rdi
callq 0x65e8
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x2f5ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x2f5e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x2f5d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x2f5cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x2f5c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x65e8
leaq -0xa0(%rbp), %rdi
callq 0x65e8
leaq -0xc0(%rbp), %rdi
callq 0x65e8
leaq -0xe0(%rbp), %rdi
callq 0x65e8
leaq -0x70(%rbp), %rdi
callq 0x65e8
leaq -0x50(%rbp), %rdi
callq 0x65e8
movq -0x78(%rbp), %rdi
callq 0x6550