// File: /workspace/github_c_makefile_star2_O3/tditlu[P]shadetabler/src/shadetabler.c
// Function: main
int main(int argc, char *argv[]) {
	const struct option longopts[] = {
		{"output", required_argument, 0, 'o' },
		{"verbose", no_argument, 0, 'v' },
		{"force", no_argument, 0, 'f' },
		{"colors", optional_argument, 0, 'c' },
		{"shades", optional_argument, 0, 's' },
 		{"type", optional_argument, 0, 't' },
		{"hq", no_argument, 0, 'h' },
		{"reserve", no_argument, 0, 'r' },
		{"priority", optional_argument, 0, 'p' },
		{"light", optional_argument, 0, 'l' },
		{"dark", optional_argument, 0, 'd' },
		{0, 0, 0, 0}
	};

	const char *optstring = "o:vfc:s:t:hrp:l:d:";

	if (argc <= 1) {
		usage();
		exit(EXIT_FAILURE);
	}

	char *output = NULL;
	unsigned int verbose = 0;
	unsigned int force = 0;
	unsigned int colors = 256;
	unsigned int shades = 64;
	unsigned int type = TYPE_LIGHT;
	unsigned int hq = 0;
	unsigned int reserve = 0;
	unsigned int priority = 0;
	char *light_output = "shadetable_light.png";
	char *dark_output = "shadetable_dark.png";

	int opt = 0;
	while ((opt = getopt_long(argc, argv, optstring, longopts, 0)) != EOF) {
		switch (opt) {
			case 'o':
				output = optarg;
				break;
			case 'v':
				verbose = 1;
				break;
			case 'f':
				force = 1;
				break;
			case 'c':
				colors = atoi(optarg);
				break;
			case 's':
				shades = atoi(optarg);
				break;
			case 't':
				if (optarg[0] == 'd' || optarg[0] == 'D') {
					type = TYPE_DARK;
				} else if (optarg[0] == 'b' || optarg[0] == 'B') {
					type = TYPE_BOTH;
				}
				break;
			case 'h':
				hq = 1;
				break;
			case 'r':
				reserve = 1;
				break;
			case 'p':
				priority = atoi(optarg);
				break;
			case 'l':
				light_output = optarg;
				break;
			case 'd':
				dark_output = optarg;
				break;
			default:
				usage();
				exit(EXIT_FAILURE);
		}
	}

	if (output == NULL) {
		usage();
		fprintf(stderr, "No output directory specified.\n\n");
		exit(EXIT_FAILURE);
	}

	if ((argc - optind) == 0) {
		usage();
		fprintf(stderr, "No input file specified.\n\n");
		exit(EXIT_FAILURE);
	}

	if ((colors < 4 && reserve) || colors < 2 || colors > 256) {
		usage();
		fprintf(stderr, "Invalid number of colors%s.\n\n", reserve ? " (2 colors are reserved for black & white)." : "");
		exit(EXIT_FAILURE);
	}

	if (shades < 2 || shades > 256) {
		usage();
		fprintf(stderr, "Invalid number of shades.\n\n");
		exit(EXIT_FAILURE);
	}

	if (verbose) {
		printf(SHADETABLER_HEADER "\n");
	}

	exq_data *exq = exq_init();
	exq_no_transparency(exq);

	image_t *images = NULL;
	unsigned char *palette = NULL;
	char path[FILENAME_MAX];

	unsigned int number_of_images = (argc - optind);
	images = calloc(number_of_images, sizeof(image_t));
	if (images == NULL) {
		fprintf(stderr, "Unable to allocate memory for images.\n");
		goto error;
	}

	for (unsigned int i = 0; i < number_of_images; i++) {
		const char *infile = argv[optind + i];
		if (cwk_path_normalize(infile, path, sizeof(path)) == 0)  {
			fprintf(stderr, "Invalid input file path \"%s\".", infile);
			goto error;
		}

		const image_error_t image_error = image_load_rgba(&images[i], path);
		if (image_error) {
			fprintf(stderr, "Could not load input file \"%s\". %s.\n", path, image_error_text(image_error));
			goto error;
		}

		unsigned char *buffer = images[i].buffer;
		unsigned int width = images[i].width;
		unsigned int height = images[i].height;

		if (verbose) {
			printf("Generating priority colors for input file \"%s\".\n", path);
		}

		for (int j = 0; j < priority; j++) {
			exq_feed_extened(exq, buffer, width * height, 0, reserve);
		}

		if (type == TYPE_LIGHT || type == TYPE_BOTH) {
			if (verbose) {
				printf("Generating light shades for input file \"%s\".\n", path);
			}
			for (int j = 1; j < shades; j++) {
				int shade = (int)floor((((float)j) / ((float)(shades - 1)) * 255.0f) + 0.5);
				exq_feed_extened(exq, buffer, width * height, shade, reserve);
			}
		}

		if (type == TYPE_DARK || type == TYPE_BOTH) {
			if (verbose) {
				printf("Generating dark shades for input file \"%s\".\n", path);
			}
			for (int j = 0; j < (shades - 1); j++) {
				int shade = ((int)floor((((float)j) / ((float)(shades - 1)) * 255.0f) - 0.5)) - 255;
				exq_feed_extened(exq, buffer, width * height, shade, reserve);
			}
		}
	}

	if (verbose) {
		printf("Quantizing images%s.\n", hq ? ", high quality" : "");
	}

	exq_quantize_ex(exq, reserve ? colors - 2 : colors, hq);

	palette = malloc(colors * 4 * sizeof(unsigned char));
	if (palette == NULL) {
		fprintf(stderr, "Unable to allocate memory for palette.\n");
		goto error;
	}

	if (verbose) {
		printf("Generating & sorting palette.\n");
	}

	exq_get_palette(exq, palette, reserve ? colors - 2 : colors);

	if (reserve) {
		palette[((colors - 2) * 4) + 0] = 0; // Force black
		palette[((colors - 2) * 4) + 1] = 0;
		palette[((colors - 2) * 4) + 2] = 0;
		palette[((colors - 2) * 4) + 3] = 255;

		palette[((colors - 1) * 4) + 0] = 255; // Force white
		palette[((colors - 1) * 4) + 1] = 255;
		palette[((colors - 1) * 4) + 2] = 255;
		palette[((colors - 1) * 4) + 3] = 255;
	}

	qsort(palette, colors, sizeof(unsigned char) * 4, palette_qsort_compare); // Sort palette

	exq_set_palette(exq, palette, colors);

	for (unsigned int i = 0; i < number_of_images; i++) {
		const char *infile = argv[optind + i];
		path_get_output_filename(path, sizeof(path), output, infile);

		int write_image = 1;
		if (!force && path_file_exists(path)) {
			fprintf(stderr,"File '%s' already exists. Overwrite? [y/N] ", path);
			fflush(stderr);
			int c = getchar();
			write_image = (c == 'y' || c == 'Y') ? 1 : 0;
			while (c != '\n' && c != EOF) { c = getchar(); }
		}

		if (write_image) {
			unsigned int width = images[i].width;
			unsigned int height = images[i].height;
			unsigned char *buffer = malloc(width * height * sizeof(unsigned char));
			if (buffer == NULL) {
				fprintf(stderr, "Unable to allocate memory for image \"%s\".\n", path);
				goto error;
			}

			if (verbose) {
				printf("Saving image \"%s\"\n", path);
			}

			exq_map_image(exq, width * height, images[i].buffer, buffer);
			save_image(path, buffer, width, height, palette, colors);
			free(buffer);
		} else {
			if (verbose) {
				printf("Skipping image \"%s\"\n", path);
			}
		}
	}

	if (type == TYPE_LIGHT || type == TYPE_BOTH) {
		path_get_output_filename(path, sizeof(path), output, light_output);
		if (!allocate_generate_and_save_shadetable(exq, path, palette, colors, shades, 1, verbose, force)) {
			goto error;
		}
	}

	if (type == TYPE_DARK || type == TYPE_BOTH) {
		path_get_output_filename(path, sizeof(path), output, dark_output);
		if (!allocate_generate_and_save_shadetable(exq, path, palette, colors, shades, 0, verbose, force)) {
			goto error;
		}
	}

error:
	if (palette != NULL) {
		free(palette);
	}

	if (images != NULL) {
		for (unsigned int i = 0; i < number_of_images; i++) {
			image_free_rgba(&images[i]);
		}
		free(images);
	}

	exq_free(exq);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1228, %rsp           # imm = 0x1228
movq %rsi, 0x70(%rsp)
movl %edi, %ebx
leaq 0x8ac9(%rip), %rsi      # 0x18c50
leaq 0xa0(%rsp), %rdi
movl $0x180, %edx            # imm = 0x180
callq 0x1130
movl %ebx, 0x4(%rsp)
cmpl $0x2, %ebx
jl 0x10a31
movl $0x100, %eax            # imm = 0x100
movq %rax, 0x40(%rsp)
movl $0x40, %eax
movq %rax, 0x38(%rsp)
movq $0x0, 0x18(%rsp)
leaq 0x3f44(%rip), %rax      # 0x1410e
movq %rax, 0x88(%rsp)
leaq 0x3f4a(%rip), %rax      # 0x14123
movq %rax, 0x90(%rsp)
leaq 0x3f13(%rip), %r14      # 0x140fb
leaq 0xa0(%rsp), %r13
leaq 0x3e41(%rip), %rbx      # 0x14038
movq 0x8dda(%rip), %r15      # 0x18fd8
movl $0x0, (%rsp)
movl $0x0, 0x34(%rsp)
xorl %eax, %eax
movq $0x0, 0x58(%rsp)
xorl %ecx, %ecx
movq $0x0, 0x48(%rsp)
movl %ecx, %ebp
movl %eax, %r12d
movl 0x4(%rsp), %edi
movq 0x70(%rsp), %rsi
movq %r14, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0x10b0
leal -0x63(%rax), %edx
cmpl $0x13, %edx
ja 0x1031e
movl $0x1, %ecx
movslq (%rbx,%rdx,4), %rdx
addq %rbx, %rdx
movl %r12d, %eax
jmpq *%rdx
movq (%r15), %rdi
callq 0x11b0
movq %rax, 0x40(%rsp)
jmp 0x102ef
movq (%r15), %rax
movzbl (%rax), %edx
movl $0x1, %eax
cmpl $0x61, %edx
jg 0x102f9
cmpl $0x42, %edx
je 0x10312
movl %ebp, %ecx
cmpl $0x44, %edx
je 0x10223
jmp 0x102ef
movq (%r15), %rdi
callq 0x11b0
movq %rax, 0x38(%rsp)
jmp 0x102ef
movq (%r15), %rax
movq %rax, 0x88(%rsp)
jmp 0x102ef
movq (%r15), %rax
movq %rax, 0x48(%rsp)
jmp 0x102ef
movl $0x1, %eax
movq %rax, 0x58(%rsp)
jmp 0x102ef
movl $0x1, (%rsp)
jmp 0x102ef
movl $0x1, 0x34(%rsp)
jmp 0x102ef
movq (%r15), %rax
movq %rax, 0x90(%rsp)
jmp 0x102ef
movq (%r15), %rdi
callq 0x11b0
movq %rax, 0x18(%rsp)
movl %r12d, %eax
movl %ebp, %ecx
jmp 0x10223
movl %ebp, %ecx
cmpl $0x64, %edx
je 0x10223
movl %r12d, %eax
movl %ebp, %ecx
cmpl $0x62, %edx
jne 0x10223
movl $0x2, %eax
movl %ebp, %ecx
jmp 0x10223
cmpl $-0x1, %eax
jne 0x10a31
cmpq $0x0, 0x48(%rsp)
je 0x10a40
movq 0x8c96(%rip), %rcx      # 0x18fd0
movl 0x4(%rsp), %eax
cmpl %eax, (%rcx)
movq 0x40(%rsp), %rsi
movl (%rsp), %edx
movl 0x34(%rsp), %r14d
je 0x10a45
cmpl $0x4, %esi
setb %al
testl %edx, %edx
setne %cl
testb %cl, %al
movq 0x38(%rsp), %rcx
jne 0x10a4a
leal -0x101(%rsi), %eax
cmpl $0xffffff00, %eax       # imm = 0xFFFFFF00
jbe 0x10a4a
leal -0x101(%rcx), %eax
cmpl $0xffffff00, %eax       # imm = 0xFFFFFF00
jbe 0x10a57
movq %rsi, 0x40(%rsp)
testl %ebp, %ebp
je 0x103a2
leaq 0x4076(%rip), %rdi      # 0x14413
callq 0x1060
xorl %eax, %eax
callq 0x156c
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0x159c
movq 0x8c13(%rip), %rax      # 0x18fd0
movl (%rax), %r15d
movl 0x4(%rsp), %ebx
movl %ebx, %r13d
subl %r15d, %r13d
movl $0x10, %esi
movq %r13, %rdi
callq 0x10f0
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x109a0
movl %r15d, 0x14(%rsp)
cmpl %r15d, %ebx
movq %r13, 0x60(%rsp)
je 0x10679
movq 0x38(%rsp), %rax
decl %eax
movl %eax, 0x7c(%rsp)
cvtsi2ss %eax, %xmm1
leal -0x1(%r12), %eax
movl %eax, 0x78(%rsp)
leaq 0x220(%rsp), %r15
xorl %edx, %edx
movq %rbp, 0x68(%rsp)
movq %r12, 0x80(%rsp)
movss %xmm1, 0x20(%rsp)
movq 0x8b9c(%rip), %rax      # 0x18fd0
movl (%rax), %eax
addl %edx, %eax
movq 0x70(%rsp), %rcx
movq %rdx, %r14
movq (%rcx,%rax,8), %rbx
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf911
testq %rax, %rax
je 0x109b3
movq %r14, 0x98(%rsp)
movq %r14, %rbx
shlq $0x4, %rbx
addq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xff42
testl %eax, %eax
jne 0x109d0
movq (%rbx), %r14
movl 0x8(%rbx), %eax
movl %eax, 0x2c(%rsp)
movl 0xc(%rbx), %eax
movl %eax, 0x30(%rsp)
testl %ebp, %ebp
je 0x104aa
leaq 0x3da3(%rip), %rdi      # 0x14243
movq %r15, %rsi
xorl %eax, %eax
callq 0x10c0
cmpl $0x0, 0x18(%rsp)
movl (%rsp), %ebx
movq 0x8(%rsp), %r12
je 0x104e4
movl 0x30(%rsp), %r15d
imull 0x2c(%rsp), %r15d
movq 0x18(%rsp), %rax
movl %eax, %r13d
movq %r12, %rdi
movq %r14, %rsi
movl %r15d, %edx
xorl %ecx, %ecx
movl %ebx, %r8d
callq 0x10a5c
decl %r13d
jne 0x104cc
testb $0x1, 0x80(%rsp)
movss 0x20(%rsp), %xmm1
movss 0x1ba6(%rip), %xmm2     # 0x120a0
jne 0x10595
cmpl $0x0, 0x68(%rsp)
je 0x1052b
leaq 0x3d66(%rip), %rdi      # 0x14274
leaq 0x220(%rsp), %rsi
xorl %eax, %eax
callq 0x10c0
movss 0x1b7b(%rip), %xmm2     # 0x120a0
movss 0x20(%rsp), %xmm1
movl 0x30(%rsp), %r15d
imull 0x2c(%rsp), %r15d
movl $0x1, %r13d
movq 0x38(%rsp), %rbp
movl (%rsp), %ebx
movq 0x8(%rsp), %r12
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
divss %xmm1, %xmm0
mulss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0x3ac3(%rip), %xmm0     # 0x14028
callq 0x11a0
cvttsd2si %xmm0, %ecx
movq %r12, %rdi
movq %r14, %rsi
movl %r15d, %edx
movl %ebx, %r8d
callq 0x10a5c
movss 0x1b19(%rip), %xmm2     # 0x120a0
movss 0x20(%rsp), %xmm1
incl %r13d
cmpl %r13d, %ebp
jne 0x10549
cmpl $0x1, 0x78(%rsp)
movl 0x7c(%rsp), %r12d
movsd 0x3a89(%rip), %xmm3     # 0x14030
ja 0x10646
cmpl $0x0, 0x68(%rsp)
je 0x105e0
leaq 0x3ce7(%rip), %rdi      # 0x142a2
leaq 0x220(%rsp), %rsi
xorl %eax, %eax
callq 0x10c0
movsd 0x3a5e(%rip), %xmm3     # 0x14030
movss 0x1ac6(%rip), %xmm2     # 0x120a0
movss 0x20(%rsp), %xmm1
movl 0x30(%rsp), %ebp
imull 0x2c(%rsp), %ebp
xorl %r15d, %r15d
movq 0x8(%rsp), %r13
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
divss %xmm1, %xmm0
mulss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
addsd %xmm3, %xmm0
callq 0x11a0
cvttsd2si %xmm0, %ecx
addl $0xffffff01, %ecx       # imm = 0xFFFFFF01
movq %r13, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %r8d
callq 0x10a5c
movsd 0x3a00(%rip), %xmm3     # 0x14030
movss 0x1a68(%rip), %xmm2     # 0x120a0
movss 0x20(%rsp), %xmm1
incl %r15d
cmpl %r15d, %r12d
jne 0x105f1
movq 0x98(%rsp), %rdx
incq %rdx
movq 0x60(%rsp), %r13
cmpq %r13, %rdx
movq 0x80(%rsp), %r12
movl 0x34(%rsp), %r14d
leaq 0x220(%rsp), %r15
movq 0x68(%rsp), %rbp
jne 0x1042d
testl %ebp, %ebp
je 0x106a0
testl %r14d, %r14d
leaq 0x3aeb(%rip), %rax      # 0x14172
leaq 0x3c57(%rip), %rsi      # 0x142e5
cmoveq %rax, %rsi
leaq 0x3c36(%rip), %rdi      # 0x142cf
xorl %eax, %eax
callq 0x10c0
movq 0x40(%rsp), %rbx
leal -0x2(%rbx), %eax
cmpl $0x0, (%rsp)
movl %ebx, %r15d
movl %eax, 0x18(%rsp)
cmovnel %eax, %r15d
movq 0x8(%rsp), %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x17c0
movl %ebx, %eax
movq %rax, 0x20(%rsp)
leaq (,%rax,4), %r14
movq %r14, %rdi
callq 0x1140
testq %rax, %rax
je 0x109ac
movq %rax, %rbx
testl %ebp, %ebp
je 0x106fa
leaq 0x3d00(%rip), %rdi      # 0x143f5
callq 0x1060
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x1e46
cmpl $0x0, (%rsp)
je 0x10724
movl 0x18(%rsp), %eax
movl $0xff000000, (%rbx,%rax,4) # imm = 0xFF000000
movl $0xffffffff, -0x4(%rbx,%r14) # imm = 0xFFFFFFFF
leaq 0x5b7(%rip), %rcx       # 0x10ce2
movl $0x4, %edx
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0x1070
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq 0x40(%rsp), %r15
movl %r15d, %edx
callq 0x1f66
movl 0x14(%rsp), %eax
cmpl %eax, 0x4(%rsp)
movq %rbx, 0x18(%rsp)
jne 0x107d5
testb $0x1, %r12b
jne 0x108f7
leaq 0x220(%rsp), %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movq 0x48(%rsp), %rdx
movq 0x88(%rsp), %rcx
callq 0x100e1
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq 0x18(%rsp), %rbx
movq %rbx, %rdx
movl %r15d, %ecx
movq 0x38(%rsp), %r8
movl $0x1, %r9d
pushq 0x58(%rsp)
pushq %rbp
callq 0x10ede
addq $0x10, %rsp
testl %eax, %eax
setne %al
decl %r12d
cmpl $0x2, %r12d
setb %cl
testb %cl, %al
jne 0x10900
jmp 0x1094b
movq 0x50(%rsp), %rax
leaq 0xc(%rax), %r14
leaq 0x220(%rsp), %rdi
xorl %ecx, %ecx
movq 0x87e1(%rip), %rax      # 0x18fd0
movl (%rax), %eax
movq %rcx, 0x20(%rsp)
addl %ecx, %eax
movq 0x70(%rsp), %rcx
movq (%rcx,%rax,8), %rcx
movl $0x1000, %esi           # imm = 0x1000
movq 0x48(%rsp), %rdx
callq 0x100e1
cmpl $0x0, 0x58(%rsp)
jne 0x1082c
leaq 0x220(%rsp), %rdi
callq 0x100bc
testl %eax, %eax
jne 0x108d8
movl -0x4(%r14), %eax
movq %r14, %r13
movl (%r14), %r15d
movl %r15d, %ebx
movl %eax, (%rsp)
imull %eax, %ebx
movq %rbx, %rdi
callq 0x1140
testq %rax, %rax
je 0x10a02
movq %rax, %r14
testl %ebp, %ebp
je 0x1086d
leaq 0x3b15(%rip), %rdi      # 0x14373
leaq 0x220(%rsp), %rsi
xorl %eax, %eax
callq 0x10c0
movq -0xc(%r13), %rdx
movq 0x8(%rsp), %rdi
movl %ebx, %esi
movq %r14, %rcx
callq 0x217d
leaq 0x220(%rsp), %rdi
movq %r14, %rsi
movl (%rsp), %edx
movl %r15d, %ecx
movq 0x18(%rsp), %rbx
movq %rbx, %r8
movq 0x40(%rsp), %r15
movl %r15d, %r9d
callq 0x10d7b
movq %r14, %rdi
movq %r13, %r14
callq 0x1030
movq 0x60(%rsp), %r13
movq 0x20(%rsp), %rcx
incq %rcx
addq $0x10, %r14
cmpq %rcx, %r13
leaq 0x220(%rsp), %rdi
jne 0x107e8
jmp 0x10761
xorl %esi, %esi
testl %ebp, %ebp
sete %sil
leaq 0x220(%rsp), %rdi
callq 0x1220
testb $0x1, %al
jne 0x1082c
jmp 0x108b6
decl %r12d
cmpl $0x1, %r12d
ja 0x1094b
leaq 0x220(%rsp), %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movq 0x48(%rsp), %rdx
movq 0x90(%rsp), %rcx
callq 0x100e1
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq 0x18(%rsp), %rbx
movq %rbx, %rdx
movl %r15d, %ecx
movq 0x38(%rsp), %r8
xorl %r9d, %r9d
pushq 0x58(%rsp)
pushq %rbp
callq 0x10ede
addq $0x10, %rsp
movq %rbx, %rdi
callq 0x1030
movl 0x4(%rsp), %eax
movl 0x14(%rsp), %ecx
cmpl %ecx, %eax
movq 0x8(%rsp), %r14
je 0x1097a
movq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0xff28
addq $0x10, %rbx
decq %r13
jne 0x10969
movq 0x50(%rsp), %rdi
callq 0x1030
movq %r14, %rdi
callq 0x15a7
xorl %eax, %eax
addq $0x1228, %rsp           # imm = 0x1228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x12b3
movq 0x8(%rsp), %r14
jmp 0x10984
callq 0x1291
jmp 0x10953
movq 0x863e(%rip), %rax      # 0x18ff8
movq (%rax), %rdi
leaq 0x383c(%rip), %rsi      # 0x14200
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1110
jmp 0x10953
movq 0x8621(%rip), %rcx      # 0x18ff8
movq (%rcx), %rbx
movl %eax, %edi
callq 0x10097
leaq 0x3836(%rip), %rsi      # 0x1421e
leaq 0x220(%rsp), %rdx
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x1110
jmp 0x10953
movq 0x85ef(%rip), %rax      # 0x18ff8
movq (%rax), %rdi
leaq 0x3935(%rip), %rsi      # 0x14348
leaq 0x220(%rsp), %rdx
xorl %eax, %eax
callq 0x1110
movq 0x18(%rsp), %rbx
movq 0x60(%rsp), %r13
jmp 0x1094b
callq 0x11113
movl $0x1, %edi
callq 0x11c0
callq 0x1366
callq 0x133c
xorl %edi, %edi
testl %edx, %edx
setne %dil
callq 0x12ff
callq 0x12d5