// File: /workspace/github_c_makefile_star2_O0/baskerville[P]bspwm/src/bspwm.c
// Function: main
int main(int argc, char *argv[])
{
	fd_set descriptors;
	char socket_path[MAXLEN];
	char state_path[MAXLEN] = {0};
	int run_level = 0;
	config_path[0] = '\0';
	int sock_fd = -1, cli_fd, dpy_fd, max_fd, n;
	struct sockaddr_un sock_address;
	char msg[BUFSIZ] = {0};
	xcb_generic_event_t *event;
	char *end;
	int opt;

	while ((opt = getopt(argc, argv, "hvc:s:o:")) != -1) {
		switch (opt) {
			case 'h':
				printf(WM_NAME " [-h|-v|-c CONFIG_PATH]\n");
				exit(EXIT_SUCCESS);
				break;
			case 'v':
				printf("%s\n", VERSION);
				exit(EXIT_SUCCESS);
				break;
			case 'c':
				snprintf(config_path, sizeof(config_path), "%s", optarg);
				break;
			case 's':
				run_level |= 1;
				snprintf(state_path, sizeof(state_path), "%s", optarg);
				break;
			case 'o':
				run_level |= 2;
				sock_fd = strtol(optarg, &end, 0);
				if (*end != '\0') {
					sock_fd = -1;
				}
				break;
		}
	}

	if (config_path[0] == '\0') {
		char *config_home = getenv(CONFIG_HOME_ENV);
		if (config_home != NULL) {
			snprintf(config_path, sizeof(config_path), "%s/%s/%s", config_home, WM_NAME, CONFIG_NAME);
		} else {
			snprintf(config_path, sizeof(config_path), "%s/%s/%s/%s", getenv("HOME"), ".config", WM_NAME, CONFIG_NAME);
		}
	}

	dpy = xcb_connect(NULL, &default_screen);

	if (!check_connection(dpy)) {
		exit(EXIT_FAILURE);
	}

	load_settings();
	setup();

	if (state_path[0] != '\0') {
		restore_state(state_path);
		unlink(state_path);
	}

	dpy_fd = xcb_get_file_descriptor(dpy);

	if (sock_fd == -1) {
		char *sp = getenv(SOCKET_ENV_VAR);
		if (sp != NULL) {
			snprintf(socket_path, sizeof(socket_path), "%s", sp);
		} else {
			char *host = NULL;
			int dn = 0, sn = 0;
			if (xcb_parse_display(NULL, &host, &dn, &sn) != 0) {
				snprintf(socket_path, sizeof(socket_path), SOCKET_PATH_TPL, host, dn, sn);
			}
			free(host);
		}

		sock_address.sun_family = AF_UNIX;
		if (snprintf(sock_address.sun_path, sizeof(sock_address.sun_path), "%s", socket_path) < 0) {
			err("Couldn't write the socket path.\n");
		}

		sock_fd = socket(AF_UNIX, SOCK_STREAM, 0);

		if (sock_fd == -1) {
			err("Couldn't create the socket.\n");
		}

		unlink(socket_path);

		if (bind(sock_fd, (struct sockaddr *) &sock_address, sizeof(sock_address)) == -1) {
			err("Couldn't bind a name to the socket.\n");
		}

		if (listen(sock_fd, SOMAXCONN) == -1) {
			err("Couldn't listen to the socket.\n");
		}
	}

	fcntl(sock_fd, F_SETFD, FD_CLOEXEC | fcntl(sock_fd, F_GETFD));

	signal(SIGINT, sig_handler);
	signal(SIGHUP, sig_handler);
	signal(SIGTERM, sig_handler);
	signal(SIGCHLD, sig_handler);
	signal(SIGPIPE, SIG_IGN);
	run_config(run_level);
	running = true;

	while (running) {

		xcb_flush(dpy);

		FD_ZERO(&descriptors);
		FD_SET(sock_fd, &descriptors);
		FD_SET(dpy_fd, &descriptors);
		max_fd = MAX(sock_fd, dpy_fd);

		for (pending_rule_t *pr = pending_rule_head; pr != NULL; pr = pr->next) {
			FD_SET(pr->fd, &descriptors);
			if (pr->fd > max_fd) {
				max_fd = pr->fd;
			}
		}

		if (select(max_fd + 1, &descriptors, NULL, NULL, NULL) > 0) {

			pending_rule_t *pr = pending_rule_head;
			while (pr != NULL) {
				pending_rule_t *next = pr->next;
				if (FD_ISSET(pr->fd, &descriptors)) {
					if (manage_window(pr->win, pr->csq, pr->fd)) {
						for (event_queue_t *eq = pr->event_head; eq != NULL; eq = eq->next) {
							handle_event(&eq->event);
						}
					}
					remove_pending_rule(pr);
				}
				pr = next;
			}

			if (FD_ISSET(sock_fd, &descriptors)) {
				cli_fd = accept(sock_fd, NULL, 0);
				if (cli_fd > 0 && (n = recv(cli_fd, msg, sizeof(msg)-1, 0)) > 0) {
					msg[n] = '\0';
					FILE *rsp = fdopen(cli_fd, "w");
					if (rsp != NULL) {
						handle_message(msg, n, rsp);
					} else {
						warn("Can't open the client socket as file.\n");
						close(cli_fd);
					}
				}
			}

			if (FD_ISSET(dpy_fd, &descriptors)) {
				xcb_aux_sync(dpy);
				while ((event = xcb_poll_for_event(dpy)) != NULL) {
					handle_event(event);
					free(event);
				}
			}

		}

		if (!check_connection(dpy)) {
			running = false;
		}

		prune_dead_subscribers();
	}

	if (restart) {
		char *host = NULL;
		int dn = 0, sn = 0;
		if (xcb_parse_display(NULL, &host, &dn, &sn) != 0) {
			snprintf(state_path, sizeof(state_path), STATE_PATH_TPL, host, dn, sn);
		}
		free(host);
		FILE *f = fopen(state_path, "w");
		query_state(f);
		fclose(f);
	}

	cleanup();
	ungrab_buttons();
	xcb_ewmh_connection_wipe(ewmh);
	xcb_destroy_window(dpy, meta_window);
	xcb_destroy_window(dpy, motion_recorder.id);
	free(ewmh);
	xcb_flush(dpy);
	xcb_disconnect(dpy);

	if (restart) {
		fcntl(sock_fd, F_SETFD, ~FD_CLOEXEC & fcntl(sock_fd, F_GETFD));

		int rargc;
		for (rargc = 0; rargc < argc; rargc++) {
			if (streq("-s", argv[rargc])) {
				break;
			}
		}

		int len = rargc + 5;
		char **rargv = malloc(len * sizeof(char *));

		for (int i = 0; i < rargc; i++) {
			rargv[i] = argv[i];
		}

		char sock_fd_arg[SMALEN];
		snprintf(sock_fd_arg, sizeof(sock_fd_arg), "%i", sock_fd);

		rargv[rargc] = "-s";
		rargv[rargc + 1] = state_path;
		rargv[rargc + 2] = "-o";
		rargv[rargc + 3] = sock_fd_arg;
		rargv[rargc + 4] = 0;

		execvp(*rargv, rargv);

		exit_status = 1;
		free(rargv);
	}

	close(sock_fd);
	unlink(socket_path);

	return exit_status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2430, %rsp           # imm = 0x2430
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x290(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x4100
movl $0x0, -0x294(%rbp)
movb $0x0, 0x30963(%rip)     # 0x355b0
movl $0xffffffff, -0x298(%rbp) # imm = 0xFFFFFFFF
leaq -0x2320(%rbp), %rdi
xorl %esi, %esi
movl $0x2000, %edx           # imm = 0x2000
callq 0x4100
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x28417(%rip), %rdx     # 0x2d08f
callq 0x4560
movl %eax, -0x2334(%rbp)
cmpl $-0x1, %eax
je 0x4d97
movl -0x2334(%rbp), %eax
addl $-0x63, %eax
movl %eax, %ecx
movq %rcx, -0x23f8(%rbp)
subl $0x13, %eax
ja 0x4d92
movq -0x23f8(%rbp), %rax
leaq 0x2834f(%rip), %rcx     # 0x2d004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x283d3(%rip), %rdi     # 0x2d098
movb $0x0, %al
callq 0x4090
xorl %edi, %edi
callq 0x4200
leaq 0x2aa83(%rip), %rdi     # 0x2f75d
leaq 0x283d5(%rip), %rsi     # 0x2d0b6
movb $0x0, %al
callq 0x4090
xorl %edi, %edi
callq 0x4200
movq 0x302ea(%rip), %rax     # 0x34fe0
movq (%rax), %rcx
leaq 0x308b0(%rip), %rdi     # 0x355b0
movl $0x100, %esi            # imm = 0x100
leaq 0x283e4(%rip), %rdx     # 0x2d0f0
movb $0x0, %al
callq 0x4120
jmp 0x4d92
movl -0x294(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x294(%rbp)
leaq -0x290(%rbp), %rdi
movq 0x302ae(%rip), %rax     # 0x34fe0
movq (%rax), %rcx
movl $0x100, %esi            # imm = 0x100
leaq 0x283af(%rip), %rdx     # 0x2d0f0
movb $0x0, %al
callq 0x4120
jmp 0x4d92
movl -0x294(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x294(%rbp)
movq 0x30280(%rip), %rax     # 0x34fe0
movq (%rax), %rdi
leaq -0x2330(%rbp), %rsi
xorl %edx, %edx
callq 0x4660
movl %eax, -0x298(%rbp)
movq -0x2330(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x4d90
movl $0xffffffff, -0x298(%rbp) # imm = 0xFFFFFFFF
jmp 0x4d92
jmp 0x4c6a
movsbl 0x30812(%rip), %eax     # 0x355b0
cmpl $0x0, %eax
jne 0x4e39
leaq 0x2831b(%rip), %rdi     # 0x2d0c9
callq 0x4770
movq %rax, -0x2340(%rbp)
cmpq $0x0, -0x2340(%rbp)
je 0x4df5
movq -0x2340(%rbp), %rcx
leaq 0x307de(%rip), %rdi     # 0x355b0
movl $0x100, %esi            # imm = 0x100
leaq 0x2830c(%rip), %rdx     # 0x2d0ea
leaq 0x282f4(%rip), %r8      # 0x2d0d9
leaq 0x282f3(%rip), %r9      # 0x2d0df
movb $0x0, %al
callq 0x4120
jmp 0x4e37
leaq 0x282d8(%rip), %rdi     # 0x2d0d4
callq 0x4770
movq %rax, %rcx
leaq 0x307a5(%rip), %rdi     # 0x355b0
movl $0x100, %esi            # imm = 0x100
leaq 0x282d0(%rip), %rdx     # 0x2d0e7
leaq 0x282d5(%rip), %r8      # 0x2d0f3
leaq 0x282b4(%rip), %r9      # 0x2d0d9
leaq 0x282b3(%rip), %rax     # 0x2d0df
movq %rax, (%rsp)
movb $0x0, %al
callq 0x4120
jmp 0x4e39
xorl %eax, %eax
movl %eax, %edi
leaq 0x3086c(%rip), %rsi     # 0x356b0
callq 0x43c0
movq %rax, 0x30868(%rip)     # 0x356b8
movq 0x30861(%rip), %rdi     # 0x356b8
callq 0x5890
testb $0x1, %al
jne 0x4e6a
movl $0x1, %edi
callq 0x4200
callq 0x7c80
callq 0x5980
movsbl -0x290(%rbp), %eax
cmpl $0x0, %eax
je 0x4e98
leaq -0x290(%rbp), %rdi
callq 0x26c10
leaq -0x290(%rbp), %rdi
callq 0x42f0
movq 0x30819(%rip), %rdi     # 0x356b8
callq 0x4390
movl %eax, -0x2a0(%rbp)
cmpl $-0x1, -0x298(%rbp)
jne 0x503b
leaq 0x2823d(%rip), %rdi     # 0x2d0fb
callq 0x4770
movq %rax, -0x2348(%rbp)
cmpq $0x0, -0x2348(%rbp)
je 0x4ef7
leaq -0x190(%rbp), %rdi
movq -0x2348(%rbp), %rcx
movl $0x100, %esi            # imm = 0x100
leaq 0x28202(%rip), %rdx     # 0x2d0f0
movb $0x0, %al
callq 0x4120
jmp 0x4f74
movq $0x0, -0x2350(%rbp)
movl $0x0, -0x2354(%rbp)
movl $0x0, -0x2358(%rbp)
xorl %eax, %eax
movl %eax, %edi
leaq -0x2350(%rbp), %rsi
leaq -0x2354(%rbp), %rdx
leaq -0x2358(%rbp), %rcx
callq 0x48f0
cmpl $0x0, %eax
je 0x4f68
leaq -0x190(%rbp), %rdi
movq -0x2350(%rbp), %rcx
movl -0x2354(%rbp), %r8d
movl -0x2358(%rbp), %r9d
movl $0x100, %esi            # imm = 0x100
leaq 0x281a7(%rip), %rdx     # 0x2d108
movb $0x0, %al
callq 0x4120
movq -0x2350(%rbp), %rdi
callq 0x4450
movw $0x1, -0x316(%rbp)
leaq -0x316(%rbp), %rdi
addq $0x2, %rdi
leaq -0x190(%rbp), %rcx
movl $0x6c, %esi
leaq 0x28155(%rip), %rdx     # 0x2d0f0
movb $0x0, %al
callq 0x4120
cmpl $0x0, %eax
jge 0x4fb5
leaq 0x28174(%rip), %rdi     # 0x2d122
movb $0x0, %al
callq 0x64b0
movl $0x1, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x4740
movl %eax, -0x298(%rbp)
cmpl $-0x1, -0x298(%rbp)
jne 0x4fe0
leaq 0x2816a(%rip), %rdi     # 0x2d143
movb $0x0, %al
callq 0x64b0
leaq -0x190(%rbp), %rdi
callq 0x42f0
movl -0x298(%rbp), %edi
leaq -0x316(%rbp), %rsi
movl $0x6e, %edx
callq 0x49a0
cmpl $-0x1, %eax
jne 0x5016
leaq 0x28151(%rip), %rdi     # 0x2d160
movb $0x0, %al
callq 0x64b0
movl -0x298(%rbp), %edi
movl $0x1000, %esi           # imm = 0x1000
callq 0x44c0
cmpl $-0x1, %eax
jne 0x5039
leaq 0x28153(%rip), %rdi     # 0x2d185
movb $0x0, %al
callq 0x64b0
jmp 0x503b
movl -0x298(%rbp), %eax
movl %eax, -0x23fc(%rbp)
movl -0x298(%rbp), %edi
movl $0x1, %esi
movb $0x0, %al
callq 0x4a80
movl -0x23fc(%rbp), %edi
movl %eax, %edx
orl $0x1, %edx
movl $0x2, %esi
movb $0x0, %al
callq 0x4a80
movl $0x2, %edi
leaq 0x1084(%rip), %rsi      # 0x6100
callq 0x4070
movl $0x1, %edi
leaq 0x1073(%rip), %rsi      # 0x6100
callq 0x4070
movl $0xf, %edi
leaq 0x1062(%rip), %rsi      # 0x6100
callq 0x4070
movl $0x11, %edi
leaq 0x1051(%rip), %rsi      # 0x6100
callq 0x4070
movl $0xd, %edi
movl $0x1, %esi
callq 0x4070
movl -0x294(%rbp), %edi
callq 0x7bf0
movb $0x1, 0x305eb(%rip)     # 0x356c0
testb $0x1, 0x305e4(%rip)     # 0x356c0
je 0x5558
movq 0x305cf(%rip), %rdi     # 0x356b8
callq 0x4650
leaq -0x90(%rbp), %rax
movq %rax, -0x2368(%rbp)
movl $0x0, -0x235c(%rbp)
movl -0x235c(%rbp), %eax
cmpq $0x10, %rax
jae 0x5138
movq -0x2368(%rbp), %rax
movl -0x235c(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
movl -0x235c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x235c(%rbp)
jmp 0x5106
jmp 0x513a
movl -0x298(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movl -0x298(%rbp), %eax
movl $0x40, %esi
cltd
idivl %esi
cltq
orq -0x90(%rbp,%rax,8), %rcx
movq %rcx, -0x90(%rbp,%rax,8)
movl -0x2a0(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movl -0x2a0(%rbp), %eax
movl $0x40, %esi
cltd
idivl %esi
cltq
orq -0x90(%rbp,%rax,8), %rcx
movq %rcx, -0x90(%rbp,%rax,8)
movl -0x298(%rbp), %eax
cmpl -0x2a0(%rbp), %eax
jle 0x51d0
movl -0x298(%rbp), %eax
movl %eax, -0x2400(%rbp)
jmp 0x51dc
movl -0x2a0(%rbp), %eax
movl %eax, -0x2400(%rbp)
movl -0x2400(%rbp), %eax
movl %eax, -0x2a4(%rbp)
movq 0x304d9(%rip), %rax     # 0x356c8
movq %rax, -0x2370(%rbp)
cmpq $0x0, -0x2370(%rbp)
je 0x527c
movq -0x2370(%rbp), %rax
movl (%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movq -0x2370(%rbp), %rax
movl (%rax), %eax
movl $0x40, %esi
cltd
idivl %esi
cltq
orq -0x90(%rbp,%rax,8), %rcx
movq %rcx, -0x90(%rbp,%rax,8)
movq -0x2370(%rbp), %rax
movl (%rax), %eax
cmpl -0x2a4(%rbp), %eax
jle 0x5263
movq -0x2370(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2a4(%rbp)
jmp 0x5265
movq -0x2370(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x2370(%rbp)
jmp 0x51f6
movl -0x2a4(%rbp), %edi
addl $0x1, %edi
leaq -0x90(%rbp), %rsi
xorl %eax, %eax
movl %eax, %r8d
movq %r8, %rdx
movq %r8, %rcx
callq 0x41e0
cmpl $0x0, %eax
jle 0x5537
movq 0x3041c(%rip), %rax     # 0x356c8
movq %rax, -0x2378(%rbp)
cmpq $0x0, -0x2378(%rbp)
je 0x53a9
movq -0x2378(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x2380(%rbp)
movq -0x2378(%rbp), %rax
movl (%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
cltq
movq -0x90(%rbp,%rax,8), %rax
movq %rax, -0x2408(%rbp)
movq -0x2378(%rbp), %rax
movl (%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x2408(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x5396
movq -0x2378(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x2378(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x2378(%rbp), %rax
movl (%rax), %edx
callq 0x15c80
testb $0x1, %al
jne 0x534c
jmp 0x538a
movq -0x2378(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x2388(%rbp)
cmpq $0x0, -0x2388(%rbp)
je 0x5388
movq -0x2388(%rbp), %rdi
callq 0x130b0
movq -0x2388(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x2388(%rbp)
jmp 0x535e
jmp 0x538a
movq -0x2378(%rbp), %rdi
callq 0x29a70
movq -0x2380(%rbp), %rax
movq %rax, -0x2378(%rbp)
jmp 0x52b3
movl -0x298(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
cltq
movq -0x90(%rbp,%rax,8), %rax
movq %rax, -0x2410(%rbp)
movl -0x298(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x2410(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x54aa
movl -0x298(%rbp), %edi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x4a50
movl %eax, -0x29c(%rbp)
cmpl $0x0, -0x29c(%rbp)
jle 0x54a8
movl -0x29c(%rbp), %edi
leaq -0x2320(%rbp), %rsi
movl $0x1fff, %edx           # imm = 0x1FFF
xorl %ecx, %ecx
callq 0x42d0
movl %eax, -0x2a8(%rbp)
cmpl $0x0, %eax
jle 0x54a8
movslq -0x2a8(%rbp), %rax
movb $0x0, -0x2320(%rbp,%rax)
movl -0x29c(%rbp), %edi
leaq 0x29a17(%rip), %rsi     # 0x2ee73
callq 0x4540
movq %rax, -0x2390(%rbp)
cmpq $0x0, -0x2390(%rbp)
je 0x548d
leaq -0x2320(%rbp), %rdi
movl -0x2a8(%rbp), %esi
movq -0x2390(%rbp), %rdx
callq 0x18c10
jmp 0x54a6
leaq 0x27d11(%rip), %rdi     # 0x2d1a5
movb $0x0, %al
callq 0x6410
movl -0x29c(%rbp), %edi
callq 0x4160
jmp 0x54a8
jmp 0x54aa
movl -0x2a0(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
cltq
movq -0x90(%rbp,%rax,8), %rax
movq %rax, -0x2418(%rbp)
movl -0x2a0(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x2418(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x5535
movq 0x301bd(%rip), %rdi     # 0x356b8
callq 0x40f0
movq 0x301b1(%rip), %rdi     # 0x356b8
callq 0x46a0
movq %rax, -0x2328(%rbp)
cmpq $0x0, %rax
je 0x5533
movq -0x2328(%rbp), %rdi
callq 0x130b0
movq -0x2328(%rbp), %rdi
callq 0x4450
jmp 0x5500
jmp 0x5535
jmp 0x5537
movq 0x3017a(%rip), %rdi     # 0x356b8
callq 0x5890
testb $0x1, %al
jne 0x554e
movb $0x0, 0x30172(%rip)     # 0x356c0
callq 0x2c260
jmp 0x50d5
testb $0x1, 0x30171(%rip)     # 0x356d0
je 0x5614
movq $0x0, -0x2398(%rbp)
movl $0x0, -0x239c(%rbp)
movl $0x0, -0x23a0(%rbp)
xorl %eax, %eax
movl %eax, %edi
leaq -0x2398(%rbp), %rsi
leaq -0x239c(%rbp), %rdx
leaq -0x23a0(%rbp), %rcx
callq 0x48f0
cmpl $0x0, %eax
je 0x55d6
leaq -0x290(%rbp), %rdi
movq -0x2398(%rbp), %rcx
movl -0x239c(%rbp), %r8d
movl -0x23a0(%rbp), %r9d
movl $0x100, %esi            # imm = 0x100
leaq 0x27bfd(%rip), %rdx     # 0x2d1cc
movb $0x0, %al
callq 0x4120
movq -0x2398(%rbp), %rdi
callq 0x4450
leaq -0x290(%rbp), %rdi
leaq 0x29883(%rip), %rsi     # 0x2ee73
callq 0x42b0
movq %rax, -0x23a8(%rbp)
movq -0x23a8(%rbp), %rdi
callq 0x22930
movq -0x23a8(%rbp), %rdi
callq 0x48a0
callq 0x6160
callq 0x151f0
leaq 0x307fb(%rip), %rax     # 0x35e20
movq (%rax), %rdi
callq 0x61e0
movq 0x30084(%rip), %rdi     # 0x356b8
movl 0x3009a(%rip), %esi     # 0x356d4
callq 0x4140
movl %eax, -0x23ac(%rbp)
movq 0x3006c(%rip), %rdi     # 0x356b8
movl 0x30086(%rip), %esi     # 0x356d8
callq 0x4140
movl %eax, -0x23b0(%rbp)
leaq 0x307bc(%rip), %rax     # 0x35e20
movq (%rax), %rdi
callq 0x4450
movq 0x30045(%rip), %rdi     # 0x356b8
callq 0x4650
movq 0x30039(%rip), %rdi     # 0x356b8
callq 0x4960
testb $0x1, 0x30045(%rip)     # 0x356d0
je 0x585d
movl -0x298(%rbp), %eax
movl %eax, -0x241c(%rbp)
movl -0x298(%rbp), %edi
movl $0x1, %esi
movb $0x0, %al
callq 0x4a80
movl -0x241c(%rbp), %edi
movl %eax, %edx
andl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movl $0x2, %esi
movb $0x0, %al
callq 0x4a80
movl $0x0, -0x23b4(%rbp)
movl -0x23b4(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x5713
movq -0x10(%rbp), %rax
movslq -0x23b4(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x28803(%rip), %rdi     # 0x2def7
callq 0x4800
cmpl $0x0, %eax
jne 0x5700
jmp 0x5713
jmp 0x5702
movl -0x23b4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x23b4(%rbp)
jmp 0x56d3
movl -0x23b4(%rbp), %eax
addl $0x5, %eax
movl %eax, -0x23b8(%rbp)
movslq -0x23b8(%rbp), %rdi
shlq $0x3, %rdi
callq 0x42a0
movq %rax, -0x23c0(%rbp)
movl $0x0, -0x23c4(%rbp)
movl -0x23c4(%rbp), %eax
cmpl -0x23b4(%rbp), %eax
jge 0x5783
movq -0x10(%rbp), %rax
movslq -0x23c4(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x23c0(%rbp), %rax
movslq -0x23c4(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x23c4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x23c4(%rbp)
jmp 0x5743
leaq -0x23f0(%rbp), %rdi
movl -0x298(%rbp), %ecx
movl $0x20, %esi
leaq 0x29b3d(%rip), %rdx     # 0x2f2d9
movb $0x0, %al
callq 0x4120
movq -0x23c0(%rbp), %rax
movslq -0x23b4(%rbp), %rcx
leaq 0x2873f(%rip), %rdx     # 0x2def7
movq %rdx, (%rax,%rcx,8)
leaq -0x290(%rbp), %rdx
movq -0x23c0(%rbp), %rax
movl -0x23b4(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x23c0(%rbp), %rax
movl -0x23b4(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
leaq 0x279f1(%rip), %rdx     # 0x2d1e5
movq %rdx, (%rax,%rcx,8)
leaq -0x23f0(%rbp), %rdx
movq -0x23c0(%rbp), %rax
movl -0x23b4(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x23c0(%rbp), %rax
movl -0x23b4(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x23c0(%rbp), %rax
movq (%rax), %rdi
movq -0x23c0(%rbp), %rsi
callq 0x41f0
movl $0x1, 0x2fe8f(%rip)     # 0x356e0
movq -0x23c0(%rbp), %rdi
callq 0x4450
movl -0x298(%rbp), %edi
callq 0x4160
leaq -0x190(%rbp), %rdi
callq 0x42f0
movl 0x2fe66(%rip), %eax     # 0x356e0
addq $0x2430, %rsp           # imm = 0x2430
popq %rbp
retq
nopw %cs:(%rax,%rax)