// File: /workspace/github_cpp_makefile_star2_O1/hey-yahei[P]ConvNet/src/helper.cpp
// Function: LoadFromSparseHuffmanFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char*, TarFile*)
unsigned long LoadFromSparseHuffmanFile(string prefix, char* dst, TarFile* tarfile) {
	string data_path = prefix + ".data";
	string index_path = prefix + ".index";

	vector<unsigned char> index, data;
	LoadFromHuffmanFile(index_path, index, tarfile);
	LoadFromHuffmanFile(data_path, data, tarfile);
	unsigned long size = index.size();
	if (size != data.size()) {
		cerr << "LoadFromSparseHuffmanFile: size not match" << endl;
		exit(1);
	}

	index[0]--;
	for (int i = 0; i < size; i++) {
		dst += index[i];
		*dst = data[i];
	}
	return size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq -0x90(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
addq %rsi, %rdx
leaq -0xa0(%rbp), %r12
movq %r12, %rdi
callq 0x4ebc
leaq 0x19b8(%rip), %rsi      # 0x63bf
movq %r12, %rdi
callq 0x2310
leaq -0x70(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq -0x80(%rbp), %rdi
callq 0x4ebc
leaq 0x1993(%rip), %rsi      # 0x63c5
leaq -0x80(%rbp), %rdi
callq 0x2310
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
xorl %eax, %eax
movq %rax, -0x50(%rbp)
movq %rax, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
leaq -0xd0(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0xe0(%rbp), %rdi
callq 0x4ebc
leaq -0xe0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movq %r14, %rdx
callq 0x4784
movq -0xe0(%rbp), %rdi
cmpq %r15, %rdi
je 0x4aa0
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq -0xb0(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
addq %rsi, %rdx
leaq -0xc0(%rbp), %rdi
callq 0x4ebc
leaq -0xc0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movq %r14, %rdx
callq 0x4784
movq -0xc0(%rbp), %rdi
cmpq %r15, %rdi
je 0x4af6
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, %r14
subq %rax, %r14
movq -0x38(%rbp), %rdx
subq -0x40(%rbp), %rdx
cmpq %rdx, %r14
jne 0x4bb7
decb (%rax)
cmpq %rax, %rcx
je 0x4b48
movq -0x60(%rbp), %rax
movq -0x40(%rbp), %rcx
cmpq $0x1, %r14
movq %r14, %rdx
adcq $0x0, %rdx
xorl %esi, %esi
movzbl (%rax,%rsi), %edi
movb (%rcx,%rsi), %r8b
movb %r8b, (%rbx,%rdi)
addq %rdi, %rbx
incq %rsi
cmpq %rsi, %rdx
jne 0x4b31
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x4b5d
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x4b72
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
je 0x4b87
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0xa0(%rbp), %rdi
cmpq %r13, %rdi
je 0x4ba2
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x21b0
movq %r14, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4432(%rip), %rdi      # 0x8ff0
leaq 0x1807(%rip), %rsi      # 0x63cc
movl $0x29, %edx
callq 0x21e0
movq 0x441a(%rip), %rdi      # 0x8ff0
callq 0x20d0
movl $0x1, %edi
callq 0x2210
jmp 0x4c2b
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
cmpq %r15, %rdi
je 0x4c2e
movq -0xb0(%rbp), %rsi
jmp 0x4c15
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
cmpq %r15, %rdi
je 0x4c2e
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x21b0
jmp 0x4c2e
movq %rax, %rbx
jmp 0x4c58
jmp 0x4c26
movq %rax, %rbx
jmp 0x4c6d
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x4c43
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x4c58
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
je 0x4c6d
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21b0
movq -0xa0(%rbp), %rdi
cmpq %r13, %rdi
je 0x4c88
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x22e0