// File: mdpkh[P]retro6k/src/main.cpp
// Function: DoPickFile(filetype, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void DoPickFile(filetype ft, std::string &path)
{
	SDL_Surface* winbuffer = SDL_CreateRGBSurfaceWithFormat(
		0,
		480,
		config.screen.pixheight * 109,
		8,
		SDL_PIXELFORMAT_INDEX8);
	SDL_SetSurfaceBlendMode(winbuffer, SDL_BLENDMODE_BLEND);
	SDL_SetColorKey(winbuffer, true, 0xf9);
	SDL_Surface* mwsurface = SDL_GetWindowSurface(mainwindow);
	SDL_SetSurfaceBlendMode(mwsurface, SDL_BLENDMODE_NONE);
	SDL_Surface* restorescreen = SDL_CreateRGBSurfaceWithFormat(
		0,
		winbuffer->w,
		winbuffer->h,
		mwsurface->format->BitsPerPixel,
		SDL_MasksToPixelFormatEnum(
			mwsurface->format->BitsPerPixel,
			mwsurface->format->Rmask,
			mwsurface->format->Gmask,
			mwsurface->format->Bmask,
			mwsurface->format->Amask));
	if (!winbuffer || !restorescreen)
	{
		SDL_Log("Could not create menu display buffers: %s", SDL_GetError());
		return;
	}
	SDL_SetSurfaceBlendMode(restorescreen, SDL_BLENDMODE_NONE);
	int winmacrox, winmacroy;
	const char* titles[4] = {
		"Choose a File\x85",
		"Choose a ROM Chip\x85",
		"Choose a Cartridge\x85",
		"Choose a Cartridge Save File\x85",
	};
	const char* exts[4] = {
		"",
		".rom",
		".r6kcart",
		".r6ksave",
	};
	char* wintitle;
	char* filterext;
	bool ignoreext = false;
	std::filesystem::path browsedir;
	switch (ft)
	{
	case filetype::FT_ROM:
		wintitle = (char*)titles[1];
		filterext = (char*)exts[1];
		for (auto& path : config.sessionpath.rompath)
		{
			if (std::filesystem::exists(path))
			{
				browsedir = std::filesystem::canonical(path);
				break;
			}
		}
		winmacrox = 4;
		winmacroy = 4;
		break;
	case filetype::FT_CART:
		wintitle = (char*)titles[2];
		filterext = (char*)exts[2];
		for (auto& path : config.sessionpath.cartpath)
		{
			if (std::filesystem::exists(path))
			{
				browsedir = std::filesystem::canonical(path);
				break;
			}
		}
		winmacrox = 2;
		winmacroy = 3;
		break;
	case filetype::FT_CARTSAVE:
		wintitle = (char*)titles[3];
		filterext = (char*)exts[3];
		for (auto& path : config.sessionpath.savepath)
		{
			if (std::filesystem::exists(path))
			{
				browsedir = std::filesystem::canonical(path);
				break;
			}
		}
		winmacrox = 6;
		winmacroy = 5;
		break;
	default:
		wintitle = (char*)titles[0];
		filterext = (char*)exts[0];
		ignoreext = true;
		browsedir = std::filesystem::canonical(".");
		winmacrox = 4;
		winmacroy = 4;
	}
	int mww, mwh;
	SDL_GetWindowSize(mainwindow, &mww, &mwh);
	SDL_Rect winpos;
	winpos.w = winbuffer->w;
	winpos.h = winbuffer->h;
	winpos.x = (winmacrox * (mww - winpos.w)) >> 3;
	winpos.y = (winmacroy * (mwh - winpos.h)) >> 3;
	SetHWPalette(winbuffer->format->palette);
	SDL_UpdateWindowSurface(mainwindow);
	SDL_BlitSurface(mwsurface, &winpos, restorescreen, NULL);
	PaintWindow(winbuffer, 0xff, 0x39, wintitle, 0xff);
	const char* keyshint = "Ctrl+D: ChDir  \x97  Ctrl+E: ExtFilter on/off  \x97  Esc: Cancel";
	int tx0 = (winpos.w - TextWidth(keyshint)) >> 1;
	DrawText(keyshint, tx0, winpos.h - 20, 0x31, 0xff, winbuffer);
	int displaylines = (winpos.h - 60) / 18;
	int filey0;
	filey0 = (winpos.h - displaylines * 18 + 20) >> 1;
	const int filex0 = 16;
	const int prevx0 = winpos.w - 80;
	DrawTextCX("Loading directory listing\x85", filex0, filey0 + 18 * ((displaylines - 1) >> 1), 0x07, 0xff, winbuffer);
	SDL_Rect dstanimrect = winpos;
	SDL_Rect srcanimrect = { 0, 0, winpos.w, winpos.h };
	for (int t = 1; t <= 8; ++t)
	{
		SDL_SetSurfaceAlphaMod(winbuffer, t * 31);
		dstanimrect.w = winpos.w * t / 8;
		srcanimrect.w = dstanimrect.w;
		dstanimrect.x = (winmacrox * (mww - dstanimrect.w)) >> 3;
		SDL_BlitSurface(restorescreen, NULL, mwsurface, &winpos);
		SDL_BlitSurface(winbuffer, &srcanimrect, mwsurface, &dstanimrect);
		SDL_UpdateWindowSurface(mainwindow);
		SDL_Delay(16);
	}
	bool relistfiles = true;
	std::vector<std::string> filelist;
	std::vector<std::filesystem::path> pathlist;
	int filesel = 0;
	int displaystart = 0;
	while (true)
	{
		bool repaintfiles = false;
		SDL_Event event;
		while (SDL_PollEvent(&event))
		{
			SDL_Event newevent;
			switch (event.type)
			{
			case SDL_KEYDOWN:
				if (event.key.keysym.mod & KMOD_CTRL)
				{
					switch (event.key.keysym.sym)
					{
					case SDLK_d:
						UIBeepUnavailable();
						break;
					case SDLK_e:
						UIBeepUnavailable();
						break;
					}
				}
				else
				{
					int nfiles = (int)filelist.size();
					switch (event.key.keysym.sym)
					{
					case SDLK_HOME:
						if (filesel == 0)
						{
							UIBeepUnavailable();
						}
						else
						{
							UIBeepMoveSel();
							displaystart = 0;
							filesel = 0;
							repaintfiles = true;
						}
						break;
					case SDLK_END:
						if (filesel + 1 == nfiles)
						{
							UIBeepMoveSel();
						}
						else
						{
							UIBeepMoveSel();
							displaystart = nfiles - displaylines;
							filesel = nfiles - 1;
							if (displaystart < 0)
								displaystart = 0;
							repaintfiles = true;
						}
						break;
					case SDLK_PAGEUP:
						if (displaystart == 0 || displaylines >= nfiles)
						{
							if (filesel == 0)
							{
								UIBeepUnavailable();
							}
							else
							{
								UIBeepMoveSel();
								filesel = 0;
								repaintfiles = true;
							}
						}
						else
						{
							UIBeepMoveSel();
							displaystart -= displaylines;
							if (displaystart < 0)
								displaystart = 0;
							int lastvisible = displaystart + displaylines - 1;
							if (filesel > lastvisible)
								filesel = lastvisible;
							repaintfiles = true;
						}
						break;
					case SDLK_PAGEDOWN:
						if (displaystart + displaylines == nfiles || displaylines >= nfiles)
						{
							if (filesel == nfiles - 1)
							{
								UIBeepUnavailable();
							}
							else
							{
								filesel = nfiles - 1;
								repaintfiles = true;
							}
						}
						else
						{
							UIBeepMoveSel();
							displaystart += displaylines;
							if (displaystart + displaylines > nfiles)
								displaystart = nfiles - displaylines;
							if (filesel < displaystart)
								filesel = displaystart;
							repaintfiles = true;
						}
						break;
					case SDLK_UP:
						if (filesel == 0)
						{
							UIBeepUnavailable();
						}
						else
						{
							UIBeepMoveSel();
							--filesel;
							if (filesel < displaystart)
								displaystart = filesel;
							repaintfiles = true;
						}
						break;
					case SDLK_DOWN:
						if (filesel == nfiles - 1)
						{
							UIBeepUnavailable();
						}
						else
						{
							UIBeepMoveSel();
							++filesel;
							if (filesel >= displaystart + displaylines)
								displaystart = filesel - displaylines + 1;
							repaintfiles = true;
						}
						break;
					case SDLK_RETURN:
					case SDLK_KP_ENTER:
						path = pathlist[filesel].string();
						UIBeepTakeAction();
						goto exitpickfile;
					case SDLK_ESCAPE:
						path.clear();
						goto exitpickfile;
					}
				}
				break;
			case SDL_QUIT:
				newevent.type = SDL_QUIT;
				SDL_PushEvent(&newevent);
				goto exitpickfile;
			}
		}
		if (relistfiles)
		{
			filelist.clear();
			pathlist.clear();
			for (auto& entry: std::filesystem::directory_iterator(browsedir, std::filesystem::directory_options::skip_permission_denied))
			{
				if (entry.is_regular_file() && (ignoreext || cilstreq(entry.path().extension().string().c_str(), (const char*)filterext)))
				{
					filelist.push_back(entry.path().filename().string());
					pathlist.push_back(entry.path());
				}
			}
			repaintfiles = true;
		}
		if (repaintfiles)
		{
			SDL_Rect paintbox{filex0 - 9, filey0 - 1, prevx0 - filey0 + 9, 18 * displaylines + 2};
			{
				int x = filex0;
				DrawText("Location: ", x, 23, 0x31, 0xff, winbuffer);
				std::string loc = browsedir.string();
				DrawText(loc.c_str(), x, 23, 0x00, 0xff, winbuffer);
			}
			SDL_FillRect(winbuffer, &paintbox, 0xff);
			for (int i = 0, j = displaystart, ky = filey0; i < displaylines && j < filelist.size(); ++i, ++j, ky += 18)
			{
				if (filesel == j)
				{
					SDL_Rect selrect{ paintbox.x, ky - 1, paintbox.w, 18 };
					FillRoundedRect(winbuffer, selrect, 0x31);
					DrawTextCX(filelist[j].c_str(), filex0, ky, 0xff, 0x31, winbuffer);
				}
				else
				{
					DrawTextCX(filelist[j].c_str(), filex0, ky, 0x00, 0xff, winbuffer);
				}
			}
			if (filelist.size() == 0)
			{
				DrawTextCX("No files here!", filex0, filey0 + 18 * ((displaylines - 1) >> 1), 0x07, 0xff, winbuffer);
			}
			repaintfiles = false;
			SDL_BlitSurface(restorescreen, NULL, mwsurface, &winpos);
			SDL_BlitSurface(winbuffer, NULL, mwsurface, &winpos);
			SDL_UpdateWindowSurface(mainwindow);
		}
		SDL_Delay(16);
	}
exitpickfile:
	for (int t = 7; t > 0; --t)
	{
		SDL_SetSurfaceAlphaMod(winbuffer, t * 31);
		dstanimrect.h = winpos.h * t / 8;
		srcanimrect.h = dstanimrect.h;
		srcanimrect.y = winpos.h - dstanimrect.h;
		dstanimrect.y = (winmacroy * (mwh - dstanimrect.h)) >> 3;
		SDL_BlitSurface(restorescreen, NULL, mwsurface, &winpos);
		SDL_BlitSurface(winbuffer, &srcanimrect, mwsurface, &dstanimrect);
		SDL_UpdateWindowSurface(mainwindow);
		SDL_Delay(16);
	}
	SDL_BlitSurface(restorescreen, NULL, mwsurface, &winpos);
	SDL_FreeSurface(restorescreen);
	SDL_FreeSurface(winbuffer);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4c0, %rsp            # imm = 0x4C0
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
imull $0x6d, 0x219ab(%rip), %edx # 0x2d554
xorl %edi, %edi
movl $0x1e0, %esi            # imm = 0x1E0
movl $0x8, %ecx
movl $0x13000801, %r8d       # imm = 0x13000801
callq 0x70b0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x7330
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0xf9, %edx
callq 0x7560
movq 0x8257fc(%rip), %rdi    # 0x8313e8
callq 0x75a0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x7330
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x47c(%rbp)
movq -0x18(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x478(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movzbl 0x10(%rax), %eax
movl %eax, -0x474(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movzbl 0x10(%rax), %edi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x14(%rax), %esi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x18(%rax), %edx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x1c(%rax), %ecx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x20(%rax), %r8d
callq 0x7690
movl -0x47c(%rbp), %esi
movl -0x478(%rbp), %edx
movl -0x474(%rbp), %ecx
movl %eax, %r8d
xorl %edi, %edi
callq 0x70b0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xbc98
cmpq $0x0, -0x28(%rbp)
jne 0xbcb3
callq 0x7370
movq %rax, %rsi
leaq 0x17799(%rip), %rdi     # 0x23440
movb $0x0, %al
callq 0x75c0
jmp 0xd0e6
movq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x7330
movaps 0x2009b(%rip), %xmm0    # 0x2bd60
movaps %xmm0, -0x40(%rbp)
movaps 0x20080(%rip), %xmm0    # 0x2bd50
movaps %xmm0, -0x50(%rbp)
movaps 0x200a5(%rip), %xmm0    # 0x2bd80
movaps %xmm0, -0x60(%rbp)
movaps 0x2008a(%rip), %xmm0    # 0x2bd70
movaps %xmm0, -0x70(%rbp)
movb $0x0, -0x81(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x137e0
movl -0x4(%rbp), %eax
movl %eax, -0x480(%rbp)
testl %eax, %eax
je 0xbd31
jmp 0xbd0c
movl -0x480(%rbp), %eax
subl $0x1, %eax
je 0xbe4b
jmp 0xbd1d
movl -0x480(%rbp), %eax
subl $0x2, %eax
je 0xbf4b
jmp 0xc048
movq -0x48(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq 0x216d8(%rip), %rax     # 0x2d420
addq $0xc8, %rax
movq %rax, -0xb8(%rbp)
leaq 0x216c4(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
callq 0x12da0
movq %rax, -0xc0(%rbp)
leaq 0x216aa(%rip), %rdi     # 0x2d420
addq $0xc8, %rdi
callq 0x12d30
movq %rax, -0xc8(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0xbda5
jmp 0xbe38
leaq -0xc0(%rbp), %rdi
callq 0x12e40
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rdi
callq 0x12e10
movb %al, -0x481(%rbp)
jmp 0xbdcc
movb -0x481(%rbp), %al
testb $0x1, %al
jne 0xbdd8
jmp 0xbe25
movq -0xd0(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x7280
jmp 0xbded
leaq -0xb0(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x12e60
leaq -0x108(%rbp), %rdi
callq 0x12ed0
jmp 0xbe38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0xd107
jmp 0xbe27
leaq -0xc0(%rbp), %rdi
callq 0x12f00
jmp 0xbd89
movl $0x4, -0x2c(%rbp)
movl $0x4, -0x30(%rbp)
jmp 0xc0c7
movq -0x40(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq 0x215be(%rip), %rax     # 0x2d420
addq $0xe0, %rax
movq %rax, -0x110(%rbp)
leaq 0x215aa(%rip), %rdi     # 0x2d420
addq $0xe0, %rdi
callq 0x12da0
movq %rax, -0x118(%rbp)
leaq 0x21590(%rip), %rdi     # 0x2d420
addq $0xe0, %rdi
callq 0x12d30
movq %rax, -0x120(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0xbebc
jmp 0xbf38
leaq -0x118(%rbp), %rdi
callq 0x12e40
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
callq 0x12e10
movb %al, -0x482(%rbp)
jmp 0xbee3
movb -0x482(%rbp), %al
testb $0x1, %al
jne 0xbeef
jmp 0xbf25
movq -0x128(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x7280
jmp 0xbf04
leaq -0xb0(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x12e60
leaq -0x150(%rbp), %rdi
callq 0x12ed0
jmp 0xbf38
jmp 0xbf27
leaq -0x118(%rbp), %rdi
callq 0x12f00
jmp 0xbea3
movl $0x2, -0x2c(%rbp)
movl $0x3, -0x30(%rbp)
jmp 0xc0c7
movq -0x38(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq 0x214be(%rip), %rax     # 0x2d420
addq $0xf8, %rax
movq %rax, -0x158(%rbp)
leaq 0x214aa(%rip), %rdi     # 0x2d420
addq $0xf8, %rdi
callq 0x12da0
movq %rax, -0x160(%rbp)
leaq 0x21490(%rip), %rdi     # 0x2d420
addq $0xf8, %rdi
callq 0x12d30
movq %rax, -0x168(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x12dd0
testb $0x1, %al
jne 0xbfbc
jmp 0xc038
leaq -0x160(%rbp), %rdi
callq 0x12e40
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rdi
callq 0x12e10
movb %al, -0x483(%rbp)
jmp 0xbfe3
movb -0x483(%rbp), %al
testb $0x1, %al
jne 0xbfef
jmp 0xc025
movq -0x170(%rbp), %rsi
leaq -0x198(%rbp), %rdi
callq 0x7280
jmp 0xc004
leaq -0xb0(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x12e60
leaq -0x198(%rbp), %rdi
callq 0x12ed0
jmp 0xc038
jmp 0xc027
leaq -0x160(%rbp), %rdi
callq 0x12f00
jmp 0xbfa3
movl $0x6, -0x2c(%rbp)
movl $0x5, -0x30(%rbp)
jmp 0xc0c7
movq -0x50(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
movb $0x1, -0x81(%rbp)
leaq 0x1743d(%rip), %rsi     # 0x234a3
leaq -0x1e8(%rbp), %rdi
movl $0x2, %edx
callq 0x13820
jmp 0xc079
leaq -0x1c0(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x7280
jmp 0xc08e
leaq -0xb0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x12e60
leaq -0x1c0(%rbp), %rdi
callq 0x12ed0
leaq -0x1e8(%rbp), %rdi
callq 0x12ed0
movl $0x4, -0x2c(%rbp)
movl $0x4, -0x30(%rbp)
movq 0x82531a(%rip), %rdi    # 0x8313e8
leaq -0x1ec(%rbp), %rsi
leaq -0x1f0(%rbp), %rdx
callq 0x7170
jmp 0xc0e3
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x1f8(%rbp)
movq -0x18(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x1f4(%rbp)
movl -0x2c(%rbp), %eax
movl -0x1ec(%rbp), %ecx
movl -0x1f8(%rbp), %edx
subl %edx, %ecx
imull %ecx, %eax
sarl $0x3, %eax
movl %eax, -0x200(%rbp)
movl -0x30(%rbp), %eax
movl -0x1f0(%rbp), %ecx
movl -0x1f4(%rbp), %edx
subl %edx, %ecx
imull %ecx, %eax
sarl $0x3, %eax
movl %eax, -0x1fc(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x8a60
jmp 0xc14a
movq 0x825297(%rip), %rdi    # 0x8313e8
callq 0x74f0
jmp 0xc158
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
leaq -0x200(%rbp), %rsi
callq 0x73b0
jmp 0xc172
movq -0x18(%rbp), %rdi
movq -0x78(%rbp), %rcx
movl $0x39, %edx
movl $0xff, %r8d
movl %r8d, %esi
callq 0x8b90
jmp 0xc18f
leaq 0x1765f(%rip), %rax     # 0x237f5
movq %rax, -0x208(%rbp)
movl -0x1f8(%rbp), %eax
movl %eax, -0x48c(%rbp)
movq -0x208(%rbp), %rdi
callq 0x8ec0
movl %eax, -0x488(%rbp)
jmp 0xc1bd
movl -0x488(%rbp), %ecx
movl -0x48c(%rbp), %eax
subl %ecx, %eax
sarl %eax
movl %eax, -0x20c(%rbp)
movq -0x208(%rbp), %rdi
movl -0x1f4(%rbp), %edx
addl $-0x14, %edx
movq -0x18(%rbp), %r9
leaq -0x20c(%rbp), %rsi
movl $0x31, %ecx
movl $0xff, %r8d
callq 0x8f10
jmp 0xc200
movl -0x1f4(%rbp), %eax
addl $-0x3c, %eax
cltq
imulq $0x38e38e39, %rax, %rax # imm = 0x38E38E39
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x22, %rax
addl %ecx, %eax
movl %eax, -0x210(%rbp)
movl -0x1f4(%rbp), %ecx
movl -0x210(%rbp), %edx
addl %edx, %edx
movl %edx, %eax
leal (%rax,%rax,8), %edx
movl %ecx, %eax
negl %edx
movl %edx, %ecx
leal 0x14(%rax,%rcx), %eax
sarl %eax
movl %eax, -0x214(%rbp)
movl $0x10, -0x218(%rbp)
movl -0x1f8(%rbp), %eax
addl $-0x50, %eax
movl %eax, -0x21c(%rbp)
movl -0x214(%rbp), %ecx
movl -0x210(%rbp), %edx
decl %edx
shrl %edx
movl %edx, %eax
leal (%rax,%rax,8), %edx
movl %ecx, %eax
movl %edx, %ecx
leal (%rax,%rcx,2), %edx
movq -0x18(%rbp), %r9
leaq 0x175a6(%rip), %rdi     # 0x23830
movl $0x10, %esi
movl $0x7, %ecx
movl $0xff, %r8d
callq 0x13900
jmp 0xc2a1
movq -0x200(%rbp), %rax
movq %rax, -0x22c(%rbp)
movq -0x1f8(%rbp), %rax
movq %rax, -0x224(%rbp)
movl $0x0, -0x23c(%rbp)
movl $0x0, -0x238(%rbp)
movl -0x1f8(%rbp), %eax
movl %eax, -0x234(%rbp)
movl -0x1f4(%rbp), %eax
movl %eax, -0x230(%rbp)
movl $0x1, -0x240(%rbp)
cmpl $0x8, -0x240(%rbp)
jg 0xc3f0
movq -0x18(%rbp), %rdi
movl -0x240(%rbp), %ecx
movl %ecx, %eax
shll $0x5, %eax
subl %ecx, %eax
movzbl %al, %esi
callq 0x7780
jmp 0xc31b
movl -0x1f8(%rbp), %eax
movl -0x240(%rbp), %ecx
imull %ecx, %eax
movl %eax, %ecx
addl $0x7, %ecx
testl %eax, %eax
cmovsl %ecx, %eax
sarl $0x3, %eax
movl %eax, -0x224(%rbp)
movl -0x224(%rbp), %eax
movl %eax, -0x234(%rbp)
movl -0x2c(%rbp), %eax
movl -0x1ec(%rbp), %ecx
movl -0x224(%rbp), %edx
subl %edx, %ecx
imull %ecx, %eax
sarl $0x3, %eax
movl %eax, -0x22c(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x200(%rbp), %rcx
callq 0x73b0
jmp 0xc380
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x23c(%rbp), %rsi
leaq -0x22c(%rbp), %rcx
callq 0x73b0
jmp 0xc39d
movq 0x825044(%rip), %rdi    # 0x8313e8
callq 0x74f0
jmp 0xc3ab
movl $0x10, %edi
callq 0x7350
jmp 0xc3b7
jmp 0xc3b9
movl -0x240(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x240(%rbp)
jmp 0xc2f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x12ed0
jmp 0xd107
movb $0x1, -0x241(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x13950
leaq -0x278(%rbp), %rdi
callq 0x13970
movl $0x0, -0x27c(%rbp)
movl $0x0, -0x280(%rbp)
jmp 0xc425
movb $0x0, -0x281(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x72b0
movl %eax, -0x490(%rbp)
jmp 0xc440
movl -0x490(%rbp), %eax
cmpl $0x0, %eax
je 0xc8d3
movl -0x2c0(%rbp), %eax
movl %eax, -0x494(%rbp)
subl $0x100, %eax            # imm = 0x100
je 0xc8b1
jmp 0xc468
movl -0x494(%rbp), %eax
subl $0x300, %eax            # imm = 0x300
je 0xc491
jmp 0xc8ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0xd0ef
movzwl -0x2a8(%rbp), %eax
andl $0xc0, %eax
cmpl $0x0, %eax
je 0xc4d9
movl -0x2ac(%rbp), %eax
movl %eax, -0x498(%rbp)
subl $0x64, %eax
je 0xc4c2
jmp 0xc4b5
movl -0x498(%rbp), %eax
subl $0x65, %eax
je 0xc4cb
jmp 0xc4d4
callq 0x12fd0
jmp 0xc4c9
jmp 0xc4d4
callq 0x12fd0
jmp 0xc4d2
jmp 0xc4d4
jmp 0xc8af
leaq -0x260(%rbp), %rdi
callq 0x13990
movl %eax, -0x2fc(%rbp)
movl -0x2ac(%rbp), %eax
movl %eax, -0x49c(%rbp)
subl $0xd, %eax
je 0xc84c
jmp 0xc502
movl -0x49c(%rbp), %eax
subl $0x1b, %eax
je 0xc89f
jmp 0xc513
movl -0x49c(%rbp), %eax
subl $0x4000004a, %eax       # imm = 0x4000004A
je 0xc597
jmp 0xc522
movl -0x49c(%rbp), %eax
subl $0x4000004b, %eax       # imm = 0x4000004B
je 0xc631
jmp 0xc535
movl -0x49c(%rbp), %eax
subl $0x4000004d, %eax       # imm = 0x4000004D
je 0xc5d0
jmp 0xc548
movl -0x49c(%rbp), %eax
subl $0x4000004e, %eax       # imm = 0x4000004E
je 0xc6dd
jmp 0xc55b
movl -0x49c(%rbp), %eax
subl $0x40000051, %eax       # imm = 0x40000051
je 0xc7e6
jmp 0xc56e
movl -0x49c(%rbp), %eax
subl $0x40000052, %eax       # imm = 0x40000052
je 0xc798
jmp 0xc581
movl -0x49c(%rbp), %eax
subl $0x40000058, %eax       # imm = 0x40000058
je 0xc84c
jmp 0xc8ad
cmpl $0x0, -0x27c(%rbp)
jne 0xc5a9
callq 0x12fd0
jmp 0xc5a7
jmp 0xc5cb
callq 0x137a0
jmp 0xc5b0
movl $0x0, -0x280(%rbp)
movl $0x0, -0x27c(%rbp)
movb $0x1, -0x281(%rbp)
jmp 0xc8ad
movl -0x27c(%rbp), %eax
addl $0x1, %eax
cmpl -0x2fc(%rbp), %eax
jne 0xc5ea
callq 0x137a0
jmp 0xc5e8
jmp 0xc62c
callq 0x137a0
jmp 0xc5f1
movl -0x2fc(%rbp), %eax
subl -0x210(%rbp), %eax
movl %eax, -0x280(%rbp)
movl -0x2fc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x27c(%rbp)
cmpl $0x0, -0x280(%rbp)
jge 0xc625
movl $0x0, -0x280(%rbp)
movb $0x1, -0x281(%rbp)
jmp 0xc8ad
cmpl $0x0, -0x280(%rbp)
je 0xc648
movl -0x210(%rbp), %eax
cmpl -0x2fc(%rbp), %eax
jl 0xc674
cmpl $0x0, -0x27c(%rbp)
jne 0xc65a
callq 0x12fd0
jmp 0xc658
jmp 0xc672
callq 0x137a0
jmp 0xc661
movl $0x0, -0x27c(%rbp)
movb $0x1, -0x281(%rbp)
jmp 0xc6d8
callq 0x137a0
jmp 0xc67b
movl -0x210(%rbp), %ecx
movl -0x280(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x280(%rbp)
cmpl $0x0, -0x280(%rbp)
jge 0xc6a2
movl $0x0, -0x280(%rbp)
movl -0x280(%rbp), %eax
addl -0x210(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x300(%rbp)
movl -0x27c(%rbp), %eax
cmpl -0x300(%rbp), %eax
jle 0xc6d1
movl -0x300(%rbp), %eax
movl %eax, -0x27c(%rbp)
movb $0x1, -0x281(%rbp)
jmp 0xc8ad
movl -0x280(%rbp), %eax
addl -0x210(%rbp), %eax
cmpl -0x2fc(%rbp), %eax
je 0xc6ff
movl -0x210(%rbp), %eax
cmpl -0x2fc(%rbp), %eax
jl 0xc733
movl -0x27c(%rbp), %eax
movl -0x2fc(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0xc71b
callq 0x12fd0
jmp 0xc719
jmp 0xc731
movl -0x2fc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x27c(%rbp)
movb $0x1, -0x281(%rbp)
jmp 0xc793
callq 0x137a0
jmp 0xc73a
movl -0x210(%rbp), %eax
addl -0x280(%rbp), %eax
movl %eax, -0x280(%rbp)
movl -0x280(%rbp), %eax
addl -0x210(%rbp), %eax
cmpl -0x2fc(%rbp), %eax
jle 0xc772
movl -0x2fc(%rbp), %eax
subl -0x210(%rbp), %eax
movl %eax, -0x280(%rbp)
movl -0x27c(%rbp), %eax
cmpl -0x280(%rbp), %eax
jge 0xc78c
movl -0x280(%rbp), %eax
movl %eax, -0x27c(%rbp)
movb $0x1, -0x281(%rbp)
jmp 0xc8ad
cmpl $0x0, -0x27c(%rbp)
jne 0xc7aa
callq 0x12fd0
jmp 0xc7a8
jmp 0xc7e1
callq 0x137a0
jmp 0xc7b1
movl -0x27c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x27c(%rbp)
movl -0x27c(%rbp), %eax
cmpl -0x280(%rbp), %eax
jge 0xc7da
movl -0x27c(%rbp), %eax
movl %eax, -0x280(%rbp)
movb $0x1, -0x281(%rbp)
jmp 0xc8ad
movl -0x27c(%rbp), %eax
movl -0x2fc(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0xc802
callq 0x12fd0
jmp 0xc800
jmp 0xc84a
callq 0x137a0
jmp 0xc809
movl -0x27c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x27c(%rbp)
movl -0x27c(%rbp), %eax
movl -0x280(%rbp), %ecx
addl -0x210(%rbp), %ecx
cmpl %ecx, %eax
jl 0xc843
movl -0x27c(%rbp), %eax
subl -0x210(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x280(%rbp)
movb $0x1, -0x281(%rbp)
jmp 0xc8ad
movslq -0x27c(%rbp), %rsi
leaq -0x278(%rbp), %rdi
callq 0x139b0
movq %rax, %rsi
leaq -0x320(%rbp), %rdi
callq 0x139d0
jmp 0xc870
movq -0x10(%rbp), %rdi
leaq -0x320(%rbp), %rsi
movq %rsi, -0x4a8(%rbp)
callq 0x7520
movq -0x4a8(%rbp), %rdi
callq 0x72c0
callq 0x137c0
jmp 0xc89a
jmp 0xcf9a
movq -0x10(%rbp), %rdi
callq 0x75b0
jmp 0xcf9a
jmp 0xc8af
jmp 0xc8ce
movl $0x100, -0x2f8(%rbp)    # imm = 0x100
leaq -0x2f8(%rbp), %rdi
callq 0x7700
jmp 0xc8c9
jmp 0xcf9a
jmp 0xc42c
testb $0x1, -0x241(%rbp)
je 0xcc5a
leaq -0x260(%rbp), %rdi
callq 0x13a50
leaq -0x278(%rbp), %rdi
callq 0x13a70
leaq -0x338(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
movl $0x2, %edx
callq 0x13a90
jmp 0xc912
leaq -0x338(%rbp), %rax
movq %rax, -0x328(%rbp)
movq -0x328(%rbp), %rsi
leaq -0x358(%rbp), %rdi
callq 0x13af0
leaq -0x348(%rbp), %rdi
leaq -0x358(%rbp), %rsi
callq 0x13ac0
leaq -0x358(%rbp), %rdi
callq 0x13b20
movq -0x328(%rbp), %rsi
leaq -0x378(%rbp), %rdi
callq 0x13af0
leaq -0x368(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0x13b40
leaq -0x378(%rbp), %rdi
callq 0x13b20
leaq -0x348(%rbp), %rdi
leaq -0x368(%rbp), %rsi
callq 0x13b80
testb $0x1, %al
jne 0xc9c4
leaq -0x368(%rbp), %rdi
callq 0x13b20
leaq -0x348(%rbp), %rdi
callq 0x13b20
leaq -0x338(%rbp), %rdi
callq 0x13b20
jmp 0xcc53
leaq -0x348(%rbp), %rdi
callq 0x7750
movq %rax, -0x380(%rbp)
movq -0x380(%rbp), %rdi
movb $0x0, -0x3c9(%rbp)
movb $0x0, -0x3ca(%rbp)
callq 0x13bb0
movb %al, -0x4a9(%rbp)
jmp 0xc9f9
movb -0x4a9(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x4aa(%rbp)
jne 0xca11
jmp 0xca9c
movb $0x1, %al
testb $0x1, -0x81(%rbp)
movb %al, -0x4ab(%rbp)
jne 0xca90
movq -0x380(%rbp), %rdi
callq 0x13c70
movq %rax, %rsi
leaq -0x3c8(%rbp), %rdi
callq 0x13c80
jmp 0xca3f
movb $0x1, -0x3c9(%rbp)
leaq -0x3a0(%rbp), %rdi
leaq -0x3c8(%rbp), %rsi
callq 0x139d0
jmp 0xca5b
movb $0x1, -0x3ca(%rbp)
leaq -0x3a0(%rbp), %rdi
callq 0x71b0
movq %rax, %rdi
movq -0x80(%rbp), %rsi
callq 0x13be0
movb %al, -0x4ac(%rbp)
jmp 0xca82
movb -0x4ac(%rbp), %al
movb %al, -0x4ab(%rbp)
jmp 0xca90
movb -0x4ab(%rbp), %al
movb %al, -0x4aa(%rbp)
movb -0x4aa(%rbp), %al
movb %al, -0x4ad(%rbp)
testb $0x1, -0x3ca(%rbp)
jne 0xcab3
jmp 0xcabf
leaq -0x3a0(%rbp), %rdi
callq 0x72c0
testb $0x1, -0x3c9(%rbp)
jne 0xcaca
jmp 0xcad6
leaq -0x3c8(%rbp), %rdi
callq 0x12ed0
movb -0x4ad(%rbp), %al
testb $0x1, %al
jne 0xcae5
jmp 0xcc15
movq -0x380(%rbp), %rdi
callq 0x13c70
movq %rax, %rsi
leaq -0x418(%rbp), %rdi
callq 0x13d60
jmp 0xcb02
leaq -0x3f0(%rbp), %rdi
leaq -0x418(%rbp), %rsi
callq 0x139d0
jmp 0xcb17
leaq -0x260(%rbp), %rdi
leaq -0x3f0(%rbp), %rsi
callq 0x13d30
jmp 0xcb2c
leaq -0x3f0(%rbp), %rdi
callq 0x72c0
leaq -0x418(%rbp), %rdi
callq 0x12ed0
movq -0x380(%rbp), %rdi
callq 0x13c70
movq %rax, %rsi
leaq -0x278(%rbp), %rdi
callq 0x13e60
jmp 0xcb61
jmp 0xcc15
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0xcc2a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0xcbbc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
testb $0x1, -0x3ca(%rbp)
jne 0xcbae
jmp 0xcbba
leaq -0x3a0(%rbp), %rdi
callq 0x72c0
jmp 0xcbbc
testb $0x1, -0x3c9(%rbp)
jne 0xcbc7
jmp 0xcbd3
leaq -0x3c8(%rbp), %rdi
callq 0x12ed0
jmp 0xcc2a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0xcc07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0x3f0(%rbp), %rdi
callq 0x72c0
leaq -0x418(%rbp), %rdi
callq 0x12ed0
jmp 0xcc2a
jmp 0xcc17
leaq -0x348(%rbp), %rdi
callq 0x7130
jmp 0xcc25
jmp 0xc984
leaq -0x368(%rbp), %rdi
callq 0x13b20
leaq -0x348(%rbp), %rdi
callq 0x13b20
leaq -0x338(%rbp), %rdi
callq 0x13b20
jmp 0xd0ef
movb $0x1, -0x281(%rbp)
testb $0x1, -0x281(%rbp)
je 0xcf89
movl $0x7, -0x428(%rbp)
movl -0x214(%rbp), %eax
decl %eax
movl %eax, -0x424(%rbp)
movl -0x21c(%rbp), %eax
movl -0x214(%rbp), %ecx
subl %ecx, %eax
addl $0x9, %eax
movl %eax, -0x420(%rbp)
movl -0x210(%rbp), %ecx
movl %ecx, %eax
leal (%rax,%rax,8), %ecx
movl %ecx, %eax
leal 0x2(%rax,%rax), %eax
movl %eax, -0x41c(%rbp)
movl $0x10, -0x42c(%rbp)
movq -0x18(%rbp), %r9
leaq 0x16b89(%rip), %rdi     # 0x2384b
leaq -0x42c(%rbp), %rsi
movl $0x17, %edx
movl $0x31, %ecx
movl $0xff, %r8d
callq 0x8f10
jmp 0xcce0
leaq -0x450(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x139d0
jmp 0xccf5
leaq -0x450(%rbp), %rdi
callq 0x71b0
movq %rax, %rdi
movq -0x18(%rbp), %r9
leaq -0x42c(%rbp), %rsi
movl $0x17, %edx
xorl %ecx, %ecx
movl $0xff, %r8d
callq 0x8f10
jmp 0xcd23
leaq -0x450(%rbp), %rdi
callq 0x72c0
movq -0x18(%rbp), %rdi
leaq -0x428(%rbp), %rsi
movl $0xff, %edx
callq 0x7060
jmp 0xcd46
movl $0x0, -0x454(%rbp)
movl -0x280(%rbp), %eax
movl %eax, -0x458(%rbp)
movl -0x214(%rbp), %eax
movl %eax, -0x45c(%rbp)
movl -0x454(%rbp), %ecx
xorl %eax, %eax
cmpl -0x210(%rbp), %ecx
movb %al, -0x4ae(%rbp)
jge 0xcdae
movslq -0x458(%rbp), %rax
movq %rax, -0x4b8(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x13990
movq %rax, %rcx
movq -0x4b8(%rbp), %rax
cmpq %rcx, %rax
setb %al
movb %al, -0x4ae(%rbp)
movb -0x4ae(%rbp), %al
testb $0x1, %al
jne 0xcdbd
jmp 0xceec
movl -0x27c(%rbp), %eax
cmpl -0x458(%rbp), %eax
jne 0xce7a
movl -0x428(%rbp), %eax
movl %eax, -0x46c(%rbp)
movl -0x45c(%rbp), %eax
decl %eax
movl %eax, -0x468(%rbp)
movl -0x420(%rbp), %eax
movl %eax, -0x464(%rbp)
movl $0x12, -0x460(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x46c(%rbp), %rsi
movl $0x31, %edx
callq 0xd120
jmp 0xce16
movslq -0x458(%rbp), %rsi
leaq -0x260(%rbp), %rdi
callq 0x13ed0
movq %rax, %rdi
callq 0x71b0
movq %rax, %rdi
movl -0x45c(%rbp), %edx
movq -0x18(%rbp), %r9
movl $0x10, %esi
movl $0xff, %ecx
movl $0x31, %r8d
callq 0x13900
jmp 0xce55
jmp 0xceb8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0x450(%rbp), %rdi
callq 0x72c0
jmp 0xd0ef
movslq -0x458(%rbp), %rsi
leaq -0x260(%rbp), %rdi
callq 0x13ed0
movq %rax, %rdi
callq 0x71b0
movq %rax, %rdi
movl -0x45c(%rbp), %edx
movq -0x18(%rbp), %r9
movl $0x10, %esi
xorl %ecx, %ecx
movl $0xff, %r8d
callq 0x13900
jmp 0xceb6
jmp 0xceb8
jmp 0xceba
movl -0x454(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x454(%rbp)
movl -0x458(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x458(%rbp)
movl -0x45c(%rbp), %eax
addl $0x12, %eax
movl %eax, -0x45c(%rbp)
jmp 0xcd68
leaq -0x260(%rbp), %rdi
callq 0x13990
cmpq $0x0, %rax
jne 0xcf3e
movl -0x214(%rbp), %ecx
movl -0x210(%rbp), %edx
decl %edx
shrl %edx
movl %edx, %eax
leal (%rax,%rax,8), %edx
movl %ecx, %eax
movl %edx, %ecx
leal (%rax,%rcx,2), %edx
movq -0x18(%rbp), %r9
leaq 0x16931(%rip), %rdi     # 0x23856
movl $0x10, %esi
movl $0x7, %ecx
movl $0xff, %r8d
callq 0x13900
jmp 0xcf3c
jmp 0xcf3e
movb $0x0, -0x281(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x200(%rbp), %rcx
callq 0x73b0
jmp 0xcf5f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x200(%rbp), %rcx
callq 0x73b0
jmp 0xcf79
movq 0x824468(%rip), %rdi    # 0x8313e8
callq 0x74f0
jmp 0xcf87
jmp 0xcf89
movl $0x10, %edi
callq 0x7350
jmp 0xcf95
jmp 0xc423
movl $0x7, -0x470(%rbp)
cmpl $0x0, -0x470(%rbp)
jle 0xd092
movq -0x18(%rbp), %rdi
movl -0x470(%rbp), %ecx
movl %ecx, %eax
shll $0x5, %eax
subl %ecx, %eax
movzbl %al, %esi
callq 0x7780
jmp 0xcfcc
movl -0x1f4(%rbp), %eax
movl -0x470(%rbp), %ecx
imull %ecx, %eax
movl %eax, %ecx
addl $0x7, %ecx
testl %eax, %eax
cmovsl %ecx, %eax
sarl $0x3, %eax
movl %eax, -0x220(%rbp)
movl -0x220(%rbp), %eax
movl %eax, -0x230(%rbp)
movl -0x1f4(%rbp), %eax
movl -0x220(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x238(%rbp)
movl -0x30(%rbp), %eax
movl -0x1f0(%rbp), %ecx
movl -0x220(%rbp), %edx
subl %edx, %ecx
imull %ecx, %eax
sarl $0x3, %eax
movl %eax, -0x228(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x200(%rbp), %rcx
callq 0x73b0
jmp 0xd045
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x23c(%rbp), %rsi
leaq -0x22c(%rbp), %rcx
callq 0x73b0
jmp 0xd062
movq 0x82437f(%rip), %rdi    # 0x8313e8
callq 0x74f0
jmp 0xd070
movl $0x10, %edi
callq 0x7350
jmp 0xd07c
jmp 0xd07e
movl -0x470(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x470(%rbp)
jmp 0xcfa4
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x200(%rbp), %rcx
callq 0x73b0
jmp 0xd0ac
movq -0x28(%rbp), %rdi
callq 0x7400
jmp 0xd0b7
movq -0x18(%rbp), %rdi
callq 0x7400
jmp 0xd0c2
leaq -0x278(%rbp), %rdi
callq 0x13ef0
leaq -0x260(%rbp), %rdi
callq 0x13f50
leaq -0xb0(%rbp), %rdi
callq 0x12ed0
addq $0x4c0, %rsp            # imm = 0x4C0
popq %rbp
retq
leaq -0x278(%rbp), %rdi
callq 0x13ef0
leaq -0x260(%rbp), %rdi
callq 0x13f50
leaq -0xb0(%rbp), %rdi
callq 0x12ed0
movq -0xd8(%rbp), %rdi
callq 0x7710
nop