// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movl %edi, %ebp
leaq 0x1a8b57(%rip), %rax    # 0x1b3700
movl $0x1, (%rax)
leaq 0x68562(%rip), %rdi     # 0x73118
leaq 0x68566(%rip), %rsi     # 0x73123
leaq 0x926(%rip), %rdx       # 0xb4ea
callq 0x49014
leaq 0x6857b(%rip), %rdi     # 0x7314b
leaq 0x6857c(%rip), %rsi     # 0x73153
leaq 0x95f(%rip), %rdx       # 0xb53d
callq 0x49014
leaq 0x685b3(%rip), %rdi     # 0x7319d
leaq 0x685b7(%rip), %rsi     # 0x731a8
leaq 0xa5b(%rip), %rdx       # 0xb653
callq 0x49014
leaq 0x685e5(%rip), %rdi     # 0x731e9
leaq 0x685f0(%rip), %rsi     # 0x731fb
leaq 0xaab(%rip), %rdx       # 0xb6bd
callq 0x49014
leaq 0x68658(%rip), %rdi     # 0x73276
callq 0x6bc55
leaq 0x1ace12(%rip), %rax    # 0x1b7a3c
movw $0x1, (%rax)
movb $0x0, 0x121cfa(%rip)    # 0x12c930
cmpl $0x2, %ebp
jl 0xad6e
movl %ebp, %eax
shlq $0x3, %rax
movq %rax, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movl $0x1, %r12d
xorl %ebx, %ebx
xorl %r15d, %r15d
movslq %r12d, %rax
movq (%r14,%rax,8), %r13
cmpb $0x2d, (%r13)
jne 0xad0b
movq %r13, %rdi
leaq 0x68613(%rip), %rsi     # 0x7328d
callq 0x68d0
testl %eax, %eax
je 0xad31
movq %r13, %rdi
leaq 0x685ff(%rip), %rsi     # 0x73290
callq 0x68d0
testl %eax, %eax
je 0xad31
movq %r13, %rdi
leaq 0x685ee(%rip), %rsi     # 0x73296
callq 0x68d0
testl %eax, %eax
je 0xb10a
movq %r13, %rdi
leaq 0x685d6(%rip), %rsi     # 0x73295
callq 0x68d0
testl %eax, %eax
je 0xb10a
movq %r13, %rdi
leaq 0x685c6(%rip), %rsi     # 0x7329c
callq 0x68d0
testl %eax, %eax
je 0xb10a
movq %r13, %rdi
leaq 0x68688(%rip), %rsi     # 0x73375
callq 0x68d0
testl %eax, %eax
movq 0x38(%rsp), %rax
movzbl %al, %eax
movl $0x1, %ecx
cmovel %ecx, %eax
movq %rax, 0x38(%rsp)
jmp 0xad57
cmpb $0x0, 0x121c1e(%rip)    # 0x12c930
jne 0xad57
movl $0x3fb, %edx            # imm = 0x3FB
leaq 0x121c10(%rip), %rdi    # 0x12c930
movq %r13, %rsi
callq 0x6190
movb $0x0, 0x121ffc(%rip)    # 0x12cd2b
jmp 0xad57
testl %r15d, %r15d
jne 0xad43
movq 0x40(%rsp), %rdi
callq 0x69a0
movq %rax, %rbx
incl %r12d
movslq %r12d, %rax
movq (%r14,%rax,8), %rax
movslq %r15d, %rcx
incl %r15d
movq %rax, (%rbx,%rcx,8)
incl %r12d
cmpl %ebp, %r12d
jl 0xac5e
cmpb $0x0, 0x38(%rsp)
setne %r13b
jmp 0xad76
xorl %r15d, %r15d
xorl %ebx, %ebx
xorl %r13d, %r13d
cmpb $0x0, 0x121bb3(%rip)    # 0x12c930
je 0xadb0
leaq 0x121baa(%rip), %r14    # 0x12c930
movq %r14, %rdi
movl $0x2e, %esi
callq 0x69e0
testq %rax, %rax
jne 0xadd2
movq %r14, %rdi
callq 0x6420
movl $0x70616d2e, (%rax,%r14) # imm = 0x70616D2E
movb $0x0, 0x4(%rax,%r14)
jmp 0xadd2
movabsq $0x70616d2e647261, %rax # imm = 0x70616D2E647261
movq %rax, 0x121b74(%rip)    # 0x12c935
movabsq $0x6472616f6277656e, %rax # imm = 0x6472616F6277656E
movq %rax, 0x121b5e(%rip)    # 0x12c930
callq 0x9cb5
testl %eax, %eax
js 0xb0ff
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movups %xmm0, 0x1c(%rsp)
leaq 0x1722b5(%rip), %r12    # 0x17d0a8
movl (%r12), %ecx
movl %ecx, 0x10(%rsp)
movl 0x981d7(%rip), %ecx     # 0xa2fd8
movl %ecx, 0x14(%rsp)
movl 0x981d1(%rip), %ecx     # 0xa2fdc
movl %ecx, 0x18(%rsp)
movl 0x981cb(%rip), %ecx     # 0xa2fe0
movl %ecx, 0x1c(%rsp)
movl 0x981c5(%rip), %ecx     # 0xa2fe4
movl %ecx, 0x20(%rsp)
movl 0x981bf(%rip), %ecx     # 0xa2fe8
movl %ecx, 0x24(%rsp)
movl 0x981b9(%rip), %ecx     # 0xa2fec
movl %ecx, 0x28(%rsp)
orl %ecx, %eax
setne %al
orb %r13b, %al
testb $0x1, %al
je 0xae68
leaq 0x172256(%rip), %rax    # 0x17d0a0
xorl %r14d, %r14d
cmpb $0x0, (%rax)
jne 0xb4a7
leaq 0x10(%rsp), %rdi
callq 0x1e2eb
testl %eax, %eax
je 0xb4a7
movl 0x10(%rsp), %eax
movl 0x14(%rsp), %ecx
movl %eax, (%r12)
movl %ecx, 0x9815e(%rip)     # 0xa2fd8
movl 0x18(%rsp), %eax
movl %eax, 0x98158(%rip)     # 0xa2fdc
movl 0x1c(%rsp), %eax
movl %eax, 0x98152(%rip)     # 0xa2fe0
movl 0x20(%rsp), %eax
movl %eax, 0x9814c(%rip)     # 0xa2fe4
movl 0x24(%rsp), %eax
movl %eax, 0x98146(%rip)     # 0xa2fe8
movl 0x28(%rsp), %eax
movl %eax, 0x98140(%rip)     # 0xa2fec
testq %rbx, %rbx
setne %al
testl %r15d, %r15d
setg %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xaef3
movl %r15d, %r15d
leaq 0x684c0(%rip), %r14     # 0x73389
xorl %r13d, %r13d
movq (%rbx,%r13,8), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x24cb4
movq (%rbx,%r13,8), %rdi
callq 0x1fa6b
incq %r13
cmpq %r13, %r15
jne 0xaecc
movq %rbx, %rdi
callq 0x61c0
leaq 0x6849a(%rip), %rdi     # 0x73394
callq 0x3c68f
leaq 0x819(%rip), %rsi       # 0xb71f
movl $0x78, %edi
callq 0x6c63e
callq 0x6c320
callq 0x6c561
leaq 0x6847d(%rip), %rdi     # 0x7339e
movl $0x100000, %esi         # imm = 0x100000
callq 0x34c98
callq 0xb935
movabsq $0x6e616d7265766c, %rax # imm = 0x6E616D7265766C
movq %rax, 0x121dfe(%rip)    # 0x12cd3f
movups 0x6832e(%rip), %xmm0    # 0x73276
movaps %xmm0, 0x121de1(%rip)   # 0x12cd30
leaq 0x877ba(%rip), %rax     # 0x92710
movq (%rax), %rdi
callq 0x220e4
testl %eax, %eax
jne 0xaf6e
leaq 0x68442(%rip), %rdi     # 0x733ab
callq 0x32200
movsbl (%r12), %edi
movl 0x98067(%rip), %esi     # 0xa2fe0
movl 0x98065(%rip), %edx     # 0xa2fe4
movl 0x98063(%rip), %ecx     # 0xa2fe8
callq 0x332f0
testl %eax, %eax
js 0xb4b9
movswl 0x121983(%rip), %edi    # 0x12c91c
leaq 0x270610(%rip), %rbx    # 0x27b5b0
xorl %r14d, %r14d
movq %rbx, %rsi
xorl %edx, %edx
callq 0x33747
addq $0x2, %rbx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movzbl -0x2(%rbx), %edx
movzbl -0x1(%rbx), %esi
addl %edx, %esi
movzbl (%rbx), %edx
addl %esi, %edx
cmpl %ecx, %edx
jbe 0xafd4
movl %r14d, 0x121d76(%rip)   # 0x12cd48
movl %edx, %ecx
cmpl %eax, %edx
jge 0xafe1
movl %r14d, 0x121d6d(%rip)   # 0x12cd4c
movl %edx, %eax
incq %r14
addq $0x3, %rbx
cmpq $0x100, %r14            # imm = 0x100
jne 0xafb8
movl $0x26, %eax
leaq 0x237a63(%rip), %rcx    # 0x242a60
movw $0xffff, (%rcx,%rax)    # imm = 0xFFFF
addq $0x28, %rax
cmpq $0x28026, %rax          # imm = 0x28026
jne 0xaffd
xorl %eax, %eax
leaq 0x1aca38(%rip), %rcx    # 0x1b7a50
movw $0xffff, 0x1e(%rcx,%rax) # imm = 0xFFFF
addq $0x20, %rax
cmpq $0x80000, %rax          # imm = 0x80000
jne 0xb018
movl $0x2a, %eax
leaq 0x270c79(%rip), %r14    # 0x27bcb0
movw $0xffff, (%r14,%rax)    # imm = 0xFFFF
addq $0x2c, %rax
cmpq $0xb002a, %rax          # imm = 0xB002A
jne 0xb037
leaq 0x683a1(%rip), %rdi     # 0x733f2
callq 0x6bc86
callq 0xa0d0
leaq 0x1a869e(%rip), %rax    # 0x1b3700
cmpl $0x0, (%rax)
sete %al
cmpl $0x0, 0x1218a9(%rip)    # 0x12c918
setne %bpl
andb %al, %bpl
leaq 0x121ce1(%rip), %r15    # 0x12cd5e
movq %r15, (%rsp)
movzbl %bpl, %esi
addl %esi, %esi
leaq 0x1218a2(%rip), %rbx    # 0x12c930
leaq 0x121cbb(%rip), %rdx    # 0x12cd50
leaq 0x121cb8(%rip), %rcx    # 0x12cd54
leaq 0x121cb5(%rip), %r8     # 0x12cd58
leaq 0x121cb2(%rip), %r9     # 0x12cd5c
movq %rbx, %rdi
callq 0x2f6ce
cmpl $-0x2, %eax
jne 0xb0ea
addb %bpl, %bpl
movq %r15, (%rsp)
movzbl %bpl, %esi
leaq 0x121867(%rip), %rdi    # 0x12c930
leaq 0x121c80(%rip), %rdx    # 0x12cd50
leaq 0x121c7d(%rip), %rcx    # 0x12cd54
leaq 0x121c7a(%rip), %r8     # 0x12cd58
leaq 0x121c77(%rip), %r9     # 0x12cd5c
callq 0x2f978
testl %eax, %eax
js 0xb12e
leaq 0x12183b(%rip), %rdi    # 0x12c930
callq 0xa0d1
jmp 0xb18d
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0xb4a7
leaq 0x68165(%rip), %rdi     # 0x73276
leaq 0x6898a(%rip), %rsi     # 0x73aa2
leaq 0x68180(%rip), %rdx     # 0x7329f
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x6b95c
jmp 0xb4a7
callq 0x2565f
movl $0x8000, %eax           # imm = 0x8000
movl %eax, 0x121c12(%rip)    # 0x12cd50
movl %eax, 0x121c10(%rip)    # 0x12cd54
movl $0x0, 0x121c0a(%rip)    # 0x12cd58
movw $0x600, 0x121c05(%rip)  # imm = 0x600
leaq 0x3c3e02(%rip), %rax    # 0x3cef60
xorl %ecx, %ecx
movw %cx, (%rax)
leaq 0x40aafe(%rip), %rax    # 0x415c68
movw %cx, (%rax)
movw $0xffff, 0x121be8(%rip) # imm = 0xFFFF
callq 0xbbec
movslq 0x97e36(%rip), %rax     # 0xa2fb8
leaq 0x172107(%rip), %rcx    # 0x17d290
movb $0x0, (%rcx,%rax)
movl $0x0, 0x16e035(%rip)    # 0x1791cc
xorl %eax, %eax
movl $0x1a, %ecx
cmpw $0x3ff, (%r14,%rcx)     # imm = 0x3FF
jg 0xb1af
incl %eax
movl %eax, 0x16e01d(%rip)    # 0x1791cc
addq $0x2c, %rcx
cmpq $0xb001a, %rcx          # imm = 0xB001A
jne 0xb19e
movl 0x121b8e(%rip), %eax    # 0x12cd50
leaq 0x447b4b(%rip), %rcx    # 0x452d14
movl %eax, (%rcx)
movl 0x121b83(%rip), %eax    # 0x12cd54
leaq 0x447b40(%rip), %rcx    # 0x452d18
movl %eax, (%rcx)
movl 0x121b78(%rip), %eax    # 0x12cd58
leaq 0x447b35(%rip), %rcx    # 0x452d1c
movl %eax, (%rcx)
movzwl 0x121b6c(%rip), %eax    # 0x12cd5c
leaq 0x447b29(%rip), %rcx    # 0x452d20
movw %ax, (%rcx)
movzwl 0x121b5d(%rip), %eax    # 0x12cd5e
leaq 0x447b1a(%rip), %rcx    # 0x452d22
movw %ax, (%rcx)
leaq 0x3a02d6(%rip), %r15    # 0x3ab4e8
movl $0x0, (%r15)
xorl %r12d, %r12d
leaq 0x171e7d(%rip), %rbp    # 0x17d0a0
leaq 0x172066(%rip), %r13    # 0x17d290
leaq 0x681cd(%rip), %r14     # 0x733fe
callq 0x6d55e
testl %eax, %eax
je 0xb249
cmpb $0x0, (%rbp)
je 0xb249
movb $0x1, 0x1(%r13)
movb $0x0, (%rbp)
callq 0x4a7e3
callq 0x9f68
movl 0x121af7(%rip), %edi    # 0x12cd50
movl 0x121af5(%rip), %esi    # 0x12cd54
movl 0x121af3(%rip), %edx    # 0x12cd58
movswl 0x121af0(%rip), %ecx    # 0x12cd5c
movl 0x97d5d(%rip), %r8d     # 0xa2fd0
movswl 0x121ae3(%rip), %r9d    # 0x12cd5e
callq 0x2573e
callq 0xab56
callq 0x2925e
callq 0x9f69
callq 0x33ad9
movl (%r15), %eax
movl %eax, %ecx
subl 0x121ac1(%rip), %ecx    # 0x12cd60
movl %ecx, 0x121abf(%rip)    # 0x12cd64
movl %eax, 0x121ab5(%rip)    # 0x12cd60
cmpb $0x0, 0x1(%r13)
jle 0xb30c
movb $0x0, 0x1(%r13)
movq %r14, %rdi
callq 0x13567
callq 0x6d200
movl (%r15), %eax
movl %eax, %ecx
subl 0x121a91(%rip), %ecx    # 0x12cd60
movl %ecx, 0x121a8f(%rip)    # 0x12cd64
movl %eax, 0x121a85(%rip)    # 0x12cd60
movb 0x1c(%r13), %al
orb 0x1(%r13), %al
orb 0x39(%r13), %al
orb 0x31(%r13), %al
jne 0xb30c
callq 0x6d55e
movb $0x1, %cl
testl %eax, %eax
je 0xb2fe
cmpb $0x0, (%rbp)
jne 0xb30f
cmpb $0x0, 0x15(%r13)
je 0xb2db
movb $0x0, 0x15(%r13)
jmp 0xb30f
movl %r12d, %ecx
movl %ecx, %r12d
testb %cl, %cl
je 0xb231
cmpw $0x0, 0x121604(%rip)    # 0x12c926
je 0xb431
leaq 0x680e4(%rip), %rdi     # 0x73413
callq 0x13567
callq 0x6d200
movb 0x1c(%r13), %al
orb 0x1(%r13), %al
orb 0x39(%r13), %al
orb 0x31(%r13), %al
jne 0xb431
callq 0x6d55e
testl %eax, %eax
je 0xb362
cmpb $0x0, (%rbp)
jne 0xb431
cmpb $0x0, 0x15(%r13)
je 0xb339
movb $0x0, 0x15(%r13)
leaq 0x1a838b(%rip), %rax    # 0x1b3700
cmpl $0x0, (%rax)
jne 0xb399
leaq 0x1215af(%rip), %r14    # 0x12c930
movq %r14, %rdi
movl $0x2f, %esi
callq 0x69e0
leaq 0x1(%rax), %rbx
testq %rax, %rax
cmoveq %r14, %rbx
callq 0x135f3
leaq 0x44796f(%rip), %rax    # 0x452d14
movl (%rax), %edi
leaq 0x44796a(%rip), %rax    # 0x452d18
movl (%rax), %esi
leaq 0x44796b(%rip), %rdx    # 0x452d22
callq 0x25f34
callq 0xa0e3
leaq 0x983d0(%rip), %rax     # 0xa3798
cmpl $0x6, (%rax)
jg 0xb3fa
leaq 0x447940(%rip), %rsi    # 0x452d14
leaq 0x44793d(%rip), %rdx    # 0x452d18
leaq 0x44793a(%rip), %rcx    # 0x452d1c
leaq 0x447937(%rip), %r8     # 0x452d20
leaq 0x447932(%rip), %r9     # 0x452d22
movq %rbx, %rdi
callq 0x31c27
jmp 0xb425
leaq 0x447913(%rip), %rsi    # 0x452d14
leaq 0x447910(%rip), %rdx    # 0x452d18
leaq 0x44790d(%rip), %rcx    # 0x452d1c
leaq 0x44790a(%rip), %r8     # 0x452d20
leaq 0x447905(%rip), %r9     # 0x452d22
movq %rbx, %rdi
callq 0x318ae
testl %eax, %eax
jne 0xb431
movq %rbx, %rdi
callq 0xa0e4
movq 0x16e198(%rip), %rdi    # 0x1795d0
callq 0x206c1
movq 0x16e194(%rip), %rdi    # 0x1795d8
callq 0x206c1
xorl %r14d, %r14d
movq %r14, 0x16e185(%rip)    # 0x1795d8
movq %r14, 0x16e176(%rip)    # 0x1795d0
movl %r14d, 0x16e17f(%rip)   # 0x1795e0
movl %r14d, 0x16e17c(%rip)   # 0x1795e4
callq 0x9f55
callq 0x25589
leaq 0x1ac59f(%rip), %rax    # 0x1b7a18
movl (%rax), %esi
leaq 0x1ac58e(%rip), %rax    # 0x1b7a10
movl (%rax), %edx
leaq 0x67f96(%rip), %rdi     # 0x73421
xorl %eax, %eax
callq 0x24cb4
leaq 0x6d993(%rip), %rdi     # 0x78e2c
leaq 0x121890(%rip), %rsi    # 0x12cd30
xorl %eax, %eax
callq 0x24cb4
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x9f55
callq 0x25589
leaq 0x3fbb22(%rip), %rax    # 0x406fec
movl (%rax), %esi
leaq 0x3fbb1d(%rip), %rax    # 0x406ff0
movl (%rax), %edx
leaq 0x67ee9(%rip), %rdi     # 0x733c5
xorl %eax, %eax
callq 0x24cb4
xorl %edi, %edi
callq 0x66a0