LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/edid-decode.cpp
// Function: extract_edid_xrandr(char const*)
static bool extract_edid_xrandr(const char *start)
{
	static const char indentation1[] = "                ";
	static const char indentation2[] = "\t\t";
	/* Used to detect that we've gone past the EDID property */
	static const char half_indentation1[] = "        ";
	static const char half_indentation2[] = "\t";
	const char *indentation;
	const char *s;

	for (;;) {
		unsigned j;

		/* Get the next start of the line of EDID hex, assuming spaces for indentation */
		s = strstr(start, indentation = indentation1);
		/* Did we skip the start of another property? */
		if (s && s > strstr(start, half_indentation1))
			break;

		/* If we failed, retry assuming tabs for indentation */
		if (!s) {
			s = strstr(start, indentation = indentation2);
			/* Did we skip the start of another property? */
			if (s && s > strstr(start, half_indentation2))
				break;
		}

		if (!s)
			break;

		start = s + strlen(indentation);

		for (j = 0; j < 16; j++, start += 2) {
			/* Read a %02x from the log */
			if (!isxdigit(start[0]) || !isxdigit(start[1])) {
				if (j)
					break;
				return false;
			}
			if (!edid_add_byte(start))
				return false;
		}
	}
	return state.edid_size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r12
leaq 0x17c34(%rip), %rbx     # 0x200d0
leaq 0x17c3e(%rip), %r14     # 0x200e1
leaq 0x17c3a(%rip), %r15     # 0x200e4
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3080
testq %rax, %rax
je 0x84db
movq %rax, %r13
movq %r12, %rdi
movq %r15, %rsi
callq 0x3080
movl $0x2, %ecx
cmpq %rax, %r13
ja 0x857c
movq %rbx, %rdi
jmp 0x8510
movq %r12, %rdi
movq %r14, %rsi
callq 0x3080
testq %rax, %rax
je 0x850a
movq %rax, %r13
movq %r12, %rdi
movl $0x9, %esi
callq 0x30e0
movl $0x2, %ecx
cmpq %rax, %r13
ja 0x857c
movq %r14, %rdi
jmp 0x8510
movq %r14, %rdi
xorl %r13d, %r13d
testq %r13, %r13
je 0x8567
callq 0x3110
addq %rax, %r13
xorl %ebp, %ebp
movq %r13, %r12
addq %rbp, %r12
movsbl (%r13,%rbp), %edi
callq 0x3090
testl %eax, %eax
je 0x856e
movsbl 0x1(%r13,%rbp), %edi
callq 0x3090
testl %eax, %eax
je 0x856e
movq %r12, %rdi
movl $0x1, %esi
callq 0x865c
testb %al, %al
je 0x8577
addq $0x2, %rbp
cmpl $0x20, %ebp
jne 0x851f
addq %rbp, %r13
xorl %ecx, %ecx
movq %r13, %r12
jmp 0x857c
movl $0x2, %ecx
jmp 0x857c
xorl %ecx, %ecx
testl %ebp, %ebp
sete %cl
jmp 0x857c
movl $0x1, %ecx
testl %ecx, %ecx
je 0x84aa
cmpl $0x2, %ecx
jne 0x8595
cmpl $0x0, 0x32150(%rip)     # 0x3a6e0
setne %al
jmp 0x8597
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/edid-decode.cpp
// Function: extract_edid_xorg(char const*)
static bool extract_edid_xorg(const char *start)
{
	bool find_first_num = true;

	for (; *start; start++) {
		if (find_first_num) {
			const char *s;

			/* skip ahead to the : */
			s = strstr(start, ": \t");
			if (!s)
				s = strstr(start, ":     ");
			if (!s)
				break;
			start = s;
			/* and find the first number */
			while (!isxdigit(start[1]))
				start++;
			find_first_num = false;
			continue;
		} else {
			/* Read a %02x from the log */
			if (!isxdigit(*start)) {
				find_first_num = true;
				continue;
			}
			if (!edid_add_byte(start))
				return false;
			start++;
		}
	}
	return state.edid_size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movb (%rdi), %al
testb %al, %al
je 0x8645
movq %rdi, %rbx
movb $0x1, %bpl
leaq 0x18b0c(%rip), %r14     # 0x210d1
leaq 0x18b09(%rip), %r15     # 0x210d5
testb $0x1, %bpl
je 0x8616
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3080
movq %rax, %r12
testq %rax, %rax
jne 0x85f3
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3080
movq %rax, %r12
testq %r12, %r12
je 0x860f
leaq -0x1(%r12), %rbx
movsbl 0x2(%rbx), %edi
callq 0x3090
incq %rbx
testl %eax, %eax
je 0x85fd
xorl %ebp, %ebp
testq %r12, %r12
jne 0x863b
jmp 0x8645
movsbl %al, %edi
callq 0x3090
testl %eax, %eax
je 0x8638
movq %rbx, %rdi
movl $0x1, %esi
callq 0x865c
testb %al, %al
je 0x8658
incq %rbx
jmp 0x863b
movb $0x1, %bpl
movb 0x1(%rbx), %al
incq %rbx
testb %al, %al
jne 0x85cc
cmpl $0x0, 0x32094(%rip)     # 0x3a6e0
setne %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x864f
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/edid-decode.cpp
// Function: edid_add_byte(char const*, bool)
static bool edid_add_byte(const char *s, bool two_digits = true)
{
	char buf[3];

	if (state.edid_size == sizeof(edid))
		return false;
	buf[0] = s[0];
	buf[1] = two_digits ? s[1] : 0;
	buf[2] = 0;
	edid[state.edid_size++] = strtoul(buf, NULL, 16);
	return true;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl 0x32079(%rip), %ebx     # 0x3a6e0
cmpl $0x8000, %ebx           # imm = 0x8000
je 0x86b2
movb (%rdi), %al
movb %al, 0xd(%rsp)
testb %sil, %sil
je 0x867f
movb 0x1(%rdi), %al
jmp 0x8681
xorl %eax, %eax
leaq 0xd(%rsp), %rdi
movb %al, 0x1(%rdi)
movb $0x0, 0x2(%rdi)
xorl %esi, %esi
movl $0x10, %edx
callq 0x30c0
movl 0x32041(%rip), %ecx     # 0x3a6e0
leal 0x1(%rcx), %edx
movl %edx, 0x32038(%rip)     # 0x3a6e0
leaq 0x36b01(%rip), %rdx     # 0x3f1b0
movb %al, (%rcx,%rdx)
cmpl $0x8000, %ebx           # imm = 0x8000
setne %al
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-base-block.cpp
// Function: close_match_to_dmt(timings const&, unsigned int&)
const struct timings *close_match_to_dmt(const timings &t, unsigned &dmt)
{
	for (unsigned i = 0; i < ARRAY_SIZE(dmt_timings); i++) {
		if (timings_close_match(t, dmt_timings[i].t)) {
			dmt = dmt_timings[i].dmt_id;
			return &dmt_timings[i].t;
		}
	}
	dmt = 0;
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x19394(%rip), %r14     # 0x2256c
movq %r14, %rsi
callq 0x3dc2
leaq 0x19379(%rip), %r12     # 0x22560
testb %al, %al
je 0x91ef
xorl %eax, %eax
jmp 0x921f
xorl %r14d, %r14d
cmpq $0x57, %r14
je 0x9227
leaq 0x6c(%r12), %rsi
movq %r15, %rdi
callq 0x3dc2
addq $0x60, %r12
incq %r14
testb %al, %al
je 0x91f2
decq %r14
cmpq $0x57, %r14
setae %al
leaq 0xc(%r12), %r14
movl (%r12), %ecx
movl %ecx, (%rbx)
jmp 0x9231
setae %al
addq $0xc, %r12
movq %r12, %r14
testb %al, %al
je 0x923e
movl $0x0, (%rbx)
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-base-block.cpp
// Function: extract_string(unsigned char const*, unsigned int)
char *extract_string(const unsigned char *x, unsigned len)
{
	static char s[EDID_PAGE_SIZE];
	int seen_newline = 0;
	unsigned i;

	memset(s, 0, sizeof(s));

	for (i = 0; i < len; i++) {
		if (isgraph(x[i])) {
			s[i] = x[i];
		} else if (!seen_newline) {
			if (x[i] == 0x0a) {
				seen_newline = 1;
				if (!i)
					fail("Empty string.\n");
				else if (s[i - 1] == 0x20)
					fail("One or more trailing spaces.\n");
			} else if (x[i] == 0x20) {
				s[i] = x[i];
			} else {
				fail("Non-printable character.\n");
				return s;
			}
		} else if (x[i] != 0x20) {
			fail("Non-space after newline.\n");
			return s;
		}
	}
	/* Does the string end with a space? */
	if (!seen_newline && s[len - 1] == 0x20)
		fail("One or more trailing spaces.\n");

	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x3d113(%rip)    # 0x47230
movaps %xmm0, 0x3d0fc(%rip)    # 0x47220
movaps %xmm0, 0x3d0e5(%rip)    # 0x47210
movaps %xmm0, 0x3d0ce(%rip)    # 0x47200
movaps %xmm0, 0x3d0b7(%rip)    # 0x471f0
movaps %xmm0, 0x3d0a0(%rip)    # 0x471e0
movaps %xmm0, 0x3d089(%rip)    # 0x471d0
movaps %xmm0, 0x3d072(%rip)    # 0x471c0
testl %esi, %esi
je 0xa20a
movq %rdi, %r14
movq %rsi, (%rsp)
movl %esi, %r13d
xorl %r15d, %r15d
xorl %ebx, %ebx
movb (%r14,%r15), %r12b
movzbl %r12b, %ebp
movl %ebp, %edi
callq 0x3220
testl %eax, %eax
je 0xa185
leaq 0x3d041(%rip), %rax     # 0x471c0
movb %r12b, (%r15,%rax)
jmp 0xa1f6
testl %ebx, %ebx
je 0xa199
movl $0x1, %ebx
cmpb $0x20, %r12b
je 0xa1f6
jmp 0xa222
cmpl $0x20, %ebp
je 0xa1d2
cmpl $0xa, %ebp
jne 0xa22b
testq %r15, %r15
je 0xa1e1
movl $0x1, %ebx
leaq 0x3d008(%rip), %rax     # 0x471c0
cmpb $0x20, -0x1(%r15,%rax)
jne 0xa1f6
xorl %edi, %edi
leaq 0x1a63a(%rip), %rsi     # 0x24803
xorl %eax, %eax
callq 0x37ec
jmp 0xa1f6
leaq 0x3cfe7(%rip), %rax     # 0x471c0
movb %r12b, (%r15,%rax)
xorl %ebx, %ebx
jmp 0xa1f6
xorl %edi, %edi
leaq 0x1a60a(%rip), %rsi     # 0x247f4
xorl %eax, %eax
callq 0x37ec
movl $0x1, %ebx
incq %r15
cmpq %r15, %r13
jne 0xa165
testl %ebx, %ebx
movq (%rsp), %rsi
jne 0xa23b
decl %esi
leaq 0x3cfad(%rip), %rax     # 0x471c0
cmpb $0x20, (%rsi,%rax)
jne 0xa23b
leaq 0x1a5e3(%rip), %rsi     # 0x24803
jmp 0xa232
leaq 0x1a612(%rip), %rsi     # 0x2483b
jmp 0xa232
leaq 0x1a5ef(%rip), %rsi     # 0x24821
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
leaq 0x3cf7e(%rip), %rax     # 0x471c0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-base-block.cpp
// Function: edid_state::preparse_detailed_block(unsigned char const*)
void edid_state::preparse_detailed_block(const unsigned char *x)
{
	if (x[0] || x[1])
		return;
	if (x[3] != 0xfd)
		return;

	switch (x[10]) {
	case 0x00: /* default gtf */
		base.supports_gtf = true;
		break;
	case 0x02: /* secondary gtf curve */
		base.supports_gtf = true;
		base.supports_sec_gtf = !memchk(x + 12, 6);
		base.sec_gtf_start_freq = x[12] * 2;
		base.C = x[13] / 2.0;
		base.M = (x[15] << 8) | x[14];
		base.K = x[16];
		base.J = x[17] / 2.0;
		break;
	case 0x04: /* cvt */
		if (base.edid_minor >= 4) {
			/* GTF is implied if CVT is signaled */
			base.supports_gtf = true;
			base.supports_cvt = true;
		}
		break;
	}
}

// Assembly:
cmpb $0x0, (%rsi)
je 0xbf66
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
cmpb $0x0, 0x1(%rsi)
jne 0xc04e
cmpb $-0x3, 0x3(%r14)
jne 0xc04e
movq %rdi, %rbx
movzbl 0xa(%r14), %eax
cmpl $0x4, %eax
je 0xc037
cmpl $0x2, %eax
je 0xbfac
testl %eax, %eax
jne 0xc04e
movb $0x1, 0x91(%rbx)
jmp 0xc04e
movb $0x1, 0x91(%rbx)
leaq 0xc(%r14), %rdi
movl $0x6, %esi
xorl %edx, %edx
callq 0x5b92
xorb $0x1, %al
movb %al, 0x92(%rbx)
movzbl 0xc(%r14), %eax
addl %eax, %eax
movl %eax, 0x94(%rbx)
movzbl 0xd(%r14), %eax
cvtsi2sd %eax, %xmm0
movsd 0x1401f(%rip), %xmm1    # 0x20008
mulsd %xmm1, %xmm0
movsd %xmm0, 0x98(%rbx)
movzwl 0xe(%r14), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0xa0(%rbx)
movzbl 0x10(%r14), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0xa8(%rbx)
movzbl 0x11(%r14), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0xb0(%rbx)
jmp 0xc04e
cmpl $0x4, 0x88(%rbx)
jb 0xc04e
movb $0x1, %al
movb %al, 0x91(%rbx)
movb %al, 0xb8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: find_vic_id(unsigned char)
const struct timings *find_vic_id(unsigned char vic)
{
	if (vic > 0 && vic <= ARRAY_SIZE(edid_cta_modes1))
		return edid_cta_modes1 + vic - 1;
	if (vic >= 193 && vic < ARRAY_SIZE(edid_cta_modes2) + 193)
		return edid_cta_modes2 + vic - 193;
	return NULL;
}

// Assembly:
testb %dil, %dil
jle 0xe1ab
movzbl %dil, %eax
imulq $0x54, %rax, %rax
leaq 0x1892d(%rip), %rcx     # 0x26ad0
addq %rcx, %rax
addq $-0x54, %rax
retq
leal 0x3f(%rdi), %eax
cmpb $0x1a, %al
ja 0xe1cb
movzbl %dil, %eax
imulq $0x54, %rax, %rax
leaq 0x1b2bf(%rip), %rcx     # 0x29480
addq %rcx, %rax
addq $-0x3f54, %rax          # imm = 0xC0AC
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: cta_close_match_to_vic(timings const&, unsigned int&)
const struct timings *cta_close_match_to_vic(const timings &t, unsigned &vic)
{
	for (vic = 1; vic <= ARRAY_SIZE(edid_cta_modes1); vic++) {
		if (timings_close_match(t, edid_cta_modes1[vic - 1]))
			return &edid_cta_modes1[vic - 1];
	}
	for (vic = 193; vic < ARRAY_SIZE(edid_cta_modes2) + 193; vic++) {
		if (timings_close_match(t, edid_cta_modes1[vic - 193]))
			return &edid_cta_modes1[vic - 193];
	}
	vic = 0;
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, (%rsi)
xorl %ecx, %ecx
leaq 0x188ba(%rip), %rbx     # 0x26ad0
movl %ecx, %eax
imulq $0x54, %rax, %rsi
addq %rbx, %rsi
movq %r15, %rdi
callq 0x3dc2
movl (%r14), %ecx
testb %al, %al
jne 0xe27b
leal 0x1(%rcx), %eax
movl %eax, (%r14)
cmpl $0x80, %eax
jb 0xe216
movl $0xc1, (%r14)
movl $0xc1, %ecx
addl $0xffffff3f, %ecx       # imm = 0xFFFFFF3F
imulq $0x54, %rcx, %rsi
addq %rbx, %rsi
movq %r15, %rdi
callq 0x3dc2
movl (%r14), %ecx
testb %al, %al
jne 0xe27f
incl %ecx
movl %ecx, (%r14)
cmpl $0xdc, %ecx
jb 0xe247
movl $0x0, (%r14)
xorl %ebx, %ebx
jmp 0xe28c
decl %ecx
jmp 0xe285
addl $0xffffff3f, %ecx       # imm = 0xFFFFFF3F
imulq $0x54, %rcx, %rax
addq %rax, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: edid_state::cta_list_vics()
void edid_state::cta_list_vics()
{
	char type[16];
	for (unsigned vic = 1; vic <= ARRAY_SIZE(edid_cta_modes1); vic++) {
		sprintf(type, "VIC %3u", vic);
		print_timings("", &edid_cta_modes1[vic - 1], type, "", false, false);
	}
	for (unsigned vic = 193; vic < ARRAY_SIZE(edid_cta_modes2) + 193; vic++) {
		sprintf(type, "VIC %3u", vic);
		print_timings("", &edid_cta_modes2[vic - 193], type, "", false, false);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq $-0x7f, %rbp
leaq 0x1881b(%rip), %r14     # 0x26ad0
leaq 0x12638(%rip), %r15     # 0x208f4
leaq 0x10(%rsp), %r12
leaq 0x129b1(%rip), %r13     # 0x20c79
leal 0x80(%rbp), %edx
movq %r12, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3070
movl $0x0, (%rsp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %r12, %rcx
movq %r13, %r8
xorl %r9d, %r9d
callq 0x3ebe
addq $0x54, %r14
incq %rbp
jne 0xe2c8
movq $-0x1b, %rbp
leaq 0x1b170(%rip), %r14     # 0x29480
leaq 0x125dd(%rip), %r15     # 0x208f4
leaq 0x10(%rsp), %r12
leaq 0x12956(%rip), %r13     # 0x20c79
leal 0xdc(%rbp), %edx
movq %r12, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3070
movl $0x0, (%rsp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %r12, %rcx
movq %r13, %r8
xorl %r9d, %r9d
callq 0x3ebe
addq $0x54, %r14
incq %rbp
jne 0xe323
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: edid_state::cta_list_hdmi_vics()
void edid_state::cta_list_hdmi_vics()
{
	for (unsigned i = 0; i < ARRAY_SIZE(edid_hdmi_mode_map); i++) {
		unsigned vic = edid_hdmi_mode_map[i];
		char type[16];

		sprintf(type, "HDMI VIC %u", i + 1);
		print_timings("", find_vic_id(vic), type, "", false, false);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
leaq 0x18747(%rip), %rbp     # 0x26ad0
leaq 0x128e9(%rip), %r12     # 0x20c79
xorl %r13d, %r13d
leaq 0x1bbce(%rip), %rax     # 0x29f68
movzbl (%r13,%rax), %r14d
incq %r13
movq %r15, %rdi
leaq 0x12565(%rip), %rsi     # 0x20912
movl %r13d, %edx
xorl %eax, %eax
callq 0x3070
imulq $0x54, %r14, %rax
leaq (%rax,%rbp), %rdx
addq $-0x54, %rdx
movl $0x0, (%rsp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rcx
movq %r12, %r8
xorl %r9d, %r9d
callq 0x3ebe
cmpq $0x4, %r13
jne 0xe393
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: edid_state::print_vic_index(char const*, unsigned int, char const*, bool)
void edid_state::print_vic_index(const char *prefix, unsigned idx, const char *suffix, bool ycbcr420)
{
	if (!suffix)
		suffix = "";
	if (idx < cta.preparsed_svds[0].size()) {
		unsigned char vic = cta.preparsed_svds[0][idx];
		const struct timings *t = find_vic_id(vic);
		char buf[16];

		sprintf(buf, "VIC %3u", vic);

		if (t) {
			struct timings tmp = *t;
			tmp.ycbcr420 = ycbcr420;
			print_timings(prefix, &tmp, buf, suffix);
		} else {
			printf("%sUnknown (%s%s%s)\n", prefix, buf,
			       *suffix ? ", " : "", suffix);
		}
	} else {
		// Should not happen!
		printf("%sSVD Index %u is out of range", prefix, idx + 1);
		if (*suffix)
			printf(" (%s)", suffix);
		printf("\n");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %rbx
movq %rsi, %r14
testq %rcx, %rcx
leaq 0x121cf(%rip), %r13     # 0x20c79
cmoveq %r13, %rbx
movl %edx, %eax
movq 0x8e0(%rdi), %rcx
movq 0x8e8(%rdi), %rsi
subq %rcx, %rsi
cmpq %rax, %rsi
jbe 0xeaee
movl %r8d, %ebp
movq %rdi, %r15
movsbq (%rcx,%rax), %rax
movzbl %al, %edx
testq %rax, %rax
jle 0xeb2f
imulq $0x54, %rax, %rax
leaq 0x17fec(%rip), %rcx     # 0x26ad0
leaq (%rax,%rcx), %r12
addq $-0x54, %r12
jmp 0xeb55
incl %edx
leaq 0x1b5b0(%rip), %rdi     # 0x2a0a7
movq %r14, %rsi
xorl %eax, %eax
callq 0x3030
cmpb $0x0, (%rbx)
je 0xeb17
leaq 0x1b5b9(%rip), %rdi     # 0x2a0c6
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3030
movl $0xa, %edi
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3310
leal 0x3f(%rax), %ecx
cmpb $0x1a, %cl
ja 0xeb52
movzbl %al, %eax
imulq $0x54, %rax, %rax
leaq 0x1a93b(%rip), %rcx     # 0x29480
leaq (%rax,%rcx), %r12
addq $-0x3f54, %r12          # imm = 0xC0AC
jmp 0xeb55
xorl %r12d, %r12d
leaq 0x11d98(%rip), %rsi     # 0x208f4
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x3070
testq %r12, %r12
je 0xeba2
leaq 0x24(%rsp), %rdx
movl $0x15, %ecx
movq %rdx, %rdi
movq %r12, %rsi
rep  movsl (%rsi), %es:(%rdi)
movb %bpl, 0x50(%rdx)
movl $0x1, (%rsp)
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %r8
xorl %r9d, %r9d
callq 0x3ebe
jmp 0xebc9
cmpb $0x0, (%rbx)
leaq 0x11f62(%rip), %rcx     # 0x20b0e
cmoveq %r13, %rcx
leaq 0x1b4dc(%rip), %rdi     # 0x2a093
leaq 0x10(%rsp), %rdx
movq %r14, %rsi
movq %rbx, %r8
xorl %eax, %eax
callq 0x3030
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: edid_state::cta_y420cmdb(unsigned char const*, unsigned int)
void edid_state::cta_y420cmdb(const unsigned char *x, unsigned length)
{
	unsigned max_idx = 0;
	unsigned i;

	if (!length) {
		printf("    All VDB SVDs\n");
		return;
	}

	if (memchk(x, length)) {
		printf("    Empty Capability Map\n");
		fail("Empty Capability Map.\n");
		return;
	}

	for (i = 0; i < length; i++) {
		unsigned char v = x[i];
		unsigned j;

		for (j = 0; j < 8; j++) {
			if (!(v & (1 << j)))
				continue;

			print_vic_index("    ", i * 8 + j, "", true);
			max_idx = i * 8 + j;
			if (max_idx < cta.preparsed_svds[0].size()) {
				unsigned vic = cta.preparsed_svds[0][max_idx];
				if (cta.preparsed_has_vic[1][vic])
					fail("VIC %u is also a YCbCr 4:2:0-only VIC.\n", vic);
			}
		}
	}
	if (max_idx >= cta.preparsed_svds[0].size())
		fail("Max index %u > %u (#SVDs).\n",
		     max_idx + 1, cta.preparsed_svds[0].size());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testl %edx, %edx
je 0xec2c
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movl %edx, %esi
xorl %edx, %edx
callq 0x5b92
testb %al, %al
je 0xec46
leaq 0x1e97d(%rip), %rdi     # 0x2d586
callq 0x3380
leaq 0x1b4b7(%rip), %rsi     # 0x2a0cc
xorl %edi, %edi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x37ec
leaq 0x1e942(%rip), %rdi     # 0x2d575
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3380
movl %ebp, %eax
movq %rax, (%rsp)
leaq 0x12026(%rip), %r12     # 0x20c79
xorl %eax, %eax
xorl %edx, %edx
movq %r14, 0x8(%rsp)
leal (,%rax,8), %ebp
movq %rax, 0x10(%rsp)
movzbl (%r14,%rax), %r13d
xorl %r14d, %r14d
movl $0x8, %r15d
btl %r14d, %r13d
jae 0xeccc
movq %rbx, %rdi
leaq 0x167c1(%rip), %rsi     # 0x25447
movl %ebp, %edx
movq %r12, %rcx
movl $0x1, %r8d
callq 0xea8c
movq 0x8e0(%rbx), %rax
movq 0x8e8(%rbx), %rcx
subq %rax, %rcx
cmpq %rbp, %rcx
jbe 0xecca
movzbl (%rax,%rbp), %edx
cmpb $0x0, 0x7e0(%rbx,%rdx)
je 0xecca
xorl %edi, %edi
leaq 0x1b420(%rip), %rsi     # 0x2a0e3
xorl %eax, %eax
callq 0x37ec
movl %ebp, %edx
incl %r14d
incq %rbp
decq %r15
jne 0xec76
movq 0x10(%rsp), %rax
incq %rax
cmpq (%rsp), %rax
movq 0x8(%rsp), %r14
jne 0xec5c
movl %edx, %eax
movq 0x8e8(%rbx), %rcx
subq 0x8e0(%rbx), %rcx
cmpq %rax, %rcx
jbe 0xed12
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incl %edx
leaq 0x1b3f0(%rip), %rsi     # 0x2a10b
xorl %edi, %edi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x37ec
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: hdmi_latency2s[abi:cxx11](unsigned char, bool)
static std::string hdmi_latency2s(unsigned char l, bool is_video)
{
	if (!l)
		return "Unknown";
	if (l == 0xff)
		return is_video ? "Video not supported" : "Audio not supported";
	return std::to_string(1 + 2 * l) + " ms";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
cmpl $0xff, %esi
je 0xf46b
testl %esi, %esi
jne 0xf4a5
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x164fc(%rip), %rsi     # 0x2595e
leaq 0x164fc(%rip), %rdx     # 0x25965
jmp 0xf498
leaq 0x1c597(%rip), %rax     # 0x2ba09
leaq 0x1c5a4(%rip), %rsi     # 0x2ba1d
leaq 0x10(%rbx), %rcx
testb %dl, %dl
cmovneq %rax, %rsi
movq %rcx, (%rbx)
leaq 0x1c58f(%rip), %rax     # 0x2ba1c
leaq 0x1c59c(%rip), %rdx     # 0x2ba30
cmovneq %rax, %rdx
movq %rbx, %rdi
callq 0x8f6e
jmp 0xf554
movzbl %sil, %eax
leal 0x1(,%rax,2), %ebp
cmpb $0x32, %al
movl $0x3, %ecx
sbbl $0x0, %ecx
cmpb $0x5, %al
movl $0x1, %r14d
cmovael %ecx, %r14d
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x2d, %edx
callq 0x32a0
movq (%r15), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x8c91
leaq 0x1c53a(%rip), %rsi     # 0x2ba31
movq %r15, %rdi
callq 0x3420
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0xf521
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0xf527
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0xf554
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0xf57d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x3400
nop
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: edid_state::cta_preparse_sldb(unsigned char const*, unsigned int)
void edid_state::cta_preparse_sldb(const unsigned char *x, unsigned length)
{
	cta.has_sldb = true;
	while (length >= 2) {
		if (length >= 5 && (x[0] & 0x40)) {
			cta.preparsed_sld_has_coord = true;
			return;
		}
		length -= 2;
		x += 2;
	}
}

// Assembly:
movb $0x1, 0x2ce(%rdi)
cmpl $0x2, %edx
jb 0x10428
cmpl $0x5, %edx
jb 0x1041c
testb $0x40, (%rsi)
jne 0x10429
addl $-0x2, %edx
addq $0x2, %rsi
cmpl $0x1, %edx
ja 0x10412
retq
movb $0x1, 0x2cc(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: edid_state::cta_displayid_type_7(unsigned char const*, unsigned int)
void edid_state::cta_displayid_type_7(const unsigned char *x, unsigned length)
{
	check_displayid_datablock_revision(x[0], 0x00, 2);

	if (length < 21U + ((x[0] & 0x70) >> 4)) {
		fail("Empty Data Block with length %u.\n", length);
		return;
	}
	parse_displayid_type_1_7_timing(x + 1, true, 2, true);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movzbl (%rsi), %esi
xorl %edx, %edx
movl $0x2, %ecx
callq 0x1627c
movzbl (%r14), %eax
shrl $0x4, %eax
andl $0x7, %eax
addl $0x15, %eax
cmpl %ebx, %eax
jbe 0x1065a
leaq 0x19add(%rip), %rsi     # 0x2a127
xorl %edi, %edi
movl %ebx, %edx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x37ec
incq %r14
movq %r15, %rdi
movq %r14, %rsi
movl $0x1, %edx
movl $0x2, %ecx
movl $0x1, %r8d
popq %rbx
popq %r14
popq %r15
jmp 0x1682e
nop
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: edid_state::cta_displayid_type_8(unsigned char const*, unsigned int)
void edid_state::cta_displayid_type_8(const unsigned char *x, unsigned length)
{
	check_displayid_datablock_revision(x[0], 0xe8, 1);
	if (length < ((x[0] & 0x08) ? 3 : 2)) {
		fail("Empty Data Block with length %u.\n", length);
		return;
	}

	unsigned sz = (x[0] & 0x08) ? 2 : 1;
	unsigned type = x[0] >> 6;

	if (type) {
		fail("Only code type 0 is supported.\n");
		return;
	}

	if (x[0] & 0x20)
		printf("    Also supports YCbCr 4:2:0\n");

	x++;
	length--;
	for (unsigned i = 0; i < length / sz; i++) {
		unsigned id = x[i * sz];

		if (sz == 2)
			id |= x[i * sz + 1] << 8;
		parse_displayid_type_4_8_timing(type, id, true);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movzbl (%rsi), %esi
movl $0xe8, %edx
movl $0x1, %ecx
callq 0x1627c
movzbl (%r14), %eax
movl %eax, %r12d
andl $0x8, %r12d
cmpl $0x1, %r12d
movl $0x3, %ecx
sbbl $0x0, %ecx
cmpl %ebx, %ecx
jbe 0x106de
leaq 0x19a62(%rip), %rsi     # 0x2a127
xorl %edi, %edi
movl %ebx, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x37ec
cmpb $0x40, %al
jae 0x1074a
cmpb $0x20, %al
jb 0x106f2
leaq 0x1d28c(%rip), %rdi     # 0x2d979
callq 0x3380
decl %ebx
movl %r12d, %ebp
shrl $0x3, %ebp
movl %ebp, %ecx
shrl %cl, %ebx
testl %ebx, %ebx
je 0x1073b
xorl %r13d, %r13d
movl %r13d, %eax
movl %ebp, %ecx
shll %cl, %eax
movzbl 0x1(%r14,%rax), %edx
testb %r12b, %r12b
je 0x10724
movl %eax, %eax
movzbl 0x2(%r14,%rax), %eax
shll $0x8, %eax
orl %eax, %edx
movq %r15, %rdi
xorl %esi, %esi
movl $0x1, %ecx
callq 0x1793c
incl %r13d
cmpl %r13d, %ebx
jne 0x10705
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a460(%rip), %rsi     # 0x2abb1
xorl %edi, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x37ec
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: edid_state::cta_displayid_type_10(unsigned char const*, unsigned int)
void edid_state::cta_displayid_type_10(const unsigned char *x, unsigned length)
{
	check_displayid_datablock_revision(x[0], 0x70);
	if (length < 7U + ((x[0] & 0x70) >> 4)) {
		fail("Empty Data Block with length %u.\n", length);
		return;
	}

	unsigned sz = 6U + ((x[0] & 0x70) >> 4);
	x++;
	length--;
	for (unsigned i = 0; i < length / sz; i++)
		parse_displayid_type_10_timing(x + i * sz, true);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movzbl (%rsi), %esi
movl $0x70, %edx
xorl %ecx, %ecx
callq 0x1627c
movzbl (%rbx), %r12d
shrl $0x4, %r12d
andl $0x7, %r12d
leal 0x7(%r12), %eax
cmpl %ebp, %eax
jbe 0x107bf
leaq 0x19981(%rip), %rsi     # 0x2a127
xorl %edi, %edi
movl %ebp, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x37ec
addl $0x6, %r12d
decl %ebp
cmpl %ebp, %r12d
ja 0x107ff
incq %rbx
xorl %r13d, %r13d
movl %ebp, %eax
xorl %edx, %edx
divl %r12d
movl %eax, %r15d
cmpl $0x1, %eax
adcl $0x0, %r15d
negq %r15
movl %r13d, %esi
addq %rbx, %rsi
movq %r14, %rdi
movl $0x1, %edx
callq 0x1a888
addl %r12d, %r13d
incq %r15
jne 0x107e4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: cta_hdr10plus(unsigned char const*, unsigned int)
static void cta_hdr10plus(const unsigned char *x, unsigned length)
{
	printf("    Application Version: %u", x[0]);
	if (length > 1)
		hex_block("  ", x + 1, length - 1);
	else
		printf("\n");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movzbl (%rdi), %esi
leaq 0x19aa8(%rip), %rdi     # 0x2be67
xorl %eax, %eax
callq 0x3030
cmpl $0x2, %ebx
jb 0x123f3
incq %r14
decl %ebx
leaq 0x13072(%rip), %rdi     # 0x25449
movq %r14, %rsi
movl %ebx, %edx
movl $0x1, %ecx
movl $0x10, %r8d
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5bbb
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3310
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: cta_dolby_audio(unsigned char const*, unsigned int)
static void cta_dolby_audio(const unsigned char *x, unsigned length)
{
	unsigned char version = 1 + (x[0] & 0x07);

	printf("    Version: %u (%u bytes)\n", version, length + 5);
	if (x[0] & 0x80)
		printf("    Headphone playback only\n");
	if (x[0] & 0x40)
		printf("    Height speaker zone present\n");
	if (x[0] & 0x20)
		printf("    Surround speaker zone present\n");
	if (x[0] & 0x10)
		printf("    Center speaker zone present\n");
	if (x[1] & 0x01)
		printf("    Supports Dolby MAT PCM decoding at 48 kHz only, does not support TrueHD\n");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movzbl (%rdi), %eax
andl $0x7, %eax
incl %eax
leal 0x5(%rsi), %edx
leaq 0x1945c(%rip), %rdi     # 0x2be83
movl %eax, %esi
xorl %eax, %eax
callq 0x3030
cmpb $0x0, (%rbx)
jns 0x12a41
leaq 0x1b4d7(%rip), %rdi     # 0x2df13
callq 0x3380
testb $0x40, (%rbx)
je 0x12a52
leaq 0x1b4e2(%rip), %rdi     # 0x2df2f
callq 0x3380
testb $0x20, (%rbx)
je 0x12a63
leaq 0x1b4f1(%rip), %rdi     # 0x2df4f
callq 0x3380
testb $0x10, (%rbx)
je 0x12a74
leaq 0x1b502(%rip), %rdi     # 0x2df71
callq 0x3380
testb $0x1, 0x1(%rbx)
jne 0x12a7c
popq %rbx
retq
leaq 0x1b50e(%rip), %rdi     # 0x2df91
popq %rbx
jmp 0x3380
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: edid_state::cta_resolve_svr(__gnu_cxx::__normal_iterator<timings_ext*, std::vector<timings_ext, std::allocator<timings_ext>>>)
void edid_state::cta_resolve_svr(vec_timings_ext::iterator iter)
{
	if (iter->svr() == 254) {
		iter->flags = cta.t8vtdb.flags;
		iter->t = cta.t8vtdb.t;
	} else if (iter->svr() <= 144) {
		iter->flags = cta.vec_dtds[iter->svr() - 129].flags;
		iter->t = cta.vec_dtds[iter->svr() - 129].t;
	} else {
		iter->flags = cta.vec_vtdbs[iter->svr() - 145].flags;
		iter->t = cta.vec_vtdbs[iter->svr() - 145].t;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %eax
cmpl $0xfe, %eax
jne 0x154fa
leaq 0x210(%r14), %r15
addq $0x288, %r14            # imm = 0x288
leaq 0x78(%rbx), %rdi
movq %r14, %rsi
callq 0x3140
jmp 0x15571
leaq 0x78(%rbx), %rdi
cmpl $0x90, %eax
ja 0x1553c
movl $0xffffff7f, %r15d      # imm = 0xFFFFFF7F
addl %r15d, %eax
movq 0x188(%r14), %rcx
imulq $0x98, %rax, %rax
leaq (%rcx,%rax), %rsi
addq $0x78, %rsi
callq 0x3140
addl (%rbx), %r15d
imulq $0x98, %r15, %r15
addq 0x188(%r14), %r15
jmp 0x15571
movl $0xffffff6f, %r15d      # imm = 0xFFFFFF6F
addl %r15d, %eax
movq 0x1a8(%r14), %rcx
imulq $0x98, %rax, %rax
leaq (%rcx,%rax), %rsi
addq $0x78, %rsi
callq 0x3140
addl (%rbx), %r15d
imulq $0x98, %r15, %r15
addq 0x1a8(%r14), %r15
movl $0xa, %ecx
movq %rbx, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x50(%r15), %eax
movl %eax, 0x50(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: edid_state::cta_resolve_svrs()
void edid_state::cta_resolve_svrs()
{
	for (vec_timings_ext::iterator iter = cta.preferred_timings.begin();
	     iter != cta.preferred_timings.end(); ++iter) {
		if (iter->has_svr())
			cta_resolve_svr(iter);
	}

	for (vec_timings_ext::iterator iter = cta.native_timings.begin();
	     iter != cta.native_timings.end(); ++iter) {
		if (iter->has_svr())
			cta_resolve_svr(iter);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x1c0(%rdi), %r14
cmpq 0x1c8(%rdi), %r14
je 0x155cb
cmpl $0x0, (%r14)
je 0x155bb
cmpl $0x0, 0x4(%r14)
jne 0x155bb
movq %rbx, %rdi
movq %r14, %rsi
callq 0x154ca
addq $0x98, %r14
cmpq 0x1c8(%rbx), %r14
jne 0x155a3
movq 0x2a8(%rbx), %r14
cmpq 0x2b0(%rbx), %r14
je 0x155fc
cmpl $0x0, (%r14)
je 0x155f3
cmpl $0x0, 0x4(%r14)
jne 0x155f3
movq %rbx, %rdi
movq %r14, %rsi
callq 0x154ca
addq $0x98, %r14
jmp 0x155d2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::check_displayid_datablock_revision(unsigned char, unsigned char, unsigned char)
void edid_state::check_displayid_datablock_revision(unsigned char hdr,
						    unsigned char valid_flags,
						    unsigned char rev)
{
	unsigned char revision = hdr & 7;
	unsigned char flags = hdr & ~7 & ~valid_flags;

	if (revision != rev)
		warn("Unexpected revision (%u != %u).\n", revision, rev);
	if (flags)
		warn("Unexpected flags (0x%02x).\n", flags);
}

// Assembly:
pushq %rbx
movl %edx, %ebx
notb %bl
andb %sil, %bl
movl %esi, %eax
andb $0x7, %al
andb $-0x8, %bl
cmpb %cl, %al
je 0x162a8
movzbl %cl, %ecx
movzbl %al, %edx
leaq 0x188d4(%rip), %rsi     # 0x2eb70
movl $0x1, %edi
xorl %eax, %eax
callq 0x37ec
testb %bl, %bl
je 0x162c3
movzbl %bl, %edx
leaq 0x188db(%rip), %rsi     # 0x2eb91
movl $0x1, %edi
xorl %eax, %eax
popq %rbx
jmp 0x37ec
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::parse_displayid_product_id(unsigned char const*)
void edid_state::parse_displayid_product_id(const unsigned char *x)
{
	check_displayid_datablock_revision(x[1]);

	dispid.has_product_identification = true;
	if (dispid.version >= 0x20) {
		unsigned oui = (x[3] << 16) | (x[4] << 8) | x[5];
		printf("    Vendor OUI %s\n", ouitohex(oui).c_str());
	} else {
		printf("    Vendor ID: %c%c%c\n", x[3], x[4], x[5]);
	}
	printf("    Product Code: %u\n", x[6] | (x[7] << 8));
	unsigned sn = x[8] | (x[9] << 8) | (x[10] << 16) | (x[11] << 24);
	if (sn) {
		if (hide_serial_numbers)
			printf("    Serial Number: ...\n");
		else
			printf("    Serial Number: %u\n", sn);
	}
	unsigned week = x[12];
	unsigned year = 2000 + x[13];
	printf("    %s: %u",
	       week == 0xff ? "Model Year" : "Year of Manufacture", year);
	if (week && week <= 0x36)
		printf(", Week %u", week);
	printf("\n");
	if (x[14]) {
		char buf[256];

		memcpy(buf, x + 15, x[14]);
		buf[x[14]] = 0;
		printf("    Product ID: %s\n", buf);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rsi, %rbx
movq %rdi, %r14
movzbl 0x1(%rsi), %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1627c
movb $0x1, 0x91e(%r14)
cmpb $0x20, 0x910(%r14)
movzbl 0x3(%rbx), %esi
jb 0x16345
shll $0x10, %esi
movzbl 0x4(%rbx), %eax
shll $0x8, %eax
orl %esi, %eax
movzbl 0x5(%rbx), %esi
orl %eax, %esi
movq %rsp, %r15
movq %r15, %rdi
callq 0x5b32
movq (%r15), %rsi
leaq 0x1888b(%rip), %rdi     # 0x2ebad
xorl %eax, %eax
callq 0x3030
movq (%r15), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1635b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1635b
movzbl 0x4(%rbx), %edx
movzbl 0x5(%rbx), %ecx
leaq 0x1886c(%rip), %rdi     # 0x2ebc0
xorl %eax, %eax
callq 0x3030
movzwl 0x6(%rbx), %esi
leaq 0x18871(%rip), %rdi     # 0x2ebd7
xorl %eax, %eax
callq 0x3030
movl 0x8(%rbx), %esi
testl %esi, %esi
je 0x16397
cmpb $0x1, 0x52(%r14)
jne 0x16389
leaq 0x101ca(%rip), %rdi     # 0x2654c
callq 0x3380
jmp 0x16397
leaq 0xf6e2(%rip), %rdi      # 0x25a72
xorl %eax, %eax
callq 0x3030
movzbl 0xc(%rbx), %r14d
movzbl 0xd(%rbx), %edx
addl $0x7d0, %edx            # imm = 0x7D0
cmpl $0xff, %r14d
leaq 0x18844(%rip), %rax     # 0x2ebf8
leaq 0x18848(%rip), %rsi     # 0x2ec03
cmoveq %rax, %rsi
leaq 0x18827(%rip), %rdi     # 0x2ebed
xorl %eax, %eax
callq 0x3030
leal -0x1(%r14), %eax
cmpb $0x35, %al
ja 0x163e6
leaq 0x1883b(%rip), %rdi     # 0x2ec17
movl %r14d, %esi
xorl %eax, %eax
callq 0x3030
movl $0xa, %edi
callq 0x3310
movzbl 0xe(%rbx), %r14d
testq %r14, %r14
je 0x16425
addq $0xf, %rbx
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x31d0
movb $0x0, (%rsp,%r14)
leaq 0x18806(%rip), %rdi     # 0x2ec21
movq %r15, %rsi
xorl %eax, %eax
callq 0x3030
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::parse_displayid_parameters(unsigned char const*)
void edid_state::parse_displayid_parameters(const unsigned char *x)
{
	check_displayid_datablock_revision(x[1]);

	if (!check_displayid_datablock_length(x, 12, 12))
		return;

	dispid.has_display_parameters = true;
	printf("    Image size: %.1f mm x %.1f mm\n",
	       ((x[4] << 8) + x[3]) / 10.0,
	       ((x[6] << 8) + x[5]) / 10.0);
	printf("    Pixels: %d x %d\n",
	       (x[8] << 8) + x[7], (x[10] << 8) + x[9]);
	print_flag_lines("      ", "    Feature support flags:",
			 x[11], feature_support_flags);

	if (x[12] != 0xff)
		printf("    Gamma: %.2f\n", ((x[12] + 100.0) / 100.0));
	printf("    Aspect ratio: %.2f\n", ((x[13] + 100.0) / 100.0));
	printf("    Dynamic bpc native: %d\n", (x[14] & 0xf) + 1);
	printf("    Dynamic bpc overall: %d\n", ((x[14] >> 4) & 0xf) + 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzbl 0x1(%rsi), %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1627c
movq %rbx, %rdi
movl $0xc, %esi
movl $0xc, %edx
xorl %ecx, %ecx
callq 0x165ab
testb %al, %al
je 0x1659c
movb $0x1, 0x91f(%r14)
movzwl 0x3(%rbx), %eax
cvtsi2sd %eax, %xmm0
movsd 0x1817c(%rip), %xmm2    # 0x2e600
divsd %xmm2, %xmm0
movzwl 0x5(%rbx), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm2, %xmm1
leaq 0x1879a(%rip), %rdi     # 0x2ec35
movb $0x2, %al
callq 0x3030
movzwl 0x7(%rbx), %esi
movzwl 0x9(%rbx), %edx
leaq 0x187a7(%rip), %rdi     # 0x2ec58
xorl %eax, %eax
callq 0x3030
movzbl 0xb(%rbx), %ebp
testl %ebp, %ebp
je 0x16508
leaq 0x187a6(%rip), %rdi     # 0x2ec6d
callq 0x3380
leaq 0x2388d(%rip), %r12     # 0x39d60
leaq 0xec2b(%rip), %r14      # 0x25105
leaq 0xef64(%rip), %r15      # 0x25445
xorl %r13d, %r13d
btl %r13d, %ebp
jae 0x164fb
movq (%r12), %rdx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3030
incq %r13
addq $0x8, %r12
cmpq $0x8, %r13
jne 0x164e4
movb 0xc(%rbx), %al
cmpb $-0x1, %al
je 0x16537
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x9af7(%rip), %xmm1     # 0x20018
addsd %xmm1, %xmm0
divsd %xmm1, %xmm0
leaq 0xf82d(%rip), %rdi      # 0x25d5d
movb $0x1, %al
callq 0x3030
movzbl 0xd(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x9ace(%rip), %xmm1     # 0x20018
addsd %xmm1, %xmm0
divsd %xmm1, %xmm0
leaq 0x1872f(%rip), %rdi     # 0x2ec88
movb $0x1, %al
callq 0x3030
movzbl 0xe(%rbx), %esi
andl $0xf, %esi
incl %esi
leaq 0x18730(%rip), %rdi     # 0x2eca0
xorl %eax, %eax
callq 0x3030
movzbl 0xe(%rbx), %esi
shrl $0x4, %esi
incl %esi
leaq 0x18735(%rip), %rdi     # 0x2ecbc
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3030
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: check_displayid_datablock_length(unsigned char const*, unsigned int, unsigned int, unsigned int)
static bool check_displayid_datablock_length(const unsigned char *x,
					     unsigned expectedlenmin = 0,
					     unsigned expectedlenmax = 128 - 2 - 5 - 3,
					     unsigned payloaddumpstart = 0)
{
	unsigned char len = x[2];

	if (expectedlenmin == expectedlenmax && len != expectedlenmax)
		fail("DisplayID payload length is different than expected (%d != %d).\n", len, expectedlenmax);
	else if (len > expectedlenmax)
		fail("DisplayID payload length is greater than expected (%d > %d).\n", len, expectedlenmax);
	else if (len < expectedlenmin)
		fail("DisplayID payload length is less than expected (%d < %d).\n", len, expectedlenmin);
	else
		return true;

	if (len > payloaddumpstart)
		hex_block("    ", x + 3 + payloaddumpstart, len - payloaddumpstart);
	return false;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebp
movl %edx, %ecx
movl %esi, %r8d
movq %rdi, %r14
movzbl 0x2(%rdi), %ebx
cmpl %edx, %esi
jne 0x165c5
cmpl %ecx, %ebx
jne 0x165e9
cmpl %ecx, %ebx
jbe 0x165d2
leaq 0x1a5b8(%rip), %rsi     # 0x30b88
jmp 0x165f0
movb $0x1, %al
cmpl %r8d, %ebx
jae 0x16624
leaq 0x1a5e6(%rip), %rsi     # 0x30bc6
xorl %edi, %edi
movl %ebx, %edx
movl %r8d, %ecx
jmp 0x165f4
leaq 0x1a557(%rip), %rsi     # 0x30b47
xorl %edi, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x37ec
subl %ebp, %ebx
jbe 0x16622
movl %ebp, %eax
leaq (%r14,%rax), %rsi
addq $0x3, %rsi
leaq 0xee37(%rip), %rdi      # 0x25447
movl %ebx, %edx
movl $0x1, %ecx
movl $0x10, %r8d
callq 0x5bbb
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::parse_displayid_video_timing_range_limits(unsigned char const*)
void edid_state::parse_displayid_video_timing_range_limits(const unsigned char *x)
{
	check_displayid_datablock_revision(x[1]);

	if (!check_displayid_datablock_length(x, 15, 15))
		return;
	printf("    Pixel Clock: %.3f-%.3f MHz\n",
	       (double)((x[3] | (x[4] << 8) | (x[5] << 16)) + 1) / 100.0,
	       (double)((x[6] | (x[7] << 8) | (x[8] << 16)) + 1) / 100.0);
	printf("    Horizontal Frequency: %u-%u kHz\n", x[9], x[10]);
	printf("    Minimum Horizontal Blanking: %u pixels\n", x[11] | (x[12] << 8));
	printf("    Vertical Refresh: %u-%u Hz\n", x[13], x[14]);
	printf("    Minimum Vertical Blanking: %u lines\n", x[15] | (x[16] << 8));
	if (x[17] & 0x80)
		printf("    Supports Interlaced\n");
	if (x[17] & 0x40)
		printf("    Supports CVT\n");
	if (x[17] & 0x20)
		printf("    Supports CVT Reduced Blanking\n");
	if (x[17] & 0x10)
		printf("    Discrete frequency display device\n");
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movzbl 0x1(%rsi), %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1627c
movq %rbx, %rdi
movl $0xf, %esi
movl $0xf, %edx
xorl %ecx, %ecx
callq 0x165ab
testb %al, %al
je 0x17c75
movzwl 0x3(%rbx), %eax
movzbl 0x5(%rbx), %ecx
shll $0x10, %ecx
addl %ecx, %eax
incl %eax
cvtsi2sd %eax, %xmm0
movsd 0x8458(%rip), %xmm2     # 0x20018
divsd %xmm2, %xmm0
movzwl 0x6(%rbx), %eax
movzbl 0x8(%rbx), %ecx
shll $0x10, %ecx
addl %ecx, %eax
incl %eax
cvtsi2sd %eax, %xmm1
divsd %xmm2, %xmm1
leaq 0x17329(%rip), %rdi     # 0x2ef0b
movb $0x2, %al
callq 0x3030
movzbl 0x9(%rbx), %esi
movzbl 0xa(%rbx), %edx
leaq 0x17333(%rip), %rdi     # 0x2ef2b
xorl %eax, %eax
callq 0x3030
movzwl 0xb(%rbx), %esi
leaq 0x17346(%rip), %rdi     # 0x2ef50
xorl %eax, %eax
callq 0x3030
movzbl 0xd(%rbx), %esi
movzbl 0xe(%rbx), %edx
leaq 0x1735c(%rip), %rdi     # 0x2ef7c
xorl %eax, %eax
callq 0x3030
movzwl 0xf(%rbx), %esi
leaq 0x1736a(%rip), %rdi     # 0x2ef9c
xorl %eax, %eax
callq 0x3030
cmpb $0x0, 0x11(%rbx)
jns 0x17c4b
leaq 0x19123(%rip), %rdi     # 0x30d69
callq 0x3380
testb $0x40, 0x11(%rbx)
je 0x17c5d
leaq 0x19129(%rip), %rdi     # 0x30d81
callq 0x3380
testb $0x20, 0x11(%rbx)
je 0x17c6f
leaq 0x19128(%rip), %rdi     # 0x30d92
callq 0x3380
testb $0x10, 0x11(%rbx)
jne 0x17c77
popq %rbx
retq
leaq 0x19136(%rip), %rdi     # 0x30db4
popq %rbx
jmp 0x3380
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::parse_displayid_intf_power_sequencing(unsigned char const*)
void edid_state::parse_displayid_intf_power_sequencing(const unsigned char *x)
{
	check_displayid_datablock_revision(x[1]);

	if (!check_displayid_datablock_length(x, 6, 6))
		return;

	printf("    Power Sequence T1 Range: %.1f-%u.0 ms\n", (x[3] >> 4) / 10.0, (x[3] & 0xf) * 2);
	printf("    Power Sequence T2 Range: 0.0-%u.0 ms\n", (x[4] & 0x3f) * 2);
	printf("    Power Sequence T3 Range: 0.0-%u.0 ms\n", (x[5] & 0x3f) * 2);
	printf("    Power Sequence T4 Min: %u.0 ms\n", (x[6] & 0x7f) * 10);
	printf("    Power Sequence T5 Min: %u.0 ms\n", (x[7] & 0x3f) * 10);
	printf("    Power Sequence T6 Min: %u.0 ms\n", (x[8] & 0x3f) * 10);
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movzbl 0x1(%rsi), %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1627c
movq %rbx, %rdi
movl $0x6, %esi
movl $0x6, %edx
xorl %ecx, %ecx
callq 0x165ab
testb %al, %al
je 0x180b4
movzbl 0x3(%rbx), %esi
movl %esi, %eax
shrl $0x4, %eax
cvtsi2sd %eax, %xmm0
divsd 0x165dc(%rip), %xmm0    # 0x2e600
addl %esi, %esi
andl $0x1e, %esi
leaq 0x1717c(%rip), %rdi     # 0x2f1ac
movb $0x1, %al
callq 0x3030
movzbl 0x4(%rbx), %esi
addl %esi, %esi
andl $0x7e, %esi
leaq 0x17190(%rip), %rdi     # 0x2f1d7
xorl %eax, %eax
callq 0x3030
movzbl 0x5(%rbx), %esi
addl %esi, %esi
andl $0x7e, %esi
leaq 0x171a3(%rip), %rdi     # 0x2f201
xorl %eax, %eax
callq 0x3030
movzbl 0x6(%rbx), %eax
andl $0x7f, %eax
addl %eax, %eax
leal (%rax,%rax,4), %esi
leaq 0x171b3(%rip), %rdi     # 0x2f22b
xorl %eax, %eax
callq 0x3030
movzbl 0x7(%rbx), %eax
andl $0x3f, %eax
addl %eax, %eax
leal (%rax,%rax,4), %esi
leaq 0x171bd(%rip), %rdi     # 0x2f24f
xorl %eax, %eax
callq 0x3030
movzbl 0x8(%rbx), %eax
andl $0x3f, %eax
addl %eax, %eax
leal (%rax,%rax,4), %esi
leaq 0x171c7(%rip), %rdi     # 0x2f273
xorl %eax, %eax
popq %rbx
jmp 0x3030
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: print_flags(char const*, unsigned char, char const**, bool)
static void print_flags(const char *label, unsigned char flag_byte,
			const char **flags, bool reverse = false)
{
	if (!flag_byte)
		return;

	unsigned countflags = 0;

	printf("%s: ", label);
	for (unsigned i = 0; i < 8; i++) {
		if (flag_byte & (1 << (reverse ? 7 - i : i))) {
			if (countflags)
				printf(", ");
			if (flags[i])
				printf("%s", flags[i]);
			else
				printf("Undefined (%u)", i);
			countflags++;
		}
	}
	printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
testl %esi, %esi
je 0x18762
movl %ecx, %ebx
movq %rdx, %r14
movq %rdi, %rsi
leaq 0x192a6(%rip), %rdi     # 0x31983
xorl %eax, %eax
callq 0x3030
movzbl %bpl, %r15d
leaq 0x841f(%rip), %r13      # 0x20b0e
xorl %ebp, %ebp
xorl %r12d, %r12d
movl %ebp, %eax
xorb $0x7, %al
movzbl %al, %eax
testb %bl, %bl
cmovel %ebp, %eax
btl %eax, %r15d
jae 0x18741
testl %r12d, %r12d
je 0x18715
movq %r13, %rdi
xorl %eax, %eax
callq 0x3030
movq (%r14,%rbp,8), %rsi
testq %rsi, %rsi
je 0x1872e
leaq 0x863d(%rip), %rdi      # 0x20d62
xorl %eax, %eax
callq 0x3030
jmp 0x1873e
leaq 0x185bb(%rip), %rdi     # 0x30cf0
movl %ebp, %esi
xorl %eax, %eax
callq 0x3030
incl %r12d
incq %rbp
cmpq $0x8, %rbp
jne 0x186f4
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3310
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop