// File: /workspace/github_cpp_makefile_star2_O1/LifeAlgorithm[P]RockPaperScissors/Rock.cpp
// Function: Rock::fight(Tool&)
char Rock::fight(Tool & toolIn)
{
	//Temporary strength holders
	int tempRockStrength = this->strength;
	int tempToolInStrength = toolIn.getStrength();

	char outcome;

	//Rock vs. Scissors
	if (toolIn.getType() == 's') {
		tempRockStrength *= 2; //rock is strong against scissors, so strength is doubled
		tempToolInStrength /= 2; //scissors are weak to rock, so strength is halved
		outcome = compareStrength(tempRockStrength, tempToolInStrength); //compare
	}

	//Rock vs. Paper
	else if (toolIn.getType() == 'p') {
		tempRockStrength /= 2; //rock is weak to paper, so strength is halved
		tempToolInStrength *= 2;//paper is strong to rock, so strength is doubled
		outcome = compareStrength(tempRockStrength, tempToolInStrength); //compare
	}

	//Rock vs. Rock
	else {
		outcome = compareStrength(tempRockStrength, tempToolInStrength); //no temporary modifiers, compare
	}

	cout << this->longType << " strength: " << this->strength << " (temp: " << tempRockStrength << ")" << endl;
	cout << toolIn.getLongType() << " strength: " << toolIn.getStrength() << " (temp: " << tempToolInStrength << ")"  << endl;

	return outcome;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r12
movl 0x8(%rdi), %r15d
movq %rsi, %rdi
callq 0x23f8
movl %eax, %ebp
movq %rbx, %rdi
callq 0x23f4
cmpb $0x73, %al
jne 0x2551
addl %r15d, %r15d
movl %ebp, %r14d
shrl $0x1f, %r14d
addl %ebp, %r14d
sarl %r14d
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x23fc
movb %al, 0x7(%rsp)
jmp 0x2596
movq %rbx, %rdi
callq 0x23f4
cmpb $0x70, %al
jne 0x2582
movl %r15d, %r14d
shrl $0x1f, %r14d
addl %r15d, %r14d
sarl %r14d
addl %ebp, %ebp
movq %r12, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x23fc
movb %al, 0x7(%rsp)
movl %r14d, %r15d
jmp 0x2593
movq %r12, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x23fc
movb %al, 0x7(%rsp)
movl %ebp, %r14d
movq 0x10(%r12), %rsi
movq 0x18(%r12), %rdx
movq 0x5a29(%rip), %rbp      # 0x7fd0
movq %rbp, %rdi
callq 0x2120
movq %rax, %r13
leaq 0x2cd6(%rip), %rsi      # 0x528f
movl $0xb, %edx
movq %rax, %rdi
callq 0x2120
movl 0x8(%r12), %esi
movq %r13, %rdi
callq 0x2170
movq %rax, %r13
leaq 0x2a2d(%rip), %r12      # 0x500a
movl $0x8, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2120
movq %r13, %rdi
movl %r15d, %esi
callq 0x2170
movq %rax, %r13
leaq 0x2ac9(%rip), %r15      # 0x50cb
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2120
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2414
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbp, %rdi
callq 0x2120
movq %rax, %r13
movl $0xb, %edx
movq %rax, %rdi
leaq 0x2c2c(%rip), %rsi      # 0x528f
callq 0x2120
movq %rbx, %rdi
callq 0x23f8
movq %r13, %rdi
movl %eax, %esi
callq 0x2170
movq %rax, %rbx
movl $0x8, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2120
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2170
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2120
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
movb 0x7(%rsp), %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)