// File: rpavlik[P]edid-decode/edid-decode.cpp
// Function: main
int main(int argc, char **argv)
{
	char short_options[26 * 2 * 2 + 1];
	enum output_format out_fmt = OUT_FMT_DEFAULT;
	gtf_parsed_data gtf_data;
	int ret;

	while (1) {
		int option_index = 0;
		unsigned idx = 0;
		unsigned i, val;
		const timings *t;
		char buf[16];

		for (i = 0; long_options[i].name; i++) {
			if (!isalpha(long_options[i].val))
				continue;
			short_options[idx++] = long_options[i].val;
			if (long_options[i].has_arg == required_argument)
				short_options[idx++] = ':';
		}
		short_options[idx] = 0;
		int ch = getopt_long(argc, argv, short_options,
				     long_options, &option_index);
		if (ch == -1)
			break;

		options[ch] = 1;
		switch (ch) {
		case OptHelp:
			usage();
			return -1;
		case OptOutputFormat:
			if (!strcmp(optarg, "hex")) {
				out_fmt = OUT_FMT_HEX;
			} else if (!strcmp(optarg, "raw")) {
				out_fmt = OUT_FMT_RAW;
			} else if (!strcmp(optarg, "carray")) {
				out_fmt = OUT_FMT_CARRAY;
			} else if (!strcmp(optarg, "xml")) {
				out_fmt = OUT_FMT_XML;
			} else {
				usage();
				exit(1);
			}
			break;
		case OptSTD: {
			unsigned char byte1, byte2 = 0;
			char *endptr;

			byte1 = strtoul(optarg, &endptr, 0);
			if (*endptr == ',')
				byte2 = strtoul(endptr + 1, NULL, 0);
			state.print_standard_timing("", byte1, byte2, false, true);
			break;
		}
		case OptDMT:
			val = strtoul(optarg, NULL, 0);
			t = find_dmt_id(val);
			if (t) {
				sprintf(buf, "DMT 0x%02x", val);
				state.print_timings("", t, buf, "", true, false);
			} else {
				fprintf(stderr, "Unknown DMT code 0x%02x.\n", val);
			}
			break;
		case OptVIC:
			val = strtoul(optarg, NULL, 0);
			t = find_vic_id(val);
			if (t) {
				sprintf(buf, "VIC %3u", val);
				state.print_timings("", t, buf, "", true, false);
			} else {
				fprintf(stderr, "Unknown VIC code %u.\n", val);
			}
			break;
		case OptHDMIVIC:
			val = strtoul(optarg, NULL, 0);
			t = find_hdmi_vic_id(val);
			if (t) {
				sprintf(buf, "HDMI VIC %u", val);
				state.print_timings("", t, buf, "", true, false);
			} else {
				fprintf(stderr, "Unknown HDMI VIC code %u.\n", val);
			}
			break;
		case OptCVT:
			parse_cvt(optarg);
			break;
		case OptGTF:
			parse_gtf(optarg, gtf_data);
			break;
		case ':':
			fprintf(stderr, "Option '%s' requires a value.\n",
				argv[optind]);
			usage();
			return -1;
		case '?':
			fprintf(stderr, "Unknown argument '%s'.\n",
				argv[optind]);
			usage();
			return -1;
		}
	}
	if (optind == argc && options[OptVersion]) {
		if (strlen(STRING(SHA)))
			printf("edid-decode SHA: %s %s\n", STRING(SHA), STRING(DATE));
		else
			printf("edid-decode SHA: not available\n");
		return 0;
	}

	if (options[OptListEstTimings])
		state.list_established_timings();
	if (options[OptListDMTs])
		state.list_dmts();
	if (options[OptListVICs])
		state.cta_list_vics();
	if (options[OptListHDMIVICs])
		state.cta_list_hdmi_vics();

	if (options[OptListEstTimings] || options[OptListDMTs] ||
	    options[OptListVICs] || options[OptListHDMIVICs])
		return 0;

	if (options[OptCVT] || options[OptDMT] || options[OptVIC] ||
	    options[OptHDMIVIC] || options[OptSTD])
		return 0;

	if (options[OptGTF] && (!gtf_data.params_from_edid || optind == argc)) {
		show_gtf(gtf_data);
		return 0;
	}

	if (optind == argc)
		ret = edid_from_file("-", stdout);
	else
		ret = edid_from_file(argv[optind], argv[optind + 1] ? stderr : stdout);

	if (ret && options[OptPhysicalAddress]) {
		printf("f.f.f.f\n");
		return 0;
	}
	if (optind < argc - 1)
		return ret ? ret : edid_to_file(argv[optind + 1], out_fmt);

	if (options[OptGTF]) {
		timings t;

		// Find the Secondary Curve
		state.preparse_detailed_block(edid + 0x36);
		state.preparse_detailed_block(edid + 0x48);
		state.preparse_detailed_block(edid + 0x5a);
		state.preparse_detailed_block(edid + 0x6c);

		t = state.calc_gtf_mode(gtf_data.w, gtf_data.h, gtf_data.freq,
					gtf_data.interlaced, gtf_data.ip_parm,
					gtf_data.overscan);
		unsigned hbl = t.hfp + t.hsync + t.hbp;
		unsigned htotal = t.hact + hbl;
		double hor_freq_khz = htotal ? (double)t.pixclk_khz / htotal : 0;

		if (state.base.supports_sec_gtf &&
		    hor_freq_khz >= state.base.sec_gtf_start_freq) {
			t = state.calc_gtf_mode(gtf_data.w, gtf_data.h, gtf_data.freq,
						gtf_data.interlaced, gtf_data.ip_parm,
						gtf_data.overscan, true,
						state.base.C, state.base.M,
						state.base.K, state.base.J);
		}
		calc_ratio(&t);
		if (t.hfp <= 0)
			state.print_timings("", &t, "GTF", "INVALID: Hfront <= 0", true, false);
		else
			state.print_timings("", &t, "GTF", "", true, false);
		return 0;
	}

	return ret ? ret : state.parse_edid();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x84(%rbp)
movl $0x0, -0xc8(%rbp)
movl $0x0, -0xcc(%rbp)
movl $0x0, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
movl %eax, %ecx
leaq 0x42720(%rip), %rax     # 0x4b300
shlq $0x5, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x8c92
movl -0xd0(%rbp), %eax
movl %eax, %ecx
leaq 0x42700(%rip), %rax     # 0x4b300
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x18(%rax), %edi
callq 0x44c0
cmpl $0x0, %eax
jne 0x8c16
jmp 0x8c7e
movl -0xd0(%rbp), %eax
movl %eax, %ecx
leaq 0x426db(%rip), %rax     # 0x4b300
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movb %al, %cl
movl -0xcc(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0xcc(%rbp)
movl %eax, %eax
movb %cl, -0x80(%rbp,%rax)
movl -0xd0(%rbp), %eax
movl %eax, %ecx
leaq 0x426a9(%rip), %rax     # 0x4b300
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x1, 0x8(%rax)
jne 0x8c7c
movl -0xcc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xcc(%rbp)
movl %eax, %eax
movb $0x3a, -0x80(%rbp,%rax)
jmp 0x8c7e
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x8bd1
movl -0xcc(%rbp), %eax
movb $0x0, -0x80(%rbp,%rax)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq -0x80(%rbp), %rdx
leaq 0x42651(%rip), %rcx     # 0x4b300
leaq -0xc8(%rbp), %r8
callq 0x4500
movl %eax, -0xf4(%rbp)
cmpl $-0x1, -0xf4(%rbp)
jne 0x8ccf
jmp 0x910c
movslq -0xf4(%rbp), %rax
leaq 0x47833(%rip), %rcx     # 0x50510
movb $0x1, (%rax,%rcx)
movl -0xf4(%rbp), %eax
addl $-0x3a, %eax
movl %eax, %ecx
movq %rcx, -0x218(%rbp)
subl $0x4e, %eax
ja 0x9107
movq -0x218(%rbp), %rax
leaq 0x26356(%rip), %rcx     # 0x2f060
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x9650
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9644
movq 0x42295(%rip), %rax     # 0x4afc0
movq (%rax), %rdi
leaq 0x26d71(%rip), %rsi     # 0x2faa6
callq 0x4440
cmpl $0x0, %eax
jne 0x8d4e
movl $0x1, -0x84(%rbp)
jmp 0x8dd8
movq 0x4226b(%rip), %rax     # 0x4afc0
movq (%rax), %rdi
leaq 0x26d4b(%rip), %rsi     # 0x2faaa
callq 0x4440
cmpl $0x0, %eax
jne 0x8d75
movl $0x2, -0x84(%rbp)
jmp 0x8dd6
movq 0x42244(%rip), %rax     # 0x4afc0
movq (%rax), %rdi
leaq 0x26d28(%rip), %rsi     # 0x2faae
callq 0x4440
cmpl $0x0, %eax
jne 0x8d9c
movl $0x3, -0x84(%rbp)
jmp 0x8dd4
movq 0x4221d(%rip), %rax     # 0x4afc0
movq (%rax), %rdi
leaq 0x26d08(%rip), %rsi     # 0x2fab5
callq 0x4440
cmpl $0x0, %eax
jne 0x8dc3
movl $0x4, -0x84(%rbp)
jmp 0x8dd2
callq 0x9650
movl $0x1, %edi
callq 0x43c0
jmp 0x8dd4
jmp 0x8dd6
jmp 0x8dd8
jmp 0x9107
movb $0x0, -0xf6(%rbp)
movq 0x421d5(%rip), %rax     # 0x4afc0
movq (%rax), %rdi
leaq -0x100(%rbp), %rsi
xorl %edx, %edx
callq 0x4100
movb %al, -0xf5(%rbp)
movq -0x100(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x8e2d
movq -0x100(%rbp), %rdi
addq $0x1, %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x4100
movb %al, -0xf6(%rbp)
movb -0xf5(%rbp), %al
leaq 0x42d16(%rip), %rdi     # 0x4bb50
leaq 0x27078(%rip), %rsi     # 0x2feb9
xorl %r8d, %r8d
movl $0x1, %r9d
movzbl %al, %edx
movzbl -0xf6(%rbp), %ecx
callq 0xf6f0
jmp 0x9107
movq 0x4215b(%rip), %rax     # 0x4afc0
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x4100
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movzbl %al, %edi
callq 0xe6b0
movq %rax, -0xe0(%rbp)
cmpq $0x0, -0xe0(%rbp)
je 0x8ee8
leaq -0xf0(%rbp), %rdi
movl -0xd4(%rbp), %edx
leaq 0x26c0d(%rip), %rsi     # 0x2fab9
movb $0x0, %al
callq 0x40a0
movq -0xe0(%rbp), %rdx
leaq -0xf0(%rbp), %rcx
leaq 0x42c88(%rip), %rdi     # 0x4bb50
leaq 0x26fea(%rip), %r8      # 0x2feb9
movl $0x1, %r9d
xorl %eax, %eax
movq %r8, %rsi
movl $0x0, (%rsp)
callq 0x50c0
jmp 0x8f06
movq 0x420e9(%rip), %rax     # 0x4afd8
movq (%rax), %rdi
movl -0xd4(%rbp), %edx
leaq 0x26bc5(%rip), %rsi     # 0x2fac4
movb $0x0, %al
callq 0x4450
jmp 0x9107
movq 0x420ae(%rip), %rax     # 0x4afc0
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x4100
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movzbl %al, %edi
callq 0x154d0
movq %rax, -0xe0(%rbp)
cmpq $0x0, -0xe0(%rbp)
je 0x8f95
leaq -0xf0(%rbp), %rdi
movl -0xd4(%rbp), %edx
leaq 0x26b85(%rip), %rsi     # 0x2fade
movb $0x0, %al
callq 0x40a0
movq -0xe0(%rbp), %rdx
leaq -0xf0(%rbp), %rcx
leaq 0x42bdb(%rip), %rdi     # 0x4bb50
leaq 0x26f3d(%rip), %r8      # 0x2feb9
movl $0x1, %r9d
xorl %eax, %eax
movq %r8, %rsi
movl $0x0, (%rsp)
callq 0x50c0
jmp 0x8fb3
movq 0x4203c(%rip), %rax     # 0x4afd8
movq (%rax), %rdi
movl -0xd4(%rbp), %edx
leaq 0x26b3a(%rip), %rsi     # 0x2fae6
movb $0x0, %al
callq 0x4450
jmp 0x9107
movq 0x42001(%rip), %rax     # 0x4afc0
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x4100
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movzbl %al, %edi
callq 0x15560
movq %rax, -0xe0(%rbp)
cmpq $0x0, -0xe0(%rbp)
je 0x9042
leaq -0xf0(%rbp), %rdi
movl -0xd4(%rbp), %edx
leaq 0x26af6(%rip), %rsi     # 0x2fafc
movb $0x0, %al
callq 0x40a0
movq -0xe0(%rbp), %rdx
leaq -0xf0(%rbp), %rcx
leaq 0x42b2e(%rip), %rdi     # 0x4bb50
leaq 0x26e90(%rip), %r8      # 0x2feb9
movl $0x1, %r9d
xorl %eax, %eax
movq %r8, %rsi
movl $0x0, (%rsp)
callq 0x50c0
jmp 0x9060
movq 0x41f8f(%rip), %rax     # 0x4afd8
movq (%rax), %rdi
movl -0xd4(%rbp), %edx
leaq 0x26aaf(%rip), %rsi     # 0x2fb08
movb $0x0, %al
callq 0x4450
jmp 0x9107
movq 0x41f54(%rip), %rax     # 0x4afc0
movq (%rax), %rdi
callq 0x9670
jmp 0x9107
movq 0x41f40(%rip), %rax     # 0x4afc0
movq (%rax), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x9860
jmp 0x9107
movq 0x41f40(%rip), %rax     # 0x4afd8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x41f3a(%rip), %rcx     # 0x4afe0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x26a6f(%rip), %rsi     # 0x2fb23
movb $0x0, %al
callq 0x4450
callq 0x9650
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9644
movq 0x41f05(%rip), %rax     # 0x4afd8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x41eff(%rip), %rcx     # 0x4afe0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x26a53(%rip), %rsi     # 0x2fb42
movb $0x0, %al
callq 0x4450
callq 0x9650
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9644
jmp 0x8bb3
movq 0x41ecd(%rip), %rax     # 0x4afe0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jne 0x914b
cmpb $0x0, 0x47471(%rip)     # 0x50592
je 0x914b
leaq 0x26928(%rip), %rdi     # 0x2fa52
leaq 0x26939(%rip), %rsi     # 0x2fa6a
leaq 0x2693f(%rip), %rdx     # 0x2fa77
movb $0x0, %al
callq 0x4050
movl $0x0, -0x4(%rbp)
jmp 0x9644
cmpb $0x0, 0x47447(%rip)     # 0x50599
je 0x9160
leaq 0x429f5(%rip), %rdi     # 0x4bb50
callq 0xe720
cmpb $0x0, 0x47433(%rip)     # 0x5059a
je 0x9175
leaq 0x429e0(%rip), %rdi     # 0x4bb50
callq 0xe9a0
cmpb $0x0, 0x4741f(%rip)     # 0x5059b
je 0x918a
leaq 0x429cb(%rip), %rdi     # 0x4bb50
callq 0x156e0
cmpb $0x0, 0x4740b(%rip)     # 0x5059c
je 0x919f
leaq 0x429b6(%rip), %rdi     # 0x4bb50
callq 0x157d0
cmpb $0x0, 0x473f3(%rip)     # 0x50599
jne 0x91c3
cmpb $0x0, 0x473eb(%rip)     # 0x5059a
jne 0x91c3
cmpb $0x0, 0x473e3(%rip)     # 0x5059b
jne 0x91c3
cmpb $0x0, 0x473db(%rip)     # 0x5059c
je 0x91cf
movl $0x0, -0x4(%rbp)
jmp 0x9644
cmpb $0x0, 0x473c1(%rip)     # 0x50597
jne 0x91fc
cmpb $0x0, 0x473b5(%rip)     # 0x50594
jne 0x91fc
cmpb $0x0, 0x473ad(%rip)     # 0x50595
jne 0x91fc
cmpb $0x0, 0x473a5(%rip)     # 0x50596
jne 0x91fc
cmpb $0x0, 0x47399(%rip)     # 0x50593
je 0x9208
movl $0x0, -0x4(%rbp)
jmp 0x9644
cmpb $0x0, 0x47389(%rip)     # 0x50598
je 0x9240
testb $0x1, -0x8d(%rbp)
je 0x9228
movq 0x41dbf(%rip), %rax     # 0x4afe0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jne 0x9240
leaq -0xc0(%rbp), %rdi
callq 0x9b10
movl $0x0, -0x4(%rbp)
jmp 0x9644
movq 0x41d99(%rip), %rax     # 0x4afe0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jne 0x926c
movq 0x41d5b(%rip), %rax     # 0x4afb0
movq (%rax), %rsi
leaq 0x2af30(%rip), %rdi     # 0x3418f
callq 0x9c00
movl %eax, -0xc4(%rbp)
jmp 0x92dc
movq -0x10(%rbp), %rax
movq 0x41d69(%rip), %rcx     # 0x4afe0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x220(%rbp)
movq -0x10(%rbp), %rax
movq 0x41d50(%rip), %rcx     # 0x4afe0
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x92b2
movq 0x41d32(%rip), %rax     # 0x4afd8
movq (%rax), %rax
movq %rax, -0x228(%rbp)
jmp 0x92c3
movq 0x41cf7(%rip), %rax     # 0x4afb0
movq (%rax), %rax
movq %rax, -0x228(%rbp)
movq -0x220(%rbp), %rdi
movq -0x228(%rbp), %rsi
callq 0x9c00
movl %eax, -0xc4(%rbp)
cmpl $0x0, -0xc4(%rbp)
je 0x9308
cmpb $0x0, 0x47274(%rip)     # 0x50560
je 0x9308
leaq 0x26865(%rip), %rdi     # 0x2fb5a
movb $0x0, %al
callq 0x4050
movl $0x0, -0x4(%rbp)
jmp 0x9644
movq 0x41cd1(%rip), %rax     # 0x4afe0
movl (%rax), %eax
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x9368
cmpl $0x0, -0xc4(%rbp)
je 0x9332
movl -0xc4(%rbp), %eax
movl %eax, -0x22c(%rbp)
jmp 0x935a
movq -0x10(%rbp), %rax
movq 0x41ca3(%rip), %rcx     # 0x4afe0
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
movl -0x84(%rbp), %esi
callq 0x9da0
movl %eax, -0x22c(%rbp)
movl -0x22c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x9644
cmpb $0x0, 0x47229(%rip)     # 0x50598
je 0x9612
leaq 0x427d4(%rip), %rdi     # 0x4bb50
leaq 0x4729d(%rip), %rsi     # 0x50620
addq $0x36, %rsi
callq 0x11ed0
leaq 0x427bd(%rip), %rdi     # 0x4bb50
leaq 0x47286(%rip), %rsi     # 0x50620
addq $0x48, %rsi
callq 0x11ed0
leaq 0x427a6(%rip), %rdi     # 0x4bb50
leaq 0x4726f(%rip), %rsi     # 0x50620
addq $0x5a, %rsi
callq 0x11ed0
leaq 0x4278f(%rip), %rdi     # 0x4bb50
leaq 0x47258(%rip), %rsi     # 0x50620
addq $0x6c, %rsi
callq 0x11ed0
movl -0xc0(%rbp), %edx
movl -0xbc(%rbp), %ecx
movsd -0xb8(%rbp), %xmm0
movb -0x8f(%rbp), %r8b
movl -0x8c(%rbp), %r9d
movb -0x90(%rbp), %al
leaq -0x1a8(%rbp), %rdi
leaq 0x42749(%rip), %rsi     # 0x4bb50
xorl %r10d, %r10d
movsd 0x25c2e(%rip), %xmm1    # 0x2f040
movsd 0x25c2e(%rip), %xmm2    # 0x2f048
movsd 0x25c2e(%rip), %xmm3    # 0x2f050
movsd 0x25c2e(%rip), %xmm4    # 0x2f058
andb $0x1, %r8b
andb $0x1, %al
movzbl %r8b, %r8d
movzbl %al, %eax
movl %eax, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x2cff0
leaq -0x154(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
movl $0x54, %edx
callq 0x42a0
movl -0x138(%rbp), %eax
addl -0x134(%rbp), %eax
addl -0x130(%rbp), %eax
movl %eax, -0x1ac(%rbp)
movl -0x154(%rbp), %eax
addl -0x1ac(%rbp), %eax
movl %eax, -0x1b0(%rbp)
cmpl $0x0, -0x1b0(%rbp)
je 0x94b6
movl -0x144(%rbp), %eax
cvtsi2sd %rax, %xmm0
movl -0x1b0(%rbp), %eax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x238(%rbp)
jmp 0x94c3
xorps %xmm0, %xmm0
movsd %xmm0, -0x238(%rbp)
jmp 0x94c3
movsd -0x238(%rbp), %xmm0
movsd %xmm0, -0x1b8(%rbp)
testb $0x1, 0x42708(%rip)     # 0x4bbe2
je 0x9588
movsd -0x1b8(%rbp), %xmm0
movl 0x426f6(%rip), %eax     # 0x4bbe4
cvtsi2sd %rax, %xmm1
ucomisd %xmm1, %xmm0
jb 0x9588
movl -0xc0(%rbp), %edx
movl -0xbc(%rbp), %ecx
movsd -0xb8(%rbp), %xmm0
movb -0x8f(%rbp), %r8b
movl -0x8c(%rbp), %r9d
movb -0x90(%rbp), %al
movsd 0x426bb(%rip), %xmm1    # 0x4bbe8
movsd 0x426bb(%rip), %xmm2    # 0x4bbf0
movsd 0x426bb(%rip), %xmm3    # 0x4bbf8
movsd 0x426bb(%rip), %xmm4    # 0x4bc00
leaq -0x20c(%rbp), %rdi
leaq 0x425fd(%rip), %rsi     # 0x4bb50
andb $0x1, %r8b
andb $0x1, %al
movzbl %r8b, %r8d
movzbl %al, %eax
movl %eax, (%rsp)
movl $0x1, 0x8(%rsp)
callq 0x2cff0
leaq -0x154(%rbp), %rdi
leaq -0x20c(%rbp), %rsi
movl $0x54, %edx
callq 0x42a0
leaq -0x154(%rbp), %rdi
callq 0x4c30
cmpl $0x0, -0x138(%rbp)
jg 0x95d6
leaq 0x425ac(%rip), %rdi     # 0x4bb50
leaq 0x2690e(%rip), %rsi     # 0x2feb9
leaq -0x154(%rbp), %rdx
leaq 0x2a635(%rip), %rcx     # 0x33bee
leaq 0x265a3(%rip), %r8      # 0x2fb63
movl $0x1, %r9d
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x50c0
jmp 0x9609
leaq 0x42573(%rip), %rdi     # 0x4bb50
leaq 0x268d5(%rip), %r8      # 0x2feb9
leaq -0x154(%rbp), %rdx
leaq 0x2a5fc(%rip), %rcx     # 0x33bee
movl $0x1, %r9d
xorl %eax, %eax
movq %r8, %rsi
movl $0x0, (%rsp)
callq 0x50c0
movl $0x0, -0x4(%rbp)
jmp 0x9644
cmpl $0x0, -0xc4(%rbp)
je 0x9629
movl -0xc4(%rbp), %eax
movl %eax, -0x23c(%rbp)
jmp 0x963b
leaq 0x42520(%rip), %rdi     # 0x4bb50
callq 0x8310
movl %eax, -0x23c(%rbp)
movl -0x23c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq