// File: soybin[P]idyll/src/main.cpp
// Function: main
int main(int argc, char* argv[]) {
	// base coordinates
	double y = 0.5, x = 0.5;

	// init gui
	gui::setup();

	// get config info
	int width = config::getInt("width");
	int height = config::getInt("height");
	int threadCount = config::getInt("threads");

	// pointer to seed object and parsing user input
	seed* s;
	if (argc > 2) {
		std::cout << "[-] The only permissible argument is a seed file's location.\n\n";
		return 0;
	} else if (argc == 2) {
		std::ifstream seedFile(argv[1]);
		if (!seedFile.good()) {
			std::cout << "[-] Couldn't find specified seed file.\n\n";
			return 0;
		}
		std::string seedData;
		std::getline(seedFile, seedData);
		s = new seed(seedData);
		if (!s->seedParsingSuccessful) {
			std::cout << "[-] Seed not valid.\n\n";
			delete s;
			return 0;
		}
		std::cout << "[+] Successfully read seed from '" << argv[1] << "'.\n";
	} else {
		s = new seed();
	}

	// pointer to fractal object
	fractal* f = new fractal(s);

	// pointer to renderer object
	renderer* r = new renderer(width, height, s, f);

	// pointer to 2d matrix of pixels. it'll be accessible
	// by every thread
	std::vector<std::vector<math::vec3>>* image = new std::vector<std::vector<math::vec3>>(height, std::vector<math::vec3>(width, math::vec3()));

	// thread array
	std::vector<std::thread> threads;

	// thread constants
	int chunk = width * height / threadCount;
	int lastY = 0;
	int lastX = 0;

	// thread assignment loop. this loop assigns to every thread
	// the render function with the right coordinates and stores
	// it on the thread array	
	for (int i = 0; i < threadCount; ++i) {
		int y = lastY;
		int x = lastX;
		int count = 0;
		for (; y < height && count < chunk; ) {
			for (; x < width && count < chunk; ) {
				if (++count == chunk) {
					break;
				}
				++x;
			}
			if (count < chunk) {
				x = 0;
				++y;
			}
		}

		// skip the first chunk because that one will be rendered
		// by the main thread later
		if (i > 0) {
			threads.push_back(std::thread{renderRange, lastY, y, lastX, x, width, height, chunk, r, image});
		}

		// advance one coordinate to set the starter coordinate
		// for the next loop, since this coordinate has already
		// been enqueued to be computed in the previously called
		// thread
		if (x + 1 == width) {
			x = 0;
			++y;
		} else {
			++x;
		}

		// save starter coordinates
		lastY = y;
		lastX = x;
	}

	// fill the remaining image portion which is smaller
	// than one chunk in case there's any
	if ((width * height) % threadCount != 0) {
		threads.push_back(std::thread{renderRange, lastY, height, lastX, width, width, height, chunk, r, image});
	}

	// render the first chunk in the main application thread
	// so that it can update the gui progress bar
	int count = 0;
	std::thread guiThread(gui::update, &count, chunk);
	for (int y = 0; y < height && count < chunk; ++y) {
		for (int x = 0; x < width && count < chunk; ++x) {
			(*image)[y][x] = r->render((double)height - ((double)y + 0.5f), (double)x + 0.5);
			++count;
		}
	}

	// wait for rendering threads to finish
	for (auto& thread : threads) {
		thread.join();
	}
	
	// wait for graphical user interface thread
	guiThread.join();

	//
	// define output file's path
	//
	int fileCount = 0;
	std::string fileCountStr;
	for (bool ok = true; ok & 1; ++fileCount) {
		fileCountStr = std::to_string(fileCount);
		std::ifstream pngFile("render" + fileCountStr + ".png");
		std::ifstream ppmFile("render" + fileCountStr + ".ppm");
		ok = pngFile.good() || ppmFile.good(); 
	}

	//
	// store seed inside new file
	//
	std::ofstream seedOut("seed" + fileCountStr + ".txt");
	seedOut << s->buildSeed();
	std::cout << "[+] Successfully stored seed at 'seed" << fileCountStr << ".txt'.\n";

	if (config::getInt("png")) {
		//
		// convert to portable network graphics format.
		// all credits for this functionality go to Nayuki for writing
		// the Tiny PNG Output library:
		// https://www.nayuki.io/page/tiny-png-output
		//
		try {
			// write image
			std::ofstream out("render" + fileCountStr + ".png", std::ios::binary);
			TinyPngOut pngout(static_cast<std::uint32_t>(width), static_cast<std::uint32_t>(height), out);
			std::vector<std::uint8_t> line(static_cast<size_t>(width) * 3);
			for (int y = 0; y < height; ++y) {
				for (int x = 0; x < width; ++x) {
					math::vec3 pixel = (*image)[y][x];
					line[(long long)x * 3 + 0] = static_cast<uint8_t>(pixel.x);
					line[(long long)x * 3 + 1] = static_cast<uint8_t>(pixel.y);
					line[(long long)x * 3 + 2] = static_cast<uint8_t>(pixel.z);
				}
				pngout.write(line.data(), static_cast<size_t>(width));
			}
			std::cout << "[+] Successfully stored png file to 'render" << fileCountStr << ".png'.\n\n";	
		} catch (const char* message) {
			std::cout << message << std::endl;
		}
	} else {
		//
		// write image data to ppm file
		//
		std::ofstream out("render" + fileCountStr + ".ppm");
		out << "P3\n" << width << ' ' << height << ' ' << 255 << '\n';
		for (int i = 0; i < height; ++i) {
			for (int j = 0; j < width; ++j) {
				math::vec3 pixel = (*image)[i][j];
				out << (int)pixel.x << ' ' << (int)pixel.y << ' ' << (int)pixel.z << '\n';
			}
		}
		std::cout << "[+] Successfully store ppm file to 'render" << fileCountStr << ".ppm'.\n\n";
	}

	//
	// free heap allocated memory
	//
	delete s;
	delete f;
	delete r;
	delete image;

	// correct teminal color pallette
	std::cout << "\033[0m";
	
#ifdef _WIN32
	std::system("pause");
#endif

	// exit :D
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1260, %rsp           # imm = 0x1260
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, -0x18(%rbp)
movq %rax, -0x20(%rbp)
callq 0xb7e0
leaq -0x49(%rbp), %rdi
movq %rdi, -0x1098(%rbp)
callq 0x45e0
movq -0x1098(%rbp), %rdx
leaq 0x185b2(%rip), %rsi     # 0x1d010
leaq -0x48(%rbp), %rdi
callq 0x62c0
jmp 0x4a69
leaq -0x48(%rbp), %rdi
callq 0xac80
movl %eax, -0x109c(%rbp)
jmp 0x4a7a
leaq -0x48(%rbp), %rdi
callq 0x41f0
leaq -0x49(%rbp), %rdi
callq 0x43c0
movl -0x109c(%rbp), %eax
movl %eax, -0x24(%rbp)
leaq -0x81(%rbp), %rdi
movq %rdi, -0x10a8(%rbp)
callq 0x45e0
movq -0x10a8(%rbp), %rdx
leaq 0x19108(%rip), %rsi     # 0x1dbbe
leaq -0x80(%rbp), %rdi
callq 0x62c0
jmp 0x4ac1
leaq -0x80(%rbp), %rdi
callq 0xac80
movl %eax, -0x10ac(%rbp)
jmp 0x4ad2
leaq -0x80(%rbp), %rdi
callq 0x41f0
leaq -0x81(%rbp), %rdi
callq 0x43c0
movl -0x10ac(%rbp), %eax
movl %eax, -0x60(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x10b8(%rbp)
callq 0x45e0
movq -0x10b8(%rbp), %rdx
leaq 0x18505(%rip), %rsi     # 0x1d016
leaq -0xa8(%rbp), %rdi
callq 0x62c0
jmp 0x4b1f
leaq -0xa8(%rbp), %rdi
callq 0xac80
movl %eax, -0x10bc(%rbp)
jmp 0x4b33
leaq -0xa8(%rbp), %rdi
callq 0x41f0
leaq -0xa9(%rbp), %rdi
callq 0x43c0
movl -0x10bc(%rbp), %eax
movl %eax, -0x88(%rbp)
cmpl $0x2, -0x8(%rbp)
jle 0x4c1c
movq 0x22448(%rip), %rdi     # 0x26fb0
leaq 0x184af(%rip), %rsi     # 0x1d01e
callq 0x4350
movl $0x0, -0x4(%rbp)
jmp 0x6267
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x4ba3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x41f0
leaq -0x49(%rbp), %rdi
callq 0x43c0
jmp 0x6273
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x4bd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x41f0
leaq -0x81(%rbp), %rdi
callq 0x43c0
jmp 0x6273
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x4c0b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x41f0
leaq -0xa9(%rbp), %rdi
callq 0x43c0
jmp 0x6273
cmpl $0x2, -0x8(%rbp)
jne 0x4e9c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x2c0(%rbp), %rdi
movl $0x8, %edx
callq 0x4610
movq -0x2c0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x2c0(%rbp,%rax), %rdi
callq 0x4570
movb %al, -0x10bd(%rbp)
jmp 0x4c5f
movb -0x10bd(%rbp), %al
testb $0x1, %al
jne 0x4ca7
jmp 0x4c6b
movq 0x2233e(%rip), %rdi     # 0x26fb0
leaq 0x183e4(%rip), %rsi     # 0x1d05d
callq 0x4350
jmp 0x4c80
movl $0x0, -0x4(%rbp)
movl $0x1, -0x2c4(%rbp)
jmp 0x4e60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x4e8b
leaq -0x2e8(%rbp), %rdi
movq %rdi, -0x10c8(%rbp)
callq 0x4490
movq -0x10c8(%rbp), %rsi
leaq -0x2c0(%rbp), %rdi
callq 0x4080
jmp 0x4ccf
movl $0x2748, %edi           # imm = 0x2748
callq 0x4360
movq %rax, -0x10d0(%rbp)
jmp 0x4ce2
movb $0x1, -0x309(%rbp)
leaq -0x308(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x4130
jmp 0x4cfe
movq -0x10d0(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x150c0
jmp 0x4d13
movq -0x10d0(%rbp), %rax
movb $0x0, -0x309(%rbp)
movq %rax, -0xb8(%rbp)
leaq -0x308(%rbp), %rdi
callq 0x41f0
movq -0xb8(%rbp), %rax
testb $0x1, 0x2710(%rax)
jne 0x4dfc
movq 0x22261(%rip), %rdi     # 0x26fb0
leaq 0x18330(%rip), %rsi     # 0x1d086
callq 0x4350
jmp 0x4d5d
movq -0xb8(%rbp), %rax
movq %rax, -0x10d8(%rbp)
cmpq $0x0, %rax
je 0x4d8e
movq -0x10d8(%rbp), %rdi
callq 0x16fe0
movq -0x10d8(%rbp), %rdi
movl $0x2748, %esi           # imm = 0x2748
callq 0x4370
movl $0x0, -0x4(%rbp)
movl $0x1, -0x2c4(%rbp)
jmp 0x4e54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x4e7f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x4ddb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x308(%rbp), %rdi
callq 0x41f0
testb $0x1, -0x309(%rbp)
jne 0x4de6
jmp 0x4df7
movq -0x10d0(%rbp), %rdi
movl $0x2748, %esi           # imm = 0x2748
callq 0x4370
jmp 0x4e7f
movq 0x221ad(%rip), %rdi     # 0x26fb0
leaq 0x18292(%rip), %rsi     # 0x1d09c
callq 0x4350
movq %rax, -0x10e0(%rbp)
jmp 0x4e18
movq -0x10e0(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x4350
movq %rax, -0x10e8(%rbp)
jmp 0x4e35
movq -0x10e8(%rbp), %rdi
leaq 0x182af(%rip), %rsi     # 0x1d0f2
callq 0x4350
jmp 0x4e4a
movl $0x0, -0x2c4(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x41f0
leaq -0x2c0(%rbp), %rdi
callq 0x40b0
movl -0x2c4(%rbp), %eax
testl %eax, %eax
je 0x4e7d
jmp 0x4e78
jmp 0x6267
jmp 0x4eec
leaq -0x2e8(%rbp), %rdi
callq 0x41f0
leaq -0x2c0(%rbp), %rdi
callq 0x40b0
jmp 0x6273
movl $0x2748, %edi           # imm = 0x2748
callq 0x4360
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x10f0(%rbp)
callq 0x12f90
jmp 0x4eba
movq -0x10f0(%rbp), %rax
movq %rax, -0xb8(%rbp)
jmp 0x4eec
movq -0x10f0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
movl $0x2748, %esi           # imm = 0x2748
callq 0x4370
jmp 0x6273
jmp 0x4eee
movl $0xa8, %edi
callq 0x4360
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x10f8(%rbp)
movq -0xb8(%rbp), %rsi
callq 0x11530
jmp 0x4f13
movq -0x10f8(%rbp), %rax
movq %rax, -0x318(%rbp)
movl $0xd0, %edi
callq 0x4360
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x1100(%rbp)
movl -0x24(%rbp), %esi
movl -0x60(%rbp), %edx
movq -0xb8(%rbp), %rcx
movq -0x318(%rbp), %r8
callq 0xd920
jmp 0x4f53
movq -0x1100(%rbp), %rax
movq %rax, -0x320(%rbp)
movl $0x18, %edi
callq 0x4360
movq %rax, -0x1118(%rbp)
movb $0x1, -0x35b(%rbp)
movslq -0x60(%rbp), %rax
movq %rax, -0x1110(%rbp)
movslq -0x24(%rbp), %rax
movq %rax, -0x1108(%rbp)
leaq -0x358(%rbp), %rdi
callq 0xbdd0
jmp 0x4f9d
leaq -0x359(%rbp), %rdi
movq %rdi, -0x1120(%rbp)
callq 0x6370
movq -0x1108(%rbp), %rsi
movq -0x1120(%rbp), %rcx
leaq -0x340(%rbp), %rdi
leaq -0x358(%rbp), %rdx
callq 0x6390
jmp 0x4fd3
leaq -0x35a(%rbp), %rdi
movq %rdi, -0x1128(%rbp)
callq 0x6410
movq -0x1118(%rbp), %rdi
movq -0x1110(%rbp), %rsi
movq -0x1128(%rbp), %rcx
leaq -0x340(%rbp), %rdx
callq 0x6430
jmp 0x5009
movb $0x0, -0x35b(%rbp)
leaq -0x35a(%rbp), %rdi
callq 0x64b0
leaq -0x340(%rbp), %rdi
callq 0x64d0
leaq -0x359(%rbp), %rdi
callq 0x6530
movq -0x1118(%rbp), %rax
movq %rax, -0x328(%rbp)
leaq -0x378(%rbp), %rdi
callq 0x6550
movl -0x24(%rbp), %eax
imull -0x60(%rbp), %eax
cltd
idivl -0x88(%rbp)
movl %eax, -0x37c(%rbp)
movl $0x0, -0x380(%rbp)
movl $0x0, -0x384(%rbp)
movl $0x0, -0x388(%rbp)
movl -0x388(%rbp), %eax
cmpl -0x88(%rbp), %eax
jge 0x535b
movl -0x380(%rbp), %eax
movl %eax, -0x38c(%rbp)
movl -0x384(%rbp), %eax
movl %eax, -0x390(%rbp)
movl $0x0, -0x394(%rbp)
movl -0x38c(%rbp), %ecx
xorl %eax, %eax
cmpl -0x60(%rbp), %ecx
movb %al, -0x1129(%rbp)
jge 0x50dc
movl -0x394(%rbp), %eax
cmpl -0x37c(%rbp), %eax
setl %al
movb %al, -0x1129(%rbp)
movb -0x1129(%rbp), %al
testb $0x1, %al
jne 0x50eb
jmp 0x5235
jmp 0x50ed
movl -0x390(%rbp), %ecx
xorl %eax, %eax
cmpl -0x24(%rbp), %ecx
movb %al, -0x112a(%rbp)
jge 0x5115
movl -0x394(%rbp), %eax
cmpl -0x37c(%rbp), %eax
setl %al
movb %al, -0x112a(%rbp)
movb -0x112a(%rbp), %al
testb $0x1, %al
jne 0x5124
jmp 0x5209
movl -0x394(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x394(%rbp)
cmpl -0x37c(%rbp), %eax
jne 0x51f5
jmp 0x5209
movq -0x10f8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
movl $0xa8, %esi
callq 0x4370
jmp 0x6273
movq -0x1100(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
movl $0xd0, %esi
callq 0x4370
jmp 0x6273
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x51d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x51c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x35a(%rbp), %rdi
callq 0x64b0
leaq -0x340(%rbp), %rdi
callq 0x64d0
leaq -0x359(%rbp), %rdi
callq 0x6530
testb $0x1, -0x35b(%rbp)
jne 0x51df
jmp 0x51f0
movq -0x1118(%rbp), %rdi
movl $0x18, %esi
callq 0x4370
jmp 0x6273
movl -0x390(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x390(%rbp)
jmp 0x50ed
movl -0x394(%rbp), %eax
cmpl -0x37c(%rbp), %eax
jge 0x5230
movl $0x0, -0x390(%rbp)
movl -0x38c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38c(%rbp)
jmp 0x50b4
cmpl $0x0, -0x388(%rbp)
jle 0x52f7
movq %rsp, %rax
leaq -0x328(%rbp), %rcx
movq %rcx, 0x20(%rax)
leaq -0x320(%rbp), %rcx
movq %rcx, 0x18(%rax)
leaq -0x37c(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq -0x60(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq -0x24(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x99c(%rip), %rsi      # 0x48e0
leaq -0x3a0(%rbp), %rdi
leaq -0x380(%rbp), %rdx
leaq -0x38c(%rbp), %rcx
leaq -0x384(%rbp), %r8
leaq -0x390(%rbp), %r9
callq 0x65a0
jmp 0x52a6
leaq -0x378(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0x6570
jmp 0x52bb
leaq -0x3a0(%rbp), %rdi
callq 0x66c0
jmp 0x52f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x6259
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x3a0(%rbp), %rdi
callq 0x66c0
jmp 0x6259
movl -0x390(%rbp), %eax
addl $0x1, %eax
cmpl -0x24(%rbp), %eax
jne 0x5320
movl $0x0, -0x390(%rbp)
movl -0x38c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38c(%rbp)
jmp 0x532f
movl -0x390(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x390(%rbp)
movl -0x38c(%rbp), %eax
movl %eax, -0x380(%rbp)
movl -0x390(%rbp), %eax
movl %eax, -0x384(%rbp)
movl -0x388(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x388(%rbp)
jmp 0x5080
movl -0x24(%rbp), %eax
imull -0x60(%rbp), %eax
cltd
idivl -0x88(%rbp)
cmpl $0x0, %edx
je 0x5408
movq %rsp, %rax
leaq -0x328(%rbp), %rcx
movq %rcx, 0x20(%rax)
leaq -0x320(%rbp), %rcx
movq %rcx, 0x18(%rax)
leaq -0x37c(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq -0x60(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq -0x24(%rbp), %r9
movq %r9, (%rax)
leaq -0xacc(%rip), %rsi      # 0x48e0
leaq -0x3a8(%rbp), %rdi
leaq -0x380(%rbp), %rdx
leaq -0x384(%rbp), %r8
callq 0x65a0
jmp 0x53c8
leaq -0x378(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x6570
jmp 0x53dd
leaq -0x3a8(%rbp), %rdi
callq 0x66c0
jmp 0x5408
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x3a8(%rbp), %rdi
callq 0x66c0
jmp 0x6259
movl $0x0, -0x3ac(%rbp)
leaq -0x3ac(%rbp), %rax
movq %rax, -0x3c0(%rbp)
leaq 0x6429(%rip), %rsi      # 0xb850
leaq -0x3b8(%rbp), %rdi
leaq -0x3c0(%rbp), %rdx
leaq -0x37c(%rbp), %rcx
callq 0x66f0
jmp 0x5443
movl $0x0, -0x3c4(%rbp)
movl -0x3c4(%rbp), %ecx
xorl %eax, %eax
cmpl -0x60(%rbp), %ecx
movb %al, -0x112b(%rbp)
jge 0x5475
movl -0x3ac(%rbp), %eax
cmpl -0x37c(%rbp), %eax
setl %al
movb %al, -0x112b(%rbp)
movb -0x112b(%rbp), %al
testb $0x1, %al
jne 0x5484
jmp 0x5580
movl $0x0, -0x3c8(%rbp)
movl -0x3c8(%rbp), %ecx
xorl %eax, %eax
cmpl -0x24(%rbp), %ecx
movb %al, -0x112c(%rbp)
jge 0x54b6
movl -0x3ac(%rbp), %eax
cmpl -0x37c(%rbp), %eax
setl %al
movb %al, -0x112c(%rbp)
movb -0x112c(%rbp), %al
testb $0x1, %al
jne 0x54c5
jmp 0x556a
movq -0x320(%rbp), %rsi
cvtsi2sdl -0x60(%rbp), %xmm0
cvtsi2sdl -0x3c4(%rbp), %xmm1
movsd 0x17b27(%rip), %xmm2    # 0x1d008
addsd %xmm2, %xmm1
subsd %xmm1, %xmm0
cvtsi2sdl -0x3c8(%rbp), %xmm1
addsd %xmm2, %xmm1
leaq -0x3e0(%rbp), %rdi
callq 0xef40
jmp 0x5503
movq -0x328(%rbp), %rdi
movslq -0x3c4(%rbp), %rsi
callq 0x6280
movq %rax, %rdi
movslq -0x3c8(%rbp), %rsi
callq 0x62a0
movq %rax, %rdi
leaq -0x3e0(%rbp), %rsi
callq 0xc090
jmp 0x5536
movl -0x3ac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3ac(%rbp)
movl -0x3c8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c8(%rbp)
jmp 0x548e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x624d
jmp 0x556c
movl -0x3c4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c4(%rbp)
jmp 0x544d
leaq -0x378(%rbp), %rax
movq %rax, -0x3e8(%rbp)
movq -0x3e8(%rbp), %rdi
callq 0x67c0
movq %rax, -0x3f0(%rbp)
movq -0x3e8(%rbp), %rdi
callq 0x67f0
movq %rax, -0x3f8(%rbp)
leaq -0x3f0(%rbp), %rdi
leaq -0x3f8(%rbp), %rsi
callq 0x6820
testb $0x1, %al
jne 0x55cd
jmp 0x55fe
leaq -0x3f0(%rbp), %rdi
callq 0x6860
movq %rax, -0x400(%rbp)
movq -0x400(%rbp), %rdi
callq 0x4580
jmp 0x55ee
jmp 0x55f0
leaq -0x3f0(%rbp), %rdi
callq 0x6880
jmp 0x55b4
leaq -0x3b8(%rbp), %rdi
callq 0x4580
jmp 0x560c
movl $0x0, -0x404(%rbp)
leaq -0x428(%rbp), %rdi
callq 0x4490
movb $0x1, -0x429(%rbp)
movb -0x429(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x58a5
movl -0x404(%rbp), %esi
leaq -0x450(%rbp), %rdi
callq 0x68a0
jmp 0x5654
leaq -0x428(%rbp), %rdi
movq %rdi, -0x1138(%rbp)
leaq -0x450(%rbp), %rsi
movq %rsi, -0x1140(%rbp)
callq 0x4430
movq -0x1140(%rbp), %rdi
callq 0x41f0
movq -0x1138(%rbp), %rdx
leaq 0x17a8c(%rip), %rsi     # 0x1d11b
leaq -0x698(%rbp), %rdi
callq 0x6a10
jmp 0x569d
leaq 0x17a1a(%rip), %rdx     # 0x1d0be
leaq -0x678(%rbp), %rdi
leaq -0x698(%rbp), %rsi
callq 0x69c0
jmp 0x56b9
leaq -0x658(%rbp), %rdi
leaq -0x678(%rbp), %rsi
movl $0x8, %edx
callq 0x4520
jmp 0x56d3
leaq -0x678(%rbp), %rdi
callq 0x41f0
leaq -0x698(%rbp), %rdi
callq 0x41f0
leaq 0x17a29(%rip), %rsi     # 0x1d11b
leaq -0x8e0(%rbp), %rdi
leaq -0x428(%rbp), %rdx
callq 0x6a10
jmp 0x5707
leaq 0x179b5(%rip), %rdx     # 0x1d0c3
leaq -0x8c0(%rbp), %rdi
leaq -0x8e0(%rbp), %rsi
callq 0x69c0
jmp 0x5723
leaq -0x8a0(%rbp), %rdi
leaq -0x8c0(%rbp), %rsi
movl $0x8, %edx
callq 0x4520
jmp 0x573d
leaq -0x8c0(%rbp), %rdi
callq 0x41f0
leaq -0x8e0(%rbp), %rdi
callq 0x41f0
movq -0x658(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x658(%rbp,%rax), %rdi
callq 0x4570
movb %al, -0x1141(%rbp)
jmp 0x5775
movb -0x1141(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x1142(%rbp)
jne 0x57b8
jmp 0x578a
movq -0x8a0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x8a0(%rbp,%rax), %rdi
callq 0x4570
movb %al, -0x1143(%rbp)
jmp 0x57aa
movb -0x1143(%rbp), %al
movb %al, -0x1142(%rbp)
jmp 0x57b8
movb -0x1142(%rbp), %al
andb $0x1, %al
movb %al, -0x429(%rbp)
leaq -0x8a0(%rbp), %rdi
callq 0x40b0
leaq -0x658(%rbp), %rdi
callq 0x40b0
movl -0x404(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x404(%rbp)
jmp 0x5629
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x6241
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5829
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x678(%rbp), %rdi
callq 0x41f0
leaq -0x698(%rbp), %rdi
callq 0x41f0
jmp 0x6241
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5894
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x586e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x8c0(%rbp), %rdi
callq 0x41f0
leaq -0x8e0(%rbp), %rdi
callq 0x41f0
jmp 0x5894
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x8a0(%rbp), %rdi
callq 0x40b0
leaq -0x658(%rbp), %rdi
callq 0x40b0
jmp 0x6241
leaq 0x1783d(%rip), %rsi     # 0x1d0e9
leaq -0xb20(%rbp), %rdi
leaq -0x428(%rbp), %rdx
callq 0x6a10
jmp 0x58c1
leaq 0x17aab(%rip), %rdx     # 0x1d373
leaq -0xb00(%rbp), %rdi
leaq -0xb20(%rbp), %rsi
callq 0x69c0
jmp 0x58dd
leaq -0xae0(%rbp), %rdi
leaq -0xb00(%rbp), %rsi
movl $0x10, %edx
callq 0x4650
jmp 0x58f7
leaq -0xb00(%rbp), %rdi
callq 0x41f0
leaq -0xb20(%rbp), %rdi
callq 0x41f0
movq -0xb8(%rbp), %rsi
leaq -0xb40(%rbp), %rdi
callq 0x17010
jmp 0x5924
leaq -0xae0(%rbp), %rdi
leaq -0xb40(%rbp), %rsi
callq 0x4320
jmp 0x5939
leaq -0xb40(%rbp), %rdi
callq 0x41f0
movq 0x21664(%rip), %rdi     # 0x26fb0
leaq 0x17775(%rip), %rsi     # 0x1d0c8
callq 0x4350
movq %rax, -0x1150(%rbp)
jmp 0x5961
movq -0x1150(%rbp), %rdi
leaq -0x428(%rbp), %rsi
callq 0x4320
movq %rax, -0x1158(%rbp)
jmp 0x597d
movq -0x1158(%rbp), %rdi
leaq 0x17763(%rip), %rsi     # 0x1d0ee
callq 0x4350
jmp 0x5992
leaq -0xb61(%rbp), %rdi
movq %rdi, -0x1160(%rbp)
callq 0x45e0
movq -0x1160(%rbp), %rdx
leaq 0x1770c(%rip), %rsi     # 0x1d0bf
leaq -0xb60(%rbp), %rdi
callq 0x62c0
jmp 0x59c1
leaq -0xb60(%rbp), %rdi
callq 0xac80
movl %eax, -0x1164(%rbp)
jmp 0x59d5
leaq -0xb60(%rbp), %rdi
callq 0x41f0
leaq -0xb61(%rbp), %rdi
callq 0x43c0
movl -0x1164(%rbp), %eax
cmpl $0x0, %eax
je 0x5e22
leaq 0x17718(%rip), %rsi     # 0x1d11b
leaq -0xda8(%rbp), %rdi
leaq -0x428(%rbp), %rdx
callq 0x6a10
jmp 0x5a18
leaq 0x1769f(%rip), %rdx     # 0x1d0be
leaq -0xd88(%rbp), %rdi
leaq -0xda8(%rbp), %rsi
callq 0x69c0
jmp 0x5a34
leaq -0xd68(%rbp), %rdi
leaq -0xd88(%rbp), %rsi
movl $0x4, %edx
callq 0x4650
jmp 0x5a4e
leaq -0xd88(%rbp), %rdi
callq 0x41f0
leaq -0xda8(%rbp), %rdi
callq 0x41f0
movl -0x24(%rbp), %esi
movl -0x60(%rbp), %edx
leaq -0xdd8(%rbp), %rdi
leaq -0xd68(%rbp), %rcx
callq 0x1b6d0
jmp 0x5a81
movslq -0x24(%rbp), %rax
leaq (%rax,%rax,2), %rax
movq %rax, -0x1178(%rbp)
leaq -0xdf1(%rbp), %rdi
movq %rdi, -0x1170(%rbp)
callq 0x6b20
movq -0x1178(%rbp), %rsi
movq -0x1170(%rbp), %rdx
leaq -0xdf0(%rbp), %rdi
callq 0x6b40
jmp 0x5abf
leaq -0xdf1(%rbp), %rdi
callq 0x6bb0
movl $0x0, -0xdf8(%rbp)
movl -0xdf8(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0x5d3e
movl $0x0, -0xdfc(%rbp)
movl -0xdfc(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x5ced
movq -0x328(%rbp), %rdi
movslq -0xdf8(%rbp), %rsi
callq 0x6280
movq %rax, %rdi
movslq -0xdfc(%rbp), %rsi
callq 0x62a0
movq 0x10(%rax), %rcx
movq %rcx, -0xe10(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0xe20(%rbp)
cvttsd2si -0xe20(%rbp), %eax
movb %al, -0x1189(%rbp)
movslq -0xdfc(%rbp), %rax
leaq (%rax,%rax,2), %rsi
leaq -0xdf0(%rbp), %rdi
movq %rdi, -0x1188(%rbp)
callq 0x6bd0
movb -0x1189(%rbp), %cl
movq -0x1188(%rbp), %rdi
movb %cl, (%rax)
cvttsd2si -0xe18(%rbp), %eax
movb %al, -0x117a(%rbp)
movslq -0xdfc(%rbp), %rax
leaq 0x1(%rax,%rax,2), %rsi
callq 0x6bd0
movb -0x117a(%rbp), %cl
movb %cl, (%rax)
cvttsd2si -0xe10(%rbp), %eax
movb %al, -0x1179(%rbp)
movslq -0xdfc(%rbp), %rax
imulq $0x3, %rax, %rsi
addq $0x2, %rsi
leaq -0xdf0(%rbp), %rdi
callq 0x6bd0
movb -0x1179(%rbp), %cl
movb %cl, (%rax)
movl -0xdfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdfc(%rbp)
jmp 0x5aee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5c01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xb00(%rbp), %rdi
callq 0x41f0
leaq -0xb20(%rbp), %rdi
callq 0x41f0
jmp 0x6241
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x6235
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xb40(%rbp), %rdi
callq 0x41f0
jmp 0x6235
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5c66
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xb60(%rbp), %rdi
callq 0x41f0
leaq -0xb61(%rbp), %rdi
callq 0x43c0
jmp 0x6235
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5db1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5cae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xd88(%rbp), %rdi
callq 0x41f0
leaq -0xda8(%rbp), %rdi
callq 0x41f0
jmp 0x5db1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5da5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xdf1(%rbp), %rdi
callq 0x6bb0
jmp 0x5da5
leaq -0xdf0(%rbp), %rdi
callq 0x6bf0
movq %rax, %rsi
movslq -0x24(%rbp), %rdx
leaq -0xdd8(%rbp), %rdi
callq 0x1bb30
jmp 0x5d0e
jmp 0x5d10
movl -0xdf8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdf8(%rbp)
jmp 0x5ad5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xdf0(%rbp), %rdi
callq 0x6c10
jmp 0x5da5
movq 0x2126b(%rip), %rdi     # 0x26fb0
leaq 0x173aa(%rip), %rsi     # 0x1d0f6
callq 0x4350
movq %rax, -0x1198(%rbp)
jmp 0x5d5a
movq -0x1198(%rbp), %rdi
leaq -0x428(%rbp), %rsi
callq 0x4320
movq %rax, -0x11a0(%rbp)
jmp 0x5d76
movq -0x11a0(%rbp), %rdi
leaq 0x1739e(%rip), %rsi     # 0x1d122
callq 0x4350
jmp 0x5d8b
leaq -0xdf0(%rbp), %rdi
callq 0x6c10
leaq -0xd68(%rbp), %rdi
callq 0x44f0
jmp 0x5e07
leaq -0xd68(%rbp), %rdi
callq 0x44f0
movl -0x5c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x6235
movq -0x58(%rbp), %rdi
callq 0x4110
movq %rax, -0xe28(%rbp)
movq -0xe28(%rbp), %rsi
movq 0x211d1(%rip), %rdi     # 0x26fb0
callq 0x4350
movq %rax, -0x11a8(%rbp)
jmp 0x5ded
movq -0x11a8(%rbp), %rdi
movq 0x2116d(%rip), %rsi     # 0x26f68
callq 0x43a0
jmp 0x5e02
callq 0x4540
jmp 0x6119
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
callq 0x4540
jmp 0x6235
leaq 0x172f2(%rip), %rsi     # 0x1d11b
leaq -0x1068(%rbp), %rdi
leaq -0x428(%rbp), %rdx
callq 0x6a10
jmp 0x5e3e
leaq 0x1727e(%rip), %rdx     # 0x1d0c3
leaq -0x1048(%rbp), %rdi
leaq -0x1068(%rbp), %rsi
callq 0x69c0
jmp 0x5e5a
leaq -0x1028(%rbp), %rdi
leaq -0x1048(%rbp), %rsi
movl $0x10, %edx
callq 0x4650
jmp 0x5e74
leaq -0x1048(%rbp), %rdi
callq 0x41f0
leaq -0x1068(%rbp), %rdi
callq 0x41f0
leaq 0x17298(%rip), %rsi     # 0x1d12b
leaq -0x1028(%rbp), %rdi
callq 0x4350
movq %rax, -0x11b0(%rbp)
jmp 0x5ea8
movq -0x11b0(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x45b0
movq %rax, -0x11b8(%rbp)
jmp 0x5ec0
movq -0x11b8(%rbp), %rdi
movl $0x20, %esi
callq 0x4420
movq %rax, -0x11c0(%rbp)
jmp 0x5eda
movq -0x11c0(%rbp), %rdi
movl -0x60(%rbp), %esi
callq 0x45b0
movq %rax, -0x11c8(%rbp)
jmp 0x5ef2
movq -0x11c8(%rbp), %rdi
movl $0x20, %esi
callq 0x4420
movq %rax, -0x11d0(%rbp)
jmp 0x5f0c
movq -0x11d0(%rbp), %rdi
movl $0xff, %esi
callq 0x45b0
movq %rax, -0x11d8(%rbp)
jmp 0x5f26
movq -0x11d8(%rbp), %rdi
movl $0xa, %esi
callq 0x4420
jmp 0x5f39
movl $0x0, -0x106c(%rbp)
movl -0x106c(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0x60c0
movl $0x0, -0x1070(%rbp)
movl -0x1070(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x60aa
movq -0x328(%rbp), %rdi
movslq -0x106c(%rbp), %rsi
callq 0x6280
movq %rax, %rdi
movslq -0x1070(%rbp), %rsi
callq 0x62a0
movq 0x10(%rax), %rcx
movq %rcx, -0x1080(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x1090(%rbp)
cvttsd2si -0x1090(%rbp), %esi
leaq -0x1028(%rbp), %rdi
callq 0x45b0
movq %rax, -0x11e0(%rbp)
jmp 0x5fbf
movq -0x11e0(%rbp), %rdi
movl $0x20, %esi
callq 0x4420
movq %rax, -0x11e8(%rbp)
jmp 0x5fd9
movq -0x11e8(%rbp), %rdi
cvttsd2si -0x1088(%rbp), %esi
callq 0x45b0
movq %rax, -0x11f0(%rbp)
jmp 0x5ff6
movq -0x11f0(%rbp), %rdi
movl $0x20, %esi
callq 0x4420
movq %rax, -0x11f8(%rbp)
jmp 0x6010
movq -0x11f8(%rbp), %rdi
cvttsd2si -0x1080(%rbp), %esi
callq 0x45b0
movq %rax, -0x1200(%rbp)
jmp 0x602d
movq -0x1200(%rbp), %rdi
movl $0xa, %esi
callq 0x4420
jmp 0x6040
jmp 0x6042
movl -0x1070(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1070(%rbp)
jmp 0x5f5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x607c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x1048(%rbp), %rdi
callq 0x41f0
leaq -0x1068(%rbp), %rdi
callq 0x41f0
jmp 0x6235
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x1028(%rbp), %rdi
callq 0x44f0
jmp 0x6235
jmp 0x60ac
movl -0x106c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x106c(%rbp)
jmp 0x5f43
movq 0x20ee9(%rip), %rdi     # 0x26fb0
leaq 0x17061(%rip), %rsi     # 0x1d12f
callq 0x4350
movq %rax, -0x1208(%rbp)
jmp 0x60dc
movq -0x1208(%rbp), %rdi
leaq -0x428(%rbp), %rsi
callq 0x4320
movq %rax, -0x1210(%rbp)
jmp 0x60f8
movq -0x1210(%rbp), %rdi
leaq 0x17054(%rip), %rsi     # 0x1d15a
callq 0x4350
jmp 0x610d
leaq -0x1028(%rbp), %rdi
callq 0x44f0
movq -0xb8(%rbp), %rax
movq %rax, -0x1218(%rbp)
cmpq $0x0, %rax
je 0x614a
movq -0x1218(%rbp), %rdi
callq 0x16fe0
movq -0x1218(%rbp), %rdi
movl $0x2748, %esi           # imm = 0x2748
callq 0x4370
movq -0x318(%rbp), %rax
movq %rax, -0x1220(%rbp)
cmpq $0x0, %rax
je 0x617b
movq -0x1220(%rbp), %rdi
callq 0x12410
movq -0x1220(%rbp), %rdi
movl $0xa8, %esi
callq 0x4370
movq -0x320(%rbp), %rax
movq %rax, -0x1228(%rbp)
cmpq $0x0, %rax
je 0x61ac
movq -0x1228(%rbp), %rdi
callq 0xef00
movq -0x1228(%rbp), %rdi
movl $0xd0, %esi
callq 0x4370
movq -0x328(%rbp), %rax
movq %rax, -0x1230(%rbp)
cmpq $0x0, %rax
je 0x61dd
movq -0x1230(%rbp), %rdi
callq 0x6c70
movq -0x1230(%rbp), %rdi
movl $0x18, %esi
callq 0x4370
movq 0x20dcc(%rip), %rdi     # 0x26fb0
leaq 0x16f78(%rip), %rsi     # 0x1d163
callq 0x4350
jmp 0x61f2
movl $0x0, -0x4(%rbp)
movl $0x1, -0x2c4(%rbp)
leaq -0xae0(%rbp), %rdi
callq 0x44f0
leaq -0x428(%rbp), %rdi
callq 0x41f0
leaq -0x3b8(%rbp), %rdi
callq 0x66c0
leaq -0x378(%rbp), %rdi
callq 0x6cd0
jmp 0x6267
leaq -0xae0(%rbp), %rdi
callq 0x44f0
leaq -0x428(%rbp), %rdi
callq 0x41f0
leaq -0x3b8(%rbp), %rdi
callq 0x66c0
leaq -0x378(%rbp), %rdi
callq 0x6cd0
jmp 0x6273
movl -0x4(%rbp), %eax
addq $0x1260, %rsp           # imm = 0x1260
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x45d0
nopl (%rax)