// File: /workspace/github_cpp_makefile_star2_O3/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 0x1d00(%rip), %rsi      # 0xb208
leaq 0x1cfe(%rip), %rdx      # 0xb20d
leaq -0xa0(%rbp), %rdi
callq 0x351a
leaq -0x70(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1d8d(%rip), %rsi      # 0xb2b8
leaq 0x1d8f(%rip), %rdx      # 0xb2c1
leaq -0x80(%rbp), %rdi
callq 0x351a
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 0x5a20
addq $0x20, %rsp
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
je 0x9580
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0xa0(%rbp), %rdi
cmpq %r15, %rdi
je 0x959b
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2200
leaq -0x2f8(%rbp), %rdi
callq 0x22f0
leaq 0x1d74(%rip), %rsi      # 0xb322
leaq -0x60(%rbp), %rdi
movq %r14, %rdx
callq 0x58c9
leaq 0x2213(%rip), %rsi      # 0xb7d4
leaq -0x60(%rbp), %rdi
callq 0x2350
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x95ee
movq %rdx, -0x40(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x30(%rbp)
jmp 0x95f5
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 0x2330
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x962a
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2200
leaq -0x50(%rbp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x9644
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2200
leaq 0x1cd7(%rip), %rsi      # 0xb322
leaq -0x60(%rbp), %rdi
movq %r14, %rdx
callq 0x58c9
leaq 0x2176(%rip), %rsi      # 0xb7d4
leaq -0x60(%rbp), %rdi
callq 0x2350
movq %r15, -0x40(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9687
movq %rdx, -0x40(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x30(%rbp)
jmp 0x968e
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 0x96cf
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x96e4
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2200
movq (%rbx), %rsi
movq 0x8(%rbx), %rax
cmpq %rax, %rsi
jae 0x9748
leaq -0x2f8(%rbp), %r14
leaq 0x58(%rsi), %r12
cmpq %rax, %r12
je 0x9734
movq %r14, %rdi
callq 0x5ee7
movq %rax, %r15
movq (%rax), %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
jmp 0x973c
movq %r14, %rdi
callq 0x5ee7
movq 0x8(%rbx), %rax
movq %r12, %rsi
cmpq %rax, %r12
jb 0x96f7
leaq -0x2f8(%rbp), %rdi
callq 0x2270
movq 0x586d(%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 0x21b0
leaq -0x200(%rbp), %rdi
callq 0x20e0
leaq -0xc8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x97a9
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x2200
leaq -0xe8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x97c8
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x2200
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9866
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x97fa
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2200
jmp 0x97fa
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
jne 0x9817
jmp 0x9869
jmp 0x9866
movq %rax, %rbx
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9869
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2200
jmp 0x9869
jmp 0x9866
movq %rax, %rbx
jmp 0x9875
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
je 0x9849
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2200
jmp 0x9849
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r15, %rdi
je 0x9881
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2200
jmp 0x9881
movq %rax, %rbx
leaq -0x2f8(%rbp), %rdi
callq 0x2290
leaq -0xf8(%rbp), %rdi
callq 0x5884
movq %rbx, %rdi
callq 0x2310
nop