// File: /workspace/github_c_makefile_star2_O1/0x3f00[P]PhotonCpp/PhotonCpp.cpp
// Function: main
int main(int argc, char * argv[])
{
	if (argc != 3)
	{
		std::cerr << "\nUsage: PngToPhoton <input-1440x2560.png> <output.photon>\n"
		"To read data from STDIN use '-' as filename.\n"
		"To write data to STDOUT use '-' as filename.\n\n"
		"White and transparent areas of the image are treated as voids.\n"
		"Check with Photon File Validator after conversion. Use output at your own risk.\n";
		return -1;
	}

#ifdef WIN32
	_setmode(_fileno(stdout), _O_BINARY);
	_setmode(_fileno(stdin), _O_BINARY);
#endif // WIN32

	std::string bufferModel = getModel();

	PhotonFileHeader photonFileHeader(bufferModel);
	PhotonFilePreview previewOne(photonFileHeader.getPreviewOneOffsetAddress(), bufferModel);
	PhotonFilePreview previewTwo(photonFileHeader.getPreviewTwoOffsetAddress(), bufferModel);
	
	PhotonFilePrintParameters photonFilePrintParameters;
	if (photonFileHeader.getVersion() > 1) 
	{
		PhotonFilePrintParameters dummy(photonFileHeader.getPrintParametersOffsetAddress(), bufferModel);
		photonFilePrintParameters = std::move(dummy);
	}

	int margin = 0;
	
	std::vector<PhotonFileLayer> layers = PhotonFileLayer::readLayers(photonFileHeader, bufferModel, margin);

//	PhotonFileLayer::calculateLayers(photonFileHeader,layers, 0);

	// load png
	std::string bufferPng;
	
	if (std::string("-") == argv[1])
	{
		std::string tmp(std::istreambuf_iterator<char>(std::cin), {});
		bufferPng = std::move(tmp);
	}
	else
	{
		std::ifstream ifPng(argv[1], std::ios_base::binary);

		if (ifPng.fail())
		{
			std::cerr << "Error opening input file.\n";
			return -1;
		}

		ifPng.seekg(0, std::ios::end);
		std::streamoff size = 0;
		size = ifPng.tellg();
		bufferPng.resize((unsigned int)size);
		ifPng.seekg(0);
		ifPng.read(&bufferPng[0], size);
		ifPng.close();
	}

	std::pair<std::string, PhotonLayer> rle = png2layer(bufferPng);
	if (!rle.first.empty())
	{
		std::cerr << rle.first << "\n";
		return -1;
	}

	PhotonLayer & layerPng = rle.second;
	int antiAliasLevel = 1;
	if (photonFileHeader.getVersion() > 1) {
		antiAliasLevel = photonFileHeader.getAntiAliasingLevel();
	}

	for (int i = 0; i < photonFileHeader.getNumberOfLayers(); i++) {
		PhotonFileLayer & layer = layers.at(i);
		layer.saveLayer(layerPng);
		if (antiAliasLevel > 1) {
			for (int a = 0; a < (antiAliasLevel - 1); a++) {
				layer.getAntiAlias(a).saveLayer(layerPng);
			}
		}
	}




	// writing is here:
	int headerPos = 0;
	int previewOnePos = headerPos + photonFileHeader.getByteSize();
	int previewTwoPos = previewOnePos + previewOne.getByteSize();
	int layerDefinitionPos = previewTwoPos + previewTwo.getByteSize();

	int parametersPos = 0;
	if (photonFileHeader.getVersion() > 1) {
		parametersPos = layerDefinitionPos;
		layerDefinitionPos = parametersPos + photonFilePrintParameters.getByteSize();
	}

	int dataPosition = layerDefinitionPos + (PhotonFileLayer::getByteSize() * photonFileHeader.getNumberOfLayers() * antiAliasLevel);


	std::ofstream ofs;
	if (std::string("-") != argv[2])
	{
		ofs.open(argv[2], std::ios_base::binary);
		if (ofs.fail())
		{
			std::cerr << "Error opening output file.\n";
			return -1;
		}
	}

	PhotonOutputStream os( std::string("-") != argv[2] ? ofs : std::cout);
	photonFileHeader.save(os, previewOnePos, previewTwoPos, layerDefinitionPos, parametersPos);
	previewOne.save(os, previewOnePos);
	previewTwo.save(os, previewTwoPos);

	if (photonFileHeader.getVersion() > 1) {
		photonFilePrintParameters.save(os);
	}

	// Optimize order for speed read on photon
	for (int i = 0; i < photonFileHeader.getNumberOfLayers(); i++) {
		PhotonFileLayer & layer = layers.at(i);
		dataPosition = layer.savePos(dataPosition);
		if (antiAliasLevel > 1) {
			for (int a = 0; a < (antiAliasLevel - 1); a++) {
				dataPosition = layer.getAntiAlias(a).savePos(dataPosition);
			}
		}
	}

	// Order for backward compatibility with photon/cbddlp version 1
	for (int i = 0; i < photonFileHeader.getNumberOfLayers(); i++) {
		layers.at(i).save(os);
	}

	if (antiAliasLevel > 1) {
		for (int a = 0; a < (antiAliasLevel - 1); a++) {
			for (int i = 0; i < photonFileHeader.getNumberOfLayers(); i++) {
				layers.at(i).getAntiAlias(a).save(os);
			}
		}
	}

	// Optimize order for speed read on photon
	for (int i = 0; i < photonFileHeader.getNumberOfLayers(); i++) {
		PhotonFileLayer & layer = layers.at(i);
		layer.saveData(os);
		if (antiAliasLevel > 1) {
			for (int a = 0; a < (antiAliasLevel - 1); a++) {
				layer.getAntiAlias(a).saveData(os);
			}
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4a8, %rsp            # imm = 0x4A8
cmpl $0x3, %edi
jne 0x4826
movq %rsi, %r15
leaq -0xb0(%rbp), %r14
movq %r14, %rdi
callq 0x458b
leaq -0x140(%rbp), %rdi
movq %r14, %rsi
callq 0x8768
movl -0x104(%rbp), %esi
leaq -0x220(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0x8950
movl -0xf8(%rbp), %esi
leaq -0x1d0(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0x8950
movaps 0x8953(%rip), %xmm0     # 0xd020
movups %xmm0, -0x180(%rbp)
movl $0x43960000, -0x170(%rbp) # imm = 0x43960000
xorps %xmm0, %xmm0
movups %xmm0, -0x16c(%rbp)
movl $0x0, -0x15c(%rbp)
cmpl $0x2, -0x13c(%rbp)
jl 0x474c
movl -0xec(%rbp), %esi
leaq -0x4d0(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0x8adc
movups -0x4d0(%rbp), %xmm0
movups -0x4c0(%rbp), %xmm1
movups -0x4b0(%rbp), %xmm2
movups -0x4a4(%rbp), %xmm3
movups %xmm3, -0x154(%rbp)
movaps %xmm2, -0x160(%rbp)
movaps %xmm1, -0x170(%rbp)
movaps %xmm0, -0x180(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x140(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
xorl %ecx, %ecx
callq 0x8c7e
leaq -0x50(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq -0x4c0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x9450(%rip), %rsi      # 0xdbde
leaq 0x944a(%rip), %rdx      # 0xdbdf
leaq -0x4d0(%rbp), %rdi
callq 0xa048
movq %r15, -0x40(%rbp)
movq 0x8(%r15), %rsi
leaq -0x4d0(%rbp), %r15
movq %r15, %rdi
callq 0x20a0
movl %eax, %r14d
movq (%r15), %rdi
cmpq %rbx, %rdi
je 0x47c8
callq 0x21d0
testl %r14d, %r14d
je 0x4849
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x4d0(%rbp), %rdi
movl $0x4, %edx
callq 0x23d0
movq -0x4d0(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x4b0(%rbp,%rax), %r15d
testb $0x5, %r15b
je 0x489d
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movq 0xd7e0(%rip), %rdi      # 0x11ff0
leaq 0x93c9(%rip), %rsi      # 0xdbe0
movl $0x1a, %edx
callq 0x2230
jmp 0x48ff
movq 0xd7c3(%rip), %rdi      # 0x11ff0
leaq 0x9285(%rip), %rsi      # 0xdab9
movl $0x124, %edx            # imm = 0x124
callq 0x2230
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x4f9e
movq 0xd788(%rip), %rax      # 0x11fd8
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq 0xe8(%rax,%rcx), %rsi
leaq -0x4d0(%rbp), %rdi
movq %rbx, (%rdi)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0xc270
leaq -0x60(%rbp), %rdi
leaq -0x4d0(%rbp), %r14
movq %r14, %rsi
callq 0x2270
movq (%r14), %rdi
cmpq %rbx, %rdi
je 0x4915
callq 0x21d0
jmp 0x4915
leaq -0x4d0(%rbp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x22c0
leaq -0x4d0(%rbp), %rdi
callq 0x23a0
movq %rax, %r14
movl %r14d, %esi
leaq -0x60(%rbp), %rdi
xorl %edx, %edx
callq 0x20b0
leaq -0x4d0(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2290
movq -0x60(%rbp), %rsi
leaq -0x4d0(%rbp), %rdi
movq %r14, %rdx
callq 0x2280
xorl %r14d, %r14d
leaq -0x4d0(%rbp), %rdi
callq 0x2070
leaq -0x4d0(%rbp), %rdi
callq 0x2080
testb $0x5, %r15b
jne 0x4f2e
leaq -0x2c8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3fa5
movq -0x2c0(%rbp), %rdx
testq %rdx, %rdx
je 0x4963
movq -0x2c8(%rbp), %rsi
movq 0xd6b1(%rip), %rdi      # 0x11ff0
callq 0x2230
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
leaq 0x92a8(%rip), %rsi      # 0xdbf9
movl $0x1, %edx
movq %rax, %rdi
callq 0x2230
jmp 0x4ec6
movl -0xfc(%rbp), %r12d
cmpl $0x2, -0x13c(%rbp)
movl $0x1, %eax
movq %rax, -0x30(%rbp)
jl 0x4986
movl -0xe4(%rbp), %eax
movq %rax, -0x30(%rbp)
movabsq $-0x2c8590b21642c859, %rcx # imm = 0xD37A6F4DE9BD37A7
testl %r12d, %r12d
jle 0x4a49
leaq -0x2a8(%rbp), %r15
movq -0x30(%rbp), %rax
leal -0x1(%rax), %ebx
xorl %r14d, %r14d
movq -0x78(%rbp), %r12
movq -0x70(%rbp), %rdx
subq %r12, %rdx
sarq $0x3, %rdx
imulq %rcx, %rdx
cmpq %r14, %rdx
jbe 0x4ffa
imulq $0xb8, %r14, %rax
addq %rax, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x90be
cmpl $0x2, -0x30(%rbp)
movabsq $-0x2c8590b21642c859, %rcx # imm = 0xD37A6F4DE9BD37A7
jl 0x4a36
xorl %r13d, %r13d
movq 0x90(%r12), %rdi
movq 0x98(%r12), %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
imulq %rcx, %rdx
cmpq %r13, %rdx
jbe 0x4fb3
imulq $0xb8, %r13, %rax
addq %rax, %rdi
movq %r15, %rsi
callq 0x90be
incq %r13
cmpq %rbx, %r13
movabsq $-0x2c8590b21642c859, %rcx # imm = 0xD37A6F4DE9BD37A7
jne 0x49ee
incq %r14
movslq -0xfc(%rbp), %r12
cmpq %r12, %r14
jl 0x49aa
xorl %esi, %esi
xorl %r15d, %r15d
cmpl $0x2, -0x13c(%rbp)
setge %r15b
movl -0x214(%rbp), %r14d
leal 0x6c(%r14,%r15,4), %eax
movl -0x1c4(%rbp), %ecx
leal 0x40(%rcx,%rax), %edx
leal 0x7c(%rcx,%rax), %eax
cmovll %edx, %eax
movq %rax, -0x90(%rbp)
cmovgel %edx, %esi
movl %esi, -0x7c(%rbp)
leaq -0x4d0(%rbp), %rdi
callq 0x2390
movq %r14, -0x88(%rbp)
leaq -0xc0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x9136(%rip), %rsi      # 0xdbde
leaq 0x9130(%rip), %rdx      # 0xdbdf
leaq -0xd0(%rbp), %rdi
callq 0xa048
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0xd0(%rbp), %r14
movq %r14, %rdi
callq 0x20a0
movl %eax, %r13d
movq (%r14), %rdi
cmpq %rbx, %rdi
movq %rbx, %r14
je 0x4ae5
callq 0x21d0
testl %r13d, %r13d
je 0x4b3b
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x4d0(%rbp), %rdi
movl $0x4, %edx
callq 0x2050
movq -0x4d0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x4b0(%rbp,%rax)
je 0x4b3b
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movq 0xd4cb(%rip), %rdi      # 0x11ff0
leaq 0x90cf(%rip), %rsi      # 0xdbfb
movl $0x1b, %edx
callq 0x2230
jmp 0x4e8c
leaq -0xd0(%rbp), %rdi
movq %r14, (%rdi)
leaq 0x9092(%rip), %rsi      # 0xdbde
leaq 0x908c(%rip), %rdx      # 0xdbdf
callq 0xa048
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0xd0(%rbp), %rdi
callq 0x20a0
testl %eax, %eax
leaq -0x4d0(%rbp), %rcx
jne 0x4b7e
movq 0xd44a(%rip), %rcx      # 0x11fc8
leal 0x6c(,%r15,4), %r13d
movq -0x88(%rbp), %rax
leal (%rax,%r15,4), %ebx
addl $0x8c, %ebx
movq %rcx, -0x38(%rbp)
movq -0xd0(%rbp), %rdi
cmpq %r14, %rdi
je 0x4bac
callq 0x21d0
movq -0x38(%rbp), %rsi
leaq -0x140(%rbp), %rdi
movl %r13d, %edx
movl %ebx, %ecx
movq -0x90(%rbp), %r14
movl %r14d, %r8d
movl -0x7c(%rbp), %r9d
callq 0x9154
movq -0x38(%rbp), %rsi
leaq -0x220(%rbp), %rdi
movl %r13d, %edx
callq 0x92f2
movq -0x38(%rbp), %rsi
leaq -0x1d0(%rbp), %rdi
movl %ebx, %edx
callq 0x92f2
cmpl $0x2, -0x13c(%rbp)
jl 0x4c0d
leaq -0x180(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x93c0
movslq -0xfc(%rbp), %rcx
testq %rcx, %rcx
jle 0x4cc9
movq -0x30(%rbp), %rsi
imull %esi, %r12d
leal (%r12,%r12,8), %eax
leal (%r14,%rax,4), %eax
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
movabsq $-0x2c8590b21642c859, %r8 # imm = 0xD37A6F4DE9BD37A7
imulq %r8, %rdx
leal -0x1(%rsi), %r8d
xorl %r9d, %r9d
cmpq %rdx, %r9
je 0x501c
imulq $0xb8, %r9, %rsi
movl 0x10(%rdi,%rsi), %r10d
addl %eax, %r10d
movl %eax, 0xc(%rdi,%rsi)
cmpl $0x2, -0x30(%rbp)
jl 0x4cbe
addq %rdi, %rsi
movq 0x90(%rsi), %r11
movq 0x98(%rsi), %rax
subq %r11, %rax
sarq $0x3, %rax
movabsq $-0x2c8590b21642c859, %rsi # imm = 0xD37A6F4DE9BD37A7
imulq %rsi, %rax
addq $0x10, %r11
xorl %esi, %esi
cmpq %rsi, %rax
je 0x4fc4
movl %r10d, -0x4(%r11)
addl (%r11), %r10d
incq %rsi
addq $0xb8, %r11
cmpq %rsi, %r8
jne 0x4c9f
incq %r9
movl %r10d, %eax
cmpq %rcx, %r9
jne 0x4c51
cmpl $0x0, -0xfc(%rbp)
movabsq $-0x2c8590b21642c859, %rcx # imm = 0xD37A6F4DE9BD37A7
jle 0x4d2c
xorl %r15d, %r15d
leaq -0x38(%rbp), %r14
xorl %ebx, %ebx
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
imulq %rcx, %rdx
cmpq %rbx, %rdx
jbe 0x500b
addq %r15, %rdi
movq %r14, %rsi
callq 0x9484
incq %rbx
movslq -0xfc(%rbp), %rax
addq $0xb8, %r15
cmpq %rax, %rbx
movabsq $-0x2c8590b21642c859, %rcx # imm = 0xD37A6F4DE9BD37A7
jl 0x4ce5
cmpl $0x2, -0x30(%rbp)
jl 0x4dd1
movq -0x30(%rbp), %rax
decl %eax
movq %rax, -0x40(%rbp)
xorl %r12d, %r12d
leaq -0x38(%rbp), %rbx
cmpl $0x0, -0xfc(%rbp)
jle 0x4dc4
movl $0x98, %r13d
imulq $0xb8, %r12, %r15
xorl %r14d, %r14d
movq -0x78(%rbp), %rax
movq -0x70(%rbp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %rcx, %rdx
cmpq %r14, %rdx
jbe 0x4fd8
movq -0x8(%rax,%r13), %rdi
movq (%rax,%r13), %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
imulq %rcx, %rdx
cmpq %r12, %rdx
jbe 0x4fd5
addq %r15, %rdi
movq %rbx, %rsi
callq 0x9484
incq %r14
movslq -0xfc(%rbp), %rax
addq $0xb8, %r13
cmpq %rax, %r14
movabsq $-0x2c8590b21642c859, %rcx # imm = 0xD37A6F4DE9BD37A7
jl 0x4d60
incq %r12
cmpq -0x40(%rbp), %r12
jne 0x4d47
cmpl $0x0, -0xfc(%rbp)
jle 0x4e89
movq -0x30(%rbp), %rax
leal -0x1(%rax), %r13d
xorl %ebx, %ebx
leaq -0x38(%rbp), %r14
movq -0x78(%rbp), %r15
movq -0x70(%rbp), %rdx
subq %r15, %rdx
sarq $0x3, %rdx
imulq %rcx, %rdx
cmpq %rbx, %rdx
jbe 0x502d
imulq $0xb8, %rbx, %rax
addq %rax, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x9500
cmpl $0x2, -0x30(%rbp)
movabsq $-0x2c8590b21642c859, %rcx # imm = 0xD37A6F4DE9BD37A7
jl 0x4e76
xorl %r12d, %r12d
movq 0x90(%r15), %rdi
movq 0x98(%r15), %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
imulq %rcx, %rdx
cmpq %r12, %rdx
jbe 0x4fe9
imulq $0xb8, %r12, %rax
addq %rax, %rdi
movq %r14, %rsi
callq 0x9500
incq %r12
cmpq %r13, %r12
movabsq $-0x2c8590b21642c859, %rcx # imm = 0xD37A6F4DE9BD37A7
jne 0x4e30
incq %rbx
movslq -0xfc(%rbp), %rax
cmpq %rax, %rbx
jl 0x4dec
xorl %r14d, %r14d
movq 0xd12d(%rip), %rax      # 0x11fc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x4c8(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x4d0(%rbp,%rcx)
callq 0x21b0
leaq -0x3d8(%rbp), %rdi
callq 0x20d0
leaq -0x50(%rbp), %r12
movq -0x238(%rbp), %rdi
testq %rdi, %rdi
je 0x4ed7
callq 0x21d0
movq -0x250(%rbp), %rdi
testq %rdi, %rdi
je 0x4ee8
callq 0x21d0
movq -0x268(%rbp), %rdi
testq %rdi, %rdi
je 0x4ef9
callq 0x21d0
movq -0x280(%rbp), %rdi
testq %rdi, %rdi
je 0x4f0a
callq 0x21d0
leaq -0x298(%rbp), %rbx
movq %rbx, %rdi
callq 0x96fa
movq -0x30(%rbx), %rdi
leaq -0x2b8(%rbp), %rax
cmpq %rax, %rdi
je 0x4f2e
callq 0x21d0
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x4f3c
callq 0x21d0
leaq -0x78(%rbp), %rdi
callq 0x95e8
movq -0x1a8(%rbp), %rdi
testq %rdi, %rdi
je 0x4f56
callq 0x21d0
movq -0x1c0(%rbp), %rdi
testq %rdi, %rdi
je 0x4f67
callq 0x21d0
movq -0x1f8(%rbp), %rdi
testq %rdi, %rdi
je 0x4f78
callq 0x21d0
movq -0x210(%rbp), %rdi
testq %rdi, %rdi
je 0x4f89
callq 0x21d0
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4f9e
callq 0x21d0
movl %r14d, %eax
addq $0x4a8, %rsp            # imm = 0x4A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x92f1(%rip), %rdi      # 0xe2ab
movq %r13, %rsi
xorl %eax, %eax
callq 0x2300
leaq 0x92e0(%rip), %rdi      # 0xe2ab
movq %rax, %rdx
xorl %eax, %eax
callq 0x2300
movq %r12, %r14
leaq 0x92cc(%rip), %rdi      # 0xe2ab
movq %r14, %rsi
xorl %eax, %eax
callq 0x2300
leaq 0x92bb(%rip), %rdi      # 0xe2ab
movq %r12, %rsi
xorl %eax, %eax
callq 0x2300
leaq 0x92aa(%rip), %rdi      # 0xe2ab
movq %r14, %rsi
xorl %eax, %eax
callq 0x2300
leaq 0x9299(%rip), %rdi      # 0xe2ab
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2300
leaq 0x9288(%rip), %rdi      # 0xe2ab
movq %rdx, %rsi
xorl %eax, %eax
callq 0x2300
leaq 0x9277(%rip), %rdi      # 0xe2ab
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2300
jmp 0x50a1
jmp 0x50a1
jmp 0x5098
jmp 0x50a1
jmp 0x5059
jmp 0x506a
jmp 0x50a1
jmp 0x506f
jmp 0x506a
jmp 0x5059
jmp 0x506a
movq %rax, %rbx
jmp 0x50b4
movq %rax, %rbx
leaq -0x4d0(%rbp), %rdi
callq 0x2080
jmp 0x50c0
movq %rax, %rbx
jmp 0x50c0
movq %rax, %rbx
jmp 0x50d7
movq %rax, %rbx
jmp 0x50e3
jmp 0x507b
movq %rax, %rbx
jmp 0x50ef
jmp 0x50a1
jmp 0x50a1
jmp 0x50a1
jmp 0x50a1
jmp 0x50a1
jmp 0x5098
jmp 0x5098
jmp 0x50a1
jmp 0x50a1
jmp 0x50a1
jmp 0x50a1
jmp 0x5098
movq %rax, %rbx
leaq -0x50(%rbp), %r12
jmp 0x50b4
movq %rax, %rbx
leaq -0x50(%rbp), %r12
leaq -0x4d0(%rbp), %rdi
callq 0x22e0
leaq -0x2c8(%rbp), %rdi
callq 0x9580
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x50ce
callq 0x21d0
leaq -0x78(%rbp), %rdi
callq 0x95e8
leaq -0x1d0(%rbp), %rdi
callq 0x9662
leaq -0x220(%rbp), %rdi
callq 0x9662
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5104
callq 0x21d0
movq %rbx, %rdi
callq 0x23b0