// File: hobbitsyfeet[P]Turn/inventory.cc
// Function: Inventory::saveInventory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Inventory::saveInventory(string unitName){
  Item temp;
  vector<Item>::iterator it;
  ofstream fout;
  //open file at destination
	remove(("./saves/" + unitName +"Inv").c_str());
  fout.open(("./saves/" + unitName +"Inv").c_str());
  for(it=invContainer.begin(); it< invContainer.end(); it++){
    if(it+1 != invContainer.end())
      fout<<*it<<endl;
    else
      fout<<*it;
  }
  fout.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3c0, %rsp            # imm = 0x3C0
movq %rsi, -0x390(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x388(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0x380(%rbp)
callq 0x3450
movq -0x380(%rbp), %rdx
leaq 0x252e(%rip), %rsi      # 0x121d4
leaq -0x88(%rbp), %rdi
callq 0x47d0
jmp 0xfcb4
leaq -0xc1(%rbp), %rdi
movq %rdi, -0x398(%rbp)
callq 0x3450
movq -0x398(%rbp), %rdx
leaq 0x25af(%rip), %rsi      # 0x12284
leaq -0xc0(%rbp), %rdi
callq 0x47d0
jmp 0xfce3
movq %rsp, %rax
movl $0x0, 0x10(%rax)
movl $0x14, 0x8(%rax)
movl $0x0, (%rax)
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
leaq -0xc0(%rbp), %rdx
movl $0x1, %ecx
xorl %r9d, %r9d
movl %r9d, %r8d
callq 0x8690
jmp 0xfd1e
leaq -0xc0(%rbp), %rdi
callq 0x31c0
leaq -0xc1(%rbp), %rdi
callq 0x32d0
leaq -0x88(%rbp), %rdi
callq 0x31c0
leaq -0x89(%rbp), %rdi
callq 0x32d0
leaq -0xd0(%rbp), %rdi
callq 0x7aa0
leaq -0x2d0(%rbp), %rdi
callq 0x3410
jmp 0xfd68
movq -0x390(%rbp), %rdx
leaq 0x2578(%rip), %rsi      # 0x122ee
leaq -0x310(%rbp), %rdi
callq 0x7dd0
jmp 0xfd84
leaq 0x2b41(%rip), %rdx      # 0x128cc
leaq -0x2f0(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0xcc10
jmp 0xfda0
leaq -0x2f0(%rbp), %rdi
movq %rdi, -0x3a0(%rbp)
callq 0x3130
movq %rax, %rdi
callq 0x3480
movq -0x3a0(%rbp), %rdi
callq 0x31c0
leaq -0x310(%rbp), %rdi
callq 0x31c0
movq -0x390(%rbp), %rdx
leaq 0x250d(%rip), %rsi      # 0x122ee
leaq -0x350(%rbp), %rdi
callq 0x7dd0
jmp 0xfdef
leaq 0x2ad6(%rip), %rdx      # 0x128cc
leaq -0x330(%rbp), %rdi
leaq -0x350(%rbp), %rsi
callq 0xcc10
jmp 0xfe0b
leaq -0x330(%rbp), %rdi
callq 0x3130
movq %rax, %rsi
leaq -0x2d0(%rbp), %rdi
movl $0x10, %edx
callq 0x3070
jmp 0xfe2d
leaq -0x330(%rbp), %rdi
callq 0x31c0
leaq -0x350(%rbp), %rdi
callq 0x31c0
movq -0x388(%rbp), %rdi
callq 0x7ac0
movq %rax, -0x358(%rbp)
movq -0x358(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x388(%rbp), %rdi
callq 0x7b30
movq %rax, -0x360(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0x360(%rbp), %rsi
callq 0x7af0
testb $0x1, %al
jne 0xfe95
jmp 0x10055
leaq -0xd0(%rbp), %rdi
movl $0x1, %esi
callq 0x8230
movq -0x388(%rbp), %rdi
movq %rax, -0x368(%rbp)
callq 0x7b30
movq %rax, -0x370(%rbp)
leaq -0x368(%rbp), %rdi
leaq -0x370(%rbp), %rsi
callq 0x82f0
testb $0x1, %al
jne 0xfedc
jmp 0x1001a
leaq -0xd0(%rbp), %rdi
callq 0x7c10
movq %rax, %rsi
leaq -0x2d0(%rbp), %rdi
callq 0x8d60
movq %rax, -0x3a8(%rbp)
jmp 0xff00
movq -0x3a8(%rbp), %rdi
movq 0x90b2(%rip), %rsi      # 0x18fc0
callq 0x32b0
jmp 0xff15
jmp 0x10039
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0xff78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0xff60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x31c0
leaq -0xc1(%rbp), %rdi
callq 0x32d0
leaq -0x88(%rbp), %rdi
callq 0x31c0
leaq -0x89(%rbp), %rdi
callq 0x32d0
jmp 0x10096
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x1008d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x10081
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x310(%rbp), %rdi
callq 0x31c0
jmp 0x10081
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x1000c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x330(%rbp), %rdi
callq 0x31c0
leaq -0x350(%rbp), %rdi
callq 0x31c0
jmp 0x10081
leaq -0xd0(%rbp), %rdi
callq 0x7c10
movq %rax, %rsi
leaq -0x2d0(%rbp), %rdi
callq 0x8d60
jmp 0x10037
jmp 0x10039
jmp 0x1003b
leaq -0xd0(%rbp), %rdi
xorl %esi, %esi
callq 0x7d70
movq %rax, -0x378(%rbp)
jmp 0xfe66
leaq -0x2d0(%rbp), %rdi
callq 0x33a0
jmp 0x10063
leaq -0x2d0(%rbp), %rdi
callq 0x33c0
leaq -0x68(%rbp), %rdi
callq 0x4b00
addq $0x3c0, %rsp            # imm = 0x3C0
popq %rbp
retq
leaq -0x2d0(%rbp), %rdi
callq 0x33c0
leaq -0x68(%rbp), %rdi
callq 0x4b00
movq -0x98(%rbp), %rdi
callq 0x3440
nopw %cs:(%rax,%rax)