// File: rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: cta_dolby_video(unsigned char const*, unsigned int)
static void cta_dolby_video(const unsigned char *x, unsigned length)
{
	unsigned char version = (x[0] >> 5) & 0x07;

	printf("    Version: %u (%u bytes)\n", version, length + 5);
	if (x[0] & 0x01)
		printf("    Supports YUV422 12 bit\n");

	if (version == 0) {
		if (x[0] & 0x02)
			printf("    Supports 2160p60\n");
		if (x[0] & 0x04)
			printf("    Supports global dimming\n");
		unsigned char dm_version = x[16];
		printf("    DM Version: %u.%u\n", dm_version >> 4, dm_version & 0xf);
		printf("    Target Min PQ: %u\n", (x[14] << 4) | (x[13] >> 4));
		printf("    Target Max PQ: %u\n", (x[15] << 4) | (x[13] & 0xf));
		printf("    Rx, Ry: %.8f, %.8f\n",
		       ((x[1] >> 4) | (x[2] << 4)) / 4096.0,
		       ((x[1] & 0xf) | (x[3] << 4)) / 4096.0);
		printf("    Gx, Gy: %.8f, %.8f\n",
		       ((x[4] >> 4) | (x[5] << 4)) / 4096.0,
		       ((x[4] & 0xf) | (x[6] << 4)) / 4096.0);
		printf("    Bx, By: %.8f, %.8f\n",
		       ((x[7] >> 4) | (x[8] << 4)) / 4096.0,
		       ((x[7] & 0xf) | (x[9] << 4)) / 4096.0);
		printf("    Wx, Wy: %.8f, %.8f\n",
		       ((x[10] >> 4) | (x[11] << 4)) / 4096.0,
		       ((x[10] & 0xf) | (x[12] << 4)) / 4096.0);
		return;
	}

	if (version == 1) {
		if (x[0] & 0x02)
			printf("    Supports 2160p60\n");
		if (x[1] & 0x01)
			printf("    Supports global dimming\n");
		unsigned char dm_version = (x[0] >> 2) & 0x07;
		printf("    DM Version: %u.x\n", dm_version + 2);
		printf("    Colorimetry: %s\n", (x[2] & 0x01) ? "P3-D65" : "ITU-R BT.709");
		printf("    Low Latency: %s\n", (x[3] & 0x01) ? "Standard + Low Latency" : "Only Standard");
		printf("    Target Max Luminance: %u cd/m^2\n", 100 + (x[1] >> 1) * 50);
		double lm = (x[2] >> 1) / 127.0;
		printf("    Target Min Luminance: %.8f cd/m^2\n", lm * lm);
		if (length == 10) {
			printf("    Rx, Ry: %.8f, %.8f\n", x[4] / 256.0, x[5] / 256.0);
			printf("    Gx, Gy: %.8f, %.8f\n", x[6] / 256.0, x[7] / 256.0);
			printf("    Bx, By: %.8f, %.8f\n", x[8] / 256.0, x[9] / 256.0);
		} else {
			double xmin = 0.625;
			double xstep = (0.74609375 - xmin) / 31.0;
			double ymin = 0.25;
			double ystep = (0.37109375 - ymin) / 31.0;

			printf("    Unique Rx, Ry: %.8f, %.8f\n",
			       xmin + xstep * (x[6] >> 3),
			       ymin + ystep * (((x[6] & 0x7) << 2) | (x[4] & 0x01) | ((x[5] & 0x01) << 1)));
			xstep = 0.49609375 / 127.0;
			ymin = 0.5;
			ystep = (0.99609375 - ymin) / 127.0;
			printf("    Unique Gx, Gy: %.8f, %.8f\n",
			       xstep * (x[4] >> 1), ymin + ystep * (x[5] >> 1));
			xmin = 0.125;
			xstep = (0.15234375 - xmin) / 7.0;
			ymin = 0.03125;
			ystep = (0.05859375 - ymin) / 7.0;
			printf("    Unique Bx, By: %.8f, %.8f\n",
			       xmin + xstep * (x[3] >> 5),
			       ymin + ystep * ((x[3] >> 2) & 0x07));
		}
		return;
	}

	if (version == 2) {
		if (x[0] & 0x02)
			printf("    Supports Backlight Control\n");
		if (x[1] & 0x04)
			printf("    Supports global dimming\n");
		unsigned char dm_version = (x[0] >> 2) & 0x07;
		printf("    DM Version: %u.x\n", dm_version + 2);
		printf("    Backlt Min Luma: %u cd/m^2\n", 25 + (x[1] & 0x03) * 25);
		printf("    Interface: ");
		switch (x[2] & 0x03) {
		case 0: printf("Low-Latency\n"); break;
		case 1: printf("Low-Latency + Low-Latency-HDMI\n"); break;
		case 2: printf("Standard + Low-Latency\n"); break;
		case 3: printf("Standard + Low-Latency + Low-Latency-HDMI\n"); break;
		}
		printf("    Supports 10b 12b 444: ");
		switch ((x[3] & 0x01) << 1 | (x[4] & 0x01)) {
		case 0: printf("Not supported\n"); break;
		case 1: printf("10 bit\n"); break;
		case 2: printf("12 bit\n"); break;
		case 3: printf("Reserved\n"); break;
		}
		printf("    Target Min PQ v2: %u\n", 20 * (x[1] >> 3));
		printf("    Target Max PQ v2: %u\n", 2055 + 65 * (x[2] >> 3));

		double xmin = 0.625;
		double xstep = (0.74609375 - xmin) / 31.0;
		double ymin = 0.25;
		double ystep = (0.37109375 - ymin) / 31.0;

		printf("    Unique Rx, Ry: %.8f, %.8f\n",
		       xmin + xstep * (x[5] >> 3),
		       ymin + ystep * (x[6] >> 3));
		xstep = 0.49609375 / 127.0;
		ymin = 0.5;
		ystep = (0.99609375 - ymin) / 127.0;
		printf("    Unique Gx, Gy: %.8f, %.8f\n",
		       xstep * (x[3] >> 1), ymin + ystep * (x[4] >> 1));
		xmin = 0.125;
		xstep = (0.15234375 - xmin) / 7.0;
		ymin = 0.03125;
		ystep = (0.05859375 - ymin) / 7.0;
		printf("    Unique Bx, By: %.8f, %.8f\n",
		       xmin + xstep * (x[5] & 0x07),
		       ymin + ystep * (x[6] & 0x07));
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
sarl $0x5, %eax
andl $0x7, %eax
movb %al, -0xd(%rbp)
movzbl -0xd(%rbp), %esi
movl -0xc(%rbp), %edx
addl $0x5, %edx
leaq 0x21b67(%rip), %rdi     # 0x3b7ea
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x19ca7
leaq 0x21b66(%rip), %rdi     # 0x3b806
movb $0x0, %al
callq 0x4050
movzbl -0xd(%rbp), %eax
cmpl $0x0, %eax
jne 0x19edd
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x19cd1
leaq 0x21b58(%rip), %rdi     # 0x3b822
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x19cee
leaq 0x21b51(%rip), %rdi     # 0x3b838
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movb 0x10(%rax), %al
movb %al, -0xe(%rbp)
movzbl -0xe(%rbp), %esi
sarl $0x4, %esi
movzbl -0xe(%rbp), %edx
andl $0xf, %edx
leaq 0x21b48(%rip), %rdi     # 0x3b855
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0xe(%rax), %esi
shll $0x4, %esi
movq -0x8(%rbp), %rax
movzbl 0xd(%rax), %eax
sarl $0x4, %eax
orl %eax, %esi
leaq 0x21b39(%rip), %rdi     # 0x3b86c
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0xf(%rax), %esi
shll $0x4, %esi
movq -0x8(%rbp), %rax
movzbl 0xd(%rax), %eax
andl $0xf, %eax
orl %eax, %esi
leaq 0x21b2a(%rip), %rdi     # 0x3b883
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
sarl $0x4, %eax
movq -0x8(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
shll $0x4, %ecx
orl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0x1f624(%rip), %xmm1    # 0x393a8
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0xf, %eax
movq -0x8(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
shll $0x4, %ecx
orl %ecx, %eax
cvtsi2sd %eax, %xmm1
movsd 0x1f5fc(%rip), %xmm2    # 0x393a8
divsd %xmm2, %xmm1
leaq 0x21ae3(%rip), %rdi     # 0x3b89a
movb $0x2, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %eax
sarl $0x4, %eax
movq -0x8(%rbp), %rcx
movzbl 0x5(%rcx), %ecx
shll $0x4, %ecx
orl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0x1f5c6(%rip), %xmm1    # 0x393a8
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %eax
andl $0xf, %eax
movq -0x8(%rbp), %rcx
movzbl 0x6(%rcx), %ecx
shll $0x4, %ecx
orl %ecx, %eax
cvtsi2sd %eax, %xmm1
movsd 0x1f59e(%rip), %xmm2    # 0x393a8
divsd %xmm2, %xmm1
leaq 0x21a9d(%rip), %rdi     # 0x3b8b2
movb $0x2, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0x7(%rax), %eax
sarl $0x4, %eax
movq -0x8(%rbp), %rcx
movzbl 0x8(%rcx), %ecx
shll $0x4, %ecx
orl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0x1f568(%rip), %xmm1    # 0x393a8
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movzbl 0x7(%rax), %eax
andl $0xf, %eax
movq -0x8(%rbp), %rcx
movzbl 0x9(%rcx), %ecx
shll $0x4, %ecx
orl %ecx, %eax
cvtsi2sd %eax, %xmm1
movsd 0x1f540(%rip), %xmm2    # 0x393a8
divsd %xmm2, %xmm1
leaq 0x21a57(%rip), %rdi     # 0x3b8ca
movb $0x2, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0xa(%rax), %eax
sarl $0x4, %eax
movq -0x8(%rbp), %rcx
movzbl 0xb(%rcx), %ecx
shll $0x4, %ecx
orl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0x1f50a(%rip), %xmm1    # 0x393a8
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movzbl 0xa(%rax), %eax
andl $0xf, %eax
movq -0x8(%rbp), %rcx
movzbl 0xc(%rcx), %ecx
shll $0x4, %ecx
orl %ecx, %eax
cvtsi2sd %eax, %xmm1
movsd 0x1f4e2(%rip), %xmm2    # 0x393a8
divsd %xmm2, %xmm1
leaq 0x21a11(%rip), %rdi     # 0x3b8e2
movb $0x2, %al
callq 0x4050
jmp 0x1a649
movzbl -0xd(%rbp), %eax
cmpl $0x1, %eax
jne 0x1a2b4
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x19f07
leaq 0x21922(%rip), %rdi     # 0x3b822
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x19f25
leaq 0x2191a(%rip), %rdi     # 0x3b838
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
sarl $0x2, %eax
andl $0x7, %eax
movb %al, -0xf(%rbp)
movzbl -0xf(%rbp), %esi
addl $0x2, %esi
leaq 0x219b7(%rip), %rdi     # 0x3b8fa
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0x2(%rax), %ecx
andl $0x1, %ecx
leaq 0x219d0(%rip), %rsi     # 0x3b92c
leaq 0x219c2(%rip), %rax     # 0x3b925
cmpl $0x0, %ecx
cmovneq %rax, %rsi
leaq 0x2199f(%rip), %rdi     # 0x3b910
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %ecx
andl $0x1, %ecx
leaq 0x219db(%rip), %rsi     # 0x3b965
leaq 0x219bd(%rip), %rax     # 0x3b94e
cmpl $0x0, %ecx
cmovneq %rax, %rsi
leaq 0x2199a(%rip), %rdi     # 0x3b939
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
sarl %eax
imull $0x32, %eax, %esi
addl $0x64, %esi
leaq 0x219b6(%rip), %rdi     # 0x3b973
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0x2(%rax), %eax
sarl %eax
cvtsi2sd %eax, %xmm0
movsd 0x1f386(%rip), %xmm1    # 0x39360
divsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
mulsd -0x18(%rbp), %xmm0
leaq 0x219a4(%rip), %rdi     # 0x3b998
movb $0x1, %al
callq 0x4050
cmpl $0xa, -0xc(%rbp)
jne 0x1a0c4
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %eax
cvtsi2sd %eax, %xmm0
movsd 0x1f387(%rip), %xmm1    # 0x393a0
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movzbl 0x5(%rax), %eax
cvtsi2sd %eax, %xmm1
movsd 0x1f36f(%rip), %xmm2    # 0x393a0
divsd %xmm2, %xmm1
leaq 0x2185e(%rip), %rdi     # 0x3b89a
movb $0x2, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0x6(%rax), %eax
cvtsi2sd %eax, %xmm0
movsd 0x1f349(%rip), %xmm1    # 0x393a0
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movzbl 0x7(%rax), %eax
cvtsi2sd %eax, %xmm1
movsd 0x1f331(%rip), %xmm2    # 0x393a0
divsd %xmm2, %xmm1
leaq 0x21838(%rip), %rdi     # 0x3b8b2
movb $0x2, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0x8(%rax), %eax
cvtsi2sd %eax, %xmm0
movsd 0x1f30b(%rip), %xmm1    # 0x393a0
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movzbl 0x9(%rax), %eax
cvtsi2sd %eax, %xmm1
movsd 0x1f2f3(%rip), %xmm2    # 0x393a0
divsd %xmm2, %xmm1
leaq 0x21812(%rip), %rdi     # 0x3b8ca
movb $0x2, %al
callq 0x4050
jmp 0x1a2af
movsd 0x1f2cc(%rip), %xmm0    # 0x39398
movsd %xmm0, -0x20(%rbp)
movsd 0x1f2b7(%rip), %xmm0    # 0x39390
subsd -0x20(%rbp), %xmm0
movsd 0x1f292(%rip), %xmm1    # 0x39378
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x1f291(%rip), %xmm0    # 0x39388
movsd %xmm0, -0x30(%rbp)
movsd 0x1f27c(%rip), %xmm0    # 0x39380
subsd -0x30(%rbp), %xmm0
movsd 0x1f267(%rip), %xmm1    # 0x39378
divsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x20(%rbp), %xmm1
movsd -0x28(%rbp), %xmm0
movq -0x8(%rbp), %rax
movzbl 0x6(%rax), %eax
sarl $0x3, %eax
cvtsi2sd %eax, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x30(%rbp), %xmm2
movsd -0x38(%rbp), %xmm1
movq -0x8(%rbp), %rax
movzbl 0x6(%rax), %eax
andl $0x7, %eax
shll $0x2, %eax
movq -0x8(%rbp), %rcx
movzbl 0x4(%rcx), %ecx
andl $0x1, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzbl 0x5(%rcx), %ecx
andl $0x1, %ecx
shll %ecx
orl %ecx, %eax
cvtsi2sd %eax, %xmm3
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
leaq 0x2183d(%rip), %rdi     # 0x3b9bf
movb $0x2, %al
callq 0x4050
movsd 0x1f1df(%rip), %xmm0    # 0x39370
movsd %xmm0, -0x28(%rbp)
movsd 0x14e7a(%rip), %xmm0    # 0x2f018
movsd %xmm0, -0x30(%rbp)
movsd 0x1f1bd(%rip), %xmm0    # 0x39368
subsd -0x30(%rbp), %xmm0
movsd 0x1f1a8(%rip), %xmm1    # 0x39360
divsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x28(%rbp), %xmm0
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %eax
sarl %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
movsd -0x30(%rbp), %xmm2
movsd -0x38(%rbp), %xmm1
movq -0x8(%rbp), %rax
movzbl 0x5(%rax), %eax
sarl %eax
cvtsi2sd %eax, %xmm3
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
leaq 0x217df(%rip), %rdi     # 0x3b9de
movb $0x2, %al
callq 0x4050
movsd 0x1f14a(%rip), %xmm0    # 0x39358
movsd %xmm0, -0x20(%rbp)
movsd 0x1f135(%rip), %xmm0    # 0x39350
subsd -0x20(%rbp), %xmm0
movsd 0x1f110(%rip), %xmm1    # 0x39338
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x1f10f(%rip), %xmm0    # 0x39348
movsd %xmm0, -0x30(%rbp)
movsd 0x1f0fa(%rip), %xmm0    # 0x39340
subsd -0x30(%rbp), %xmm0
movsd 0x1f0e5(%rip), %xmm1    # 0x39338
divsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x20(%rbp), %xmm1
movsd -0x28(%rbp), %xmm0
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %eax
sarl $0x5, %eax
cvtsi2sd %eax, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x30(%rbp), %xmm2
movsd -0x38(%rbp), %xmm1
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %eax
sarl $0x2, %eax
andl $0x7, %eax
cvtsi2sd %eax, %xmm3
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
leaq 0x21755(%rip), %rdi     # 0x3b9fd
movb $0x2, %al
callq 0x4050
jmp 0x1a649
movzbl -0xd(%rbp), %eax
cmpl $0x2, %eax
jne 0x1a649
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1a2de
leaq 0x21745(%rip), %rdi     # 0x3ba1c
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1a2fc
leaq 0x21543(%rip), %rdi     # 0x3b838
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movb (%rax), %al
shrb $0x2, %al
andb $0x7, %al
movb %al, -0x39(%rbp)
movzbl -0x39(%rbp), %esi
addl $0x2, %esi
leaq 0x215e2(%rip), %rdi     # 0x3b8fa
xorl %eax, %eax
movb %al, -0x69(%rbp)
callq 0x4050
movb -0x69(%rbp), %al
movq -0x8(%rbp), %rcx
movzbl 0x1(%rcx), %edx
andl $0x3, %edx
movl %edx, %ecx
leal (%rcx,%rcx,4), %edx
movl %edx, %ecx
leal 0x19(%rcx,%rcx,4), %esi
leaq 0x216fa(%rip), %rdi     # 0x3ba3c
callq 0x4050
movb -0x69(%rbp), %al
leaq 0x2170b(%rip), %rdi     # 0x3ba5c
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0x2(%rax), %eax
andl $0x3, %eax
movl %eax, %ecx
movq %rcx, -0x68(%rbp)
subl $0x3, %eax
ja 0x1a3be
movq -0x68(%rbp), %rax
leaq 0x1bb25(%rip), %rcx     # 0x35e9c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x216f0(%rip), %rdi     # 0x3ba77
movb $0x0, %al
callq 0x4050
jmp 0x1a3be
leaq 0x216f8(%rip), %rdi     # 0x3ba8f
movb $0x0, %al
callq 0x4050
jmp 0x1a3be
leaq 0x216c5(%rip), %rdi     # 0x3ba6c
movb $0x0, %al
callq 0x4050
jmp 0x1a3be
leaq 0x216cd(%rip), %rdi     # 0x3ba84
movb $0x0, %al
callq 0x4050
leaq 0x216ea(%rip), %rdi     # 0x3baaf
xorl %eax, %eax
callq 0x4050
movq -0x8(%rbp), %rcx
movzbl 0x3(%rcx), %eax
andl $0x1, %eax
movzbl 0x4(%rcx), %edx
andl $0x1, %edx
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, %ecx
movq %rcx, -0x78(%rbp)
subl $0x3, %eax
ja 0x1a442
movq -0x78(%rbp), %rax
leaq 0x1bab1(%rip), %rcx     # 0x35eac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x216bf(%rip), %rdi     # 0x3baca
movb $0x0, %al
callq 0x4050
jmp 0x1a442
leaq 0x216be(%rip), %rdi     # 0x3bad9
movb $0x0, %al
callq 0x4050
jmp 0x1a442
leaq 0x213ef(%rip), %rdi     # 0x3b81a
movb $0x0, %al
callq 0x4050
jmp 0x1a442
leaq 0x251e9(%rip), %rdi     # 0x3f624
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
sarl $0x3, %eax
imull $0x14, %eax, %esi
leaq 0x2168a(%rip), %rdi     # 0x3bae1
movb $0x0, %al
callq 0x4050
movq -0x8(%rbp), %rax
movzbl 0x2(%rax), %eax
sarl $0x3, %eax
imull $0x41, %eax, %esi
addl $0x807, %esi            # imm = 0x807
leaq 0x21682(%rip), %rdi     # 0x3bafb
movb $0x0, %al
callq 0x4050
movsd 0x1ef10(%rip), %xmm0    # 0x39398
movsd %xmm0, -0x48(%rbp)
movsd 0x1eefb(%rip), %xmm0    # 0x39390
subsd -0x48(%rbp), %xmm0
movsd 0x1eed6(%rip), %xmm1    # 0x39378
divsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x1eed5(%rip), %xmm0    # 0x39388
movsd %xmm0, -0x58(%rbp)
movsd 0x1eec0(%rip), %xmm0    # 0x39380
subsd -0x58(%rbp), %xmm0
movsd 0x1eeab(%rip), %xmm1    # 0x39378
divsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x48(%rbp), %xmm1
movsd -0x50(%rbp), %xmm0
movq -0x8(%rbp), %rax
movzbl 0x5(%rax), %eax
sarl $0x3, %eax
cvtsi2sd %eax, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x58(%rbp), %xmm2
movsd -0x60(%rbp), %xmm1
movq -0x8(%rbp), %rax
movzbl 0x6(%rax), %eax
sarl $0x3, %eax
cvtsi2sd %eax, %xmm3
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
leaq 0x214a0(%rip), %rdi     # 0x3b9bf
movb $0x2, %al
callq 0x4050
movsd 0x1ee42(%rip), %xmm0    # 0x39370
movsd %xmm0, -0x50(%rbp)
movsd 0x14add(%rip), %xmm0    # 0x2f018
movsd %xmm0, -0x58(%rbp)
movsd 0x1ee20(%rip), %xmm0    # 0x39368
subsd -0x58(%rbp), %xmm0
movsd 0x1ee0b(%rip), %xmm1    # 0x39360
divsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x50(%rbp), %xmm0
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %eax
sarl %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
movsd -0x58(%rbp), %xmm2
movsd -0x60(%rbp), %xmm1
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %eax
sarl %eax
cvtsi2sd %eax, %xmm3
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
leaq 0x21442(%rip), %rdi     # 0x3b9de
movb $0x2, %al
callq 0x4050
movsd 0x1edad(%rip), %xmm0    # 0x39358
movsd %xmm0, -0x48(%rbp)
movsd 0x1ed98(%rip), %xmm0    # 0x39350
subsd -0x48(%rbp), %xmm0
movsd 0x1ed73(%rip), %xmm1    # 0x39338
divsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x1ed72(%rip), %xmm0    # 0x39348
movsd %xmm0, -0x58(%rbp)
movsd 0x1ed5d(%rip), %xmm0    # 0x39340
subsd -0x58(%rbp), %xmm0
movsd 0x1ed48(%rip), %xmm1    # 0x39338
divsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x48(%rbp), %xmm1
movsd -0x50(%rbp), %xmm0
movq -0x8(%rbp), %rax
movzbl 0x5(%rax), %eax
andl $0x7, %eax
cvtsi2sd %eax, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x58(%rbp), %xmm2
movsd -0x60(%rbp), %xmm1
movq -0x8(%rbp), %rax
movzbl 0x6(%rax), %eax
andl $0x7, %eax
cvtsi2sd %eax, %xmm3
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
leaq 0x213bb(%rip), %rdi     # 0x3b9fd
movb $0x2, %al
callq 0x4050
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)