// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_save.c
// Function: InitGame
void InitGame(void)
{

#ifdef	_WIN32
	_CrtMemCheckpoint(&startup1);
#endif
	// CTF CODE -- LM_JORM
	FILE* file;
	char		line[MAX_INFO_STRING];
	char		fname[MAX_QPATH];
	size_t		i;

	// END CTF CODE -- LM_JORM

	gi.dprintf("==== InitGame %s %d-%s %s ====\n", GAMEVERSION, LMCTF_REVISION, LMCTF_VERSION, __DATE__);

	// seed the random number generator
	srand((unsigned)time(NULL));

	gun_x = gi.cvar("gun_x", "0", 0);
	gun_y = gi.cvar("gun_y", "0", 0);
	gun_z = gi.cvar("gun_z", "0", 0);

	//FIXME: sv_ prefix is wrong for these
	sv_rollspeed = gi.cvar("sv_rollspeed", "200", 0);
	sv_rollangle = gi.cvar("sv_rollangle", "2", 0);
	sv_maxvelocity = gi.cvar("sv_maxvelocity", "2000", 0);
	sv_gravity = gi.cvar("sv_gravity", "800", 0);

	// noset vars
	dedicated = gi.cvar("dedicated", "0", CVAR_NOSET);

	gi.cvar("revision", va("%d", LMCTF_REVISION), CVAR_SERVERINFO);
	gi.cvar_set("revision", va("%d-%s", LMCTF_REVISION, LMCTF_VERSION));

	// latched vars
	sv_cheats = gi.cvar("cheats", "0", CVAR_SERVERINFO | CVAR_LATCH);
	gi.cvar("gamename", GAMEVERSION, CVAR_SERVERINFO | CVAR_LATCH);
	gi.cvar("gamedate", __DATE__, CVAR_SERVERINFO | CVAR_LATCH);

	maxclients = gi.cvar("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH);
	//maxspectators = gi.cvar ("maxspectators", "4", CVAR_SERVERINFO);
	//-bat
	maxspectators = gi.cvar("maxspectators", "24", CVAR_SERVERINFO);
	deathmatch = gi.cvar("deathmatch", "0", CVAR_LATCH);
	coop = gi.cvar("coop", "0", CVAR_LATCH);
	skill = gi.cvar("skill", "1", CVAR_LATCH);
	maxentities = gi.cvar("maxentities", "1024", CVAR_LATCH);

	// change anytime vars
	dmflags = gi.cvar("dmflags", "0", CVAR_SERVERINFO);
	fraglimit = gi.cvar("fraglimit", "0", CVAR_SERVERINFO);
	timelimit = gi.cvar("timelimit", "0", CVAR_SERVERINFO);
	railtime = gi.cvar("railtime", "0", CVAR_SERVERINFO);
	password = gi.cvar("password", "", CVAR_USERINFO);
	spectator_password = gi.cvar("spectator_password", "", CVAR_USERINFO);
	needpass = gi.cvar("needpass", "0", CVAR_SERVERINFO);
	filterban = gi.cvar("filterban", "1", 0);

	g_select_empty = gi.cvar("g_select_empty", "0", CVAR_ARCHIVE);

	run_pitch = gi.cvar("run_pitch", "0.002", 0);
	run_roll = gi.cvar("run_roll", "0.005", 0);
	bob_up = gi.cvar("bob_up", "0.005", 0);
	bob_pitch = gi.cvar("bob_pitch", "0.002", 0);
	bob_roll = gi.cvar("bob_roll", "0.002", 0);

	runes = gi.cvar("runes", "15", CVAR_SERVERINFO); // CTF CODE -- LM_CTF
	ctfflags = gi.cvar("ctfflags", "0", CVAR_SERVERINFO); // CTF CODE -- LM_CTF
	refset = gi.cvar("refset", "0", CVAR_SERVERINFO); // CTF CODE -- LM_CTF
	logrename = gi.cvar("logrename", "", 0); // CTF CODE -- LM_CTF
	hostname = gi.cvar("hostname", "noname", CVAR_SERVERINFO); // CTF CODE -- LM_CTF
	gamedir = gi.cvar("game", "lmctf", CVAR_SERVERINFO); // CTF CODE -- LM_CTF
	skinset = gi.cvar("skinset", "0", CVAR_SERVERINFO); // CTF CODE -- LM_CTF
#ifdef OLDOBSERVERCODE
	autoobserve = gi.cvar("autoobserve", "0", CVAR_USERINFO); // CTF CODE -- LM_CTF
#endif
	refpassword = gi.cvar("refpassword", "", 0); // CTF CODE -- LM_CTF
	rconpassword = gi.cvar("rcon_password", "", 0); // CTF CODE -- LM_CTF
	disabled_weps = gi.cvar("disabled_weps", "0", 0);
	fastswitch = gi.cvar("fastswitch", "0", 0);
	mod_website = gi.cvar("mod_website", "http://lmctf.com", 0);
	autolock = gi.cvar("autolock", "0", 0);
	countdown_time = gi.cvar("countdown_time", "15", 0);


#ifdef ZBOT
	use_zbotdetect = gi.cvar("use_zbotdetect", "0", CVAR_SERVERINFO);
#endif

	//configuration files
	motd_file = gi.cvar("motd_file", "motd.txt", 0); //CTF CODE -- LM_CTF
	server_file = gi.cvar("server_file", "server.cfg", 0); //CTF CODE -- LM_CTF
	maplist_file = gi.cvar("maplist_file", "maplist.txt", 0);  //CTF CODE -- LM_CTF
	skin_file = gi.cvar("skin_file", "skins.ini", 0);
	skin_debug = gi.cvar("skin_debug", "0", 0);	// for debugging team skins in SkinsReadFile
	flag_init = gi.cvar("flag_init", "0", 0);	// flag spawning frame initialization.



	//logging startup after vars initialized
	ctf_SetLogName();
	sl_Logging(&gi, GAMEVERSION);	// StdLog - Mark Davies (Only required to set patch name)

	// dm map list
	sv_maplist = gi.cvar("sv_maplist", "", 0);

	// items
	InitItems();

	Com_sprintf(game.helpmessage1, sizeof(game.helpmessage1), "");

	Com_sprintf(game.helpmessage2, sizeof(game.helpmessage2), "");

	// initialize all entities for this game
	game.maxentities = maxentities->value;
	g_edicts = gi.TagMalloc(game.maxentities * sizeof(g_edicts[0]), TAG_GAME);
	globals.edicts = g_edicts;
	globals.max_edicts = game.maxentities;

	// initialize all clients for this game
	game.maxclients = maxclients->value;
	game.clients = gi.TagMalloc(game.maxclients * sizeof(game.clients[0]), TAG_GAME);
	globals.num_edicts = game.maxclients + 1;


	// CTF CODE -- LM_JORM
	if (!maplistindex) // Have we done this before?
	{
		//		sprintf (fname, "%s/maplist.txt", gamedir->string);
		sprintf(fname, "%s/%s", gamedir->string, maplist_file->string);
		file = fopen(fname, "r");
		if (!file)
			file = fopen("maplist.txt", "r");

		if (file)
		{
			// If there is a maplist file, read it
			//   And use it for our list of maps.

			maplistindex = 0;
			while (fgets(line, 255, file))
			{
				char* tempname = gi.TagMalloc(100, TAG_GAME);
				int tempmin = 0;
				int tempmax = 99;
				if (sscanf(line, "%s %d %d", tempname, &tempmin, &tempmax) != 3) {
					if (sscanf(line, "%s %d", tempname, &tempmin) != 2) {
						if (sscanf(line, "%s", tempname) != 1) {
							sprintf(line, "Bad entry in maplist");
							gi.dprintf(line);
							gi.TagFree(tempname);
							continue;
						}
					}
				}
				//, maplist[maplistindex]))
				// convert to lower case for subsequent comparisons
				for (i = 0; i < strlen(tempname); i++)
					tempname[i] = tolower(tempname[i]);
				maplist[maplistindex].mapname = tempname;
				maplist[maplistindex].minplayers = tempmin;
				maplist[maplistindex].maxplayers = tempmax;

				maplistindex++;

			}
			SortMaplist(maplist, 0, maplistindex - 1);
			//maplist[maplistindex][0] = 0; // Blank last entry
			sprintf(line, "%d entries in maplist.\n", maplistindex);
			gi.dprintf(line);
			fclose(file);
			if (maplistindex)  // Did we read anything?
			{
				Randomize_Map_List(maplistindex);
				maplistindex = -1; // This means first time through the list
			}
			else
				maplistindex = -2; // Not going to use it

		}
		else
		{
			sprintf(line, "Can't find %s.  Reverting to standard maps.\n", fname);
			gi.dprintf(line);
			maplistindex = -2; // Not going to use it
		}
	}


	// Reading the help text file

	sprintf(fname, "%s/help.txt", gamedir->string);
	file = fopen(fname, "r");
	if (!file)
		file = fopen("help.txt", "r");

	if (file)
	{
		// If there is a help file, read it

		i = 0;
		while (fgets(line, 255, file))
		{
			// Nul termination is guaranteed from fgets.
			memcpy(helptext[i], line, 24);
			i++;
		}
		helptext[i][0] = 0; // Blank last entry
		fclose(file);
		sprintf(line, "Read %zu lines of %s.\n", i, fname);
		gi.dprintf(line);
	}
	else
	{
		sprintf(line, "Can't find %s.  You get no help!\n", fname);
		gi.dprintf(line);
		strcpy(helptext[0], "No help available."); // Not going to use it
		helptext[1][0] = 0;
	}

	if (motd_file && strcmp(motd_file->string, "") != 0)
		sprintf(fname, "%s/%s", gamedir->string, motd_file->string);
	else
		sprintf(fname, "%s/motd.txt", gamedir->string);
	file = fopen(fname, "r");
	if (!file)
		file = fopen("motd.txt", "r");
	if (file)
	{
		size_t count = fread(motd, sizeof motd, 1, file);
		if (count)
			; // don't worry, be happy
		fclose(file);
	}

	SkinsReadFile(); // READ our skins.ini


	// END CTF CODE -- LM_JORM

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movq 0x30374(%rip), %r12     # 0x69600
leaq 0x1f8e6(%rip), %rdi     # 0x58b79
leaq 0x1b61c(%rip), %r14     # 0x548b6
leaq 0x1f8f8(%rip), %r13     # 0x58b99
leaq 0x1d6d0(%rip), %r8      # 0x56978
movq %r14, %rsi
movl $0x6c, %edx
movq %r13, %rcx
xorl %eax, %eax
callq *0x8(%r12)
xorl %edi, %edi
callq 0x18df0
movl %eax, %edi
callq 0x189f0
leaq 0x1f8d7(%rip), %rdi     # 0x58ba6
leaq 0x22aa6(%rip), %r15     # 0x5bd7c
movq %r15, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x30796(%rip), %rcx     # 0x69a80
movq %rax, (%rcx)
leaq 0x1f8b8(%rip), %rdi     # 0x58bac
movq %r15, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x30100(%rip), %rcx     # 0x69408
movq %rax, (%rcx)
leaq 0x1f8a0(%rip), %rdi     # 0x58bb2
movq %r15, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x30772(%rip), %rcx     # 0x69a98
movq %rax, (%rcx)
leaq 0x1f888(%rip), %rdi     # 0x58bb8
leaq 0x1f88e(%rip), %rsi     # 0x58bc5
xorl %edx, %edx
callq *0x120(%r12)
movq 0x30a70(%rip), %rcx     # 0x69db8
movq %rax, (%rcx)
leaq 0x1f877(%rip), %rdi     # 0x58bc9
leaq 0x19d17(%rip), %rsi     # 0x53070
xorl %edx, %edx
callq *0x120(%r12)
movq 0x307de(%rip), %rcx     # 0x69b48
movq %rax, (%rcx)
leaq 0x1f862(%rip), %rdi     # 0x58bd6
leaq 0x1f86a(%rip), %rsi     # 0x58be5
xorl %edx, %edx
callq *0x120(%r12)
movq 0x305e4(%rip), %rcx     # 0x69970
movq %rax, (%rcx)
leaq 0x1f854(%rip), %rdi     # 0x58bea
leaq 0x1f858(%rip), %rsi     # 0x58bf5
xorl %edx, %edx
callq *0x120(%r12)
movq 0x30c12(%rip), %rcx     # 0x69fc0
movq %rax, (%rcx)
leaq 0x1f841(%rip), %rdi     # 0x58bf9
movq %r15, %rsi
movl $0x8, %edx
callq *0x120(%r12)
movq 0x308e9(%rip), %rcx     # 0x69cb8
movq %rax, (%rcx)
movq 0x120(%r12), %rbx
leaq 0x1a4a5(%rip), %rdi     # 0x53886
movl $0x6c, %esi
xorl %eax, %eax
callq 0x19340
leaq 0x1f80f(%rip), %rbp     # 0x58c03
movq %rbp, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq *%rbx
movq 0x128(%r12), %rbx
leaq 0x1f7fc(%rip), %rdi     # 0x58c0c
movl $0x6c, %esi
movq %r13, %rdx
xorl %eax, %eax
callq 0x19340
movq %rbp, %rdi
movq %rax, %rsi
callq *%rbx
leaq 0x1f7e4(%rip), %rdi     # 0x58c12
movq %r15, %rsi
movl $0x14, %edx
callq *0x120(%r12)
movq 0x305b3(%rip), %rcx     # 0x699f8
movq %rax, (%rcx)
leaq 0x1f7ca(%rip), %rdi     # 0x58c19
movq %r14, %rsi
movl $0x14, %edx
callq *0x120(%r12)
leaq 0x1f7bc(%rip), %rdi     # 0x58c22
leaq 0x1d50b(%rip), %rsi     # 0x56978
movl $0x14, %edx
callq *0x120(%r12)
leaq 0x1f7aa(%rip), %rdi     # 0x58c2b
leaq 0x1a918(%rip), %rsi     # 0x53da0
movl $0x14, %edx
callq *0x120(%r12)
movq 0x30094(%rip), %rcx     # 0x69530
movq %rax, (%rcx)
leaq 0x1f790(%rip), %rdi     # 0x58c36
leaq 0x1f7ab(%rip), %rsi     # 0x58c58
movl $0x4, %edx
callq *0x120(%r12)
movq 0x30a77(%rip), %rcx     # 0x69f38
movq %rax, (%rcx)
leaq 0x1b053(%rip), %rdi     # 0x5451e
movq %r15, %rsi
movl $0x10, %edx
callq *0x120(%r12)
movq 0x309de(%rip), %rcx     # 0x69ec0
movq %rax, (%rcx)
leaq 0x1fa80(%rip), %rdi     # 0x58f6c
movq %r15, %rsi
movl $0x10, %edx
callq *0x120(%r12)
movq 0x30a5d(%rip), %rcx     # 0x69f60
movq %rax, (%rcx)
leaq 0x1f737(%rip), %rdi     # 0x58c44
leaq 0x19b50(%rip), %r13     # 0x53064
movq %r13, %rsi
movl $0x10, %edx
callq *0x120(%r12)
movq 0x3020d(%rip), %rcx     # 0x69738
movq %rax, (%rcx)
leaq 0x1f715(%rip), %rdi     # 0x58c4a
leaq 0x1f71a(%rip), %rsi     # 0x58c56
movl $0x10, %edx
callq *0x120(%r12)
movq 0x2ff58(%rip), %rcx     # 0x694a8
movq %rax, (%rcx)
leaq 0x19fbd(%rip), %rdi     # 0x53517
movq %r15, %rsi
movl $0x4, %edx
callq *0x120(%r12)
movq 0x300a7(%rip), %rcx     # 0x69618
movq %rax, (%rcx)
leaq 0x19fc3(%rip), %rdi     # 0x5353e
movq %r15, %rsi
movl $0x4, %edx
callq *0x120(%r12)
movq 0x3086e(%rip), %rcx     # 0x69e00
movq %rax, (%rcx)
leaq 0x19f94(%rip), %rdi     # 0x53530
movq %r15, %rsi
movl $0x4, %edx
callq *0x120(%r12)
movq 0x300fd(%rip), %rcx     # 0x696b0
movq %rax, (%rcx)
leaq 0x1f69e(%rip), %rdi     # 0x58c5b
movq %r15, %rsi
movl $0x4, %edx
callq *0x120(%r12)
movq 0x3007c(%rip), %rcx     # 0x69650
movq %rax, (%rcx)
leaq 0x1f727(%rip), %rdi     # 0x58d05
leaq 0x1b920(%rip), %rbx     # 0x54f05
movq %rbx, %rsi
movl $0x2, %edx
callq *0x120(%r12)
movq 0x3025c(%rip), %rcx     # 0x69858
movq %rax, (%rcx)
leaq 0x1f65e(%rip), %rdi     # 0x58c64
movq %rbx, %rsi
movl $0x2, %edx
callq *0x120(%r12)
movq 0x3060b(%rip), %rcx     # 0x69c28
movq %rax, (%rcx)
leaq 0x1ebb6(%rip), %rdi     # 0x581dd
movq %r15, %rsi
movl $0x4, %edx
callq *0x120(%r12)
movq 0x30732(%rip), %rcx     # 0x69d70
movq %rax, (%rcx)
leaq 0x1f62f(%rip), %rdi     # 0x58c77
movq %r13, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x30774(%rip), %rcx     # 0x69dd0
movq %rax, (%rcx)
leaq 0x1f61b(%rip), %rdi     # 0x58c81
movq %r15, %rsi
movl $0x1, %edx
callq *0x120(%r12)
movq 0x2fecb(%rip), %rcx     # 0x69548
movq %rax, (%rcx)
leaq 0x1f609(%rip), %rdi     # 0x58c90
leaq 0x1f60c(%rip), %r13     # 0x58c9a
movq %r13, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x2ffb6(%rip), %rcx     # 0x69658
movq %rax, (%rcx)
leaq 0x1f5f4(%rip), %rdi     # 0x58ca0
leaq 0x1f5f6(%rip), %rbp     # 0x58ca9
movq %rbp, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x30821(%rip), %rcx     # 0x69ee8
movq %rax, (%rcx)
leaq 0x1f5de(%rip), %rdi     # 0x58caf
movq %rbp, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x303fb(%rip), %rcx     # 0x69ae0
movq %rax, (%rcx)
leaq 0x1f5c7(%rip), %rdi     # 0x58cb6
movq %r13, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x30335(%rip), %rcx     # 0x69a38
movq %rax, (%rcx)
leaq 0x1f5b3(%rip), %rdi     # 0x58cc0
movq %r13, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x30547(%rip), %rcx     # 0x69c68
movq %rax, (%rcx)
leaq 0x1f59e(%rip), %rdi     # 0x58cc9
leaq 0x1a4bd(%rip), %r13     # 0x53bef
movq %r13, %rsi
movl $0x4, %edx
callq *0x120(%r12)
movq 0x2fd17(%rip), %rcx     # 0x69460
movq %rax, (%rcx)
leaq 0x19dd0(%rip), %rdi     # 0x53523
movq %r15, %rsi
movl $0x4, %edx
callq *0x120(%r12)
movq 0x303ee(%rip), %rcx     # 0x69b58
movq %rax, (%rcx)
leaq 0x19fe9(%rip), %rdi     # 0x5375d
movq %r15, %rsi
movl $0x4, %edx
callq *0x120(%r12)
movq 0x3020d(%rip), %rcx     # 0x69998
movq %rax, (%rcx)
leaq 0x1f53a(%rip), %rdi     # 0x58ccf
movq %rbx, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x2fd97(%rip), %rcx     # 0x69540
movq %rax, (%rcx)
leaq 0x1f526(%rip), %rdi     # 0x58cd9
leaq 0x1f528(%rip), %rsi     # 0x58ce2
movl $0x4, %edx
callq *0x120(%r12)
movq 0x30422(%rip), %rcx     # 0x69bf0
movq %rax, (%rcx)
leaq 0x1f511(%rip), %rdi     # 0x58ce9
leaq 0x1f50f(%rip), %rsi     # 0x58cee
movl $0x4, %edx
callq *0x120(%r12)
movq 0x306bd(%rip), %r14     # 0x69eb0
movq %rax, (%r14)
leaq 0x1ea2c(%rip), %rdi     # 0x58229
movq %r15, %rsi
movl $0x4, %edx
callq *0x120(%r12)
movq 0x300e4(%rip), %rcx     # 0x698f8
movq %rax, (%rcx)
leaq 0x1f4d6(%rip), %rdi     # 0x58cf4
movq %rbx, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x2fdde(%rip), %rcx     # 0x69610
movq %rax, (%rcx)
leaq 0x1f4c4(%rip), %rdi     # 0x58d00
movq %rbx, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x30208(%rip), %rcx     # 0x69a58
movq %rax, (%rcx)
leaq 0x1f4b4(%rip), %rdi     # 0x58d0e
movq %r15, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x2fbd2(%rip), %rcx     # 0x69440
movq %rax, (%rcx)
leaq 0x1d168(%rip), %rdi     # 0x569e0
movq %r15, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x30314(%rip), %rcx     # 0x69ba0
movq %rax, (%rcx)
leaq 0x1f486(%rip), %rdi     # 0x58d1c
leaq 0x1f48b(%rip), %rsi     # 0x58d28
xorl %edx, %edx
callq *0x120(%r12)
movq 0x3017a(%rip), %rcx     # 0x69a28
movq %rax, (%rcx)
leaq 0x1f481(%rip), %rdi     # 0x58d39
movq %r15, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x30444(%rip), %rcx     # 0x69d10
movq %rax, (%rcx)
leaq 0x1f46c(%rip), %rdi     # 0x58d42
movq %r13, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x2ffc6(%rip), %rcx     # 0x698b0
movq %rax, (%rcx)
leaq 0x1f45d(%rip), %rdi     # 0x58d51
leaq 0x1f574(%rip), %rsi     # 0x58e6f
xorl %edx, %edx
callq *0x120(%r12)
movq 0x3047c(%rip), %rcx     # 0x69d88
movq %rax, (%rcx)
leaq 0x1f445(%rip), %rdi     # 0x58d5b
leaq 0x19ba6(%rip), %rsi     # 0x534c3
xorl %edx, %edx
callq *0x120(%r12)
movq 0x30012(%rip), %rcx     # 0x69940
movq %rax, (%rcx)
leaq 0x1f42f(%rip), %rdi     # 0x58d67
leaq 0x1f435(%rip), %rsi     # 0x58d74
xorl %edx, %edx
callq *0x120(%r12)
movq 0x2fe08(%rip), %r13     # 0x69758
movq %rax, (%r13)
leaq 0x1f425(%rip), %rdi     # 0x58d80
leaq 0x1f428(%rip), %rsi     # 0x58d8a
xorl %edx, %edx
callq *0x120(%r12)
movq 0x2fd25(%rip), %rcx     # 0x69698
movq %rax, (%rcx)
leaq 0x1f417(%rip), %rdi     # 0x58d94
movq %r15, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x2fc77(%rip), %rcx     # 0x69608
movq %rax, (%rcx)
leaq 0x1f404(%rip), %rdi     # 0x58d9f
movq %r15, %rsi
movq %r14, %r15
xorl %edx, %edx
callq *0x120(%r12)
movq 0x2fe76(%rip), %rcx     # 0x69828
movq %rax, (%rcx)
xorl %eax, %eax
callq 0x192c0
movq %r12, %rdi
leaq 0x1aef0(%rip), %rsi     # 0x548b6
callq 0x19580
leaq 0x1f3d7(%rip), %rdi     # 0x58da9
movq %rbx, %rsi
xorl %edx, %edx
callq *0x120(%r12)
movq 0x302aa(%rip), %rcx     # 0x69c90
movq %rax, (%rcx)
callq 0x18ca0
movq 0x3034b(%rip), %r14     # 0x69d40
movq %r14, %rdi
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdx
xorl %eax, %eax
callq 0x18e10
leaq 0x200(%r14), %rdi
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdx
xorl %eax, %eax
callq 0x18e10
movq 0x2fa84(%rip), %rax     # 0x694a8
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
movl %eax, 0x614(%r14)
imull $0x4a8, %eax, %edi      # imm = 0x4A8
movl $0x2fd, %esi            # imm = 0x2FD
callq *0x108(%r12)
movq 0x2fb0b(%rip), %rcx     # 0x69558
movq %rax, (%rcx)
movq 0x300b1(%rip), %rbx     # 0x69b08
movq %rax, 0x80(%rbx)
movl 0x614(%r14), %eax
movl %eax, 0x90(%rbx)
movq 0x2fabe(%rip), %rax     # 0x69530
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
movl %eax, 0x610(%r14)
imull $0x9140, %eax, %edi     # imm = 0x9140
movl $0x2fd, %esi            # imm = 0x2FD
callq *0x108(%r12)
movq %rax, 0x408(%r14)
movl 0x610(%r14), %eax
incl %eax
movl %eax, 0x8c(%rbx)
movq 0x30327(%rip), %rbp     # 0x69dd8
cmpl $0x0, (%rbp)
jne 0x39d07
movq (%r15), %rax
movq 0x8(%rax), %rdx
movq (%r13), %rax
movq 0x8(%rax), %rcx
leaq 0x1ae89(%rip), %rsi     # 0x5495a
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x19700
leaq 0x19797(%rip), %rsi     # 0x5327e
movq %r14, %rdi
callq 0x19470
movq %rax, %r13
testq %rax, %rax
jne 0x39b0d
leaq 0x1f276(%rip), %rdi     # 0x58d74
leaq 0x19779(%rip), %rsi     # 0x5327e
callq 0x19470
movq %rax, %r13
testq %r13, %r13
je 0x39cc7
movl $0x0, (%rbp)
leaq 0x50(%rsp), %rdi
movl $0xff, %esi
movq %r13, %rdx
callq 0x18a00
testq %rax, %rax
je 0x39c6e
leaq 0x50(%rsp), %r12
movl $0x64, %edi
movl $0x2fd, %esi            # imm = 0x2FD
movq 0x2fab2(%rip), %rax     # 0x69600
callq *0x108(%rax)
movq %rax, %r15
movl $0x0, 0x8(%rsp)
movl $0x63, 0xc(%rsp)
movq %r12, %rdi
leaq 0x1a1ab(%rip), %rsi     # 0x53d1c
movq %rax, %rdx
leaq 0x8(%rsp), %rcx
leaq 0xc(%rsp), %r8
xorl %eax, %eax
callq 0x18fe0
cmpl $0x3, %eax
je 0x39bc1
movq %r12, %rdi
leaq 0x1f220(%rip), %rsi     # 0x58db4
movq %r15, %rdx
leaq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x18fe0
cmpl $0x2, %eax
je 0x39bc1
movq %r12, %rdi
leaq 0x19dfb(%rip), %rsi     # 0x539ad
movq %r15, %rdx
xorl %eax, %eax
callq 0x18fe0
cmpl $0x1, %eax
jne 0x39c39
movq %rbp, %r14
cmpb $0x0, (%r15)
je 0x39bf4
callq 0x19a30
movq %rax, %rbp
xorl %ebx, %ebx
movq (%rbp), %rax
movsbq (%r15,%rbx), %rcx
movb (%rax,%rcx,4), %al
movb %al, (%r15,%rbx)
incq %rbx
movq %r15, %rdi
callq 0x18680
cmpq %rax, %rbx
jb 0x39bd4
movq %r14, %rbp
movslq (%r14), %rax
leaq (%rax,%rax,2), %rcx
movq 0x2fbc3(%rip), %rsi     # 0x697c8
movq %r15, (%rsi,%rcx,8)
movl 0x8(%rsp), %edx
movl %edx, 0x8(%rsi,%rcx,8)
movl 0xc(%rsp), %edx
movl %edx, 0xc(%rsi,%rcx,8)
incl %eax
movl %eax, (%r14)
movq %r12, %rdi
movl $0xff, %esi
movq %r13, %rdx
callq 0x18a00
testq %rax, %rax
jne 0x39b3d
jmp 0x39c6e
movups 0x1f17a(%rip), %xmm0    # 0x58dba
movaps %xmm0, 0x50(%rsp)
movabsq $0x7473696c70616d, %rax # imm = 0x7473696C70616D
movq %rax, 0x5d(%rsp)
movq %r12, %rdi
xorl %eax, %eax
movq 0x2f9a0(%rip), %rbx     # 0x69600
callq *0x8(%rbx)
movq %r15, %rdi
callq *0x110(%rbx)
jmp 0x39c1e
movl (%rbp), %r15d
leal -0x1(%r15), %edx
movq 0x2fb4b(%rip), %rdi     # 0x697c8
xorl %esi, %esi
callq 0x19560
leaq 0x1f144(%rip), %rsi     # 0x58dcf
leaq 0x50(%rsp), %r12
movq %r12, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x19700
movq %r12, %rdi
xorl %eax, %eax
movq 0x2f957(%rip), %rcx     # 0x69600
callq *0x8(%rcx)
movq %r13, %rdi
callq 0x185a0
movl (%rbp), %edi
testl %edi, %edi
je 0x39cf8
callq 0x193b0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x39cfd
leaq 0x1f119(%rip), %rsi     # 0x58de7
leaq 0x50(%rsp), %r14
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x19700
movq %r14, %rdi
xorl %eax, %eax
movq 0x2f912(%rip), %rcx     # 0x69600
callq *0x8(%rcx)
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x39d04
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
movq 0x301ac(%rip), %r15     # 0x69eb0
movl %eax, (%rbp)
movq (%r15), %rax
movq 0x8(%rax), %rdx
leaq 0x1f0ff(%rip), %rsi     # 0x58e14
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x19700
leaq 0x19553(%rip), %rsi     # 0x5327e
movq %r14, %rdi
callq 0x19470
movq %rax, %r14
testq %rax, %rax
jne 0x39d51
leaq 0x1f0d5(%rip), %rdi     # 0x58e17
leaq 0x19535(%rip), %rsi     # 0x5327e
callq 0x19470
movq %rax, %r14
testq %r14, %r14
je 0x39db4
movq %r15, %rbx
leaq 0x50(%rsp), %rdi
movl $0xff, %esi
movq %r14, %rdx
callq 0x18a00
testq %rax, %rax
je 0x39dfc
movq 0x2ffa5(%rip), %r13     # 0x69d20
xorl %r15d, %r15d
leaq 0x50(%rsp), %r12
movq 0x60(%rsp), %rax
movq %rax, 0x10(%r13)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%r13)
incq %r15
movq %r12, %rdi
movl $0xff, %esi
movq %r14, %rdx
callq 0x18a00
addq $0x19, %r13
testq %rax, %rax
jne 0x39d83
jmp 0x39dff
leaq 0x1f07c(%rip), %rsi     # 0x58e37
leaq 0x50(%rsp), %r14
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x19700
movq %r14, %rdi
xorl %eax, %eax
movq 0x2f825(%rip), %rcx     # 0x69600
callq *0x8(%rcx)
movq 0x2ff3b(%rip), %rax     # 0x69d20
movups 0x1f06d(%rip), %xmm0    # 0x58e59
movaps %xmm0, (%rax)
movl $0x2e656c, 0xf(%rax)    # imm = 0x2E656C
movb $0x0, 0x19(%rax)
jmp 0x39e4a
xorl %r15d, %r15d
leaq (%r15,%r15,4), %rax
leaq (%rax,%rax,4), %rax
movq 0x2ff12(%rip), %rcx     # 0x69d20
movb $0x0, (%rcx,%rax)
movq %r14, %rdi
callq 0x185a0
leaq 0x1efff(%rip), %rsi     # 0x58e20
leaq 0x50(%rsp), %r14
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x19700
movq %r14, %rdi
xorl %eax, %eax
movq 0x2f7bc(%rip), %rcx     # 0x69600
callq *0x8(%rcx)
movq %rbx, %r15
movq 0x2ff37(%rip), %rax     # 0x69d88
movq (%rax), %rax
testq %rax, %rax
je 0x39e7e
movq 0x8(%rax), %rcx
cmpb $0x0, (%rcx)
je 0x39e7e
movq (%r15), %rax
movq 0x8(%rax), %rdx
leaq 0x1aaea(%rip), %rsi     # 0x5495a
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x19700
jmp 0x39e98
movq (%r15), %rax
movq 0x8(%rax), %rdx
leaq 0x1efe0(%rip), %rsi     # 0x58e6c
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x19700
leaq 0x193df(%rip), %rsi     # 0x5327e
leaq 0x10(%rsp), %rdi
callq 0x19470
movq %rax, %rbx
testq %rax, %rax
jne 0x39ec7
leaq 0x1efb7(%rip), %rdi     # 0x58e6f
leaq 0x193bf(%rip), %rsi     # 0x5327e
callq 0x19470
movq %rax, %rbx
testq %rbx, %rbx
je 0x39eed
movq 0x2f7cd(%rip), %rdi     # 0x696a0
movl $0x3e8, %esi            # imm = 0x3E8
movl $0x1, %edx
movq %rbx, %rcx
callq 0x183f0
movq %rbx, %rdi
callq 0x185a0
xorl %eax, %eax
callq 0x18830
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq