// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2e0, %rsp            # imm = 0x2E0
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x90(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1d40(%rip), %rsi      # 0xb208
leaq 0x1d3e(%rip), %rdx      # 0xb20d
leaq -0xa0(%rbp), %rdi
callq 0x34e4
leaq -0x70(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1dcd(%rip), %rsi      # 0xb2b8
leaq 0x1dcf(%rip), %rdx      # 0xb2c1
leaq -0x80(%rbp), %rdi
callq 0x34e4
subq $0x8, %rsp
xorl %eax, %eax
leaq -0xf8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x80(%rbp), %rdx
movl $0x1, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rax
pushq $0x14
pushq %rax
callq 0x5a08
addq $0x20, %rsp
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
je 0x9540
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xa0(%rbp), %rdi
cmpq %r15, %rdi
je 0x955b
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x2f8(%rbp), %rdi
callq 0x2300
leaq 0x1db4(%rip), %rsi      # 0xb322
leaq -0x60(%rbp), %rdi
movq %r14, %rdx
callq 0x58b7
leaq 0x2243(%rip), %rsi      # 0xb7c4
leaq -0x60(%rbp), %rdi
callq 0x2360
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x95ae
movq %rdx, -0x40(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x30(%rbp)
jmp 0x95b5
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x38(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x40(%rbp), %rdi
callq 0x2340
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x95ea
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x50(%rbp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x9604
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2210
leaq 0x1d17(%rip), %rsi      # 0xb322
leaq -0x60(%rbp), %rdi
movq %r14, %rdx
callq 0x58b7
leaq 0x21a6(%rip), %rsi      # 0xb7c4
leaq -0x60(%rbp), %rdi
callq 0x2360
movq %r15, -0x40(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9647
movq %rdx, -0x40(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x30(%rbp)
jmp 0x964e
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x38(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x40(%rbp), %rsi
leaq -0x2f8(%rbp), %rdi
movl $0x10, %edx
callq 0x2060
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x968f
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x96a4
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2210
movq (%rbx), %rsi
movq 0x8(%rbx), %rax
cmpq %rax, %rsi
jae 0x9708
leaq -0x2f8(%rbp), %r14
leaq 0x58(%rsi), %r12
cmpq %rax, %r12
je 0x96f4
movq %r14, %rdi
callq 0x5ecf
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
jmp 0x96fc
movq %r14, %rdi
callq 0x5ecf
movq 0x8(%rbx), %rax
movq %r12, %rsi
cmpq %rax, %r12
jb 0x96b7
leaq -0x2f8(%rbp), %rdi
callq 0x2280
movq 0x58ad(%rip), %rax      # 0xefc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x2f0(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x2f8(%rbp,%rcx)
callq 0x21c0
leaq -0x200(%rbp), %rdi
callq 0x20e0
leaq -0xc8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9769
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0xe8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9788
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x2210
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9826
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x97ba
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x97ba
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
jne 0x97d7
jmp 0x9829
jmp 0x9826
movq %rax, %rbx
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9829
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x9829
jmp 0x9826
movq %rax, %rbx
jmp 0x9835
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
je 0x9809
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x9809
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r15, %rdi
je 0x9841
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x9841
movq %rax, %rbx
leaq -0x2f8(%rbp), %rdi
callq 0x22a0
leaq -0xf8(%rbp), %rdi
callq 0x5872
movq %rbx, %rdi
callq 0x2320
nop