// File: parth-shel[P]xpac/metadata.cpp
// Function: metadata::write_package(metadata*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void metadata::write_package(metadata * package, std::string filepath){
	std::ofstream file_object;
	filepath = filepath + "/." + package->pkg_name + std::string(".metadata");	//Filename consists of package name and a metadata
	file_object.open(filepath.c_str(),std::ios::out | std::ios::trunc);
	file_object << package->pkg_name << "\n" << package->pkg_ver << "\n" << package->pkg_id << "\n";
	for(auto&& itr = package->dep_list->begin(); itr!=package->dep_list->end(); itr++)
					file_object<< *itr << "\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x330, %rsp            # imm = 0x330
movq %rsi, -0x2d0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x46b0
movq -0x2d0(%rbp), %rsi
leaq 0x3851(%rip), %rdx      # 0x150b5
leaq -0x270(%rbp), %rdi
callq 0x9170
jmp 0x11872
movq -0x8(%rbp), %rdx
leaq -0x250(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x94c0
jmp 0x1188b
leaq -0x2a1(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x46e0
movq -0x2d8(%rbp), %rdx
leaq 0x3bdf(%rip), %rsi      # 0x1548b
leaq -0x2a0(%rbp), %rdi
callq 0x4560
jmp 0x118ba
leaq -0x230(%rbp), %rdi
leaq -0x250(%rbp), %rsi
leaq -0x2a0(%rbp), %rdx
callq 0x90a0
jmp 0x118d6
movq -0x2d0(%rbp), %rdi
leaq -0x230(%rbp), %rsi
movq %rsi, -0x2f0(%rbp)
callq 0x44d0
movq -0x2f0(%rbp), %rdi
callq 0x47e8
leaq -0x2a0(%rbp), %rdi
callq 0x47e8
leaq -0x2a1(%rbp), %rdi
callq 0x4460
leaq -0x250(%rbp), %rdi
callq 0x47e8
leaq -0x270(%rbp), %rdi
callq 0x47e8
movq -0x2d0(%rbp), %rdi
callq 0x41c0
movq %rax, -0x2e8(%rbp)
movl $0x10, %edi
movl $0x20, %esi
callq 0x95c0
movl %eax, -0x2dc(%rbp)
jmp 0x11956
movl -0x2dc(%rbp), %edx
movq -0x2e8(%rbp), %rsi
leaq -0x210(%rbp), %rdi
callq 0x4080
jmp 0x11971
movq -0x8(%rbp), %rsi
leaq -0x210(%rbp), %rdi
callq 0x43d0
movq %rax, -0x2f8(%rbp)
jmp 0x1198a
movq -0x2f8(%rbp), %rdi
leaq 0x3e6a(%rip), %rsi      # 0x15802
callq 0x4400
movq %rax, -0x300(%rbp)
jmp 0x119a6
movq -0x300(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x40, %rsi
callq 0x43d0
movq %rax, -0x308(%rbp)
jmp 0x119c3
movq -0x308(%rbp), %rdi
leaq 0x3e31(%rip), %rsi      # 0x15802
callq 0x4400
movq %rax, -0x310(%rbp)
jmp 0x119df
movq -0x310(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x20, %rsi
callq 0x43d0
movq %rax, -0x318(%rbp)
jmp 0x119fc
movq -0x318(%rbp), %rdi
leaq 0x3df8(%rip), %rsi      # 0x15802
callq 0x4400
jmp 0x11a11
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x95e0
movq %rax, -0x2b8(%rbp)
leaq -0x2b8(%rbp), %rax
movq %rax, -0x2b0(%rbp)
movq -0x2b0(%rbp), %rax
movq %rax, -0x320(%rbp)
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x9650
movq -0x320(%rbp), %rdi
movq %rax, -0x2c0(%rbp)
leaq -0x2c0(%rbp), %rsi
callq 0x9610
testb $0x1, %al
jne 0x11a71
jmp 0x11b49
movq -0x2b0(%rbp), %rdi
callq 0x9680
movq %rax, %rsi
leaq -0x210(%rbp), %rdi
callq 0x43d0
movq %rax, -0x328(%rbp)
jmp 0x11a95
movq -0x328(%rbp), %rdi
leaq 0x3d5f(%rip), %rsi      # 0x15802
callq 0x4400
jmp 0x11aaa
jmp 0x11aac
movq -0x2b0(%rbp), %rdi
xorl %esi, %esi
callq 0x96a0
movq %rax, -0x2c8(%rbp)
jmp 0x11a33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x278(%rbp)
movl %eax, -0x27c(%rbp)
jmp 0x11b5e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x278(%rbp)
movl %eax, -0x27c(%rbp)
jmp 0x11b3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x278(%rbp)
movl %eax, -0x27c(%rbp)
jmp 0x11b23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x278(%rbp)
movl %eax, -0x27c(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x47e8
leaq -0x2a1(%rbp), %rdi
callq 0x4460
leaq -0x250(%rbp), %rdi
callq 0x47e8
leaq -0x270(%rbp), %rdi
callq 0x47e8
jmp 0x11b5e
leaq -0x210(%rbp), %rdi
callq 0x45c0
addq $0x330, %rsp            # imm = 0x330
popq %rbp
retq
leaq -0x210(%rbp), %rdi
callq 0x45c0
movq -0x278(%rbp), %rdi
callq 0x46d0
nopw %cs:(%rax,%rax)