// File: /workspace/github_c_makefile_star2_O0/kasymovga[P]devilwm/events.c
// Function: handle_key_event
static void handle_key_event(XKeyEvent *e) {
	KeySym key = XkbKeycodeToKeysym(dpy, e->keycode, 0, 0);
	Client *c;
	int width_inc, height_inc;
	ScreenInfo *current_screen = find_current_screen();
	switch(key) {
		case KEY_CENTER:
			if (e->state & altmask) {
				int windows_count = 0;
				struct list *iter;
				for (iter = clients_tab_order; iter; iter = iter->next) {
					c = iter->data;
					if (c->screen == current_screen && c->vdesk == current_screen->vdesk)
						windows_count++;
				}
				if (!windows_count)
					break;

				select_client(NULL);
				int display_width = DisplayWidth(dpy, current_screen->screen), display_height = DisplayHeight(dpy, current_screen->screen);
				int width_count = ceil(sqrt(windows_count));
				int height_count = ceil((float)windows_count / (float)width_count);
				int width_bottom_count = windows_count%width_count;
				if (!width_bottom_count)
					width_bottom_count = width_count;

				int window_width = display_width / width_count;
				int window_height = display_height / height_count;
				int window_bottom_width = display_width / width_bottom_count;
				int window_bottom_height = display_height - ((height_count - 1) * window_height);
				int window_right_width = display_width - ((width_count - 1) * window_width);
				int window_bottom_right_width = display_width - ((width_bottom_count - 1) * window_bottom_width);
				int i = 0, j = 0;
				for (iter = clients_tab_order; iter; iter = iter->next) {
					c = iter->data;
					if (c->screen != current_screen)
						continue;

					if (c->vdesk != current_screen->vdesk)
						continue;

					if (j < height_count - 1) {
						if (i < width_count - 1) {
							c->x = i * window_width + c->border;
							c->y = j * window_height + c->border;
							c->width = window_width - c->border * 2;
							c->height = window_height - c->border * 2;
						} else {
							c->x = i * window_width + c->border;
							c->y = j * window_height + c->border;
							c->width = window_right_width - c->border * 2;
							c->height = window_height - c->border * 2;
						}
						i++;
						if(i == width_count) {
							i = 0;j++;
						}
					} else {
						if (i < width_bottom_count - 1) {
							c->x = i * window_bottom_width + c->border;
							c->y = j * window_height + c->border;
							c->width = window_bottom_width - c->border * 2;
							c->height = window_bottom_height - c->border * 2;
						} else {
							c->x = i * window_bottom_width + c->border;
							c->y = j * window_height + c->border;
							c->width = window_bottom_right_width - c->border * 2;
							c->height = window_bottom_height - c->border * 2;
						}
						i++;
					}
					moveresize(c);
				}
			}
			break;
		case KEY_NEW:
			if (e->state & altmask)
				spawn((const char *const *)opt_term2);
			else
				spawn((const char *const *)opt_term);

			break;
		case KEY_NEXT:
			next();
			if (XGrabKeyboard(dpy, e->root, False, GrabModeAsync, GrabModeAsync, CurrentTime) == GrabSuccess) {
				XEvent ev;
				do {
					XMaskEvent(dpy, KeyPressMask|KeyReleaseMask, &ev);
					if (ev.type == KeyPress && XkbKeycodeToKeysym(dpy, ev.xkey.keycode, 0, 0) == KEY_NEXT)
						next();
				} while (ev.type == KeyPress || XkbKeycodeToKeysym(dpy, ev.xkey.keycode, 0, 0) == KEY_NEXT);
				XUngrabKeyboard(dpy, CurrentTime);
			}
			ewmh_select_client(current);
			break;
		case KEY_NEXTSCREEN:
			if (num_screens > 1) {
				int i;
				for (i = 0; i < num_screens; i++)
					if (&screens[i] == current_screen)
						break;

				i++;
				if (i >= num_screens)
					i = 0;

				XSetInputFocus(dpy, RootWindow(dpy, i), RevertToPointerRoot, CurrentTime);
				setmouse(RootWindow(dpy, i), 0, 0);
				next();
				ewmh_select_client(current);
			}
			break;
		case KEY_DOCK_TOGGLE:
			set_docks_visible(current_screen, !current_screen->docks_visible);
			break;
#ifdef VWM
		case XK_1: case XK_2: case XK_3: case XK_4:
		case XK_5: case XK_6: case XK_7: case XK_8:
			switch_vdesk(current_screen, KEY_TO_VDESK(key));
			break;
		case KEY_PREVDESK:
			if (current_screen->vdesk > 0) {
				switch_vdesk(current_screen,
						current_screen->vdesk - 1);
			}
			break;
		case KEY_NEXTDESK:
			if (current_screen->vdesk < VDESK_MAX) {
				switch_vdesk(current_screen,
						current_screen->vdesk + 1);
			}
			break;
		case KEY_TOGGLEDESK:
			switch_vdesk(current_screen, current_screen->old_vdesk);
			break;
#endif
		case KEY_QUITFROMWM:
			if (e->state & altmask)
				wm_exit = 1;

		default: break;
	}
	c = current;
	if (c == NULL) return;
	width_inc = (c->width_inc > 1) ? c->width_inc : 16;
	height_inc = (c->height_inc > 1) ? c->height_inc : 16;
	switch (key) {
		case KEY_LEFT:
			if (e->state & altmask) {
				if ((c->width - width_inc) >= c->min_width)
					c->width -= width_inc;
			} else {
				int bx;
				next_border(c, -1, 0, 1, &bx, NULL);
				c->x = bx + c->border;
			}
			goto move_client;
		case KEY_DOWN:
			if (e->state & altmask) {
				if (!c->max_height || (c->height + height_inc) <= c->max_height)
					c->height += height_inc;
			} else {
				int by;
				next_border(c, 0, 1, 1, NULL, &by);
				c->y = by - c->height - c->border;
			}
			goto move_client;
		case KEY_UP:
			if (e->state & altmask) {
				if ((c->height - height_inc) >= c->min_height)
					c->height -= height_inc;
			} else {
				int by;
				next_border(c, 0, -1, 1, NULL, &by);
				c->y = by + c->border;
			}
			goto move_client;
		case KEY_RIGHT:
			if (e->state & altmask) {
				if (!c->max_width || (c->width + width_inc) <= c->max_width)
					c->width += width_inc;
			} else {
				int bx;
				next_border(c, 1, 0, 1, &bx, NULL);
				c->x = bx - c->width - c->border;
			}
			goto move_client;
		case KEY_TOPLEFT:
			if (e->state & altmask) {
				int bx, by;
				next_border(c, -1, -1, 0, &bx, &by);
				c->width = c->width + c->x - bx - c->border;
				c->x = bx + c->border;
				c->height = c->height - by + c->y - c->border;
				c->y = by + c->border;
			} else {
				Monitor *monitor = find_monitor(c);
				c->x = monitor->x + c->border;
				c->y = monitor->y + c->border;
			}
			goto move_client;
		case KEY_TOPRIGHT:
			if (e->state & altmask) {
				int bx, by;
				next_border(c, 1, -1, 0, &bx, &by);
				c->width = bx - c->x - c->border;
				c->height = c->height + c->y - by - c->border;
				c->y = by + c->border;
			} else {
				Monitor *monitor = find_monitor(c);
				c->x = monitor->x + monitor->width - c->width - c->border;
				c->y = monitor->y + c->border;
			}
			goto move_client;
		case KEY_BOTTOMLEFT:
			if (e->state & altmask) {
				int bx, by;
				next_border(c, -1, 1, 0, &bx, &by);
				c->width = c->width + c->x - bx - c->border;
				c->height = by - c->y - c->border;
				c->x = bx + c->border;
			} else {
				Monitor *monitor = find_monitor(c);
				c->x = monitor->x + c->border;
				c->y = monitor->y + monitor->height - c->height - c->border;
			}
			goto move_client;
		case KEY_BOTTOMRIGHT:
			if (e->state & altmask) {
				int bx, by;
				next_border(c, 1, 1, 0, &bx, &by);
				c->width = bx - c->x - c->border;
				c->height = by - c->y - c->border;
			} else {
				Monitor *monitor = find_monitor(c);
				c->x = monitor->x + monitor->width - c->width - c->border;
				c->y = monitor->y + monitor->height - c->height - c->border;
			}
			goto move_client;
		case KEY_CENTER:
			if(!(e->state & altmask)) {
				Monitor *monitor = find_monitor(c);
				c->x=monitor->x + (monitor->width - c->width) / 2;
				c->y=monitor->y + (monitor->height - c->height) / 2;
				goto move_client;
			}
			break;
		case KEY_KILL:
			send_wm_delete(c, e->state & altmask);
			break;
		case KEY_LOWER: case KEY_ALTLOWER:
			client_lower(c);
			break;
		case KEY_INFO:
			show_info(c, e->keycode);
			break;
		case KEY_MAX:
			maximise_client(c, NET_WM_STATE_TOGGLE, MAXIMISE_HORZ|MAXIMISE_VERT);
			break;
		case KEY_MAXVERT:
			maximise_client(c, NET_WM_STATE_TOGGLE, MAXIMISE_VERT);
			break;
		case KEY_MAXHORZ:
			maximise_client(c, NET_WM_STATE_TOGGLE, MAXIMISE_HORZ);
			break;
#ifdef VWM
		case KEY_FIX:
			if (is_fixed(c)) {
				client_to_vdesk(c, current_screen->vdesk);
			} else {
				client_to_vdesk(c, VDESK_FIXED);
			}
			break;
#endif
		default: break;
	}
	return;
move_client:
	if (abs(c->x) == c->border && c->oldw != 0)
		c->x = 0;
	if (abs(c->y) == c->border && c->oldh != 0)
		c->y = 0;
	moveresize(c);
#ifdef WARP_POINTER
	setmouse(c->window, c->width + c->border - 1,
			c->height + c->border - 1);
#endif
	discard_enter_events(c);
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x8(%rbp)
leaq 0xc3c2(%rip), %rax      # 0x10a18
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movzbl 0x54(%rax), %esi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x3260
movq %rax, -0x10(%rbp)
callq 0xb600
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x198(%rbp)
addq $-0x31, %rax
subq $0x8, %rax
jb 0x4d63
jmp 0x4692
movq -0x198(%rbp), %rax
subq $0x61, %rax
je 0x4db6
jmp 0x46a5
movq -0x198(%rbp), %rax
subq $0x64, %rax
je 0x4d43
jmp 0x46b8
movq -0x198(%rbp), %rax
subq $0x6f, %rax
je 0x4744
jmp 0x46c7
movq -0x198(%rbp), %rax
subq $0x71, %rax
je 0x4dc8
jmp 0x46da
movq -0x198(%rbp), %rax
subq $0x73, %rax
je 0x4c11
jmp 0x46ed
movq -0x198(%rbp), %rax
subq $0xff09, %rax           # imm = 0xFF09
je 0x4b1a
jmp 0x4702
movq -0x198(%rbp), %rax
subq $0xff0d, %rax           # imm = 0xFF0D
je 0x4ae0
jmp 0x4717
movq -0x198(%rbp), %rax
subq $0xff51, %rax           # imm = 0xFF51
je 0x4d78
jmp 0x472c
movq -0x198(%rbp), %rax
subq $0xff53, %rax           # imm = 0xFF53
je 0x4d97
jmp 0x4dec
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
leaq 0xbca6(%rip), %rcx      # 0x103f8
andl (%rcx), %eax
cmpl $0x0, %eax
je 0x4adb
movl $0x0, -0x2c(%rbp)
leaq 0xc265(%rip), %rax      # 0x109d0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x47bb
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x28(%rbp), %rax
jne 0x47ac
movq -0x18(%rbp), %rax
movl 0x78(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x40(%rcx), %eax
jne 0x47ac
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x47ae
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x4772
cmpl $0x0, -0x2c(%rbp)
jne 0x47c6
jmp 0x4dee
xorl %eax, %eax
movl %eax, %edi
callq 0x3cc0
leaq 0xc242(%rip), %rax      # 0x10a18
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x28(%rbp), %rcx
movslq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movl %eax, -0x3c(%rbp)
leaq 0xc21d(%rip), %rax      # 0x10a18
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x28(%rbp), %rcx
movslq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movl %eax, -0x40(%rbp)
cvtsi2sdl -0x2c(%rbp), %xmm0
callq 0x3740
callq 0x30e0
cvttsd2si %xmm0, %eax
movl %eax, -0x44(%rbp)
cvtsi2ssl -0x2c(%rbp), %xmm0
cvtsi2ssl -0x44(%rbp), %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x30e0
cvttsd2si %xmm0, %eax
movl %eax, -0x48(%rbp)
movl -0x2c(%rbp), %eax
cltd
idivl -0x44(%rbp)
movl %edx, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
jne 0x4863
movl -0x44(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x3c(%rbp), %eax
cltd
idivl -0x44(%rbp)
movl %eax, -0x50(%rbp)
movl -0x40(%rbp), %eax
cltd
idivl -0x48(%rbp)
movl %eax, -0x54(%rbp)
movl -0x3c(%rbp), %eax
cltd
idivl -0x4c(%rbp)
movl %eax, -0x58(%rbp)
movl -0x40(%rbp), %eax
movl -0x48(%rbp), %ecx
subl $0x1, %ecx
imull -0x54(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x5c(%rbp)
movl -0x3c(%rbp), %eax
movl -0x44(%rbp), %ecx
subl $0x1, %ecx
imull -0x50(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x60(%rbp)
movl -0x3c(%rbp), %eax
movl -0x4c(%rbp), %ecx
subl $0x1, %ecx
imull -0x58(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x64(%rbp)
movl $0x0, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
leaq 0xc104(%rip), %rax      # 0x109d0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x4ad9
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x28(%rbp), %rax
je 0x48fd
jmp 0x4ac9
movq -0x18(%rbp), %rax
movl 0x78(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x40(%rcx), %eax
je 0x4912
jmp 0x4ac9
movl -0x6c(%rbp), %eax
movl -0x48(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x4a00
movl -0x68(%rbp), %eax
movl -0x44(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x4986
movl -0x68(%rbp), %ecx
imull -0x50(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
movl -0x6c(%rbp), %ecx
imull -0x54(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x50(%rbp), %ecx
movq -0x18(%rbp), %rax
movl 0x34(%rax), %eax
shll %eax
subl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x54(%rbp), %ecx
movq -0x18(%rbp), %rax
movl 0x34(%rax), %eax
shll %eax
subl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
jmp 0x49da
movl -0x68(%rbp), %ecx
imull -0x50(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
movl -0x6c(%rbp), %ecx
imull -0x54(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x60(%rbp), %ecx
movq -0x18(%rbp), %rax
movl 0x34(%rax), %eax
shll %eax
subl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x54(%rbp), %ecx
movq -0x18(%rbp), %rax
movl 0x34(%rax), %eax
shll %eax
subl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
cmpl -0x44(%rbp), %eax
jne 0x49fb
movl $0x0, -0x68(%rbp)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x4ac0
movl -0x68(%rbp), %eax
movl -0x4c(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x4a63
movl -0x68(%rbp), %ecx
imull -0x58(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
movl -0x6c(%rbp), %ecx
imull -0x54(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x58(%rbp), %ecx
movq -0x18(%rbp), %rax
movl 0x34(%rax), %eax
shll %eax
subl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x5c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl 0x34(%rax), %eax
shll %eax
subl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
jmp 0x4ab7
movl -0x68(%rbp), %ecx
imull -0x58(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
movl -0x6c(%rbp), %ecx
imull -0x54(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x64(%rbp), %ecx
movq -0x18(%rbp), %rax
movl 0x34(%rax), %eax
shll %eax
subl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x5c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl 0x34(%rax), %eax
shll %eax
subl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
callq 0xa150
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x48d3
jmp 0x4adb
jmp 0x4dee
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
leaq 0xb90a(%rip), %rcx      # 0x103f8
andl (%rcx), %eax
cmpl $0x0, %eax
je 0x4b06
leaq 0xb90c(%rip), %rax      # 0x10408
movq (%rax), %rdi
callq 0x8560
jmp 0x4b15
leaq 0xb8f3(%rip), %rax      # 0x10400
movq (%rax), %rdi
callq 0x8560
jmp 0x4dee
callq 0xb550
leaq 0xbef2(%rip), %rax      # 0x10a18
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rsi
xorl %edx, %edx
movl $0x1, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl %r8d, %ecx
callq 0x3610
cmpl $0x0, %eax
jne 0x4bfd
jmp 0x4b51
leaq 0xbec0(%rip), %rax      # 0x10a18
movq (%rax), %rdi
movl $0x3, %esi
leaq -0x130(%rbp), %rdx
callq 0x3540
cmpl $0x2, -0x130(%rbp)
jne 0x4b9e
leaq 0xbe9c(%rip), %rax      # 0x10a18
movq (%rax), %rdi
movl -0xdc(%rbp), %eax
xorl %ecx, %ecx
movzbl %al, %esi
movl %ecx, %edx
callq 0x3260
cmpq $0xff09, %rax           # imm = 0xFF09
jne 0x4b9e
callq 0xb550
jmp 0x4ba0
movb $0x1, %al
cmpl $0x2, -0x130(%rbp)
movb %al, -0x199(%rbp)
je 0x4bdc
leaq 0xbe60(%rip), %rax      # 0x10a18
movq (%rax), %rdi
movl -0xdc(%rbp), %eax
xorl %ecx, %ecx
movzbl %al, %esi
movl %ecx, %edx
callq 0x3260
cmpq $0xff09, %rax           # imm = 0xFF09
sete %al
movb %al, -0x199(%rbp)
movb -0x199(%rbp), %al
testb $0x1, %al
jne 0x4b51
leaq 0xbe27(%rip), %rax      # 0x10a18
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3470
leaq 0xbde4(%rip), %rax      # 0x109e8
movq (%rax), %rdi
callq 0x6ee0
jmp 0x4dee
leaq 0xbe10(%rip), %rax      # 0x10a28
cmpl $0x1, (%rax)
jle 0x4d3e
movl $0x0, -0x134(%rbp)
movl -0x134(%rbp), %eax
leaq 0xbdf0(%rip), %rcx      # 0x10a28
cmpl (%rcx), %eax
jge 0x4c6f
leaq 0xbded(%rip), %rax      # 0x10a30
movq (%rax), %rax
movslq -0x134(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
cmpq -0x28(%rbp), %rax
jne 0x4c5c
jmp 0x4c6f
jmp 0x4c5e
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
jmp 0x4c2b
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
movl -0x134(%rbp), %eax
leaq 0xbd9d(%rip), %rcx      # 0x10a28
cmpl (%rcx), %eax
jl 0x4c99
movl $0x0, -0x134(%rbp)
leaq 0xbd78(%rip), %rax      # 0x10a18
movq (%rax), %rdi
leaq 0xbd6e(%rip), %rax      # 0x10a18
movq (%rax), %rax
movq 0xe8(%rax), %rax
movslq -0x134(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x34e0
leaq 0xbd3d(%rip), %rax      # 0x10a18
movq (%rax), %rdi
leaq 0xbd33(%rip), %rax      # 0x10a18
movq (%rax), %rax
movq 0xe8(%rax), %rax
movslq -0x134(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
xorl %r9d, %r9d
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x3560
callq 0xb550
leaq 0xbcb2(%rip), %rax      # 0x109e8
movq (%rax), %rdi
callq 0x6ee0
jmp 0x4dee
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rax
cmpl $0x0, 0x68(%rax)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %esi
callq 0xb820
jmp 0x4dee
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
subq $0x31, %rax
movl %eax, %esi
callq 0xb720
jmp 0x4dee
movq -0x28(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jbe 0x4d95
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x40(%rax), %esi
subl $0x1, %esi
callq 0xb720
jmp 0x4dee
movq -0x28(%rbp), %rax
cmpl $0x7, 0x40(%rax)
jae 0x4db4
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x40(%rax), %esi
addl $0x1, %esi
callq 0xb720
jmp 0x4dee
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x58(%rax), %esi
callq 0xb720
jmp 0x4dee
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
leaq 0xb622(%rip), %rcx      # 0x103f8
andl (%rcx), %eax
cmpl $0x0, %eax
je 0x4dea
leaq 0xbc2c(%rip), %rax      # 0x10a10
movl $0x1, (%rax)
jmp 0x4dec
jmp 0x4dee
leaq 0xbbf3(%rip), %rax      # 0x109e8
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x4e08
jmp 0x56ad
movq -0x18(%rbp), %rax
cmpl $0x1, 0x58(%rax)
jle 0x4e21
movq -0x18(%rbp), %rax
movl 0x58(%rax), %eax
movl %eax, -0x1a0(%rbp)
jmp 0x4e2e
movl $0x10, %eax
movl %eax, -0x1a0(%rbp)
jmp 0x4e2e
movl -0x1a0(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1, 0x5c(%rax)
jle 0x4e50
movq -0x18(%rbp), %rax
movl 0x5c(%rax), %eax
movl %eax, -0x1a4(%rbp)
jmp 0x4e5d
movl $0x10, %eax
movl %eax, -0x1a4(%rbp)
jmp 0x4e5d
movl -0x1a4(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1b0(%rbp)
subq $0x2d, %rax
je 0x55fe
jmp 0x4e7d
movq -0x1b0(%rbp), %rax
subq $0x3d, %rax
je 0x55ec
jmp 0x4e90
movq -0x1b0(%rbp), %rax
subq $0x66, %rax
je 0x5613
jmp 0x4ea3
movq -0x1b0(%rbp), %rax
subq $0x68, %rax
je 0x4fb4
jmp 0x4eb6
movq -0x1b0(%rbp), %rax
subq $0x69, %rax
je 0x55c5
jmp 0x4ec9
movq -0x1b0(%rbp), %rax
subq $0x6a, %rax
je 0x5027
jmp 0x4edc
movq -0x1b0(%rbp), %rax
subq $0x6b, %rax
je 0x50a6
jmp 0x4eef
movq -0x1b0(%rbp), %rax
subq $0x6c, %rax
je 0x5119
jmp 0x4f02
movq -0x1b0(%rbp), %rax
subq $0x6d, %rax
je 0x5443
jmp 0x4f15
movq -0x1b0(%rbp), %rax
subq $0x6e, %rax
je 0x5363
jmp 0x4f28
movq -0x1b0(%rbp), %rax
subq $0x6f, %rax
je 0x5516
jmp 0x4f3b
movq -0x1b0(%rbp), %rax
subq $0x70, %rax
je 0x55ba
jmp 0x4f4e
movq -0x1b0(%rbp), %rax
subq $0x75, %rax
je 0x5283
jmp 0x4f61
movq -0x1b0(%rbp), %rax
subq $0x78, %rax
je 0x55d7
jmp 0x4f74
movq -0x1b0(%rbp), %rax
subq $0x79, %rax
je 0x5198
jmp 0x4f87
movq -0x1b0(%rbp), %rax
subq $0xff1b, %rax           # imm = 0xFF1B
je 0x559c
jmp 0x4f9c
movq -0x1b0(%rbp), %rax
subq $0xff9e, %rax           # imm = 0xFF9E
je 0x55ba
jmp 0x563f
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
leaq 0xb436(%rip), %rcx      # 0x103f8
andl (%rcx), %eax
cmpl $0x0, %eax
je 0x4fed
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %eax
subl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x48(%rcx), %eax
jl 0x4feb
movl -0x1c(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x5022
movq -0x18(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
movl $0x1, %ecx
leaq -0x138(%rbp), %r8
xorl %eax, %eax
movl %eax, %r9d
callq 0xaf10
movl -0x138(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
jmp 0x5643
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
leaq 0xb3c3(%rip), %rcx      # 0x103f8
andl (%rcx), %eax
cmpl $0x0, %eax
je 0x5068
movq -0x18(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x5059
movq -0x18(%rbp), %rax
movl 0x30(%rax), %eax
addl -0x20(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x54(%rcx), %eax
jg 0x5066
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x30(%rax), %ecx
movl %ecx, 0x30(%rax)
jmp 0x50a1
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %ecx
xorl %eax, %eax
movl %eax, %r8d
leaq -0x13c(%rbp), %r9
movl %ecx, %edx
callq 0xaf10
movl -0x13c(%rbp), %ecx
movq -0x18(%rbp), %rax
subl 0x30(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x5643
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
leaq 0xb344(%rip), %rcx      # 0x103f8
andl (%rcx), %eax
cmpl $0x0, %eax
je 0x50df
movq -0x18(%rbp), %rax
movl 0x30(%rax), %eax
subl -0x20(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4c(%rcx), %eax
jl 0x50dd
movl -0x20(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x30(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x30(%rax)
jmp 0x5114
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
xorl %eax, %eax
movl %eax, %r8d
leaq -0x140(%rbp), %r9
callq 0xaf10
movl -0x140(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x5643
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
leaq 0xb2d1(%rip), %rcx      # 0x103f8
andl (%rcx), %eax
cmpl $0x0, %eax
je 0x515a
movq -0x18(%rbp), %rax
cmpl $0x0, 0x50(%rax)
je 0x514b
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %eax
addl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jg 0x5158
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x2c(%rax), %ecx
movl %ecx, 0x2c(%rax)
jmp 0x5193
movq -0x18(%rbp), %rdi
movl $0x1, %ecx
xorl %edx, %edx
leaq -0x144(%rbp), %r8
xorl %eax, %eax
movl %eax, %r9d
movl %ecx, %esi
callq 0xaf10
movl -0x144(%rbp), %ecx
movq -0x18(%rbp), %rax
subl 0x2c(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
jmp 0x5643
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
leaq 0xb252(%rip), %rcx      # 0x103f8
andl (%rcx), %eax
cmpl $0x0, %eax
je 0x523f
movq -0x18(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
leaq -0x148(%rbp), %r8
leaq -0x14c(%rbp), %r9
movl %edx, %esi
callq 0xaf10
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %ecx
movq -0x18(%rbp), %rax
addl 0x24(%rax), %ecx
subl -0x148(%rbp), %ecx
movq -0x18(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x148(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x18(%rbp), %rax
movl 0x30(%rax), %ecx
subl -0x14c(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x28(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movl -0x14c(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x527e
movq -0x18(%rbp), %rdi
callq 0x9aa0
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x158(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x5643
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
leaq 0xb167(%rip), %rcx      # 0x103f8
andl (%rcx), %eax
cmpl $0x0, %eax
je 0x530e
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
leaq -0x15c(%rbp), %r8
leaq -0x160(%rbp), %r9
callq 0xaf10
movl -0x15c(%rbp), %ecx
movq -0x18(%rbp), %rax
subl 0x24(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x18(%rbp), %rax
movl 0x30(%rax), %ecx
movq -0x18(%rbp), %rax
addl 0x28(%rax), %ecx
subl -0x160(%rbp), %ecx
movq -0x18(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movl -0x160(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x535e
movq -0x18(%rbp), %rdi
callq 0x9aa0
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rax
movl (%rax), %ecx
movq -0x168(%rbp), %rax
addl 0x8(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x2c(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x168(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x5643
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
leaq 0xb087(%rip), %rcx      # 0x103f8
andl (%rcx), %eax
cmpl $0x0, %eax
je 0x53ee
movq -0x18(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
xorl %ecx, %ecx
leaq -0x16c(%rbp), %r8
leaq -0x170(%rbp), %r9
callq 0xaf10
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %ecx
movq -0x18(%rbp), %rax
addl 0x24(%rax), %ecx
subl -0x16c(%rbp), %ecx
movq -0x18(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x170(%rbp), %ecx
movq -0x18(%rbp), %rax
subl 0x28(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movl -0x16c(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
jmp 0x543e
movq -0x18(%rbp), %rdi
callq 0x9aa0
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
addl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x178(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x178(%rbp), %rax
addl 0xc(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x30(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x5643
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
leaq 0xafa7(%rip), %rcx      # 0x103f8
andl (%rcx), %eax
cmpl $0x0, %eax
je 0x54b0
movq -0x18(%rbp), %rdi
movl $0x1, %edx
xorl %ecx, %ecx
leaq -0x17c(%rbp), %r8
leaq -0x180(%rbp), %r9
movl %edx, %esi
callq 0xaf10
movl -0x17c(%rbp), %ecx
movq -0x18(%rbp), %rax
subl 0x24(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x180(%rbp), %ecx
movq -0x18(%rbp), %rax
subl 0x28(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
jmp 0x5511
movq -0x18(%rbp), %rdi
callq 0x9aa0
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rax
movl (%rax), %ecx
movq -0x188(%rbp), %rax
addl 0x8(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x2c(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x188(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x188(%rbp), %rax
addl 0xc(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x30(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x5643
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
leaq 0xaed4(%rip), %rcx      # 0x103f8
andl (%rcx), %eax
cmpl $0x0, %eax
jne 0x5597
movq -0x18(%rbp), %rdi
callq 0x9aa0
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rax
movl (%rax), %ecx
movq -0x190(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rdx
subl 0x2c(%rdx), %eax
movl $0x2, %esi
cltd
idivl %esi
addl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x190(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x190(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x18(%rbp), %rdx
subl 0x30(%rdx), %eax
movl $0x2, %esi
cltd
idivl %esi
addl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x5643
jmp 0x5641
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x50(%rax), %esi
leaq 0xae4a(%rip), %rax      # 0x103f8
andl (%rax), %esi
callq 0x4040
jmp 0x5641
movq -0x18(%rbp), %rdi
callq 0x3a90
jmp 0x5641
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x54(%rax), %esi
callq 0xa1f0
jmp 0x5641
movq -0x18(%rbp), %rdi
movl $0x2, %esi
movl $0x3, %edx
callq 0xabe0
jmp 0x5641
movq -0x18(%rbp), %rdi
movl $0x2, %edx
movl %edx, %esi
callq 0xabe0
jmp 0x5641
movq -0x18(%rbp), %rdi
movl $0x2, %esi
movl $0x1, %edx
callq 0xabe0
jmp 0x5641
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x78(%rax)
jne 0x562f
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x40(%rax), %esi
callq 0x3db0
jmp 0x563d
movq -0x18(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3db0
jmp 0x5641
jmp 0x5641
jmp 0x56ad
movq -0x18(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movq -0x18(%rbp), %rcx
cmpl 0x34(%rcx), %eax
jne 0x566f
movq -0x18(%rbp), %rax
cmpl $0x0, 0x40(%rax)
je 0x566f
movq -0x18(%rbp), %rax
movl $0x0, 0x24(%rax)
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movq -0x18(%rbp), %rcx
cmpl 0x34(%rcx), %eax
jne 0x569b
movq -0x18(%rbp), %rax
cmpl $0x0, 0x44(%rax)
je 0x569b
movq -0x18(%rbp), %rax
movl $0x0, 0x28(%rax)
movq -0x18(%rbp), %rdi
callq 0xa150
movq -0x18(%rbp), %rdi
callq 0x8700
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nopw %cs:(%rax,%rax)