// File: /workspace/github_cpp_makefile_star2_O1/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 0x12ca8(%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 0xacf9
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r13d, %ecx
cmpl $0x63, %ecx
jbe 0xacf0
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xacf6
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xacf9
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xacbd
addl $-0x3, %r14d
jmp 0xacf9
addl $-0x2, %r14d
jmp 0xacf9
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 0xa510
leaq 0x12c9f(%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 0xad7c
movq %rdx, -0xf8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xe8(%rbp)
jmp 0xad84
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 0x12b77(%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 0xaddb
movq %rdx, -0x118(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x108(%rbp)
jmp 0xade3
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 0xae3b
movq %rdx, -0x88(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x78(%rbp)
jmp 0xae43
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 0x12e2a(%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 0xae91
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0xae99
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 0xaf1c
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r12d, %ecx
cmpl $0x63, %ecx
jbe 0xaf13
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xaf19
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xaf1c
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xaee0
addl $-0x3, %r14d
jmp 0xaf1c
addl $-0x2, %r14d
jmp 0xaf1c
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 0xa510
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0xd0(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
leaq -0x38(%rbp), %r13
cmpq %r13, %rcx
je 0xaf7a
movq -0x38(%rbp), %rsi
cmpq %rsi, %rax
jbe 0xaf99
movl $0xf, %esi
cmpq %rbx, -0xd8(%rbp)
je 0xaf94
movq -0xc8(%rbp), %rsi
cmpq %rsi, %rax
jbe 0xafab
movq -0xd8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x4080
jmp 0xafbb
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 0xafdc
movq %rsi, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0xafe4
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 0x12bee(%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 0xb043
movq %rdx, -0xb0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xa0(%rbp)
jmp 0xb04c
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 0xb091
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x4170
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
movq %rbx, %r13
je 0xb0ad
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0xd8(%rbp), %rdi
cmpq %r12, %rdi
je 0xb0c8
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
leaq -0x78(%rbp), %rbx
je 0xb0e1
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x88(%rbp), %rdi
cmpq %rbx, %rdi
je 0xb0f9
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xb11b
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xb13d
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xb15f
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x4170
movq (%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
testl %eax, %eax
jne 0xb3d9
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
movq -0x158(%rbp), %rsi
movq -0x150(%rbp), %rdx
addq %rsi, %rdx
callq 0xa582
movq %r14, %rbx
leaq 0x12795(%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 0xb20c
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r12d, %ecx
cmpl $0x63, %ecx
jbe 0xb203
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xb209
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xb20c
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xb1d0
addl $-0x3, %r14d
jmp 0xb20c
addl $-0x2, %r14d
jmp 0xb20c
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 0xa510
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x80(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
leaq -0x38(%rbp), %r14
cmpq %r14, %rcx
je 0xb263
movq -0x38(%rbp), %rsi
cmpq %rsi, %rax
leaq -0x58(%rbp), %r13
jbe 0xb287
movl $0xf, %esi
leaq -0x78(%rbp), %rdi
cmpq %rdi, -0x88(%rbp)
je 0xb282
movq -0x78(%rbp), %rsi
cmpq %rsi, %rax
jbe 0xb299
movq -0x88(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x4080
jmp 0xb2a9
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 0xb2c6
movq %rdx, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0xb2d0
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 0x1206f(%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 0xb325
movq %rdx, -0xb0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xa0(%rbp)
jmp 0xb32d
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 0xb37c
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0xb391
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xb3ad
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0xb3c2
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 0xb3f8
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 0xb434
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xb434
movq %rax, %r14
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xb452
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xb452
movq %rax, %r14
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xb47a
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xb47a
jmp 0xb477
jmp 0xb596
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xb599
movq -0x38(%rbp), %rsi
jmp 0xb58c
movq %rax, %r14
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb4b5
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xb4b5
movq %rax, %r14
movq -0xd8(%rbp), %rdi
cmpq %rbx, %rdi
je 0xb4f9
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xb4f9
movq %rax, %r14
jmp 0xb512
movq %rax, %r14
jmp 0xb52e
movq %rax, %r14
jmp 0xb550
movq %rax, %r14
jmp 0xb572
jmp 0xb596
movq %rax, %r14
jmp 0xb5b8
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xb512
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xb52e
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xb550
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xb572
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xb599
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xb599
movq %rax, %r14
leaq -0x148(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb5b8
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x90(%rbp), %rax
movq (%rax), %rdi
cmpq -0xb8(%rbp), %rdi
je 0xb5dd
movq -0xb8(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x4170
movq %r14, %rdi
callq 0x4250
nop