// File: /workspace/github_cpp_makefile_star2_O3/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 0x1942c
testl %r14d, %r14d
leaq 0x98(%rsp), %r13
leaq 0x14831(%rip), %rax     # 0x2b240
leaq 0x148aa(%rip), %rcx     # 0x2b2c0
cmovnsq %rax, %rcx
movq %r13, -0x10(%r13)
movq (%rcx), %rsi
leaq 0x14820(%rip), %rax     # 0x2b248
leaq 0x14899(%rip), %rcx     # 0x2b2c8
cmovnsq %rax, %rcx
movq (%rcx), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x1942c
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x16aa3
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x16a9a
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x16aa0
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x16aa3
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x16a67
addl $-0x3, %r14d
jmp 0x16aa3
addl $-0x2, %r14d
jmp 0x16aa3
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 0x193bf
leaq 0x903f(%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 0x16b07
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x16b0e
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 0x1462f(%rip), %rsi     # 0x2b160
movq 0x14630(%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 0x16b64
movq %rcx, 0x48(%rsp)
movq (%rdx), %rcx
movq %rcx, 0x58(%rsp)
jmp 0x16b6b
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 0x1a5ac
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 0x16bde
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5280
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x16bf5
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5280
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x16c0c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5280
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x16c23
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5280
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x16c40
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5280
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x16c5c
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 0x16c97
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5280
jmp 0x16c97
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x16cb3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5280
jmp 0x16cb3
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x16ccf
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5280
jmp 0x16ccf
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x16ceb
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5280
jmp 0x16ceb
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x16d0d
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5280
jmp 0x16d0d
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x16d29
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5280
movq %rbx, %rdi
callq 0x53e0
nop