// File: /workspace/github_c_makefile_star2_O1/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 $0x198, %rsp            # imm = 0x198
leaq 0x5d76(%rip), %rbx      # 0xebc0
movl $0xd8, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3070
movq 0x5d50(%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, 0x5d42(%rip)       # 0xebc4
movw %r14w, 0x5d3c(%rip)     # 0xebc6
callq 0x34b0
testl %eax, %eax
je 0x8f10
movq 0x5d16(%rip), %rdi      # 0xebb0
leaq 0x58cf(%rip), %rsi      # 0xe770
callq 0x3040
testq %rax, %rax
je 0x8f10
movl 0x58bf(%rip), %edx      # 0xe770
cmpl $0x3, %edx
movl $0x3, %ecx
cmovll %edx, %ecx
movl %ecx, 0x58ae(%rip)      # 0xe770
testl %edx, %edx
jle 0x8f08
movl %ecx, %edx
movq %rax, %rcx
addq $0xa, %rcx
shlq $0x3, %rdx
leaq (%rdx,%rdx,8), %rdx
xorl %esi, %esi
movzwl -0x6(%rcx), %edi
movw %di, (%rsi,%rbx)
movzwl -0x4(%rcx), %edi
movw %di, 0x2(%rsi,%rbx)
movzwl -0x2(%rcx), %edi
movw %di, 0x4(%rsi,%rbx)
movzwl (%rcx), %edi
movw %di, 0x6(%rsi,%rbx)
addq $0xc, %rcx
addq $0x48, %rsi
cmpq %rsi, %rdx
jne 0x8ed9
movq %rax, %rdi
callq 0x3050
movl %ebp, 0x5c(%rsp)
leaq 0x5ca5(%rip), %rsi      # 0xebc0
leaq 0xc0(%rsp), %rdi
movl $0xd8, %edx
callq 0x36b0
callq 0x606d
cmpw $0x0, 0x5e66(%rip)      # 0xeda0
movl %r14d, 0x58(%rsp)
jle 0x90e7
xorl %r14d, %r14d
leaq 0x6261(%rip), %r15      # 0xf1b0
leaq 0x6262(%rip), %r12      # 0xf1b8
leaq 0x60(%rsp), %r13
movq $0x0, 0x38(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0x5e1a(%rip), %rax      # 0xeda0
movq 0x8(%rax,%r14,8), %rbx
testq %rbx, %rbx
je 0x90d1
xorpd %xmm0, %xmm0
movapd %xmm0, 0xb0(%rsp)
movapd %xmm0, 0xa0(%rsp)
movapd %xmm0, 0x90(%rsp)
movapd %xmm0, 0x80(%rsp)
movapd %xmm0, 0x70(%rsp)
movapd %xmm0, 0x60(%rsp)
movq (%rbx), %rdi
movq 0x5d36(%rip), %rsi      # 0xed08
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
movl $0x60, %r9d
callq 0x5d7b
testl %eax, %eax
setne %al
cmpq $0x6, 0x61bd(%rip)      # 0xf1b0
sete %cl
cmpl $0x0, 0x61bb(%rip)      # 0xf1b8
setne %bpl
andb %cl, %bpl
andb %al, %bpl
je 0x900d
xorl %eax, %eax
jmp 0x9049
movq (%rbx), %rdi
movq 0x5ce9(%rip), %rsi      # 0xed00
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
movl $0x20, %r9d
callq 0x5d7b
testl %eax, %eax
setne %cl
cmpq $0x6, 0x6178(%rip)      # 0xf1b0
sete %dl
cmpl $0x0, 0x6176(%rip)      # 0xf1b8
setne %al
andb %dl, %al
andb %cl, %al
cmpw $0x0, 0x102(%rbx)
je 0x90be
orb %al, %bpl
leaq 0x6153(%rip), %r15      # 0xf1b0
leaq 0x60(%rsp), %r13
je 0x90ca
movq 0x60(%rsp), %rax
movq 0x38(%rsp), %rcx
cmpq %rax, %rcx
cmovleq %rax, %rcx
movq %rcx, 0x38(%rsp)
movq 0x68(%rsp), %rax
movq 0x48(%rsp), %rcx
cmpq %rax, %rcx
cmovleq %rax, %rcx
movq %rcx, 0x48(%rsp)
movq 0x70(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq %rax, %rcx
cmovleq %rax, %rcx
movq %rcx, 0x40(%rsp)
movq 0x78(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq %rax, %rcx
cmovleq %rax, %rcx
movq %rcx, 0x30(%rsp)
jmp 0x90ca
leaq 0x60eb(%rip), %r15      # 0xf1b0
leaq 0x60(%rsp), %r13
leaq 0x60e7(%rip), %r12      # 0xf1b8
incq %r14
movswq 0x5cc4(%rip), %rax      # 0xeda0
cmpq %rax, %r14
jl 0x8f7f
jmp 0x910b
movq $0x0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x38(%rsp)
movslq 0x565e(%rip), %rcx      # 0xe770
movq %rcx, 0x50(%rsp)
testq %rcx, %rcx
movl 0x5c(%rsp), %edi
movl 0x58(%rsp), %r8d
leaq 0x5a96(%rip), %r9       # 0xebc0
movq 0x30(%rsp), %r10
movq 0x48(%rsp), %r11
movq 0x40(%rsp), %rbx
movq 0x38(%rsp), %r14
jle 0x91e1
movq 0x50(%rsp), %rax
leaq (,%rax,8), %rax
leaq (%rax,%rax,8), %rax
xorl %ecx, %ecx
testq %r14, %r14
jle 0x9176
cmpw $0x0, (%rcx,%r9)
jne 0x9176
addw %r14w, 0xc0(%rsp,%rcx)
subw %r14w, 0xc4(%rsp,%rcx)
testq %r11, %r11
jle 0x9195
movswl (%rcx,%r9), %edx
movswl 0x4(%rcx,%r9), %esi
addl %edx, %esi
cmpl %edi, %esi
jne 0x9195
subw %r11w, 0xc4(%rsp,%rcx)
testq %rbx, %rbx
jle 0x91b3
cmpw $0x0, 0x2(%rcx,%r9)
jne 0x91b3
addw %bx, 0xc2(%rsp,%rcx)
subw %bx, 0xc6(%rsp,%rcx)
testq %r10, %r10
jle 0x91d4
movswl 0x2(%rcx,%r9), %edx
movswl 0x6(%rcx,%r9), %esi
addl %edx, %esi
cmpl %r8d, %esi
jne 0x91d4
subw %r10w, 0xc6(%rsp,%rcx)
addq $0x48, %rcx
cmpq %rcx, %rax
jne 0x9157
leaq 0x59d8(%rip), %rbx      # 0xebc0
leaq 0xc0(%rsp), %rsi
movl $0xd8, %edx
movq %rbx, %rdi
callq 0x36b0
movw $0x1, 0x6042(%rip)      # 0xf248
movw $0x0, 0x603b(%rip)      # 0xf24a
cmpl $0x0, 0x50(%rsp)
jle 0x9447
movl 0x5ff0(%rip), %eax      # 0xf210
movq 0x5ff1(%rip), %rcx      # 0xf218
movq %rcx, 0x30(%rsp)
leaq 0x59a3(%rip), %rdx      # 0xebd6
xorl %esi, %esi
movl $0x5a, %r8d
movsd 0xe7d(%rip), %xmm0      # 0xa0c0
movb $0x1, %r15b
cmpq %rax, %rsi
jae 0x925a
movq 0x30(%rsp), %rcx
cmpw $0x1, 0x2(%rcx,%rsi,8)
sete %r15b
movl $0x42, %ecx
movl $0x42, %edi
cmpq %rax, %rsi
jae 0x9273
movq 0x30(%rsp), %rdi
movswl 0x4(%rdi,%rsi,8), %edi
cmpq %rax, %rsi
jae 0x9282
movq 0x30(%rsp), %rcx
movswl 0x6(%rcx,%rsi,8), %ecx
leaq (%rsi,%rsi,8), %r11
movzwl (%rbx,%r11,8), %ebp
movzwl 0x2(%rbx,%r11,8), %r9d
movzwl %bp, %r10d
movzwl 0x4(%rbx,%r11,8), %r13d
cmpl $0xb, %edi
movl $0xa, %r14d
cmovll %r14d, %edi
movzwl %r13w, %r12d
cmpl %r8d, %edi
cmovgel %r8d, %edi
cmpl $0xb, %ecx
cmovll %r14d, %ecx
cmpl %r8d, %ecx
cmovgel %r8d, %ecx
xorps %xmm2, %xmm2
cvtsi2sd %edi, %xmm2
movzwl 0x6(%rbx,%r11,8), %r11d
cvtsi2sd %ecx, %xmm1
cmpw %r11w, %r12w
jge 0x938d
movzwl %r9w, %ecx
movzwl %r11w, %r14d
movswl %r11w, %edi
cvtsi2sd %edi, %xmm3
divsd %xmm0, %xmm3
mulsd %xmm2, %xmm3
cvttsd2si %xmm3, %edi
addl %ecx, %r14d
movswl %r12w, %ecx
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
divsd %xmm0, %xmm2
mulsd %xmm1, %xmm2
cvttsd2si %xmm2, %ecx
subl %edi, %r14d
testb %r15b, %r15b
cmovnel %r9d, %r14d
leal 0x1(%r9,%rdi), %r15d
cmovel %r9d, %r15d
movl %edi, %r9d
notl %r9d
addl %r11d, %r9d
movl %ecx, %r11d
notl %r11d
addl %r12d, %r11d
addl %r12d, %r10d
subl %ecx, %r10d
xorl %r12d, %r12d
movw %bp, -0x6(%rdx,%r12,8)
movw %r14w, -0x4(%rdx,%r12,8)
movw %r13w, -0x2(%rdx,%r12,8)
movw %di, (%rdx,%r12,8)
testq %r12, %r12
je 0x937f
movw %r15w, -0x4(%rdx,%r12,8)
movw %r9w, (%rdx,%r12,8)
movw %r11w, -0x2(%rdx,%r12,8)
cmpq $0x2, %r12
je 0x937f
movw %r10w, -0x6(%rdx,%r12,8)
movw %cx, -0x2(%rdx,%r12,8)
incq %r12
cmpq $0x3, %r12
jne 0x9340
jmp 0x9435
movswl %r12w, %ecx
cvtsi2sd %ecx, %xmm3
divsd %xmm0, %xmm3
mulsd %xmm2, %xmm3
cvttsd2si %xmm3, %r14d
movswl %r11w, %ecx
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
divsd %xmm0, %xmm2
mulsd %xmm1, %xmm2
cvttsd2si %xmm2, %edi
movl %r12d, %ebp
addl %r10d, %ebp
subl %r14d, %ebp
testb %r15b, %r15b
cmovnel %r10d, %ebp
leal 0x1(%r10,%r14), %ecx
cmovel %r10d, %ecx
movl %r14d, %r10d
notl %r10d
addl %r12d, %r10d
leal (%r9,%rdi), %r15d
incl %r15d
movl %edi, %r12d
notl %r12d
addl %r11d, %r12d
xorl %r13d, %r13d
movw %bp, -0x6(%rdx,%r13,8)
movw %r9w, -0x4(%rdx,%r13,8)
movw %r14w, -0x2(%rdx,%r13,8)
movw %r11w, (%rdx,%r13,8)
testq %r13, %r13
je 0x942c
movw %cx, -0x6(%rdx,%r13,8)
movw %r10w, -0x2(%rdx,%r13,8)
movw %di, (%rdx,%r13,8)
cmpq $0x1, %r13
je 0x942c
movw %r15w, -0x4(%rdx,%r13,8)
movw %r12w, (%rdx,%r13,8)
incq %r13
cmpq $0x3, %r13
jne 0x93ee
incq %rsi
addq $0x48, %rdx
cmpq 0x50(%rsp), %rsi
jne 0x9243
movq 0x5762(%rip), %rdi      # 0xebb0
movq 0x5d53(%rip), %rsi      # 0xf1a8
movl $0x5a0000, %edx         # imm = 0x5A0000
callq 0x33e0
callq 0x31f0
cltq
leaq 0x60(%rsp), %r14
movq %rax, (%r14)
movq 0x573b(%rip), %rdi      # 0xebb0
movq 0x5d2c(%rip), %rsi      # 0xf1a8
xorpd %xmm0, %xmm0
movupd %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, 0x5da8(%rip)      # 0xf258
leaq 0x5da1(%rip), %r15      # 0xf258
movq 0x56f2(%rip), %rdi      # 0xebb0
movq 0x5ce3(%rip), %rsi      # 0xf1a8
movq 0x57f4(%rip), %rdx      # 0xecc0
leaq 0x57cd(%rip), %rax      # 0xeca0
movq %rax, (%rsp)
movl $0x1f, 0x8(%rsp)
movl $0x4, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
callq 0x35d0
movq 0x56b7(%rip), %rdi      # 0xebb0
movq 0x5ca8(%rip), %rsi      # 0xf1a8
movq 0x57e1(%rip), %rdx      # 0xece8
movl %ebp, 0x8(%rsp)
movq %r15, (%rsp)
movl $0x21, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
callq 0x35d0
movq 0x5687(%rip), %rdi      # 0xebb0
movq 0x5d28(%rip), %rsi      # 0xf258
movq 0x57c1(%rip), %rdx      # 0xecf8
movl %ebp, 0x8(%rsp)
movq %r14, (%rsp)
movl $0x6, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
callq 0x35d0
movq 0x5657(%rip), %rdi      # 0xebb0
movq 0x5cf8(%rip), %rsi      # 0xf258
movq 0x5789(%rip), %rdx      # 0xecf0
leaq 0x1590(%rip), %rax      # 0xaafe
movq %rax, (%rsp)
movl $0x4, 0x8(%rsp)
movl $0x1f, %ecx
movl $0x8, %r8d
xorl %r9d, %r9d
callq 0x35d0
movq 0x561c(%rip), %rdi      # 0xebb0
callq 0x3530
movq %rax, %r14
movl (%r14), %eax
testl %eax, %eax
jle 0x95e5
xorl %r15d, %r15d
imull %ebx, %eax
cltq
addq 0x8(%r14), %rax
movb (%r15,%rax), %bpl
movq 0x55f6(%rip), %rdi      # 0xebb0
movl $0xff7f, %esi           # imm = 0xFF7F
callq 0x3590
cmpb %al, %bpl
je 0x95d6
movl (%r14), %eax
incq %r15
cmpl %eax, %r15d
jl 0x95a6
jmp 0x95e5
movl $0x1, %eax
movl %ebx, %ecx
shll %cl, %eax
movl %eax, 0x5c67(%rip)      # 0xf24c
incl %ebx
cmpl $0x8, %ebx
jne 0x959c
movq %r14, %rdi
callq 0x3130
cmpl $0x0, 0x5c25(%rip)      # 0xf220
je 0x9762
xorl %r14d, %r14d
movl $0x1, %ebp
xorl %r15d, %r15d
movq 0x559d(%rip), %rbx      # 0xebb0
movq 0x5c0e(%rip), %rax      # 0xf228
movq 0x8(%rax,%r14), %rsi
movq %rbx, %rdi
callq 0x3590
movzbl %al, %esi
movq 0x5bf7(%rip), %rax      # 0xf228
movl (%rax,%r14), %edx
movq 0x5b6c(%rip), %rcx      # 0xf1a8
movl $0x1, (%rsp)
movq %rbx, %rdi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x35e0
movq 0x5bca(%rip), %rax      # 0xf228
cmpl $0x8000, (%rax,%r14)    # imm = 0x8000
je 0x974c
movq 0x553d(%rip), %rbx      # 0xebb0
movq 0x8(%rax,%r14), %rsi
movq %rbx, %rdi
callq 0x3590
movzbl %al, %esi
movq 0x5b9e(%rip), %rax      # 0xf228
movl (%rax,%r14), %edx
orl $0x2, %edx
movq 0x5b10(%rip), %rcx      # 0xf1a8
movl %ebp, (%rsp)
movq %rbx, %rdi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x35e0
movq 0x54fa(%rip), %rbx      # 0xebb0
movq 0x5b6b(%rip), %rax      # 0xf228
movq 0x8(%rax,%r14), %rsi
movq %rbx, %rdi
callq 0x3590
movzbl %al, %esi
movq 0x5b54(%rip), %rax      # 0xf228
movl 0x5b72(%rip), %edx      # 0xf24c
orl (%rax,%r14), %edx
movq 0x5ac3(%rip), %rcx      # 0xf1a8
movl %ebp, (%rsp)
movq %rbx, %rdi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x35e0
movq 0x54ad(%rip), %rbx      # 0xebb0
movq 0x5b1e(%rip), %rax      # 0xf228
movq 0x8(%rax,%r14), %rsi
movq %rbx, %rdi
callq 0x3590
movzbl %al, %esi
movq 0x5b07(%rip), %rax      # 0xf228
movl (%rax,%r14), %edx
orl 0x5b21(%rip), %edx      # 0xf24c
orl $0x2, %edx
movq 0x5a73(%rip), %rcx      # 0xf1a8
movl %ebp, (%rsp)
movq %rbx, %rdi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x35e0
incq %r15
movl 0x5acb(%rip), %eax      # 0xf220
addq $0x28, %r14
cmpq %rax, %r15
jb 0x960c
movq 0x5447(%rip), %rdi      # 0xebb0
movq 0x5a38(%rip), %rcx      # 0xf1a8
xorpd %xmm0, %xmm0
movupd %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 0x540b(%rip), %rdi      # 0xebb0
movq 0x59fc(%rip), %rcx      # 0xf1a8
xorpd %xmm0, %xmm0
movupd %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, 0x5a08(%rip)      # 0xf1e8
je 0x98e0
movzwl 0x55b3(%rip), %eax      # 0xeda0
testw %ax, %ax
je 0x981c
leaq 0x55a7(%rip), %rbx      # 0xeda0
decl %eax
movw %ax, 0x559e(%rip)       # 0xeda0
movswq %ax, %rax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x6884
movzwl 0x5589(%rip), %eax      # 0xeda0
testw %ax, %ax
jne 0x97f9
cmpl $0x0, 0x4f4d(%rip)      # 0xe770
jle 0x98e0
leaq 0x53c0(%rip), %r14      # 0xebf0
xorl %ebx, %ebx
xorpd %xmm1, %xmm1
movq $-0x3, %r15
movq 0x5964(%rip), %rdi      # 0xf1a8
movswl -0x8(%r14,%r15,8), %edx
movswl -0x6(%r14,%r15,8), %ecx
movswl -0x4(%r14,%r15,8), %r8d
movupd 0x598a(%rip), %xmm0     # 0xf1e8
movq 0x5963(%rip), %rax      # 0xf1c8
movupd %xmm1, 0x18(%rsp)
movq %rax, 0x10(%rsp)
movupd %xmm0, (%rsp)
movl $0x10001, %esi          # imm = 0x10001
xorl %r9d, %r9d
callq 0x41fa
movq %rax, 0x18(%r14,%r15,8)
movq 0x5322(%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 0x77c7
xorpd %xmm1, %xmm1
incq %r15
jne 0x983d
incq %rbx
movslq 0x4e9d(%rip), %rax      # 0xe770
addq $0x48, %r14
cmpq %rax, %rbx
jl 0x9836
movzwl 0x54b9(%rip), %eax      # 0xeda0
testw %ax, %ax
je 0x9916
leaq 0x54ad(%rip), %rbx      # 0xeda0
decl %eax
movw %ax, 0x54a4(%rip)       # 0xeda0
movswq %ax, %rax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x6884
movzwl 0x548f(%rip), %eax      # 0xeda0
testw %ax, %ax
jne 0x98f3
callq 0x606d
cmpw $0x0, 0x547d(%rip)      # 0xeda0
jle 0x99a0
xorl %r14d, %r14d
leaq 0x5471(%rip), %r15      # 0xeda0
movq 0x8(%r15,%r14,8), %rbx
testq %rbx, %rbx
je 0x9990
cmpw $0x0, 0x104(%rbx)
je 0x9990
movq (%rbx), %rsi
movq 0x5263(%rip), %rdi      # 0xebb0
movl $0x600030, %edx         # imm = 0x600030
callq 0x33e0
movq %rbx, %rdi
callq 0x6a78
movl 0x118(%rbx), %esi
movswl 0x100(%rbx), %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x6bc5
cmpq $0x0, 0x523a(%rip)      # 0xebb8
jne 0x9990
movq %rbx, %rdi
callq 0x7081
movq %rbx, %rdi
callq 0x727a
incq %r14
movswq 0x5405(%rip), %rax      # 0xeda0
cmpq %rax, %r14
jl 0x992f
cmpl $0x0, 0x5889(%rip)      # 0xf230
je 0x99c9
xorl %ebx, %ebx
movq 0x5886(%rip), %rax      # 0xf238
movq (%rax,%rbx,8), %rdi
callq 0x590f
incq %rbx
movl 0x586c(%rip), %eax      # 0xf230
cmpq %rax, %rbx
jb 0x99ab
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq