// File: /workspace/github_cpp_makefile_star2_O3/malcolmyeh[P]CC3K/player.cc
// Function: Player::dealDamage[abi:cxx11](Character*)
std::string Player::dealDamage(Character *opponent)
{
    double amount;
    std::string combatMsg;
    std::string defender = opponent->getRace();
    int attack = this->Atk;
    int defense = opponent->getDef();

    amount = ceil((100.0 / (100.0 + defense)) * attack);

    opponent->takeDamage((int)amount);

    combatMsg = "You deal " + std::to_string((int)amount) + " damage to " + defender + " (HP: " + std::to_string(opponent->getHP()) + "). ";

    if (opponent->getHP() == 0)
    {
        combatMsg += defender + " has been slain. You have earned " + std::to_string(opponent->getGold()) + " gold. ";
        this->updateGold(opponent->getGold());
    }

    return combatMsg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, -0x90(%rbp)
leaq 0x10(%rdi), %rax
movq %rax, -0xb8(%rbp)
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq (%rdx), %rax
leaq -0x158(%rbp), %rdi
movq %rdx, %rsi
callq *0x28(%rax)
movq %rbx, -0x160(%rbp)
movl 0x8(%rbx), %ebx
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
cvtsi2sd %eax, %xmm0
movsd 0x12d68(%rip), %xmm1    # 0x1d918
addsd %xmm1, %xmm0
divsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd %xmm1, %xmm0
callq 0x4040
cvttsd2si %xmm0, %r12d
movq (%r15), %rax
movq %r15, %rdi
movl %r12d, %esi
callq *0x48(%rax)
movl %r12d, %r13d
negl %r13d
cmovsl %r12d, %r13d
movl $0x1, %r14d
cmpl $0xa, %r13d
jb 0xac39
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r13d, %ecx
cmpl $0x63, %ecx
jbe 0xac30
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xac36
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xac39
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xabfd
addl $-0x3, %r14d
jmp 0xac39
addl $-0x2, %r14d
jmp 0xac39
decl %r14d
shrl $0x1f, %r12d
leal (%r14,%r12), %esi
leaq -0x128(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x138(%rbp), %rdi
movl $0x2d, %edx
callq 0x41b0
movl %r12d, %edi
leaq -0x138(%rbp), %r12
addq (%r12), %rdi
movl %r14d, %esi
movl %r13d, %edx
callq 0xa44c
leaq 0x12d5f(%rip), %rcx     # 0x1d9dc
movl $0x9, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4190
leaq -0xe8(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xacbc
movq %rdx, -0xf8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xe8(%rbp)
jmp 0xacc4
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0xf8(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x12c37(%rip), %rsi     # 0x1d920
callq 0x4280
leaq -0x108(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xad1b
movq %rdx, -0x118(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x108(%rbp)
jmp 0xad23
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0x118(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x158(%rbp), %rsi
movq -0x150(%rbp), %rdx
callq 0x4080
leaq -0x78(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xad7b
movq %rdx, -0x88(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x78(%rbp)
jmp 0xad83
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0x88(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x12eea(%rip), %rsi     # 0x1dc92
callq 0x4280
leaq -0x38(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xadd1
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0xadd9
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movl %eax, %r13d
movl %eax, %r12d
negl %r12d
cmovsl %eax, %r12d
movl $0x1, %r14d
cmpl $0xa, %r12d
jb 0xae5c
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r12d, %ecx
cmpl $0x63, %ecx
jbe 0xae53
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xae59
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xae5c
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xae20
addl $-0x3, %r14d
jmp 0xae5c
addl $-0x2, %r14d
jmp 0xae5c
decl %r14d
shrl $0x1f, %r13d
leal (%r14,%r13), %esi
leaq -0xc8(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq -0xd8(%rbp), %rdi
movl $0x2d, %edx
callq 0x41b0
movl %r13d, %edi
addq -0xd8(%rbp), %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0xa44c
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0xd0(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
leaq -0x38(%rbp), %r13
cmpq %r13, %rcx
je 0xaeba
movq -0x38(%rbp), %rdi
movq -0xd8(%rbp), %rsi
cmpq %rdi, %rax
jbe 0xaedc
movl $0xf, %edi
cmpq %rbx, %rsi
je 0xaed7
movq -0xc8(%rbp), %rdi
cmpq %rdi, %rax
jbe 0xaee7
leaq -0x48(%rbp), %rdi
callq 0x4080
jmp 0xaef7
leaq -0xd8(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4190
leaq -0x58(%rbp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0xaf18
movq %rsi, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0xaf20
movupd (%rcx), %xmm0
movupd %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x60(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x12cb2(%rip), %rsi     # 0x1dbf5
leaq -0x68(%rbp), %rdi
callq 0x4280
movq %rbx, %r12
leaq -0xa0(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
movq %r13, %rbx
cmpq %rcx, %rdx
je 0xaf7f
movq %rdx, -0xb0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xa0(%rbp)
jmp 0xaf88
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq -0xb0(%rbp), %r13
movq %rdx, 0x8(%r13)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x90(%rbp), %rdi
movq %r13, %rsi
callq 0x41c0
movq (%r13), %rdi
cmpq %r14, %rdi
je 0xafcd
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x4170
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
movq %rbx, %r13
je 0xafe9
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0xd8(%rbp), %rdi
cmpq %r12, %rdi
je 0xb004
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
leaq -0x78(%rbp), %rbx
je 0xb01d
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x88(%rbp), %rdi
cmpq %rbx, %rdi
je 0xb035
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xb057
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xb079
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xb09b
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x4170
movq (%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
testl %eax, %eax
jne 0xb311
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
movq -0x158(%rbp), %rsi
movq -0x150(%rbp), %rdx
addq %rsi, %rdx
callq 0xa4be
movq %r14, %rbx
leaq 0x12859(%rip), %rsi     # 0x1d92c
leaq -0x48(%rbp), %rdi
callq 0x4280
movq (%r15), %rax
movq %r15, %rdi
callq *0x20(%rax)
movl %eax, %r13d
movl %eax, %r12d
negl %r12d
cmovsl %eax, %r12d
movl $0x1, %r14d
cmpl $0xa, %r12d
jb 0xb148
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r12d, %ecx
cmpl $0x63, %ecx
jbe 0xb13f
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xb145
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xb148
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xb10c
addl $-0x3, %r14d
jmp 0xb148
addl $-0x2, %r14d
jmp 0xb148
decl %r14d
shrl $0x1f, %r13d
leal (%r14,%r13), %esi
leaq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
movq %rax, (%rdi)
movl $0x2d, %edx
callq 0x41b0
movl %r13d, %edi
addq -0x88(%rbp), %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0xa44c
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x80(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
leaq -0x38(%rbp), %r14
cmpq %r14, %rcx
je 0xb19f
movq -0x38(%rbp), %rdi
movq -0x88(%rbp), %rsi
cmpq %rdi, %rax
leaq -0x58(%rbp), %r13
jbe 0xb1c6
movl $0xf, %edi
leaq -0x78(%rbp), %r9
cmpq %r9, %rsi
je 0xb1c1
movq -0x78(%rbp), %rdi
cmpq %rdi, %rax
jbe 0xb1d1
leaq -0x48(%rbp), %rdi
callq 0x4080
jmp 0xb1e1
leaq -0x88(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4190
movq %r13, -0x68(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0xb1fe
movq %rdx, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0xb208
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x60(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x12137(%rip), %rsi     # 0x1d362
leaq -0x68(%rbp), %rdi
callq 0x4280
movq %rbx, -0xb0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb25d
movq %rdx, -0xb0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xa0(%rbp)
jmp 0xb265
movupd (%rcx), %xmm0
movupd %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, -0xa8(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq -0x90(%rbp), %rdi
callq 0x4080
movq -0xb0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xb2b4
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0xb2c9
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xb2e5
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0xb2fa
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4170
movq (%r15), %rax
movq %r15, %rdi
callq *0x20(%rax)
movq -0x160(%rbp), %rdi
movq (%rdi), %rcx
movl %eax, %esi
callq *(%rcx)
leaq -0x148(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb330
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x90(%rbp), %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0xb0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xb36c
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xb36c
movq %rax, %r14
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xb38a
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xb38a
movq %rax, %r14
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xb3b2
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xb3b2
jmp 0xb3af
jmp 0xb4ce
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xb4d1
movq -0x38(%rbp), %rsi
jmp 0xb4c4
movq %rax, %r14
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb3ed
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xb3ed
movq %rax, %r14
movq -0xd8(%rbp), %rdi
cmpq %rbx, %rdi
je 0xb431
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xb431
movq %rax, %r14
jmp 0xb44a
movq %rax, %r14
jmp 0xb466
movq %rax, %r14
jmp 0xb488
movq %rax, %r14
jmp 0xb4aa
jmp 0xb4ce
movq %rax, %r14
jmp 0xb4f0
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xb44a
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xb466
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xb488
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xb4aa
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xb4d1
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xb4d1
movq %rax, %r14
leaq -0x148(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb4f0
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x90(%rbp), %rax
movq (%rax), %rdi
cmpq -0xb8(%rbp), %rdi
je 0xb515
movq -0xb8(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x4170
movq %r14, %rdi
callq 0x4250
nop