// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/build.c
// Function: app_main
int app_main(int argc, char const * const argv[])
{
	char quitflag;
	int grpstoadd = 0;
	char const ** grps = NULL;
	int i, j;

#ifdef HAVE_STARTWIN
	char cmdsetup = 0;
    struct startwin_settings settings;
    int startretval = STARTWIN_RUN;
#endif

	pathsearchmode = PATHSEARCH_SYSTEM;		// unrestrict findfrompath so that full access to the filesystem can be had

	OSD_RegisterFunction("restartvid","restartvid: reinitialise the video mode",osdcmd_restartvid);
	OSD_RegisterFunction("vidmode","vidmode [xdim ydim] [bpp] [fullscreen]: immediately change the video mode",osdcmd_vidmode);
	OSD_RegisterFunction("mapversion","mapversion [ver]: change the map version for save (min 5, max 8)", osdcmd_mapversion);
	OSD_RegisterFunction("showspriteextents","showspriteextents [state]: show floor/wall sprite extents and "
		"walldist clipping boundary (0 = off, 1 = extents, 2 = +clip)", osdcmd_showspriteextents);

	wm_setapptitle("BUILD by Ken Silverman");

#ifdef RENDERTYPEWIN
	win_allowbackgroundidle(1);
#endif

	editstatus = 1;
	boardfilename[0] = 0;
	for (i=1; i<argc; i++) {
		if (argv[i][0] == '-') {
			if (!strcmp(argv[i], "-g") || !strcmp(argv[i], "-grp")) {
				i++;
				if (grpstoadd == 0) grps = (char const **)malloc(sizeof(char const *) * argc);
				grps[grpstoadd++] = argv[i];
			}
			else if (!strcmp(argv[i], "-help") || !strcmp(argv[i], "--help") || !strcmp(argv[i], "-?")) {
				char *s =
					"BUILD by Ken Silverman\n"
					"Syntax: build [options] mapname\n"
					"Options:\n"
					"\t-grp name.ext\tUse an extra GRP or ZIP file.\n"
					"\t-g name.ext\tSame as above.\n"
#ifdef HAVE_STARTWIN
					"\t-setup\tDisplays the configuration dialogue box before entering the editor.\n"
#endif
					;
#ifdef HAVE_STARTWIN
				wm_msgbox("BUILD by Ken Silverman","%s",s);
#else
				puts(s);
#endif
				return 0;
			}
#ifdef HAVE_STARTWIN
			else if (!strcmp(argv[i], "-setup")) cmdsetup = 1;
#endif
			continue;
		}
		if (!boardfilename[0]) {
			strncpy(boardfilename, argv[i], BMAX_PATH-4-1);
			boardfilename[BMAX_PATH-4-1] = 0;
		}
	}
	if (boardfilename[0] == 0) {
		Bstrcpy(boardfilename,"newboard.map");
	} else if (Bstrrchr(boardfilename,'.') == 0) {
		Bstrcat(boardfilename, ".map");
	}
	//Bcanonicalisefilename(boardfilename,0);

	if ((i = ExtInit()) < 0) return -1;

#ifdef HAVE_STARTWIN
    memset(&settings, 0, sizeof(settings));
    settings.fullscreen = fullscreen;
    settings.xdim2d = xdim2d;
    settings.ydim2d = ydim2d;
    settings.xdim3d = xdimgame;
    settings.ydim3d = ydimgame;
    settings.bpp3d = bppgame;
    settings.forcesetup = forcesetup;

    if (i || forcesetup || cmdsetup) {
        if (quitevent) return 0;

        startretval = startwin_run(&settings);
        if (startretval == STARTWIN_CANCEL)
            return 0;
    }

    fullscreen = settings.fullscreen;
    xdim2d = settings.xdim2d;
    ydim2d = settings.ydim2d;
    xdimgame = settings.xdim3d;
    ydimgame = settings.ydim3d;
    bppgame = settings.bpp3d;
    forcesetup = settings.forcesetup;
#endif

	if (grps && grpstoadd > 0) {
		for (i=0;i<grpstoadd;i++) {
			buildprintf("Adding %s\n",grps[i]);
			initgroupfile(grps[i]);
		}
		free((void *)grps);
	}

	buildsetlogfile("build.log");

	inittimer(TIMERINTSPERSECOND, keytimerstuff);
	initinput();
	initmouse();

	loadpics("tiles000.art",1048576);
	loadnames();

	Bstrcpy(kensig,"BUILD by Ken Silverman");
	initcrc();

	if (!loaddefinitionsfile(defsfilename)) buildputs("Definitions file loaded.\n");

	if (setgamemode(fullscreen,xdimgame,ydimgame,bppgame) < 0)
	{
		ExtUnInit();
		uninitengine();
		buildprintf("%d * %d not supported in this graphics mode\n",xdim,ydim);
		exit(0);
	}
	setbrightness(brightness,palette,0);

	int dark = INT_MAX;
	int light = 0;
	for(i=0;i<256;i++)
	{
		j = ((int)palette[i*3])+((int)palette[i*3+1])+((int)palette[i*3+2]);
		if (j > light) { light = j; whitecol = i; }
		if (j < dark) { dark = j; blackcol = i; }
	}

	for(i=0;i<MAXSECTORS;i++) sector[i].extra = -1;
	for(i=0;i<MAXWALLS;i++) wall[i].extra = -1;
	for(i=0;i<MAXSPRITES;i++) sprite[i].extra = -1;

	wm_setwindowtitle("(new board)");

	ExtPreLoadMap();
	j = pathsearchmode == PATHSEARCH_GAME && grponlymode ? KOPEN4LOAD_ANYGRP : KOPEN4LOAD_ANY;
	i = loadboard(boardfilename,j,&posx,&posy,&posz,&ang,&cursectnum);
	if (i == -2) i = loadoldboard(boardfilename,j,&posx,&posy,&posz,&ang,&cursectnum);
	if (i < 0)
	{
		initspritelists();
		posx = 32768;
		posy = 32768;
		posz = 0;
		ang = 1536;
		numsectors = 0;
		numwalls = 0;
		cursectnum = -1;
		overheadeditor();
		keystatus[buildkeys[14]] = 0;
	}
	else
	{
		ExtLoadMap(boardfilename);
	}

	updatenumsprites();

	startposx = posx;
	startposy = posy;
	startposz = posz;
	startang = ang;
	startsectnum = cursectnum;

	totalclock = 0;

	quitflag = 0;
	while (quitflag == 0)
	{
		if (handleevents()) {
			if (quitevent) {
				keystatus[1] = 1;
				quitevent = 0;
			}
		}

		OSD_DispatchQueued();

		ExtPreCheckKeys();

		drawrooms(posx,posy,posz,ang,horiz,cursectnum);
		ExtAnalyzeSprites();
		drawmasks();

		ExtCheckKeys();

		nextpage();
		synctics = totalclock-lockclock;
		lockclock += synctics;

		if (keystatus[1] > 0)
		{
			keystatus[1] = 0;
			printmessage256("Really want to quit?");
			showframe();

			synctics = totalclock-lockclock;
			lockclock += synctics;

			while ((keystatus[1]|keystatus[0x1c]|keystatus[0x39]|keystatus[0x31]) == 0)
			{
				if (handleevents()) {
					if (quitevent) {
						quitflag = 1;
						break;
					}
				}

				if (keystatus[0x15] != 0) {
					keystatus[0x15] = 0;
					quitflag = 1; break;
				}
			}
		}
	}

	if (asksave)
	{
		printmessage256("Save changes?");
		showframe();

		while ((keystatus[1]|keystatus[0x1c]|keystatus[0x39]|keystatus[0x31]) == 0)
		{
			if (handleevents()) if (quitevent) break;	// like saying no

			if (keystatus[0x15] != 0) {
				char *filename;
				int bad;

				keystatus[0x15] = 0;

				filename = boardfilename;
				if (pathsearchmode == PATHSEARCH_GAME) {
					filename = findfilename(filename);
				}

				fixspritesectors();   //Do this before saving!
				updatesector(startposx,startposy,&startsectnum);
				ExtPreSaveMap();
				if (mapversion < 7) {
					bad = saveoldboard(filename,&startposx,&startposy,&startposz,&startang,&startsectnum);
				} else {
					bad = saveboard(filename,&startposx,&startposy,&startposz,&startang,&startsectnum);
				}
				if (!bad) {
					ExtSaveMap(filename);
				}
				break;
			}
		}
	}

	clearfilenames();
	ExtUnInit();
	uninitengine();

	buildprintf("Memory status: %d(%d) bytes\n",cachesize,artsize);
	buildprintf("%s\n",kensig);
	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movb $0x0, -0x29(%rbp)
movl $0x1, -0x4c(%rbp)
leaq 0x1e4f6d(%rip), %rax    # 0x1f1260
movl $0x1, (%rax)
leaq 0xa3d5c(%rip), %rdi     # 0xb005c
leaq 0xa3d60(%rip), %rsi     # 0xb0067
leaq 0xac2(%rip), %rdx       # 0xcdd0
callq 0x6c300
leaq 0xa3d75(%rip), %rdi     # 0xb008f
leaq 0xa3d76(%rip), %rsi     # 0xb0097
leaq 0xb28(%rip), %rdx       # 0xce50
callq 0x6c300
leaq 0xa3dad(%rip), %rdi     # 0xb00e1
leaq 0xa3db1(%rip), %rsi     # 0xb00ec
leaq 0xc7e(%rip), %rdx       # 0xcfc0
callq 0x6c300
leaq 0xa3ddf(%rip), %rdi     # 0xb012d
leaq 0xa3dea(%rip), %rsi     # 0xb013f
leaq 0xd04(%rip), %rdx       # 0xd060
callq 0x6c300
leaq 0xa3e52(%rip), %rdi     # 0xb01ba
callq 0xa4800
leaq 0x1e9228(%rip), %rax    # 0x1f559c
movw $0x1, (%rax)
movb $0x0, 0x15dd10(%rip)    # 0x16a090
movl $0x1, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0xc517
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0xc4da
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa3e13(%rip), %rsi     # 0xb01d1
callq 0x6820
cmpl $0x0, %eax
je 0xc3e5
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa3df9(%rip), %rsi     # 0xb01d4
callq 0x6820
cmpl $0x0, %eax
jne 0xc42c
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0xc405
movslq -0x8(%rbp), %rdi
shlq $0x3, %rdi
callq 0x68f0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x18(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xc4d8
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa3d9b(%rip), %rsi     # 0xb01da
callq 0x6820
cmpl $0x0, %eax
je 0xc483
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa3d7d(%rip), %rsi     # 0xb01d9
callq 0x6820
cmpl $0x0, %eax
je 0xc483
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa3d67(%rip), %rsi     # 0xb01e0
callq 0x6820
cmpl $0x0, %eax
jne 0xc4b3
leaq 0xa3d59(%rip), %rax     # 0xb01e3
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdx
leaq 0xa3d21(%rip), %rdi     # 0xb01ba
leaq 0xa455b(%rip), %rsi     # 0xb09fb
movb $0x0, %al
callq 0xa4450
movl $0x0, -0x4(%rbp)
jmp 0xcdb6
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa3df3(%rip), %rsi     # 0xb02b9
callq 0x6820
cmpl $0x0, %eax
jne 0xc4d4
movb $0x1, -0x29(%rbp)
jmp 0xc4d6
jmp 0xc4d8
jmp 0xc509
cmpb $0x0, 0x15dbaf(%rip)    # 0x16a090
jne 0xc507
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x15db9a(%rip), %rdi    # 0x16a090
movl $0x3fb, %edx            # imm = 0x3FB
callq 0x6180
movb $0x0, 0x15df84(%rip)    # 0x16a48b
jmp 0xc509
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc387
movsbl 0x15db72(%rip), %eax    # 0x16a090
cmpl $0x0, %eax
jne 0xc538
leaq 0x15db66(%rip), %rdi    # 0x16a090
leaq 0xa3d8f(%rip), %rsi     # 0xb02c0
callq 0x63e0
jmp 0xc564
leaq 0x15db51(%rip), %rdi    # 0x16a090
movl $0x2e, %esi
callq 0x6910
cmpq $0x0, %rax
jne 0xc562
leaq 0x15db3a(%rip), %rdi    # 0x16a090
leaq 0xa43cc(%rip), %rsi     # 0xb0929
callq 0x6690
jmp 0xc564
callq 0xab60
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
jge 0xc57d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xcdb6
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x1c, %edx
callq 0x62d0
leaq 0x1ae674(%rip), %rax    # 0x1bac08
movl (%rax), %eax
movl %eax, -0x48(%rbp)
movl 0xd39d9(%rip), %eax     # 0xdff78
movl %eax, -0x44(%rbp)
movl 0xd39d4(%rip), %eax     # 0xdff7c
movl %eax, -0x40(%rbp)
movl 0xd39cf(%rip), %eax     # 0xdff80
movl %eax, -0x3c(%rbp)
movl 0xd39ca(%rip), %eax     # 0xdff84
movl %eax, -0x38(%rbp)
movl 0xd39c5(%rip), %eax     # 0xdff88
movl %eax, -0x34(%rbp)
movl 0xd39c0(%rip), %eax     # 0xdff8c
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0xc5e7
cmpl $0x0, 0xd39b0(%rip)     # 0xdff8c
jne 0xc5e7
movsbl -0x29(%rbp), %eax
cmpl $0x0, %eax
je 0xc61f
leaq 0x1ae612(%rip), %rax    # 0x1bac00
cmpb $0x0, (%rax)
je 0xc5ff
movl $0x0, -0x4(%rbp)
jmp 0xcdb6
leaq -0x48(%rbp), %rdi
callq 0x2d100
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
jne 0xc61d
movl $0x0, -0x4(%rbp)
jmp 0xcdb6
jmp 0xc61f
movl -0x48(%rbp), %ecx
leaq 0x1ae5df(%rip), %rax    # 0x1bac08
movl %ecx, (%rax)
movl -0x44(%rbp), %eax
movl %eax, 0xd3944(%rip)     # 0xdff78
movl -0x40(%rbp), %eax
movl %eax, 0xd393f(%rip)     # 0xdff7c
movl -0x3c(%rbp), %eax
movl %eax, 0xd393a(%rip)     # 0xdff80
movl -0x38(%rbp), %eax
movl %eax, 0xd3935(%rip)     # 0xdff84
movl -0x34(%rbp), %eax
movl %eax, 0xd3930(%rip)     # 0xdff88
movl -0x30(%rbp), %eax
movl %eax, 0xd392b(%rip)     # 0xdff8c
cmpq $0x0, -0x20(%rbp)
je 0xc6bc
cmpl $0x0, -0x18(%rbp)
jle 0xc6bc
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0xc6b3
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xa3c3d(%rip), %rdi     # 0xb02cd
movb $0x0, %al
callq 0x37c90
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2f720
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc675
movq -0x20(%rbp), %rdi
callq 0x61c0
leaq 0xa3c15(%rip), %rdi     # 0xb02d8
callq 0x5a8a0
movl $0x78, %edi
leaq 0xa1c(%rip), %rsi       # 0xd0f0
callq 0xa55d0
callq 0xa5120
callq 0xa5440
leaq 0xa3bf8(%rip), %rdi     # 0xb02e2
movl $0x100000, %esi         # imm = 0x100000
callq 0x4e0a0
callq 0xd4b0
leaq 0x15dd90(%rip), %rdi    # 0x16a490
leaq 0xa3ab3(%rip), %rsi     # 0xb01ba
callq 0x63e0
callq 0xda00
leaq 0xc2f98(%rip), %rax     # 0xcf6b0
movq (%rax), %rdi
callq 0x33300
cmpl $0x0, %eax
jne 0xc731
leaq 0xa3bc3(%rip), %rdi     # 0xb02ef
callq 0x4a720
leaq 0x1ae4d0(%rip), %rax    # 0x1bac08
movl (%rax), %eax
movl 0xd3840(%rip), %esi     # 0xdff80
movl 0xd383e(%rip), %edx     # 0xdff84
movl 0xd383c(%rip), %ecx     # 0xdff88
movsbl %al, %edi
callq 0x4c450
cmpl $0x0, %eax
jge 0xc78a
callq 0xaf20
callq 0x384b0
leaq 0x4365e2(%rip), %rax    # 0x442d4c
movl (%rax), %esi
leaq 0x4365dd(%rip), %rax    # 0x442d50
movl (%rax), %edx
leaq 0xa3b8d(%rip), %rdi     # 0xb0309
movb $0x0, %al
callq 0x37c90
xorl %edi, %edi
callq 0x6630
movswl 0x15d8eb(%rip), %edi    # 0x16a07c
leaq 0x2ac978(%rip), %rsi    # 0x2b9110
xorl %edx, %edx
callq 0x4c9c0
movl $0x7fffffff, -0x5c(%rbp) # imm = 0x7FFFFFFF
movl $0x0, -0x60(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x100, -0x24(%rbp)     # imm = 0x100
jge 0xc842
imull $0x3, -0x24(%rbp), %eax
movslq %eax, %rcx
leaq 0x2ac941(%rip), %rax    # 0x2b9110
movzbl (%rax,%rcx), %eax
imull $0x3, -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdx
leaq 0x2ac92c(%rip), %rcx    # 0x2b9110
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
imull $0x3, -0x24(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rdx
leaq 0x2ac915(%rip), %rcx    # 0x2b9110
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x60(%rbp), %eax
jle 0xc81b
movl -0x28(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x24(%rbp), %eax
movl %eax, 0x15dc8d(%rip)    # 0x16a4a8
movl -0x28(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0xc832
movl -0x28(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x24(%rbp), %eax
movl %eax, 0x15dc7a(%rip)    # 0x16a4ac
jmp 0xc834
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc7b4
movl $0x0, -0x24(%rbp)
cmpl $0x1000, -0x24(%rbp)    # imm = 0x1000
jge 0xc875
movslq -0x24(%rbp), %rcx
leaq 0x273d63(%rip), %rax    # 0x2805c0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movw $0xffff, 0x26(%rax)     # imm = 0xFFFF
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc849
movl $0x0, -0x24(%rbp)
cmpl $0x4000, -0x24(%rbp)    # imm = 0x4000
jge 0xc8a8
movslq -0x24(%rbp), %rcx
leaq 0x1e8d20(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movw $0xffff, 0x1e(%rax)     # imm = 0xFFFF
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc87c
movl $0x0, -0x24(%rbp)
cmpl $0x4000, -0x24(%rbp)    # imm = 0x4000
jge 0xc8db
movslq -0x24(%rbp), %rcx
leaq 0x2acf4d(%rip), %rax    # 0x2b9810
imulq $0x2c, %rcx, %rcx
addq %rcx, %rax
movw $0xffff, 0x2a(%rax)     # imm = 0xFFFF
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc8af
leaq 0xa3a54(%rip), %rdi     # 0xb0336
callq 0xa4850
callq 0xb1c0
xorl %eax, %eax
leaq 0x1e496b(%rip), %rcx    # 0x1f1260
cmpl $0x0, (%rcx)
movb %al, -0x6d(%rbp)
jne 0xc90a
cmpl $0x0, 0x15d774(%rip)    # 0x16a078
setne %al
movb %al, -0x6d(%rbp)
movb -0x6d(%rbp), %dl
xorl %eax, %eax
movl $0x2, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movb %al, %sil
leaq 0x15d766(%rip), %rdi    # 0x16a090
leaq 0x15db7f(%rip), %rdx    # 0x16a4b0
leaq 0x15db7c(%rip), %rcx    # 0x16a4b4
leaq 0x15db79(%rip), %r8     # 0x16a4b8
leaq 0x15db76(%rip), %r9     # 0x16a4bc
leaq 0x15db71(%rip), %rax    # 0x16a4be
movsbl %sil, %esi
movq %rax, (%rsp)
callq 0x45730
movl %eax, -0x24(%rbp)
cmpl $-0x2, -0x24(%rbp)
jne 0xc9a3
movl -0x28(%rbp), %eax
movb %al, %sil
leaq 0x15d720(%rip), %rdi    # 0x16a090
leaq 0x15db39(%rip), %rdx    # 0x16a4b0
leaq 0x15db36(%rip), %rcx    # 0x16a4b4
leaq 0x15db33(%rip), %r8     # 0x16a4b8
leaq 0x15db30(%rip), %r9     # 0x16a4bc
leaq 0x15db2b(%rip), %rax    # 0x16a4be
movsbl %sil, %esi
movq %rax, (%rsp)
callq 0x462b0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0xca0f
callq 0x385d0
movl $0x8000, 0x15daf8(%rip) # imm = 0x8000
movl $0x8000, 0x15daf2(%rip) # imm = 0x8000
movl $0x0, 0x15daec(%rip)    # 0x16a4b8
movw $0x600, 0x15dae7(%rip)  # imm = 0x600
leaq 0x4000e4(%rip), %rax    # 0x40cac0
movw $0x0, (%rax)
leaq 0x444fe0(%rip), %rax    # 0x4519c8
movw $0x0, (%rax)
movw $0xffff, 0x15dac8(%rip) # imm = 0xFFFF
callq 0xdab0
movslq 0xd3556(%rip), %rcx     # 0xdff58
leaq 0x1ae3e7(%rip), %rax    # 0x1badf0
movb $0x0, (%rax,%rcx)
jmp 0xca1b
leaq 0x15d67a(%rip), %rdi    # 0x16a090
callq 0xb1d0
callq 0x19ed0
movl 0x15da8a(%rip), %ecx    # 0x16a4b0
leaq 0x47c147(%rip), %rax    # 0x488b74
movl %ecx, (%rax)
movl 0x15da7f(%rip), %ecx    # 0x16a4b4
leaq 0x47c13c(%rip), %rax    # 0x488b78
movl %ecx, (%rax)
movl 0x15da74(%rip), %ecx    # 0x16a4b8
leaq 0x47c131(%rip), %rax    # 0x488b7c
movl %ecx, (%rax)
movw 0x15da68(%rip), %cx     # 0x16a4bc
leaq 0x47c125(%rip), %rax    # 0x488b80
movw %cx, (%rax)
movw 0x15da59(%rip), %cx     # 0x16a4be
leaq 0x47c116(%rip), %rax    # 0x488b82
movw %cx, (%rax)
leaq 0x3dc5d2(%rip), %rax    # 0x3e9048
movl $0x0, (%rax)
movb $0x0, -0x11(%rbp)
movsbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jne 0xcc05
callq 0xa6ab0
cmpl $0x0, %eax
je 0xcaba
leaq 0x1ae162(%rip), %rax    # 0x1bac00
cmpb $0x0, (%rax)
je 0xcab8
leaq 0x1ae346(%rip), %rax    # 0x1badf0
movb $0x1, 0x1(%rax)
leaq 0x1ae14b(%rip), %rax    # 0x1bac00
movb $0x0, (%rax)
jmp 0xcaba
callq 0x6e560
callq 0xaf40
movl 0x15d9e6(%rip), %edi    # 0x16a4b0
movl 0x15d9e4(%rip), %esi    # 0x16a4b4
movl 0x15d9e2(%rip), %edx    # 0x16a4b8
movw 0x15d9df(%rip), %ax     # 0x16a4bc
movl 0xd348c(%rip), %r8d     # 0xdff70
movswl %ax, %ecx
movswl 0x15d9cf(%rip), %r9d    # 0x16a4be
callq 0x38730
callq 0xc230
callq 0x3bb80
callq 0xaf50
callq 0x4ce70
leaq 0x3dc539(%rip), %rax    # 0x3e9048
movl (%rax), %eax
subl 0x15d9a9(%rip), %eax    # 0x16a4c0
movl %eax, 0x15d9a7(%rip)    # 0x16a4c4
movl 0x15d9a1(%rip), %eax    # 0x16a4c4
addl 0x15d997(%rip), %eax    # 0x16a4c0
movl %eax, 0x15d991(%rip)    # 0x16a4c0
leaq 0x1ae2ba(%rip), %rax    # 0x1badf0
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jle 0xcc00
leaq 0x1ae2a6(%rip), %rax    # 0x1badf0
movb $0x0, 0x1(%rax)
leaq 0xa37ed(%rip), %rdi     # 0xb0342
callq 0x19f30
callq 0xa67c0
leaq 0x3dc4e2(%rip), %rax    # 0x3e9048
movl (%rax), %eax
subl 0x15d952(%rip), %eax    # 0x16a4c0
movl %eax, 0x15d950(%rip)    # 0x16a4c4
movl 0x15d94a(%rip), %eax    # 0x16a4c4
addl 0x15d940(%rip), %eax    # 0x16a4c0
movl %eax, 0x15d93a(%rip)    # 0x16a4c0
leaq 0x1ae263(%rip), %rax    # 0x1badf0
movsbl 0x1(%rax), %eax
leaq 0x1ae258(%rip), %rcx    # 0x1badf0
movsbl 0x1c(%rcx), %ecx
orl %ecx, %eax
leaq 0x1ae24b(%rip), %rcx    # 0x1badf0
movsbl 0x39(%rcx), %ecx
orl %ecx, %eax
leaq 0x1ae23e(%rip), %rcx    # 0x1badf0
movsbl 0x31(%rcx), %ecx
orl %ecx, %eax
cmpl $0x0, %eax
jne 0xcbfe
callq 0xa6ab0
cmpl $0x0, %eax
je 0xcbdb
leaq 0x1ae032(%rip), %rax    # 0x1bac00
cmpb $0x0, (%rax)
je 0xcbd9
movb $0x1, -0x11(%rbp)
jmp 0xcbfe
jmp 0xcbdb
leaq 0x1ae20e(%rip), %rax    # 0x1badf0
movsbl 0x15(%rax), %eax
cmpl $0x0, %eax
je 0xcbfc
leaq 0x1ae1fe(%rip), %rax    # 0x1badf0
movb $0x0, 0x15(%rax)
movb $0x1, -0x11(%rbp)
jmp 0xcbfe
jmp 0xcb86
jmp 0xcc00
jmp 0xca80
cmpw $0x0, 0x15d479(%rip)    # 0x16a086
je 0xcd6b
leaq 0xa373d(%rip), %rdi     # 0xb0357
callq 0x19f30
callq 0xa67c0
leaq 0x1ae1c5(%rip), %rax    # 0x1badf0
movsbl 0x1(%rax), %eax
leaq 0x1ae1ba(%rip), %rcx    # 0x1badf0
movsbl 0x1c(%rcx), %ecx
orl %ecx, %eax
leaq 0x1ae1ad(%rip), %rcx    # 0x1badf0
movsbl 0x39(%rcx), %ecx
orl %ecx, %eax
leaq 0x1ae1a0(%rip), %rcx    # 0x1badf0
movsbl 0x31(%rcx), %ecx
orl %ecx, %eax
cmpl $0x0, %eax
jne 0xcd69
callq 0xa6ab0
cmpl $0x0, %eax
je 0xcc7c
leaq 0x1adf90(%rip), %rax    # 0x1bac00
cmpb $0x0, (%rax)
je 0xcc7a
jmp 0xcd69
jmp 0xcc7c
leaq 0x1ae16d(%rip), %rax    # 0x1badf0
movsbl 0x15(%rax), %eax
cmpl $0x0, %eax
je 0xcd64
leaq 0x1ae159(%rip), %rax    # 0x1badf0
movb $0x0, 0x15(%rax)
leaq 0x15d3ee(%rip), %rax    # 0x16a090
movq %rax, -0x68(%rbp)
leaq 0x1e45b3(%rip), %rax    # 0x1f1260
cmpl $0x0, (%rax)
jne 0xccbf
movq -0x68(%rbp), %rdi
callq 0x19fe0
movq %rax, -0x68(%rbp)
callq 0x1a030
leaq 0x47bea9(%rip), %rax    # 0x488b74
movl (%rax), %edi
leaq 0x47bea4(%rip), %rax    # 0x488b78
movl (%rax), %esi
leaq 0x47bea5(%rip), %rdx    # 0x488b82
callq 0x392a0
callq 0xb200
leaq 0xd3f9a(%rip), %rax     # 0xe0c88
cmpl $0x7, (%rax)
jge 0xcd24
movq -0x68(%rbp), %rdi
leaq 0x47be76(%rip), %rsi    # 0x488b74
leaq 0x47be73(%rip), %rdx    # 0x488b78
leaq 0x47be70(%rip), %rcx    # 0x488b7c
leaq 0x47be6d(%rip), %r8     # 0x488b80
leaq 0x47be68(%rip), %r9     # 0x488b82
callq 0x4a0e0
movl %eax, -0x6c(%rbp)
jmp 0xcd53
movq -0x68(%rbp), %rdi
leaq 0x47be45(%rip), %rsi    # 0x488b74
leaq 0x47be42(%rip), %rdx    # 0x488b78
leaq 0x47be3f(%rip), %rcx    # 0x488b7c
leaq 0x47be3c(%rip), %r8     # 0x488b80
leaq 0x47be37(%rip), %r9     # 0x488b82
callq 0x49b20
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
jne 0xcd62
movq -0x68(%rbp), %rdi
callq 0xb210
jmp 0xcd69
jmp 0xcc24
jmp 0xcd6b
callq 0x1a260
callq 0xaf20
callq 0x384b0
leaq 0x1e87f7(%rip), %rax    # 0x1f5578
movl (%rax), %esi
leaq 0x1e87e6(%rip), %rax    # 0x1f5570
movl (%rax), %edx
leaq 0xa35d2(%rip), %rdi     # 0xb0365
movb $0x0, %al
callq 0x37c90
leaq 0xa9233(%rip), %rdi     # 0xb5fd4
leaq 0x15d6e8(%rip), %rsi    # 0x16a490
movb $0x0, %al
callq 0x37c90
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)