// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
movl 0x30(%rdi), %r14d
movl 0x34(%rdi), %eax
subl %eax, %r14d
cmpl %esi, %r14d
cmovgel %esi, %r14d
addl %r14d, %eax
movl %eax, 0x34(%rdi)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x88(%rdi), %rsi
movq 0x90(%rdi), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x193f0
testl %r14d, %r14d
leaq 0x98(%rsp), %r13
leaq 0x14881(%rip), %rax     # 0x2b240
leaq 0x148fa(%rip), %rcx     # 0x2b2c0
cmovnsq %rax, %rcx
movq %r13, -0x10(%r13)
movq (%rcx), %rsi
leaq 0x14870(%rip), %rax     # 0x2b248
leaq 0x148e9(%rip), %rcx     # 0x2b2c8
cmovnsq %rax, %rcx
movq (%rcx), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x193f0
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x16a53
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x16a4a
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x16a50
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x16a53
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x16a17
addl $-0x3, %r14d
jmp 0x16a53
addl $-0x2, %r14d
jmp 0x16a53
decl %r14d
movl %r14d, %esi
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x68(%rsp), %rdi
movl $0x2d, %edx
callq 0x52d0
leaq 0x68(%rsp), %r15
movq (%r15), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x19383
leaq 0x908f(%rip), %rsi      # 0x1fb17
movq %r15, %rdi
callq 0x5420
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x16ab7
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x16abe
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x1467f(%rip), %rsi     # 0x2b160
movq 0x14680(%rip), %rdx     # 0x2b168
callq 0x5100
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rcx
movq %rax, %rdx
addq $0x10, %rdx
cmpq %rdx, %rcx
je 0x16b14
movq %rcx, 0x48(%rsp)
movq (%rdx), %rcx
movq %rcx, 0x58(%rsp)
jmp 0x16b1b
movups (%rdx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rsi
leaq 0x48(%rsp), %rcx
movq %rsi, 0x8(%rcx)
movq %rdx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x1a5f0
addq $0x68, %rbx
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
movq %rbx, %rdi
callq 0x5100
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16b8e
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5280
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x16ba5
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5280
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x16bbc
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5280
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x16bd3
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5280
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x16bf0
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5280
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x16c0c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5280
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16c47
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5280
jmp 0x16c47
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x16c63
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5280
jmp 0x16c63
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x16c7f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5280
jmp 0x16c7f
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x16c9b
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5280
jmp 0x16c9b
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x16cbd
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5280
jmp 0x16cbd
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x16cd9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5280
movq %rbx, %rdi
callq 0x53e0
nop