// File: /workspace/github_cpp_makefile_star2_O3/hobbitsyfeet[P]Turn/unit.cc
// Function: Unit::equipItem(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Unit::equipItem(string i){
	cout<<"entering equipitem"<<endl;
	cout<<"searching for "<<i<<endl;
  vector<Item>::iterator it;
  bool didEquip=false;
int j=1;
  for(it=inv.invContainer.begin(); it< inv.invContainer.end() /*|| it->itemGetName() == i*/; it++){
		cout<<it->itemGetName()<<it->itemGetType()<<endl;
		cout<<leftHandEquipped<<rightHandEquipped<<endl;
    if(it->itemGetName() == i){
      if(it->itemGetType() == "Right-Hand" && rightHandEquipped == false){
	rightHandEquipped = true;
	didEquip = true;
      }
      else if(it->itemGetType() == "Left-Hand" && leftHandEquipped == false){
	leftHandEquipped = true;
	didEquip = true;
      }
      else if(it->itemGetType() == "Two-Hands" && leftHandEquipped == false && rightHandEquipped == false ){
	leftHandEquipped = true;
	rightHandEquipped = true;
	didEquip = true;
      }
      else if(it->itemGetType() == "Helmet" && headEquipped == false){
	headEquipped = true;
	didEquip = true;
      }
      else if(it->itemGetType() == "Body-Armour" && torsoEquipped == false){
	torsoEquipped = true;
	didEquip = true;
      }
      else if(it->itemGetType() == "Leggings" && legsEquipped == false){
	legsEquipped = true;
	didEquip = true;
      }
      else if(it->itemGetType() == "Boots" && feetEquipped == false){
	feetEquipped = true;
	didEquip = true;
      }
			cout<<"preforming changes"<<endl;
      if(didEquip == true){
        cout<<i<<" equipped";
	      attack += it->itemGetDamage();
      	range += it->itemGetRange();
        defence += it->itemGetDefence();
        it->itemEquip();
        break;
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0xa430(%rip), %r15      # 0xefd0
leaq 0x66da(%rip), %rsi      # 0xb281
movl $0x12, %edx
movq %r15, %rdi
callq 0x2230
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
leaq 0x66b2(%rip), %rsi      # 0xb294
movl $0xe, %edx
movq %r15, %rdi
callq 0x2230
movq (%r14), %rsi
movq %r14, -0x50(%rbp)
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x2230
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
movq 0x80(%rbx), %r12
cmpq 0x88(%rbx), %r12
jae 0x5160
leaq -0x48(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x5ad6
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r15, %rdi
callq 0x2230
movq %rax, %r14
leaq -0x70(%rbp), %rdi
movq %r12, %rsi
callq 0x5b02
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %r14, %rdi
callq 0x2230
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x4cc1
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4cda
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
movzbl 0x98(%rbx), %esi
movq %r15, %rdi
callq 0x22e0
movzbl 0x99(%rbx), %esi
movq %rax, %rdi
callq 0x22e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
movq %r13, %rdi
movq %r12, %rsi
callq 0x5ad6
movq -0x40(%rbp), %rdx
movq -0x50(%rbp), %rax
cmpq 0x8(%rax), %rdx
jne 0x4d5b
movq -0x48(%rbp), %r14
testq %rdx, %rdx
je 0x4d64
movq -0x50(%rbp), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x2210
testl %eax, %eax
sete %r15b
jmp 0x4d67
movq -0x48(%rbp), %r14
xorl %r15d, %r15d
jmp 0x4d67
movb $0x1, %r15b
leaq -0x38(%rbp), %rax
cmpq %rax, %r14
je 0x4d7f
movq -0x38(%rbp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x2200
testb %r15b, %r15b
movq 0xa247(%rip), %r15      # 0xefd0
je 0x5080
movq %r13, %rdi
movq %r12, %rsi
callq 0x5b02
movq %r13, %rdi
leaq 0x64ff(%rip), %rsi      # 0xb2a3
callq 0x20c0
testl %eax, %eax
je 0x4dc8
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4df1
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
jmp 0x4df1
movb 0x99(%rbx), %r14b
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4de8
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
testb %r14b, %r14b
je 0x50a1
movq %r13, %rdi
movq %r12, %rsi
callq 0x5b02
movq %r13, %rdi
leaq 0x64a8(%rip), %rsi      # 0xb2ae
callq 0x20c0
testl %eax, %eax
je 0x4e2a
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4e53
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
jmp 0x4e53
movb 0x98(%rbx), %r14b
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4e4a
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
testb %r14b, %r14b
je 0x50aa
movq %r13, %rdi
movq %r12, %rsi
callq 0x5b02
movq %r13, %rdi
leaq 0x6450(%rip), %rsi      # 0xb2b8
callq 0x20c0
testl %eax, %eax
jne 0x4ea4
cmpb $0x0, 0x98(%rbx)
jne 0x4ea4
movb 0x99(%rbx), %r14b
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4e9a
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
testb %r14b, %r14b
jne 0x4ebd
jmp 0x5096
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4ebd
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
movq %r13, %rdi
movq %r12, %rsi
callq 0x5b02
movq %r13, %rdi
leaq 0x63f0(%rip), %rsi      # 0xb2c2
callq 0x20c0
testl %eax, %eax
je 0x4ef6
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4f1f
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
jmp 0x4f1f
movb 0x9a(%rbx), %r14b
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4f16
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
testb %r14b, %r14b
je 0x50b3
movq %r13, %rdi
movq %r12, %rsi
callq 0x5b02
movq %r13, %rdi
leaq 0x6395(%rip), %rsi      # 0xb2c9
callq 0x20c0
testl %eax, %eax
je 0x4f58
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4f81
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
jmp 0x4f81
movb 0x9b(%rbx), %r14b
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4f78
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
testb %r14b, %r14b
je 0x50bc
movq %r13, %rdi
movq %r12, %rsi
callq 0x5b02
movq %r13, %rdi
leaq 0x633f(%rip), %rsi      # 0xb2d5
callq 0x20c0
testl %eax, %eax
je 0x4fba
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4fe3
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
jmp 0x4fe3
movb 0x9c(%rbx), %r14b
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4fda
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
testb %r14b, %r14b
je 0x50c5
movq %r13, %rdi
movq %r12, %rsi
callq 0x5b02
movq %r13, %rdi
leaq 0x62e6(%rip), %rsi      # 0xb2de
callq 0x20c0
testl %eax, %eax
je 0x501c
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x5045
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
jmp 0x5045
movb 0x9d(%rbx), %r14b
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x503c
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
testb %r14b, %r14b
je 0x50ce
movl $0x12, %edx
movq %r15, %rdi
leaq 0x6290(%rip), %rsi      # 0xb2e4
callq 0x2230
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
addq $0x58, %r12
cmpq 0x88(%rbx), %r12
jb 0x4c44
jmp 0x5160
movw $0x101, 0x98(%rbx)      # imm = 0x101
jmp 0x50d5
movb $0x1, 0x99(%rbx)
jmp 0x50d5
movb $0x1, 0x98(%rbx)
jmp 0x50d5
movb $0x1, 0x9a(%rbx)
jmp 0x50d5
movb $0x1, 0x9b(%rbx)
jmp 0x50d5
movb $0x1, 0x9c(%rbx)
jmp 0x50d5
movb $0x1, 0x9d(%rbx)
leaq 0x6208(%rip), %rsi      # 0xb2e4
movl $0x12, %edx
movq %r15, %rdi
callq 0x2230
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
movq -0x50(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r15, %rdi
callq 0x2230
leaq 0x61cd(%rip), %rsi      # 0xb2f7
movl $0x9, %edx
movq %rax, %rdi
callq 0x2230
movq %r12, %rdi
callq 0x5b3a
addl %eax, 0x2c(%rbx)
movq %r12, %rdi
callq 0x5b30
addl %eax, 0x30(%rbx)
movq %r12, %rdi
callq 0x5b44
addl %eax, 0x34(%rbx)
movq %r12, %rdi
callq 0x5d5e
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5171
movq %rax, %rbx
jmp 0x5192
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x5192
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x51ab
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2310
nop