// File: /workspace/github_c_makefile_star2_O0/qpfiffer[P]38-Moths/src/greshunkel.c
// Function: interpolate_conditionals
static line
_interpolate_conditionals(const greshunkel_ctext *ctext, const char *buf, size_t *num_read, const struct compiled_regex *all_regex) {
	line to_return = {0};
	*num_read = 0;

	match_t match[4] = {{0}};
	if (regexec_2_0_beta(&all_regex->c_conditional_inverse_regex, buf, 3, match) == 0) {
		const match_t conditional_variable = match[1];
		match_t conditional_meat = match[2];
		/* Make sure they were matched: */
		assert(conditional_variable.rm_so != -1 && conditional_variable.rm_eo != -1);
		assert(conditional_meat.rm_so != -1 && conditional_meat.rm_eo != -1);

		size_t possible_dif = 0;
		const char *closest_endif = NULL;
		closest_endif = strstr(conditional_meat.start, "xXx ENDLESS xXx");
		possible_dif = closest_endif - buf;
		if (possible_dif != (unsigned int)conditional_meat.rm_so) {
			conditional_meat.rm_eo = possible_dif;
			conditional_meat.len = conditional_meat.rm_eo - conditional_meat.rm_so;
		}

		/* We found a conditioanl. */
		*num_read = conditional_meat.rm_eo + strlen("xXx ENDLESS xXx");

		char just_match_str[conditional_variable.len + 1];
		just_match_str[conditional_variable.len] = '\0';
		strncpy(just_match_str, conditional_variable.start, conditional_variable.len);

		/* TODO: Support a boolean type. */
		/*if (!((tuple = find_needle(ctext, just_match_str, 1)) && tuple->type == GSHKL_BOOL)) { */
		const greshunkel_tuple *tuple = NULL;
		char *sub_ctext_match = NULL;
		int should_render = 0;
		if ((tuple = find_needle(ctext, just_match_str, 1))) {
			if (_is_truthy(tuple)) {
				should_render = 1;
			}
		} else if ((sub_ctext_match = strchr(just_match_str, '.')) != NULL) {
			/* TODO: Check sub-context. */
			char sub_context_name[MAX_GSHKL_STR_SIZE] = {0};
			char sub_item_name[MAX_GSHKL_STR_SIZE] = {0};
			memcpy(sub_context_name, just_match_str, sub_ctext_match - just_match_str);
			memcpy(sub_item_name, sub_ctext_match + strlen("."), conditional_variable.len - strlen(sub_context_name) + strlen("."));

			if ((tuple = find_needle(ctext, sub_context_name, 1)) && tuple->type == GSHKL_SUBCTEXT) {
				const greshunkel_ctext *sub_ctext = tuple->value.sub_ctext;

				unsigned int i;
				for (i = 0; i < sub_ctext->values->count; i++) {
					const greshunkel_tuple *sub_tuple = vector_get(sub_ctext->values, i);
					const char *_name = sub_tuple->name;
					const size_t larger = strlen(_name) > strlen(sub_item_name) ?
							strlen(_name) : strlen(sub_item_name);

					if (strncmp(_name, sub_item_name, larger) == 0 && _is_falsey(sub_tuple)) {
							should_render = 1;
					}
				}
			}
		}

		if (should_render) {
			line to_render_line;
			to_render_line.data = strndup(conditional_meat.start, conditional_meat.len);
			to_render_line.size = conditional_meat.len;

			line rendered_piece = {0};

			/* Recurse contexts until my fucking mind melts. */
			greshunkel_ctext *_temp_ctext = _gshkl_init_child_context(ctext);
			rendered_piece.data = gshkl_render(_temp_ctext, to_render_line.data, to_render_line.size, &rendered_piece.size);
			gshkl_free_context(_temp_ctext);

			const size_t old_size = to_return.size;
			to_return.size += rendered_piece.size;
			if (old_size <= 0) {
				to_return.data = calloc(1, to_return.size);
			} else {
				to_return.data = realloc(to_return.data, to_return.size);
			}

			memcpy(to_return.data + old_size, rendered_piece.data, rendered_piece.size);
			free(rendered_piece.data);
			free(to_render_line.data);
		}
	} else if (regexec_2_0_beta(&all_regex->c_conditional_regex, buf, 3, match) == 0) {
		const match_t conditional_variable = match[1];
		match_t conditional_meat = match[2];

		assert(conditional_variable.rm_so != -1 && conditional_variable.rm_eo != -1);
		assert(conditional_meat.rm_so != -1 && conditional_meat.rm_eo != -1);

		size_t possible_dif = 0;
		const char *closest_endif = NULL;
		closest_endif = strstr(conditional_meat.start, "xXx ENDLESS xXx");
		possible_dif = closest_endif - buf;
		if (possible_dif != (unsigned int)conditional_meat.rm_so) {
			conditional_meat.rm_eo = possible_dif;
			conditional_meat.len = conditional_meat.rm_eo - conditional_meat.rm_so;
		}

		/* We found a conditioanl. */
		*num_read = conditional_meat.rm_eo + strlen("xXx ENDLESS xXx");

		char just_match_str[conditional_variable.len + 1];
		just_match_str[conditional_variable.len] = '\0';
		strncpy(just_match_str, conditional_variable.start, conditional_variable.len);

		/* TODO: Support a boolean type. */
		/*if (!((tuple = find_needle(ctext, just_match_str, 1)) && tuple->type == GSHKL_BOOL)) */
		const greshunkel_tuple *tuple = NULL;
		char *sub_ctext_match = NULL;
		int should_render = 0;
		if (!(tuple = find_needle(ctext, just_match_str, 1))) {
			if ((sub_ctext_match = strchr(just_match_str, '.')) != NULL) {
				/* TODO: Check sub-context. */
				char sub_context_name[MAX_GSHKL_STR_SIZE] = {0};
				char sub_item_name[MAX_GSHKL_STR_SIZE] = {0};
				memcpy(sub_context_name, just_match_str, sub_ctext_match - just_match_str);
				memcpy(sub_item_name, sub_ctext_match + strlen("."), conditional_variable.len - strlen(sub_context_name) + strlen("."));

				if ((tuple = find_needle(ctext, sub_context_name, 1)) && tuple->type == GSHKL_SUBCTEXT) {
					const greshunkel_ctext *sub_ctext = tuple->value.sub_ctext;

					unsigned int i;
					for (i = 0; i < sub_ctext->values->count; i++) {
						const greshunkel_tuple *sub_tuple = vector_get(sub_ctext->values, i);
						const char *_name = sub_tuple->name;
						const size_t larger = strlen(_name) > strlen(sub_item_name) ?
								strlen(_name) : strlen(sub_item_name);

						if (strncmp(_name, sub_item_name, larger) == 0 &&
							_is_truthy(sub_tuple)) {
								should_render = 1;
						}
					}
				}
			} else {
				should_render = 1;
			}
		} else {
			if (_is_falsey(tuple)) {
				should_render = 1;
			} else if ((sub_ctext_match = strchr(just_match_str, '.')) != NULL) {
				/* TODO: Check sub-context. */
				char sub_context_name[MAX_GSHKL_STR_SIZE] = {0};
				char sub_item_name[MAX_GSHKL_STR_SIZE] = {0};
				memcpy(sub_context_name, just_match_str, sub_ctext_match - just_match_str);
				memcpy(sub_item_name, sub_ctext_match + strlen("."), conditional_variable.len - strlen(sub_context_name) + strlen("."));

				if ((tuple = find_needle(ctext, sub_context_name, 1)) && tuple->type == GSHKL_SUBCTEXT) {
					const greshunkel_ctext *sub_ctext = tuple->value.sub_ctext;

					unsigned int i;
					for (i = 0; i < sub_ctext->values->count; i++) {
						const greshunkel_tuple *sub_tuple = vector_get(sub_ctext->values, i);
						const char *_name = sub_tuple->name;
						const size_t larger = strlen(_name) > strlen(sub_item_name) ?
								strlen(_name) : strlen(sub_item_name);

						if (strncmp(_name, sub_item_name, larger) == 0 &&
							_is_truthy(sub_tuple)) {
								should_render = 1;
						}
					}
				}
			}
		}

		if (should_render) {
			line to_render_line;
			to_render_line.data = strndup(conditional_meat.start, conditional_meat.len);
			to_render_line.size = conditional_meat.len;

			/* TODO: This should use gshkl_render. See _interpolate_loop */
			line rendered_piece = _interpolate_line(ctext, to_render_line, all_regex);

			const size_t old_size = to_return.size;
			to_return.size += rendered_piece.size;
			if (old_size <= 0) {
				to_return.data = calloc(1, to_return.size);
			} else {
				to_return.data = realloc(to_return.data, to_return.size);
			}

			memcpy(to_return.data + old_size, rendered_piece.data, rendered_piece.size);
			if (rendered_piece.data != to_render_line.data)
				free(rendered_piece.data);
			free(to_render_line.data);
		}
	}

	return to_return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xed0, %rsp            # imm = 0xED0
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
leaq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1110
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
movl $0x60, %edx
callq 0x1110
movq -0x30(%rbp), %rdi
addq $0x1c0, %rdi            # imm = 0x1C0
movq -0x20(%rbp), %rsi
leaq -0x90(%rbp), %rcx
movl $0x3, %edx
callq 0x4610
cmpl $0x0, %eax
jne 0x3ae6
movq -0x78(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xb0(%rbp)
cmpl $-0x1, -0xa8(%rbp)
je 0x3628
cmpl $-0x1, -0xa4(%rbp)
je 0x3628
jmp 0x3647
leaq 0x51de(%rip), %rdi      # 0x880d
leaq 0x4bf7(%rip), %rsi      # 0x822d
movl $0x2f4, %edx            # imm = 0x2F4
leaq 0x5210(%rip), %rcx      # 0x8852
callq 0x1100
cmpl $-0x1, -0xc0(%rbp)
je 0x365b
cmpl $-0x1, -0xbc(%rbp)
je 0x365b
jmp 0x367a
leaq 0x5260(%rip), %rdi      # 0x88c2
leaq 0x4bc4(%rip), %rsi      # 0x822d
movl $0x2f5, %edx            # imm = 0x2F5
leaq 0x51dd(%rip), %rcx      # 0x8852
callq 0x1100
movq $0x0, -0xc8(%rbp)
movq $0x0, -0xd0(%rbp)
movq -0xb0(%rbp), %rdi
leaq 0x5261(%rip), %rsi      # 0x88ff
callq 0x11f0
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movl -0xc0(%rbp), %ecx
cmpq %rcx, %rax
je 0x36f3
movq -0xc8(%rbp), %rax
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
subl -0xc0(%rbp), %eax
cltq
movq %rax, -0xb8(%rbp)
movslq -0xbc(%rbp), %rcx
addq $0xf, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0xa0(%rbp), %rcx
movq %rcx, %rax
incq %rax
movq %rsp, %rdx
movq %rdx, -0xd8(%rbp)
addq $0x10, %rcx
andq $-0x10, %rcx
movq %rsp, %rdi
subq %rcx, %rdi
movq %rdi, -0xe48(%rbp)
movq %rdi, %rsp
movq %rax, -0xe0(%rbp)
movq -0xa0(%rbp), %rax
movb $0x0, (%rdi,%rax)
movq -0x98(%rbp), %rsi
movq -0xa0(%rbp), %rdx
callq 0x1050
movq -0xe48(%rbp), %rsi
movq $0x0, -0xe8(%rbp)
movq $0x0, -0xf0(%rbp)
movl $0x0, -0xf4(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %edx
callq 0x4740
movq %rax, -0xe8(%rbp)
cmpq $0x0, %rax
je 0x37bb
movq -0xe8(%rbp), %rdi
callq 0x48b0
cmpl $0x0, %eax
je 0x37b6
movl $0x1, -0xf4(%rbp)
jmp 0x39cc
movq -0xe48(%rbp), %rdi
movl $0x2e, %esi
callq 0x10c0
movq %rax, -0xf0(%rbp)
cmpq $0x0, %rax
je 0x39ca
leaq -0x300(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x1110
leaq -0x500(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x1110
movq -0xe48(%rbp), %rsi
leaq -0x300(%rbp), %rdi
movq -0xf0(%rbp), %rdx
subq %rsi, %rdx
callq 0x1180
leaq -0x500(%rbp), %rax
movq %rax, -0xe58(%rbp)
movq -0xf0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xe50(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0xe60(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x10b0
movq -0xe60(%rbp), %rdx
movq -0xe58(%rbp), %rdi
movq -0xe50(%rbp), %rsi
subq %rax, %rdx
addq $0x1, %rdx
callq 0x1180
movq -0x18(%rbp), %rdi
leaq -0x300(%rbp), %rsi
movl $0x1, %edx
callq 0x4740
movq %rax, -0xe8(%rbp)
cmpq $0x0, %rax
je 0x39c8
movq -0xe8(%rbp), %rax
cmpl $0x2, 0x20(%rax)
jne 0x39c8
movq -0xe8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x508(%rbp)
movl $0x0, -0x50c(%rbp)
movl -0x50c(%rbp), %eax
movq -0x508(%rbp), %rcx
movq (%rcx), %rcx
cmpq 0x10(%rcx), %rax
jae 0x39c6
movq -0x508(%rbp), %rax
movq (%rax), %rdi
movl -0x50c(%rbp), %esi
callq 0x60b0
movq %rax, -0x518(%rbp)
movq -0x518(%rbp), %rax
movq %rax, -0x520(%rbp)
movq -0x520(%rbp), %rdi
callq 0x10b0
movq %rax, -0xe68(%rbp)
leaq -0x500(%rbp), %rdi
callq 0x10b0
movq %rax, %rcx
movq -0xe68(%rbp), %rax
cmpq %rcx, %rax
jbe 0x3955
movq -0x520(%rbp), %rdi
callq 0x10b0
movq %rax, -0xe70(%rbp)
jmp 0x3968
leaq -0x500(%rbp), %rdi
callq 0x10b0
movq %rax, -0xe70(%rbp)
movq -0xe70(%rbp), %rax
movq %rax, -0x528(%rbp)
movq -0x520(%rbp), %rdi
leaq -0x500(%rbp), %rsi
movq -0x528(%rbp), %rdx
callq 0x1060
cmpl $0x0, %eax
jne 0x39b0
movq -0x518(%rbp), %rdi
callq 0x4aa0
cmpl $0x0, %eax
je 0x39b0
movl $0x1, -0xf4(%rbp)
jmp 0x39b2
movl -0x50c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50c(%rbp)
jmp 0x38ce
jmp 0x39c8
jmp 0x39ca
jmp 0x39cc
cmpl $0x0, -0xf4(%rbp)
je 0x3ad7
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
callq 0x1140
movq %rax, -0x530(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x538(%rbp)
leaq -0x548(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1110
movq -0x18(%rbp), %rdi
callq 0x4880
movq %rax, -0x550(%rbp)
movq -0x550(%rbp), %rdi
movq -0x530(%rbp), %rsi
movq -0x538(%rbp), %rdx
leaq -0x548(%rbp), %rcx
callq 0x2a60
movq %rax, -0x540(%rbp)
movq -0x550(%rbp), %rdi
callq 0x2970
movq -0x10(%rbp), %rax
movq %rax, -0x558(%rbp)
movq -0x548(%rbp), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x558(%rbp)
ja 0x3a90
movq -0x10(%rbp), %rsi
movl $0x1, %edi
callq 0x1150
movq %rax, -0x8(%rbp)
jmp 0x3aa1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x11c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq -0x558(%rbp), %rdi
movq -0x540(%rbp), %rsi
movq -0x548(%rbp), %rdx
callq 0x1180
movq -0x540(%rbp), %rdi
callq 0x1030
movq -0x530(%rbp), %rdi
callq 0x1030
movq -0xd8(%rbp), %rax
movq %rax, %rsp
jmp 0x4226
movq -0x30(%rbp), %rdi
addq $0x180, %rdi            # imm = 0x180
movq -0x20(%rbp), %rsi
leaq -0x90(%rbp), %rcx
movl $0x3, %edx
callq 0x4610
cmpl $0x0, %eax
jne 0x4224
movq -0x78(%rbp), %rax
movq %rax, -0x570(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x568(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x560(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x588(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x580(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x578(%rbp)
cmpl $-0x1, -0x570(%rbp)
je 0x3b65
cmpl $-0x1, -0x56c(%rbp)
je 0x3b65
jmp 0x3b84
leaq 0x4ca1(%rip), %rdi      # 0x880d
leaq 0x46ba(%rip), %rsi      # 0x822d
movl $0x344, %edx            # imm = 0x344
leaq 0x4cd3(%rip), %rcx      # 0x8852
callq 0x1100
cmpl $-0x1, -0x588(%rbp)
je 0x3b98
cmpl $-0x1, -0x584(%rbp)
je 0x3b98
jmp 0x3bb7
leaq 0x4d23(%rip), %rdi      # 0x88c2
leaq 0x4687(%rip), %rsi      # 0x822d
movl $0x345, %edx            # imm = 0x345
leaq 0x4ca0(%rip), %rcx      # 0x8852
callq 0x1100
movq $0x0, -0x590(%rbp)
movq $0x0, -0x598(%rbp)
movq -0x578(%rbp), %rdi
leaq 0x4d24(%rip), %rsi      # 0x88ff
callq 0x11f0
movq %rax, -0x598(%rbp)
movq -0x598(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x590(%rbp)
movq -0x590(%rbp), %rax
movl -0x588(%rbp), %ecx
cmpq %rcx, %rax
je 0x3c30
movq -0x590(%rbp), %rax
movl %eax, -0x584(%rbp)
movl -0x584(%rbp), %eax
subl -0x588(%rbp), %eax
cltq
movq %rax, -0x580(%rbp)
movslq -0x584(%rbp), %rcx
addq $0xf, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x568(%rbp), %rcx
movq %rcx, %rax
incq %rax
movq %rsp, %rdx
movq %rdx, -0x5a0(%rbp)
addq $0x10, %rcx
andq $-0x10, %rcx
movq %rsp, %rdi
subq %rcx, %rdi
movq %rdi, -0xe78(%rbp)
movq %rdi, %rsp
movq %rax, -0x5a8(%rbp)
movq -0x568(%rbp), %rax
movb $0x0, (%rdi,%rax)
movq -0x560(%rbp), %rsi
movq -0x568(%rbp), %rdx
callq 0x1050
movq -0xe78(%rbp), %rsi
movq $0x0, -0x5b0(%rbp)
movq $0x0, -0x5b8(%rbp)
movl $0x0, -0x5bc(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %edx
callq 0x4740
movq %rax, -0x5b0(%rbp)
cmpq $0x0, %rax
jne 0x3efa
movq -0xe78(%rbp), %rdi
movl $0x2e, %esi
callq 0x10c0
movq %rax, -0x5b8(%rbp)
cmpq $0x0, %rax
je 0x3eeb
leaq -0x7c0(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x1110
leaq -0x9c0(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x1110
movq -0xe78(%rbp), %rsi
leaq -0x7c0(%rbp), %rdi
movq -0x5b8(%rbp), %rdx
subq %rsi, %rdx
callq 0x1180
leaq -0x9c0(%rbp), %rax
movq %rax, -0xe88(%rbp)
movq -0x5b8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xe80(%rbp)
movq -0x568(%rbp), %rax
movq %rax, -0xe90(%rbp)
leaq -0x7c0(%rbp), %rdi
callq 0x10b0
movq -0xe90(%rbp), %rdx
movq -0xe88(%rbp), %rdi
movq -0xe80(%rbp), %rsi
subq %rax, %rdx
addq $0x1, %rdx
callq 0x1180
movq -0x18(%rbp), %rdi
leaq -0x7c0(%rbp), %rsi
movl $0x1, %edx
callq 0x4740
movq %rax, -0x5b0(%rbp)
cmpq $0x0, %rax
je 0x3ee9
movq -0x5b0(%rbp), %rax
cmpl $0x2, 0x20(%rax)
jne 0x3ee9
movq -0x5b0(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x9c8(%rbp)
movl $0x0, -0x9cc(%rbp)
movl -0x9cc(%rbp), %eax
movq -0x9c8(%rbp), %rcx
movq (%rcx), %rcx
cmpq 0x10(%rcx), %rax
jae 0x3ee7
movq -0x9c8(%rbp), %rax
movq (%rax), %rdi
movl -0x9cc(%rbp), %esi
callq 0x60b0
movq %rax, -0x9d8(%rbp)
movq -0x9d8(%rbp), %rax
movq %rax, -0x9e0(%rbp)
movq -0x9e0(%rbp), %rdi
callq 0x10b0
movq %rax, -0xe98(%rbp)
leaq -0x9c0(%rbp), %rdi
callq 0x10b0
movq %rax, %rcx
movq -0xe98(%rbp), %rax
cmpq %rcx, %rax
jbe 0x3e76
movq -0x9e0(%rbp), %rdi
callq 0x10b0
movq %rax, -0xea0(%rbp)
jmp 0x3e89
leaq -0x9c0(%rbp), %rdi
callq 0x10b0
movq %rax, -0xea0(%rbp)
movq -0xea0(%rbp), %rax
movq %rax, -0x9e8(%rbp)
movq -0x9e0(%rbp), %rdi
leaq -0x9c0(%rbp), %rsi
movq -0x9e8(%rbp), %rdx
callq 0x1060
cmpl $0x0, %eax
jne 0x3ed1
movq -0x9d8(%rbp), %rdi
callq 0x48b0
cmpl $0x0, %eax
je 0x3ed1
movl $0x1, -0x5bc(%rbp)
jmp 0x3ed3
movl -0x9cc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9cc(%rbp)
jmp 0x3def
jmp 0x3ee9
jmp 0x3ef5
movl $0x1, -0x5bc(%rbp)
jmp 0x412d
movq -0x5b0(%rbp), %rdi
callq 0x4aa0
cmpl $0x0, %eax
je 0x3f1a
movl $0x1, -0x5bc(%rbp)
jmp 0x412b
movq -0xe78(%rbp), %rdi
movl $0x2e, %esi
callq 0x10c0
movq %rax, -0x5b8(%rbp)
cmpq $0x0, %rax
je 0x4129
leaq -0xbf0(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x1110
leaq -0xdf0(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x1110
movq -0xe78(%rbp), %rsi
leaq -0xbf0(%rbp), %rdi
movq -0x5b8(%rbp), %rdx
subq %rsi, %rdx
callq 0x1180
leaq -0xdf0(%rbp), %rax
movq %rax, -0xeb0(%rbp)
movq -0x5b8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xea8(%rbp)
movq -0x568(%rbp), %rax
movq %rax, -0xeb8(%rbp)
leaq -0xbf0(%rbp), %rdi
callq 0x10b0
movq -0xeb8(%rbp), %rdx
movq -0xeb0(%rbp), %rdi
movq -0xea8(%rbp), %rsi
subq %rax, %rdx
addq $0x1, %rdx
callq 0x1180
movq -0x18(%rbp), %rdi
leaq -0xbf0(%rbp), %rsi
movl $0x1, %edx
callq 0x4740
movq %rax, -0x5b0(%rbp)
cmpq $0x0, %rax
je 0x4127
movq -0x5b0(%rbp), %rax
cmpl $0x2, 0x20(%rax)
jne 0x4127
movq -0x5b0(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0xdf8(%rbp)
movl $0x0, -0xdfc(%rbp)
movl -0xdfc(%rbp), %eax
movq -0xdf8(%rbp), %rcx
movq (%rcx), %rcx
cmpq 0x10(%rcx), %rax
jae 0x4125
movq -0xdf8(%rbp), %rax
movq (%rax), %rdi
movl -0xdfc(%rbp), %esi
callq 0x60b0
movq %rax, -0xe08(%rbp)
movq -0xe08(%rbp), %rax
movq %rax, -0xe10(%rbp)
movq -0xe10(%rbp), %rdi
callq 0x10b0
movq %rax, -0xec0(%rbp)
leaq -0xdf0(%rbp), %rdi
callq 0x10b0
movq %rax, %rcx
movq -0xec0(%rbp), %rax
cmpq %rcx, %rax
jbe 0x40b4
movq -0xe10(%rbp), %rdi
callq 0x10b0
movq %rax, -0xec8(%rbp)
jmp 0x40c7
leaq -0xdf0(%rbp), %rdi
callq 0x10b0
movq %rax, -0xec8(%rbp)
movq -0xec8(%rbp), %rax
movq %rax, -0xe18(%rbp)
movq -0xe10(%rbp), %rdi
leaq -0xdf0(%rbp), %rsi
movq -0xe18(%rbp), %rdx
callq 0x1060
cmpl $0x0, %eax
jne 0x410f
movq -0xe08(%rbp), %rdi
callq 0x48b0
cmpl $0x0, %eax
je 0x410f
movl $0x1, -0x5bc(%rbp)
jmp 0x4111
movl -0xdfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdfc(%rbp)
jmp 0x402d
jmp 0x4127
jmp 0x4129
jmp 0x412b
jmp 0x412d
cmpl $0x0, -0x5bc(%rbp)
je 0x421a
movq -0x578(%rbp), %rdi
movq -0x580(%rbp), %rsi
callq 0x1140
movq %rax, -0xe20(%rbp)
movq -0x580(%rbp), %rax
movq %rax, -0xe28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rcx
movq -0xe28(%rbp), %rsi
movq -0xe20(%rbp), %rdx
callq 0x4240
movq %rax, -0xe38(%rbp)
movq %rdx, -0xe30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xe40(%rbp)
movq -0xe38(%rbp), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0xe40(%rbp)
ja 0x41c3
movq -0x10(%rbp), %rsi
movl $0x1, %edi
callq 0x1150
movq %rax, -0x8(%rbp)
jmp 0x41d4
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x11c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq -0xe40(%rbp), %rdi
movq -0xe30(%rbp), %rsi
movq -0xe38(%rbp), %rdx
callq 0x1180
movq -0xe30(%rbp), %rax
cmpq -0xe20(%rbp), %rax
je 0x420e
movq -0xe30(%rbp), %rdi
callq 0x1030
movq -0xe20(%rbp), %rdi
callq 0x1030
movq -0x5a0(%rbp), %rax
movq %rax, %rsp
jmp 0x4226
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)