// File: /workspace/github_c_makefile_star2_O3/seanpringle[P]xoat/./setup.c
// Function: setup
void setup()
{
	int i, j; Client *c; Monitor *m;
	memset(&monitors, 0, sizeof(monitors));

	int screen_w = WidthOfScreen(DefaultScreenOfDisplay(display));
	int screen_h = HeightOfScreen(DefaultScreenOfDisplay(display));

	// default non-multi-head setup
	monitors[0].w = screen_w;
	monitors[0].h = screen_h;

	// support multi-head.
	XineramaScreenInfo *info;
	if (XineramaIsActive(display) && (info = XineramaQueryScreens(display, &nmonitors)))
	{
		nmonitors = MIN(nmonitors, MONITORS);
		for_monitors(i, m)
		{
			m->x = info[i].x_org;
			m->y = info[i].y_org;
			m->w = info[i].width;
			m->h = info[i].height;
		}
		XFree(info);
	}

	// detect and adjust for panel struts
	Monitor padded[MONITORS];
	memmove(padded, monitors, sizeof(Monitor) * MONITORS);
	wm_strut all_struts; memset(&all_struts, 0, sizeof(wm_strut));

	for_windows(i, c)
	{
		wm_strut strut; memset(&strut, 0, sizeof(wm_strut));
		int v2 = GETPROP_LONG(c->window, atoms[_NET_WM_STRUT_PARTIAL], (unsigned long*)&strut, 12);
		int v1 = v2 ? 0: GETPROP_LONG(c->window, atoms[_NET_WM_STRUT], (unsigned long*)&strut, 4);
		if (!c->visible || (!v1 && !v2)) continue;

		all_struts.left   = MAX(all_struts.left,   strut.left);
		all_struts.right  = MAX(all_struts.right,  strut.right);
		all_struts.top    = MAX(all_struts.top,    strut.top);
		all_struts.bottom = MAX(all_struts.bottom, strut.bottom);
	}

	for_monitors(j, m)
	{
		Monitor *p = &padded[j];

		// monitor left side of root window?
		if (all_struts.left > 0 && !m->x)
		{
			p->x += all_struts.left;
			p->w -= all_struts.left;
		}
		// monitor right side of root window?
		if (all_struts.right > 0 && m->x + m->w == screen_w)
		{
			p->w -= all_struts.right;
		}
		// monitor top side of root window?
		if (all_struts.top > 0 && !m->y)
		{
			p->y += all_struts.top;
			p->h -= all_struts.top;
		}
		// monitor bottom side of root window?
		if (all_struts.bottom > 0 && m->y + m->h == screen_h)
		{
			p->h -= all_struts.bottom;
		}
	}
	memmove(monitors, padded, sizeof(Monitor) * MONITORS);

	// if spot_start is CURRENT, first window needs somewhere to go
	current_spot = SPOT1;
	current_mon  = 0;

	// calculate spot boxes
	for_monitors(i, m)
	{
		int x = m->x, y = m->y, w = m->w, h = m->h;

		// determine spot layout for this monitor
		int spot1_align      = have_layout(i) ? settings.layouts[i].spot1_align      : LEFT ;
		int spot1_width_pct  = have_layout(i) ? settings.layouts[i].spot1_width_pct  : 66;
		int spot2_height_pct = have_layout(i) ? settings.layouts[i].spot2_height_pct : 66;

		// monitor rotated?
		if (m->w < m->h)
		{
			int height_spot1 = (double)h / 100 * MIN(90, MAX(10, spot1_width_pct));
			int width_spot2  = (double)w / 100 * MIN(90, MAX(10, spot2_height_pct));
			for_spots(j)
			{
				m->spots[j].x = x;
				m->spots[j].y = spot1_align == LEFT ? y: y + h - height_spot1;
				m->spots[j].w = w;
				m->spots[j].h = height_spot1;
				if (j == SPOT1) continue;

				m->spots[j].y = spot1_align == LEFT ? y + height_spot1 + GAP: y;
				m->spots[j].h = h - height_spot1 - GAP;
				m->spots[j].w = w - width_spot2 - GAP;
				if (j == SPOT3) continue;

				m->spots[j].x = x + w - width_spot2;
				m->spots[j].w = width_spot2;
			}
			continue;
		}
		// normal wide screen
		int width_spot1  = (double)w / 100 * MIN(90, MAX(10, spot1_width_pct));
		int height_spot2 = (double)h / 100 * MIN(90, MAX(10, spot2_height_pct));
		for_spots(j)
		{
			m->spots[j].x = spot1_align == LEFT ? x: x + w - width_spot1;
			m->spots[j].y = y;
			m->spots[j].w = width_spot1;
			m->spots[j].h = h;
			if (j == SPOT1) continue;

			m->spots[j].x = spot1_align == LEFT ? x + width_spot1 + GAP: x;
			m->spots[j].w = w - width_spot1 - GAP;
			m->spots[j].h = height_spot2;
			if (j == SPOT2) continue;

			m->spots[j].y = y + height_spot2 + GAP;
			m->spots[j].h = h - height_spot2 - GAP;
		}
	}

	// become the window manager
	XSelectInput(display, root, PropertyChangeMask | StructureNotifyMask | SubstructureRedirectMask | SubstructureNotifyMask);

	// ewmh support
	unsigned long pid = getpid();
	ewmh = XCreateSimpleWindow(display, root, 0, 0, 1, 1, 0, 0, 0);

	SETPROP_ATOM(root, atoms[_NET_SUPPORTED],           atoms, ATOMS);
	SETPROP_WIND(root, atoms[_NET_SUPPORTING_WM_CHECK], &ewmh,     1);
	SETPROP_LONG(ewmh, atoms[_NET_WM_PID],              &pid,      1);

	XChangeProperty(display, ewmh, atoms[_NET_WM_NAME], XA_STRING, 8, PropModeReplace, (const unsigned char*)"xoat", 4);

	// figure out NumlockMask
	XModifierKeymap *modmap = XGetModifierMapping(display);
	for (i = 0; i < 8; i++) for (j = 0; j < (int)modmap->max_keypermod; j++)
		if (modmap->modifiermap[i*modmap->max_keypermod+j] == XKeysymToKeycode(display, XK_Num_Lock))
			{ NumlockMask = (1<<i); break; }
	XFreeModifiermap(modmap);

	// process config.h key bindings
	for (i = 0; i < settings.binding_count; i++)
	{
		XGrabKey(display, XKeysymToKeycode(display, settings.bindings[i].key), settings.bindings[i].mod, root, True, GrabModeAsync, GrabModeAsync);
		if (settings.bindings[i].mod == AnyModifier) continue;

		XGrabKey(display, XKeysymToKeycode(display, settings.bindings[i].key), settings.bindings[i].mod|LockMask, root, True, GrabModeAsync, GrabModeAsync);
		XGrabKey(display, XKeysymToKeycode(display, settings.bindings[i].key), settings.bindings[i].mod|NumlockMask, root, True, GrabModeAsync, GrabModeAsync);
		XGrabKey(display, XKeysymToKeycode(display, settings.bindings[i].key), settings.bindings[i].mod|LockMask|NumlockMask, root, True, GrabModeAsync, GrabModeAsync);
	}

	// we grab buttons to do click-to-focus. all clicks get passed through to apps.
	XGrabButton(display, Button1, AnyModifier, root, True, ButtonPressMask, GrabModeSync, GrabModeSync, None, None);
	XGrabButton(display, Button3, AnyModifier, root, True, ButtonPressMask, GrabModeSync, GrabModeSync, None, None);

	// create title bars
	if (settings.title)
	{
		STACK_FREE(&windows);
		for_monitors(i, m) for_spots(j)
		{
			m->bars[j] = textbox_create(root, TB_AUTOHEIGHT|TB_LEFT, m->spots[j].x, m->spots[j].y, m->spots[j].w, 0,
				settings.title, settings.title_blur, settings.border_blur, NULL, NULL);
			XSelectInput(display, m->bars[j]->window, ExposureMask);

			m->spots[j].y += m->bars[j]->h;
			m->spots[j].h -= m->bars[j]->h;
			spot_update_bar(j, i);
		}
	}

	// setup existing managable windows
	STACK_FREE(&windows);
	for_windows(i, c) if (c->manage)
	{
		window_listen(c->window);
		client_update_border(c);
		client_place_spot(c, c->spot, c->monitor, 0);
		if (!current) client_activate(c);
	}

	// auto launch
	if (settings.launchcmd_count)
	{
		for (i = 0; i < settings.launchcmd_count; i++)
			exec_cmd(settings.launchcmds[i]);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
leaq 0x5cf9(%rip), %rbx      # 0xebc0
movl $0xd8, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3070
movq 0x5cd3(%rip), %rdi      # 0xebb0
movq 0xe8(%rdi), %rax
movslq 0xe0(%rdi), %rcx
shlq $0x7, %rcx
movl 0x18(%rax,%rcx), %ebp
movl 0x1c(%rax,%rcx), %r14d
movw %bp, 0x5cc5(%rip)       # 0xebc4
movw %r14w, 0x5cbf(%rip)     # 0xebc6
callq 0x34b0
testl %eax, %eax
je 0x8f72
movq 0x5c99(%rip), %rdi      # 0xebb0
leaq 0x5852(%rip), %rsi      # 0xe770
callq 0x3040
testq %rax, %rax
je 0x8f72
movl 0x5842(%rip), %edx      # 0xe770
cmpl $0x3, %edx
movl $0x3, %ecx
cmovll %edx, %ecx
movl %ecx, 0x5831(%rip)      # 0xe770
testl %edx, %edx
jle 0x8f6a
movl %ecx, %edx
movq %rax, %rcx
addq $0x4, %rcx
shlq $0x3, %rdx
leaq (%rdx,%rdx,8), %rdx
xorl %esi, %esi
movq (%rcx), %rdi
movq %rdi, (%rsi,%rbx)
addq $0xc, %rcx
addq $0x48, %rsi
cmpq %rsi, %rdx
jne 0x8f56
movq %rax, %rdi
callq 0x3050
movl %r14d, 0x38(%rsp)
movl %ebp, 0x3c(%rsp)
leaq 0x5c3e(%rip), %r14      # 0xebc0
leaq 0xb0(%rsp), %rdi
movl $0xd8, %edx
movq %r14, %rsi
callq 0x36b0
callq 0x604f
movzwl 0x5dfd(%rip), %eax      # 0xeda0
testw %ax, %ax
jle 0x9144
xorl %r12d, %r12d
leaq 0x61fa(%rip), %rdx      # 0xf1b0
leaq 0x61fb(%rip), %r8       # 0xf1b8
leaq 0x50(%rsp), %rbp
xorl %r11d, %r11d
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %r9d, %r9d
leaq 0x5dcb(%rip), %rcx      # 0xeda0
movq 0x8(%rcx,%r12,8), %rbx
testq %rbx, %rbx
je 0x9132
movq %r15, 0x30(%rsp)
movq %r11, 0x48(%rsp)
movq %r9, 0x40(%rsp)
pxor %xmm0, %xmm0
movdqa %xmm0, 0xa0(%rsp)
movdqa %xmm0, 0x90(%rsp)
movdqa %xmm0, 0x80(%rsp)
movdqa %xmm0, 0x70(%rsp)
movdqa %xmm0, 0x60(%rsp)
movdqa %xmm0, 0x50(%rsp)
movq (%rbx), %rdi
movq 0x5cdb(%rip), %rsi      # 0xed08
movq %rdx, %r14
movq %r8, %rcx
movq %r8, %r15
movq %rbp, %r8
movl $0x60, %r9d
callq 0x5d60
testl %eax, %eax
setne %al
cmpq $0x6, 0x615f(%rip)      # 0xf1b0
sete %cl
cmpl $0x0, 0x615d(%rip)      # 0xf1b8
movq %rbp, %r8
setne %bpl
andb %cl, %bpl
andb %al, %bpl
je 0x906e
xorl %eax, %eax
jmp 0x90a7
movq (%rbx), %rdi
movq 0x5c88(%rip), %rsi      # 0xed00
movq %r14, %rdx
movq %r15, %rcx
movl $0x20, %r9d
callq 0x5d60
testl %eax, %eax
setne %cl
cmpq $0x6, 0x611a(%rip)      # 0xf1b0
sete %dl
cmpl $0x0, 0x6118(%rip)      # 0xf1b8
setne %al
andb %dl, %al
andb %cl, %al
cmpw $0x0, 0x102(%rbx)
movq 0x40(%rsp), %r9
movq 0x48(%rsp), %r11
je 0x910c
orb %al, %bpl
movq 0x30(%rsp), %r15
leaq 0x60e6(%rip), %rdx      # 0xf1b0
leaq 0x60e7(%rip), %r8       # 0xf1b8
je 0x9103
movq 0x50(%rsp), %rax
cmpq %rax, %r11
cmovleq %rax, %r11
movq 0x58(%rsp), %rax
cmpq %rax, %r13
cmovleq %rax, %r13
movq 0x60(%rsp), %rax
cmpq %rax, %r15
cmovleq %rax, %r15
movq 0x68(%rsp), %rax
cmpq %rax, %r9
cmovleq %rax, %r9
leaq 0x5ab6(%rip), %r14      # 0xebc0
jmp 0x9126
leaq 0x5aad(%rip), %r14      # 0xebc0
movq 0x30(%rsp), %r15
leaq 0x6091(%rip), %rdx      # 0xf1b0
leaq 0x6092(%rip), %r8       # 0xf1b8
leaq 0x50(%rsp), %rbp
movzwl 0x5c6e(%rip), %eax      # 0xeda0
incq %r12
movswq %ax, %rcx
cmpq %rcx, %r12
jl 0x8fce
jmp 0x9150
xorl %r9d, %r9d
xorl %r15d, %r15d
xorl %r13d, %r13d
xorl %r11d, %r11d
movslq 0x5619(%rip), %r12      # 0xe770
testq %r12, %r12
jle 0x9474
leaq (,%r12,8), %rax
leaq (%rax,%rax,8), %rax
xorl %ecx, %ecx
movl 0x3c(%rsp), %edi
movl 0x38(%rsp), %r8d
testq %r11, %r11
jle 0x9196
cmpw $0x0, (%rcx,%r14)
jne 0x9196
addw %r11w, 0xb0(%rsp,%rcx)
subw %r11w, 0xb4(%rsp,%rcx)
testq %r13, %r13
jle 0x91b5
movswl (%rcx,%r14), %edx
movswl 0x4(%rcx,%r14), %esi
addl %edx, %esi
cmpl %edi, %esi
jne 0x91b5
subw %r13w, 0xb4(%rsp,%rcx)
testq %r15, %r15
jle 0x91d5
cmpw $0x0, 0x2(%rcx,%r14)
jne 0x91d5
addw %r15w, 0xb2(%rsp,%rcx)
subw %r15w, 0xb6(%rsp,%rcx)
testq %r9, %r9
jle 0x91f6
movswl 0x2(%rcx,%r14), %edx
movswl 0x6(%rcx,%r14), %esi
addl %edx, %esi
cmpl %r8d, %esi
jne 0x91f6
subw %r9w, 0xb6(%rsp,%rcx)
addq $0x48, %rcx
cmpq %rcx, %rax
jne 0x9177
leaq 0x59b6(%rip), %rbx      # 0xebc0
leaq 0xb0(%rsp), %rsi
movl $0xd8, %edx
movq %rbx, %rdi
callq 0x36b0
movw $0x1, 0x6020(%rip)      # 0xf248
movw $0x0, 0x6019(%rip)      # 0xf24a
testl %r12d, %r12d
jle 0x949f
movl 0x5fd0(%rip), %eax      # 0xf210
movq %rax, 0x30(%rsp)
movq 0x5fcc(%rip), %rcx      # 0xf218
leaq 0x5983(%rip), %rdx      # 0xebd6
xorl %esi, %esi
movdqa 0xe63(%rip), %xmm0      # 0xa0c0
movdqa 0xe6b(%rip), %xmm1      # 0xa0d0
movdqa 0xe73(%rip), %xmm2      # 0xa0e0
movapd 0xe7b(%rip), %xmm3      # 0xa0f0
pcmpeqd %xmm4, %xmm4
movsd 0xe8f(%rip), %xmm5      # 0xa110
movb $0x1, %r14b
movdqa %xmm0, %xmm6
cmpq 0x30(%rsp), %rsi
jae 0x92a9
cmpw $0x1, 0x2(%rcx,%rsi,8)
sete %r14b
movd 0x4(%rcx,%rsi,8), %xmm6
pshuflw $0x60, %xmm6, %xmm6     # xmm6 = xmm6[0,0,2,1,4,5,6,7]
psrad $0x10, %xmm6
movq %r12, %rax
leaq (%rsi,%rsi,8), %rdi
movzwl (%rbx,%rdi,8), %r11d
movzwl 0x2(%rbx,%rdi,8), %r8d
movzwl %r11w, %r10d
movl 0x4(%rbx,%rdi,8), %ebp
movl %ebp, %edi
shrl $0x10, %edi
movzwl %bp, %r9d
movdqa %xmm6, %xmm7
pcmpgtd %xmm1, %xmm7
pand %xmm7, %xmm6
pandn %xmm1, %xmm7
por %xmm6, %xmm7
movdqa %xmm2, %xmm6
pcmpgtd %xmm7, %xmm6
pand %xmm6, %xmm7
pandn %xmm2, %xmm6
por %xmm7, %xmm6
cvtdq2pd %xmm6, %xmm6
cmpw %di, %r9w
jge 0x93af
movzwl %r8w, %r15d
movd %ebp, %xmm7
shufpd $0x1, %xmm6, %xmm6      # xmm6 = xmm6[1,0]
pshuflw $0x60, %xmm7, %xmm8     # xmm8 = xmm7[0,0,2,1,4,5,6,7]
psrad $0x10, %xmm8
cvtdq2pd %xmm8, %xmm8
addl %r15d, %edi
divpd %xmm3, %xmm8
mulpd %xmm6, %xmm8
cvttpd2dq %xmm8, %xmm6
pshufd $0x55, %xmm6, %xmm8     # xmm8 = xmm6[1,1,1,1]
movd %xmm8, %r15d
subl %r15d, %edi
testb %r14b, %r14b
cmovnel %r8d, %edi
movd %xmm6, %r14d
pshuflw $0xe8, %xmm6, %xmm6     # xmm6 = xmm6[0,2,2,3,4,5,6,7]
pxor %xmm4, %xmm6
leal 0x1(%r8,%r15), %r13d
cmovel %r8d, %r13d
paddw %xmm7, %xmm6
addl %r10d, %r9d
subl %r14d, %r9d
xorl %r8d, %r8d
movw %r11w, -0x6(%rdx,%r8,8)
movw %di, -0x4(%rdx,%r8,8)
movw %bp, -0x2(%rdx,%r8,8)
movw %r15w, (%rdx,%r8,8)
testq %r8, %r8
je 0x93aa
movw %r13w, -0x4(%rdx,%r8,8)
movd %xmm6, -0x2(%rdx,%r8,8)
cmpq $0x2, %r8
je 0x945f
movw %r9w, -0x6(%rdx,%r8,8)
movw %r14w, -0x2(%rdx,%r8,8)
incq %r8
jmp 0x936b
movswl %r9w, %r11d
xorps %xmm7, %xmm7
cvtsi2sd %r11d, %xmm7
divsd %xmm5, %xmm7
mulsd %xmm6, %xmm7
cvttsd2si %xmm7, %r11d
movswl %di, %ebp
xorps %xmm7, %xmm7
cvtsi2sd %ebp, %xmm7
divsd %xmm5, %xmm7
unpckhpd %xmm6, %xmm6            # xmm6 = xmm6[1,1]
mulsd %xmm7, %xmm6
cvttsd2si %xmm6, %r15d
movl %r9d, %ebp
addl %r10d, %ebp
subl %r11d, %ebp
testb %r14b, %r14b
cmovnel %r10d, %ebp
leal 0x1(%r10,%r11), %r14d
cmovel %r10d, %r14d
movl %r11d, %r10d
notl %r10d
addl %r9d, %r10d
leal (%r8,%r15), %r9d
incl %r9d
movl %r15d, %r13d
notl %r13d
addl %edi, %r13d
xorl %r12d, %r12d
movw %bp, -0x6(%rdx,%r12,8)
movw %r8w, -0x4(%rdx,%r12,8)
movw %r11w, -0x2(%rdx,%r12,8)
movw %di, (%rdx,%r12,8)
testq %r12, %r12
je 0x9456
movw %r14w, -0x6(%rdx,%r12,8)
movw %r10w, -0x2(%rdx,%r12,8)
movw %r15w, (%rdx,%r12,8)
cmpq $0x1, %r12
je 0x9456
movw %r9w, -0x4(%rdx,%r12,8)
movw %r13w, (%rdx,%r12,8)
incq %r12
cmpq $0x3, %r12
jne 0x9418
incq %rsi
addq $0x48, %rdx
movq %rax, %r12
cmpq %rax, %rsi
jne 0x9281
jmp 0x949f
leaq 0x5745(%rip), %rdi      # 0xebc0
leaq 0xb0(%rsp), %rsi
movl $0xd8, %edx
callq 0x36b0
movw $0x1, 0x5db2(%rip)      # 0xf248
movw $0x0, 0x5dab(%rip)      # 0xf24a
movq 0x570a(%rip), %rdi      # 0xebb0
movq 0x5cfb(%rip), %rsi      # 0xf1a8
movl $0x5a0000, %edx         # imm = 0x5A0000
callq 0x33e0
callq 0x31f0
cltq
leaq 0x50(%rsp), %r14
movq %rax, (%r14)
movq 0x56e3(%rip), %rdi      # 0xebb0
movq 0x5cd4(%rip), %rsi      # 0xf1a8
pxor %xmm0, %xmm0
movdqu %xmm0, 0x8(%rsp)
movl $0x0, (%rsp)
xorl %ebx, %ebx
movl $0x1, %ebp
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x31e0
movq %rax, 0x5d50(%rip)      # 0xf258
leaq 0x5d49(%rip), %r15      # 0xf258
movq 0x569a(%rip), %rdi      # 0xebb0
movq 0x5c8b(%rip), %rsi      # 0xf1a8
movq 0x579c(%rip), %rdx      # 0xecc0
leaq 0x5775(%rip), %rax      # 0xeca0
movq %rax, (%rsp)
movl $0x1f, 0x8(%rsp)
movl $0x4, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
callq 0x35d0
movq 0x565f(%rip), %rdi      # 0xebb0
movq 0x5c50(%rip), %rsi      # 0xf1a8
movq 0x5789(%rip), %rdx      # 0xece8
movl %ebp, 0x8(%rsp)
movq %r15, (%rsp)
movl $0x21, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
callq 0x35d0
movq 0x562f(%rip), %rdi      # 0xebb0
movq 0x5cd0(%rip), %rsi      # 0xf258
movq 0x5769(%rip), %rdx      # 0xecf8
movl %ebp, 0x8(%rsp)
movq %r14, (%rsp)
movl $0x6, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
callq 0x35d0
movq 0x55ff(%rip), %rdi      # 0xebb0
movq 0x5ca0(%rip), %rsi      # 0xf258
movq 0x5731(%rip), %rdx      # 0xecf0
leaq 0x156a(%rip), %rax      # 0xab30
movq %rax, (%rsp)
movl $0x4, 0x8(%rsp)
movl $0x1f, %ecx
movl $0x8, %r8d
xorl %r9d, %r9d
callq 0x35d0
movq 0x55c4(%rip), %rdi      # 0xebb0
callq 0x3530
movq %rax, %r14
movl (%r14), %eax
testl %eax, %eax
jle 0x963d
xorl %r15d, %r15d
imull %ebx, %eax
cltq
addq 0x8(%r14), %rax
movb (%r15,%rax), %bpl
movq 0x559e(%rip), %rdi      # 0xebb0
movl $0xff7f, %esi           # imm = 0xFF7F
callq 0x3590
cmpb %al, %bpl
je 0x962e
movl (%r14), %eax
incq %r15
cmpl %eax, %r15d
jl 0x95fe
jmp 0x963d
movl $0x1, %eax
movl %ebx, %ecx
shll %cl, %eax
movl %eax, 0x5c0f(%rip)      # 0xf24c
incl %ebx
cmpl $0x8, %ebx
jne 0x95f4
movq %r14, %rdi
callq 0x3130
cmpl $0x0, 0x5bcd(%rip)      # 0xf220
je 0x97c1
movq 0x5bc8(%rip), %rax      # 0xf228
xorl %r14d, %r14d
movl $0x1, %ebp
xorl %r15d, %r15d
movq 0x553e(%rip), %rbx      # 0xebb0
movq 0x8(%rax,%r14), %rsi
movq %rbx, %rdi
callq 0x3590
movzbl %al, %esi
movq 0x5b9f(%rip), %rax      # 0xf228
movl (%rax,%r14), %edx
movq 0x5b14(%rip), %rcx      # 0xf1a8
movl $0x1, (%rsp)
movq %rbx, %rdi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x35e0
movq 0x5b72(%rip), %rax      # 0xf228
cmpl $0x8000, (%rax,%r14)    # imm = 0x8000
je 0x97ab
movq 0x54e5(%rip), %rbx      # 0xebb0
movq 0x8(%rax,%r14), %rsi
movq %rbx, %rdi
callq 0x3590
movzbl %al, %esi
movq 0x5b46(%rip), %rax      # 0xf228
movl (%rax,%r14), %edx
orl $0x2, %edx
movq 0x5ab8(%rip), %rcx      # 0xf1a8
movl %ebp, (%rsp)
movq %rbx, %rdi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x35e0
movq 0x54a2(%rip), %rbx      # 0xebb0
movq 0x5b13(%rip), %rax      # 0xf228
movq 0x8(%rax,%r14), %rsi
movq %rbx, %rdi
callq 0x3590
movzbl %al, %esi
movq 0x5afc(%rip), %rax      # 0xf228
movl 0x5b1a(%rip), %edx      # 0xf24c
orl (%rax,%r14), %edx
movq 0x5a6b(%rip), %rcx      # 0xf1a8
movl %ebp, (%rsp)
movq %rbx, %rdi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x35e0
movq 0x5455(%rip), %rbx      # 0xebb0
movq 0x5ac6(%rip), %rax      # 0xf228
movq 0x8(%rax,%r14), %rsi
movq %rbx, %rdi
callq 0x3590
movzbl %al, %esi
movq 0x5aaf(%rip), %rax      # 0xf228
movl (%rax,%r14), %edx
orl 0x5ac9(%rip), %edx      # 0xf24c
orl $0x2, %edx
movq 0x5a1b(%rip), %rcx      # 0xf1a8
movl %ebp, (%rsp)
movq %rbx, %rdi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x35e0
movq 0x5a7d(%rip), %rax      # 0xf228
incq %r15
movl 0x5a6c(%rip), %ecx      # 0xf220
addq $0x28, %r14
cmpq %rcx, %r15
jb 0x966b
movq 0x53e8(%rip), %rdi      # 0xebb0
movq 0x59d9(%rip), %rcx      # 0xf1a8
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rsp)
xorl %ebx, %ebx
movl %ebx, 0x8(%rsp)
movl %ebx, (%rsp)
movl $0x1, %esi
movl $0x8000, %edx           # imm = 0x8000
movl $0x1, %r8d
movl $0x4, %r9d
callq 0x35b0
movq 0x53ac(%rip), %rdi      # 0xebb0
movq 0x599d(%rip), %rcx      # 0xf1a8
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rsp)
movl %ebx, 0x8(%rsp)
movl %ebx, (%rsp)
movl $0x3, %esi
movl $0x8000, %edx           # imm = 0x8000
movl $0x1, %r8d
movl $0x4, %r9d
callq 0x35b0
cmpq $0x0, 0x59a9(%rip)      # 0xf1e8
movzwl 0x555a(%rip), %eax      # 0xeda0
je 0x9946
testw %ax, %ax
je 0x987b
leaq 0x5548(%rip), %rbx      # 0xeda0
decl %eax
movw %ax, 0x553f(%rip)       # 0xeda0
movswq %ax, %rax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x6901
movzwl 0x552a(%rip), %eax      # 0xeda0
testw %ax, %ax
jne 0x9858
cmpl $0x0, 0x4eee(%rip)      # 0xe770
jle 0x9975
leaq 0x5361(%rip), %r14      # 0xebf0
xorl %ebx, %ebx
pxor %xmm1, %xmm1
movq $-0x3, %r15
movq 0x5905(%rip), %rdi      # 0xf1a8
movswl -0x8(%r14,%r15,8), %edx
movswl -0x6(%r14,%r15,8), %ecx
movswl -0x4(%r14,%r15,8), %r8d
movdqu 0x592b(%rip), %xmm0     # 0xf1e8
movq 0x5904(%rip), %rax      # 0xf1c8
movdqu %xmm1, 0x18(%rsp)
movq %rax, 0x10(%rsp)
movdqu %xmm0, (%rsp)
movl $0x10001, %esi          # imm = 0x10001
xorl %r9d, %r9d
callq 0x41e6
movq %rax, 0x18(%r14,%r15,8)
movq 0x52c3(%rip), %rdi      # 0xebb0
movq 0x8(%rax), %rsi
movl $0x8000, %edx           # imm = 0x8000
callq 0x33e0
movq 0x18(%r14,%r15,8), %rax
movzwl 0x1e(%rax), %eax
addw %ax, -0x6(%r14,%r15,8)
subw %ax, -0x2(%r14,%r15,8)
leal 0x4(%r15), %edi
movl %ebx, %esi
callq 0x782b
pxor %xmm1, %xmm1
incq %r15
jne 0x989c
incq %rbx
movslq 0x4e3e(%rip), %rax      # 0xe770
addq $0x48, %r14
cmpq %rax, %rbx
jl 0x9895
movzwl 0x545a(%rip), %eax      # 0xeda0
testw %ax, %ax
je 0x9975
leaq 0x544e(%rip), %rbx      # 0xeda0
decl %eax
movw %ax, 0x5445(%rip)       # 0xeda0
movswq %ax, %rax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x6901
movzwl 0x5430(%rip), %eax      # 0xeda0
testw %ax, %ax
jne 0x9952
callq 0x604f
cmpw $0x0, 0x541e(%rip)      # 0xeda0
jle 0x99ff
xorl %r14d, %r14d
leaq 0x5412(%rip), %r15      # 0xeda0
movq 0x8(%r15,%r14,8), %rbx
testq %rbx, %rbx
je 0x99ef
cmpw $0x0, 0x104(%rbx)
je 0x99ef
movq (%rbx), %rsi
movq 0x5204(%rip), %rdi      # 0xebb0
movl $0x600030, %edx         # imm = 0x600030
callq 0x33e0
movq %rbx, %rdi
callq 0x6afa
movl 0x118(%rbx), %esi
movswl 0x100(%rbx), %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x6c47
cmpq $0x0, 0x51db(%rip)      # 0xebb8
jne 0x99ef
movq %rbx, %rdi
callq 0x70f4
movq %rbx, %rdi
callq 0x72e5
incq %r14
movswq 0x53a6(%rip), %rax      # 0xeda0
cmpq %rax, %r14
jl 0x998e
cmpl $0x0, 0x582a(%rip)      # 0xf230
je 0x9a28
xorl %ebx, %ebx
movq 0x5827(%rip), %rax      # 0xf238
movq (%rax,%rbx,8), %rdi
callq 0x58dc
incq %rbx
movl 0x580d(%rip), %eax      # 0xf230
cmpq %rax, %rbx
jb 0x9a0a
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq