LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::parse_displayid_ContainerID(unsigned char const*)
void edid_state::parse_displayid_ContainerID(const unsigned char *x)
{
	check_displayid_datablock_revision(x[1]);

	if (check_displayid_datablock_length(x, 16, 16)) {
		x += 3;
		printf("    Container ID: %s\n", containerid2s(x).c_str());
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movzbl 0x1(%rsi), %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1611c
movq %rbx, %rdi
movl $0x10, %esi
movl $0x10, %edx
xorl %ecx, %ecx
callq 0x1644b
testb %al, %al
je 0x1a774
addq $0x3, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x590d
movq (%r14), %rsi
leaq 0x12c89(%rip), %rdi     # 0x2d3dc
xorl %eax, %eax
callq 0x3030
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1a774
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3260
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::parse_displayid_vesa(unsigned char const*)
void edid_state::parse_displayid_vesa(const unsigned char *x)
{
	check_displayid_datablock_revision(x[1]);

	if (!check_displayid_datablock_length(x, 5, 7))
		return;

	unsigned len = x[2];
	x += 6;
	printf("    Data Structure Type: ");
	switch (x[0] & 0x07) {
	case 0x00: printf("eDP\n"); break;
	case 0x01: printf("DP\n"); break;
	default: printf("Reserved\n"); break;
	}
	printf("    Default Colorspace and EOTF Handling: %s\n",
	       (x[0] & 0x80) ? "Native as specified in the Display Parameters DB" : "sRGB");
	printf("    Number of Pixels in Hor Pix Cnt Overlapping an Adjacent Panel: %u\n",
	       x[1] & 0xf);
	printf("    Multi-SST Operation: ");
	switch ((x[1] >> 5) & 0x03) {
	case 0x00: printf("Not Supported\n"); break;
	case 0x01: printf("Two Streams (number of links shall be 2 or 4)\n"); break;
	case 0x02: printf("Four Streams (number of links shall be 4)\n"); break;
	case 0x03: printf("Reserved\n"); break;
	}
	if (len >= 7) {
		double bpp = (x[2] & 0x3f) + (x[3] & 0x0f) / 16.0;
		printf("    Pass through timing's target DSC bits per pixel: %.4f\n", bpp);
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movzbl 0x1(%rsi), %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1611c
movq %rbx, %rdi
movl $0x5, %esi
movl $0x7, %edx
xorl %ecx, %ecx
callq 0x1644b
testb %al, %al
je 0x1ae75
movb 0x2(%rbx), %bpl
leaq 0x151b7(%rip), %rdi     # 0x2ff57
xorl %eax, %eax
callq 0x3030
movb 0x6(%rbx), %al
andb $0x7, %al
cmpb $0x1, %al
leaq 0x16ab7(%rip), %rcx     # 0x3186c
leaq 0x16804(%rip), %rdx     # 0x315c0
cmoveq %rcx, %rdx
testb %al, %al
leaq 0x16aa2(%rip), %rdi     # 0x3186b
cmovneq %rdx, %rdi
callq 0x3380
cmpb $0x0, 0x6(%rbx)
leaq 0x151f3(%rip), %rax     # 0x2ffd0
leaq 0x151bb(%rip), %rsi     # 0x2ff9f
cmovnsq %rax, %rsi
leaq 0x15182(%rip), %rdi     # 0x2ff71
xorl %eax, %eax
callq 0x3030
movzbl 0x7(%rbx), %esi
andl $0xf, %esi
leaq 0x151d1(%rip), %rdi     # 0x2ffd5
xorl %eax, %eax
callq 0x3030
leaq 0x1520a(%rip), %rdi     # 0x3001c
xorl %eax, %eax
callq 0x3030
movzbl 0x7(%rbx), %eax
shrl $0x3, %eax
andl $0xc, %eax
leaq 0x13d5e(%rip), %rcx     # 0x2eb88
movslq (%rax,%rcx), %rdi
addq %rcx, %rdi
callq 0x3380
cmpb $0x7, %bpl
jb 0x1ae75
movb 0x8(%rbx), %al
movb 0x9(%rbx), %cl
andb $0x3f, %al
movzbl %al, %eax
cvtsi2sd %eax, %xmm1
andb $0xf, %cl
movzbl %cl, %eax
cvtsi2sd %eax, %xmm0
mulsd 0x137f3(%rip), %xmm0    # 0x2e650
addsd %xmm1, %xmm0
leaq 0x151ce(%rip), %rdi     # 0x30036
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3030
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::parse_displayid_cta_data_block(unsigned char const*)
void edid_state::parse_displayid_cta_data_block(const unsigned char *x)
{
	check_displayid_datablock_revision(x[1]);

	unsigned len = x[2];
	unsigned i;

	if (len > 248) {
		fail("Length is > 248.\n");
		len = 248;
	}
	x += 3;

	for (i = 0; i < len; i += (x[i] & 0x1f) + 1) {
		unsigned tag = (x[i] & 0xe0) << 3;

		if (tag == 0x700)
			tag |= x[i + 1];
		bool duplicate = dispid.found_tags.find(tag) != dispid.found_tags.end();

		cta_block(x + i, duplicate);
		if (!duplicate)
			dispid.found_tags.insert(tag);
	}

	if (i != len)
		fail("Length is %u instead of %u.\n", len, i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movzbl 0x1(%rsi), %esi
xorl %ebp, %ebp
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1611c
movzbl 0x2(%rbx), %r12d
cmpl $0xf9, %r12d
jb 0x1aec5
leaq 0x151bd(%rip), %rsi     # 0x30071
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
movl $0xf8, %r12d
jmp 0x1aed4
movl $0x0, %r15d
testl %r12d, %r12d
je 0x1afb5
addq $0x3, %rbx
leaq 0x948(%r14), %rax
movq %rax, 0x20(%rsp)
leaq 0x950(%r14), %rax
movq %rax, 0x10(%rsp)
xorl %r15d, %r15d
movq %rbx, 0x18(%rsp)
movl %r15d, %eax
leaq (%rbx,%rax), %rbp
movzbl (%rbx,%rax), %eax
movl %eax, %r13d
andl $-0x20, %r13d
shll $0x3, %r13d
movl %r13d, 0xc(%rsp)
cmpb $-0x20, %al
jb 0x1af28
movzbl 0x1(%rbp), %r13d
orl $0x700, %r13d           # imm = 0x700
movl %r13d, 0xc(%rsp)
movq 0x958(%r14), %rax
testq %rax, %rax
je 0x1af80
movq 0x10(%rsp), %rcx
xorl %edx, %edx
cmpl %r13d, 0x20(%rax)
setb %dl
cmovaeq %rax, %rcx
movq 0x10(%rax,%rdx,8), %rax
testq %rax, %rax
jne 0x1af39
cmpq 0x10(%rsp), %rcx
je 0x1af80
movl %r12d, %ebx
movl 0x20(%rcx), %r12d
xorl %edx, %edx
cmpl %r12d, %r13d
setae %dl
movq %r14, %rdi
movq %rbp, %rsi
callq 0x12cda
cmpl %r12d, %r13d
movl %ebx, %r12d
movq 0x18(%rsp), %rbx
jb 0x1af8d
jmp 0x1af9c
movq %r14, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x12cda
movq 0x20(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x1600c
movzbl (%rbp), %eax
andl $0x1f, %eax
addl %eax, %r15d
incl %r15d
cmpl %r12d, %r15d
jb 0x1aef8
movl %r12d, %ebp
cmpl %ebp, %r15d
je 0x1afcf
leaq 0x150c2(%rip), %rsi     # 0x30083
xorl %edi, %edi
movl %ebp, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x37cc
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::preparse_displayid_block(unsigned char const*)
void edid_state::preparse_displayid_block(const unsigned char *x)
{
	unsigned length = x[2];

	if (length > 121)
		length = 121;

	unsigned offset = 5;

	dispid.preparsed_displayid_blocks++;
	while (length > 0) {
		unsigned tag = x[offset];
		unsigned len = x[offset + 2];

		switch (tag) {
		case 0x02:
			dispid.preparsed_color_ids |= 1 << ((x[offset + 1] >> 3) & 0x0f);
			break;
		case 0x0e:
			dispid.preparsed_xfer_ids |= 1 << ((x[offset + 1] >> 4) & 0x0f);
			break;
		default:
			break;
		}

		if (length < 3)
			break;

		if (length < len + 3)
			break;

		if (!tag && !len)
			break;

		length -= len + 3;
		offset += len + 3;
	}
}

// Assembly:
movb 0x2(%rsi), %al
incl 0x918(%rdi)
testb %al, %al
je 0x1b6de
movzbl %al, %ecx
cmpb $0x79, %al
movl $0x79, %eax
cmovbl %ecx, %eax
movzbl %al, %eax
movzwl 0x912(%rdi), %ecx
movzwl 0x914(%rdi), %edx
movl $0x5, %r8d
movl %r8d, %r9d
movzbl (%rsi,%r9), %r9d
leal 0x2(%r8), %r10d
movzbl (%rsi,%r10), %r10d
cmpl $0xe, %r9d
je 0x1b6ab
cmpl $0x2, %r9d
jne 0x1b6c3
leal 0x1(%r8), %r11d
movb (%rsi,%r11), %r11b
shrb $0x3, %r11b
andb $0xf, %r11b
btsl %r11d, %ecx
movw %cx, 0x912(%rdi)
jmp 0x1b6c3
leal 0x1(%r8), %r11d
movzbl (%rsi,%r11), %r11d
shrl $0x4, %r11d
btsl %r11d, %edx
movw %dx, 0x914(%rdi)
cmpl $0x3, %eax
jb 0x1b6de
leal 0x3(%r10), %r11d
cmpl %r11d, %eax
jb 0x1b6de
orb %r9b, %r10b
je 0x1b6de
addl %r11d, %r8d
subl %r11d, %eax
jne 0x1b671
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::check_displayid_blocks()
void edid_state::check_displayid_blocks()
{
	data_block = "DisplayID";
	if (!dispid.has_product_identification)
		fail("Missing DisplayID Product Identification Data Block.\n");
	if (dispid.is_display && !dispid.has_display_parameters)
		fail("Missing DisplayID Display Parameters Data Block.\n");
	if (dispid.is_display && !dispid.has_display_interface_features)
		fail("Missing DisplayID Display Interface Features Data Block.\n");
	if (dispid.is_display && !dispid.has_type_1_7)
		fail("Missing DisplayID Type %s Detailed Timing Data Block.\n",
		     dispid.version >= 0x20 ? "VII" : "I");
	if (dispid.preferred_timings.empty())
		fail("DisplayID expects at least one preferred timing.\n");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x30, %rdi
movq 0x38(%rbx), %rdx
leaq 0x13815(%rip), %rcx     # 0x30a6e
movl $0x9, %r8d
xorl %esi, %esi
callq 0x3390
cmpb $0x0, 0x91e(%rbx)
jne 0x1d27f
leaq 0x13802(%rip), %rsi     # 0x30a78
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
movb 0x91d(%rbx), %al
cmpb $0x1, %al
jne 0x1d2a8
cmpb $0x0, 0x91f(%rbx)
jne 0x1d2a8
leaq 0x13815(%rip), %rsi     # 0x30aae
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
movb 0x91d(%rbx), %al
testb $0x1, %al
je 0x1d2cb
cmpb $0x0, 0x921(%rbx)
jne 0x1d2cb
leaq 0x13824(%rip), %rsi     # 0x30ae0
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
movb 0x91d(%rbx), %al
testb $0x1, %al
je 0x1d301
cmpb $0x0, 0x920(%rbx)
jne 0x1d301
cmpb $0x20, 0x910(%rbx)
leaq 0x1386b(%rip), %rax     # 0x30b51
leaq 0x102e8(%rip), %rdx     # 0x2d5d5
cmovaeq %rax, %rdx
leaq 0x13822(%rip), %rsi     # 0x30b1a
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
movq 0x928(%rbx), %rax
cmpq 0x930(%rbx), %rax
je 0x1d313
popq %rbx
retq
leaq 0x1383b(%rip), %rsi     # 0x30b55
xorl %edi, %edi
xorl %eax, %eax
popq %rbx
jmp 0x37cc
// File: /workspace/github_cpp_makefile_star2_O3/rpavlik[P]edid-decode/parse-ls-ext-block.cpp
// Function: edid_state::parse_string_table(unsigned char const*)
void edid_state::parse_string_table(const unsigned char *x)
{
	printf("  UTF Type: ");
	switch (x[0] & 7) {
	case 0: printf("UTF 8\n"); break;
	case 1: printf("UTF 16BE\n"); break;
	case 2: printf("UTF 32BE\n"); break;
	default:
		printf("Unknown (0x%02x)\n", x[0] & 7);
		fail("Unknown UTF Type (0x%02x).\n", x[0] & 7);
		break;
	}
	printf("  Country Code ID (ISO 3166-3): %u\n", ((x[1] & 0x3f) << 8) | x[2]);

	if (x[3] || x[4]) {
		char name[4];

		name[0] = ((x[3] & 0x7c) >> 2) + '@';
		name[1] = ((x[3] & 0x03) << 3) + ((x[4] & 0xe0) >> 5) + '@';
		name[2] = (x[4] & 0x1f) + '@';
		name[3] = 0;
		if (name[0] == '@') name[0] = ' ';
		if (name[1] == '@') name[1] = ' ';
		if (name[2] == '@') name[2] = ' ';
		printf("  Language ID: '%s'\n", name);
	}
	x += 5;
	parse_string("Manufacturer Name", x);
	x += x[0] + 1;
	parse_string("Model Name", x);
	x += x[0] + 1;
	if (hide_serial_numbers)
		printf("  Serial Number: ...\n");
	else
		parse_string("Serial Number", x);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x14509(%rip), %rdi     # 0x318f2
xorl %eax, %eax
callq 0x3030
movzbl (%r14), %esi
andl $0x7, %esi
cmpl $0x2, %esi
je 0x1d417
cmpl $0x1, %esi
je 0x1d40e
testl %esi, %esi
jne 0x1d425
leaq 0x145ce(%rip), %rdi     # 0x319da
jmp 0x1d41e
leaq 0x145bc(%rip), %rdi     # 0x319d1
jmp 0x1d41e
leaq 0x145aa(%rip), %rdi     # 0x319c8
callq 0x3380
jmp 0x1d44a
leaq 0x7ae0(%rip), %rdi      # 0x24f0c
xorl %eax, %eax
callq 0x3030
movzbl (%r14), %edx
andl $0x7, %edx
leaq 0x144be(%rip), %rsi     # 0x318ff
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
movzbl 0x1(%r14), %eax
andl $0x3f, %eax
shll $0x8, %eax
movzbl 0x2(%r14), %esi
orl %eax, %esi
leaq 0x144b8(%rip), %rdi     # 0x3191b
xorl %eax, %eax
callq 0x3030
movb 0x3(%r14), %cl
movb 0x4(%r14), %al
movl %ecx, %edx
orb %al, %dl
je 0x1d4dc
movl %ecx, %edx
shrb $0x2, %dl
andb $0x1f, %dl
leal 0x40(%rdx), %esi
movb %sil, 0x4(%rsp)
movl %eax, %esi
shrb $0x5, %sil
shlb $0x3, %cl
orb %sil, %cl
andb $0x1f, %cl
leal 0x40(%rcx), %esi
movb %sil, 0x5(%rsp)
andb $0x1f, %al
leal 0x40(%rax), %esi
movb %sil, 0x6(%rsp)
movb $0x0, 0x7(%rsp)
testb %dl, %dl
jne 0x1d4b7
movb $0x20, 0x4(%rsp)
testb %cl, %cl
jne 0x1d4c0
movb $0x20, 0x5(%rsp)
testb %al, %al
jne 0x1d4c9
movb $0x20, 0x6(%rsp)
leaq 0x1446f(%rip), %rdi     # 0x3193f
leaq 0x4(%rsp), %rsi
xorl %eax, %eax
callq 0x3030
leaq 0x5(%r14), %rsi
leaq 0x1446d(%rip), %rdi     # 0x31954
callq 0x1d53a
movzbl 0x5(%r14), %eax
addq %rax, %r14
addq $0x6, %r14
leaq 0x14467(%rip), %rdi     # 0x31966
movq %r14, %rsi
callq 0x1d53a
cmpb $0x1, 0x52(%rbx)
jne 0x1d51b
leaq 0x908a(%rip), %rdi      # 0x2659e
callq 0x3380
jmp 0x1d532
movzbl (%r14), %eax
leaq (%r14,%rax), %rsi
incq %rsi
leaq 0x8429(%rip), %rdi      # 0x25956
callq 0x1d53a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rpavlik[P]edid-decode/parse-ls-ext-block.cpp
// Function: edid_state::parse_ls_ext_block(unsigned char const*)
void edid_state::parse_ls_ext_block(const unsigned char *x)
{
	const unsigned char *orig = x;

	printf("  Version: %u.%u\n  Unicode Version: %u.%u.%u\n",
	       x[1], x[2], (x[3] >> 4), x[3] & 0x0f, x[4]);
	x += 5;

	while (x[0] && x + x[0] < orig + 127) {
		parse_string_table(x + 1);
		x += x[0];
	}
	if (!memchk(x, orig + 127 - x)) {
		data_block.clear();
		fail("Non-zero values in unused space.\n");
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movzbl 0x1(%rsi), %esi
movzbl 0x2(%r14), %edx
movzbl 0x3(%r14), %r8d
movl %r8d, %ecx
shrl $0x4, %ecx
andl $0xf, %r8d
movzbl 0x4(%r14), %r9d
leaq 0x143cb(%rip), %rdi     # 0x31971
xorl %eax, %eax
callq 0x3030
leaq 0x5(%r14), %r15
movb 0x5(%r14), %al
decb %al
movl $0x7a, %esi
cmpb $0x78, %al
ja 0x1d5f9
movl $0x5, %eax
movq %rax, %r12
leaq 0x1(%r15), %rsi
movq %rbx, %rdi
callq 0x1d3d8
movzbl (%r15), %eax
addq %r12, %rax
leaq (%r14,%rax), %r15
movzbl (%r14,%rax), %ecx
testq %rcx, %rcx
je 0x1d5f2
addq %rax, %rcx
cmpq $0x7f, %rcx
jb 0x1d5c5
movl $0x7f, %esi
subl %eax, %esi
movq %r15, %rdi
xorl %edx, %edx
callq 0x5ba5
testb %al, %al
je 0x1d613
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq $0x0, 0x38(%rbx)
movq 0x30(%rbx), %rax
movb $0x0, (%rax)
leaq 0x14376(%rip), %rsi     # 0x3199f
xorl %edi, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x37cc
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/rpavlik[P]edid-decode/parse-di-ext-block.cpp
// Function: edid_state::parse_di_ext_block(unsigned char const*)
void edid_state::parse_di_ext_block(const unsigned char *x)
{
	printf("  Version: %u\n", x[1]);
	if (!x[1])
		fail("Invalid version 0.\n");

	parse_digital_interface(x);
	parse_display_device(x);
	parse_display_caps(x);
	if (!memchk(x + 0x27, 16))
		fail("Bytes 0x27-0x36 should be 0.\n");
	if (!memchk(x + 0x37, 17))
		fail("Bytes 0x37-0x47 should be 0.\n");
	if (!memchk(x + 0x48, 9))
		fail("Bytes 0x48-0x50 should be 0.\n");
	parse_display_xfer(x);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzbl 0x1(%rsi), %esi
leaq 0xdb98(%rip), %rdi      # 0x2c739
xorl %eax, %eax
callq 0x3030
cmpb $0x0, 0x1(%rbx)
jne 0x1ebbe
leaq 0x14026(%rip), %rsi     # 0x32bdb
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1d640
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1dc70
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1df66
leaq 0x27(%rbx), %rdi
movl $0x10, %esi
xorl %edx, %edx
callq 0x5ba5
testb %al, %al
jne 0x1ec03
leaq 0x13ff5(%rip), %rsi     # 0x32bef
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
leaq 0x37(%rbx), %rdi
movl $0x11, %esi
xorl %edx, %edx
callq 0x5ba5
testb %al, %al
jne 0x1ec27
leaq 0x13fef(%rip), %rsi     # 0x32c0d
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
leaq 0x48(%rbx), %rdi
movl $0x9, %esi
xorl %edx, %edx
callq 0x5ba5
testb %al, %al
jne 0x1ec4b
leaq 0x13fe9(%rip), %rsi     # 0x32c2b
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1e910
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/rpavlik[P]edid-decode/parse-vtb-ext-block.cpp
// Function: edid_state::parse_vtb_ext_block(unsigned char const*)
void edid_state::parse_vtb_ext_block(const unsigned char *x)
{
	printf("  Version: %u\n", x[1]);
	if (x[1] != 1)
		fail("Invalid version %u.\n", x[1]);

	unsigned num_dtd = x[2];
	unsigned num_cvt = x[3];
	unsigned num_st = x[4];

	x += 5;
	if (num_dtd) {
		printf("  Detailed Timing Descriptors:\n");
		for (unsigned i = 0; i < num_dtd; i++, x += 18)
			detailed_timings("    ", x, false);
	}
	if (num_cvt) {
		printf("  Coordinated Video Timings:\n");
		for (unsigned i = 0; i < num_cvt; i++, x += 3)
			detailed_cvt_descriptor("    ", x, false);
	}
	if (num_st) {
		// Note: the VTB-EXT standard has a mistake in the example EDID
		// that it provides: there the refresh rate (bits 5-0 of the
		// second byte) is set to 60 for 60 Hz, but this should be 0
		// since the actual refresh rate is the value + 60.
		//
		// The documentation itself is correct, though.
		printf("  Standard Timings:\n");
		for (unsigned i = 0; i < num_st; i++, x += 2)
			print_standard_timing("    ", x[0], x[1], true);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movzbl 0x1(%rsi), %esi
leaq 0xdabd(%rip), %rdi      # 0x2c739
xorl %eax, %eax
callq 0x3030
movzbl 0x1(%r15), %edx
cmpl $0x1, %edx
je 0x1ec9d
leaq 0x146d7(%rip), %rsi     # 0x3336b
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
movzbl 0x2(%r15), %r13d
leaq 0x5(%r15), %r14
movzbl 0x3(%r15), %ebp
movzbl 0x4(%r15), %r12d
testl %r13d, %r13d
je 0x1ece1
leaq 0x146c4(%rip), %rdi     # 0x33380
callq 0x3380
leaq 0x67cf(%rip), %r15      # 0x25497
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0xb13c
addq $0x12, %r14
decl %r13d
jne 0x1ecc8
testl %ebp, %ebp
je 0x1ed10
leaq 0x146b3(%rip), %rdi     # 0x3339f
callq 0x3380
leaq 0x679f(%rip), %r15      # 0x25497
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x9be4
addq $0x3, %r14
decl %ebp
jne 0x1ecf8
testq %r12, %r12
je 0x1ed52
leaq 0x146a0(%rip), %rdi     # 0x333bc
callq 0x3380
xorl %r13d, %r13d
leaq 0x676c(%rip), %r15      # 0x25497
movzbl (%r14,%r13,2), %edx
movzbl 0x1(%r14,%r13,2), %ecx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0xa024
incq %r13
cmpl %r13d, %r12d
jne 0x1ed2b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/rpavlik[P]edid-decode/calc-gtf-cvt.cpp
// Function: edid_state::edid_gtf_mode(unsigned int, timings&)
void edid_state::edid_gtf_mode(unsigned refresh, struct timings &t)
{
	unsigned hratio = t.hratio;
	unsigned vratio = t.vratio;
	t = calc_gtf_mode(t.hact, t.vact, refresh, t.interlaced);
	t.hratio = hratio;
	t.vratio = vratio;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdx, %rbx
movl (%rdx), %edx
movl 0x4(%rbx), %ecx
movl %esi, %eax
cvtsi2sd %rax, %xmm0
movzbl 0x18(%rbx), %r8d
movq 0x8(%rbx), %r15
xorl %eax, %eax
leaq 0xc(%rsp), %r14
movsd 0xd3e(%rip), %xmm1      # 0x20058
movsd 0xd2e(%rip), %xmm2      # 0x20050
movsd 0xd1e(%rip), %xmm3      # 0x20048
movsd 0xd0e(%rip), %xmm4      # 0x20040
movq %r14, %rdi
movl $0x1, %r9d
pushq %rax
pushq %rax
callq 0x1ed64
addq $0x10, %rsp
movl $0x15, %ecx
movq %rbx, %rdi
movq %r14, %rsi
rep  movsl (%rsi), %es:(%rdi)
movq %r15, 0x8(%rbx)
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rpavlik[P]edid-decode/calc-gtf-cvt.cpp
// Function: edid_state::edid_cvt_mode(unsigned int, timings&)
void edid_state::edid_cvt_mode(unsigned refresh, struct timings &t)
{
	unsigned hratio = t.hratio;
	unsigned vratio = t.vratio;

	t = calc_cvt_mode(t.hact, t.vact, refresh, t.rb & ~RB_ALT, t.interlaced,
			  false, t.rb & RB_ALT);
	t.hratio = hratio;
	t.vratio = vratio;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdx, %rbx
movl (%rdx), %edx
movl 0x4(%rbx), %ecx
movl %esi, %eax
cvtsi2sd %rax, %xmm0
movl 0x14(%rbx), %eax
movl %eax, %r8d
andl $0xffffff7f, %r8d       # imm = 0xFFFFFF7F
movzbl 0x18(%rbx), %r9d
movq 0x8(%rbx), %r15
shrb $0x7, %al
movzbl %al, %eax
leaq 0xc(%rsp), %r14
movq %r14, %rdi
pushq %rax
pushq $0x0
callq 0x1f362
addq $0x10, %rsp
movl $0x15, %ecx
movq %rbx, %rdi
movq %r14, %rsi
rep  movsl (%rsi), %es:(%rdi)
movq %r15, 0x8(%rbx)
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/0918nobita[P]algorithm/polynomial1.cc
// Function: main
int main() {
  int X0, N;
  std::cin >> X0 >> N;
  std::vector<int> S(N);

  for (int i = 0; i < N; i++) {
    int a;
    std::cin >> a;
    S[i] = a * std::pow(X0, i);
  }

  std::cout << std::accumulate(S.begin(), S.end(), 0) << std::endl;

  return EXIT_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq 0x2d74(%rip), %rdi      # 0x3fe0
leaq 0xc(%rsp), %rsi
callq 0x1070
leaq 0x8(%rsp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1070
movslq (%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0x1394
cmpl $0x0, (%rbx)
jle 0x12fe
xorl %r15d, %r15d
movq 0x2d39(%rip), %rbx      # 0x3fe0
leaq 0x4(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1070
xorps %xmm0, %xmm0
cvtsi2sdl 0x4(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0xc(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r15d, %xmm1
callq 0x1100
mulsd 0x28(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
movq 0x10(%rsp), %rax
movl %ecx, (%rax,%r15,4)
incq %r15
movslq 0x8(%rsp), %rcx
cmpq %rcx, %r15
jl 0x12ac
jmp 0x1303
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
xorl %esi, %esi
cmpq %rcx, %rax
je 0x1317
addl (%rax), %esi
addq $0x4, %rax
jmp 0x130a
movq 0x2cb2(%rip), %rdi      # 0x3fd0
callq 0x10f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1364
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x10d0
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x1372
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x138c
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x10d0
movq %rbx, %rdi
callq 0x1110
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/config.cpp
// Function: Config::getString(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string Config::getString(const char *key, const std::string &def)
{
    auto conf = config.find(key);

    if (conf == config.end()) {
        config[key] = def;
    }

    return config[key];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %r15, %rsi
callq 0xa8ae
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xb31a
movq %rax, %r13
leaq 0x18(%rsp), %rbp
movq -0x10(%rbp), %rdi
cmpq %rbp, %rdi
je 0xa46d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x65c0
leaq 0x8(%r14), %rax
cmpq %rax, %r13
jne 0xa4b7
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %r15, %rsi
callq 0xa8ae
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xaafe
movq %rax, %rdi
movq %r12, %rsi
callq 0x6340
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xa4b7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x65c0
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %r15, %rsi
callq 0xa8ae
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xaafe
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0xaf06
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xa506
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x65c0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa531
jmp 0xa536
jmp 0xa531
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0xa543
jmp 0xa550
movq %rax, %rbx
jmp 0xa550
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xa550
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x65c0
movq %rbx, %rdi
callq 0x6a80
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/ui/ui.cpp
// Function: Ui::Ui()
Ui::Ui()
{
    disconnect = false;
    running = false;
    current_tab = nullptr;
    window = nullptr;
    statusbar = nullptr;
    width = 0;
    height = 0;
    tab_index = 0;
    hide_indicator = false;
    hide_top = false;
    hide_bottom = false;
    static_bar = false;
}

// Assembly:
leaq 0xc5b9(%rip), %rax      # 0x17ac0
movq %rax, (%rdi)
movl $0x30, %eax
leaq (%rdi,%rax), %rcx
movq %rcx, -0x10(%rdi,%rax)
movq $0x0, -0x8(%rdi,%rax)
movb $0x0, (%rdi,%rax)
addq $0x20, %rax
cmpq $0xf0, %rax
jne 0xb50f
leaq 0xf0(%rdi), %rax
movq %rax, 0xe0(%rdi)
xorl %eax, %eax
movq %rax, 0xe8(%rdi)
movb $0x0, 0xf0(%rdi)
movups 0xc57a(%rip), %xmm0     # 0x17ad0
movups %xmm0, 0x108(%rdi)
movups 0xc57c(%rip), %xmm0     # 0x17ae0
movups %xmm0, 0x118(%rdi)
movq 0xc57e(%rip), %rcx      # 0x17af0
movq %rcx, 0x128(%rdi)
movq %rax, 0x138(%rdi)
movl %eax, 0x130(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movq %rax, 0x18(%rdi)
movl %eax, 0x100(%rdi)
movw $0x0, 0x104(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa_object.cpp
// Function: PaObject::set_volume(float)
void PaObject::set_volume(float perc)
{

    if (pa_set_volume != nullptr) {
        pa_threaded_mainloop_lock(pulse.pa_ml);

        int vol = (PA_VOLUME_NORM * perc);
        pa_cvolume cvol;

        pa_cvolume_init(&cvol);
        pa_cvolume_set(&cvol, channels, vol);


        pa_operation *o = pa_set_volume(
                              pulse.pa_ctx,
                              index,
                              &cvol,
                              NULL,
                              NULL
                          );
        pa_operation_unref(o);
        pa_threaded_mainloop_unlock(pulse.pa_ml);
    }
}

// Assembly:
cmpq $0x0, 0x250(%rdi)
je 0x7651
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
leaq 0x1102f(%rip), %r15     # 0x18608
movq 0x158(%r15), %rdi
movss %xmm0, (%rsp)
callq 0x60c0
movss (%rsp), %xmm0
mulss 0x9bc1(%rip), %xmm0     # 0x111b8
cvttss2si %xmm0, %ebp
leaq 0x4(%rsp), %r14
movq %r14, %rdi
callq 0x6980
movl 0x210(%rbx), %esi
movq %r14, %rdi
movl %ebp, %edx
callq 0x6af0
movq 0x150(%r15), %rdi
movl 0xc(%rbx), %esi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq *0x250(%rbx)
movq %rax, %rdi
callq 0x6650
movq 0x158(%r15), %rdi
callq 0x6180
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa_object.cpp
// Function: PaObject::toggle_mute()
void PaObject::toggle_mute()
{
    if (pa_set_mute != nullptr) {
        pa_operation *o = pa_set_mute(
                              pulse.pa_ctx,
                              index,
                              !mute,
                              NULL,
                              NULL
                          );
        pa_operation_unref(o);
    }
}

// Assembly:
movq 0x258(%rdi), %r9
testq %r9, %r9
je 0x76c6
pushq %rax
leaq 0x10f6a(%rip), %rax     # 0x18608
movq 0x150(%rax), %rax
movl 0xc(%rdi), %esi
movzbl 0x218(%rdi), %edx
xorl $0x1, %edx
movq %rax, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq *%r9
movq %rax, %rdi
popq %rax
jmp 0x6650
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa_object.cpp
// Function: PaObject::move(unsigned int)
void PaObject::move(uint32_t dest)
{
    if (pa_move != nullptr) {
        pa_operation *o = pa_move(
                              pulse.pa_ctx,
                              index,
                              dest,
                              NULL,
                              NULL
                          );
        pa_operation_unref(o);
    }
}

// Assembly:
movq 0x260(%rdi), %r9
testq %r9, %r9
je 0x76fc
pushq %rax
movl %esi, %edx
leaq 0x10f2a(%rip), %rax     # 0x18608
movq 0x150(%rax), %rax
movl 0xc(%rdi), %esi
movq %rax, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq *%r9
movq %rax, %rdi
popq %rax
jmp 0x6650
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa_object.cpp
// Function: PaObject::set_active_attribute(char const*)
void PaObject::set_active_attribute(const char *name)
{
    if (pa_set_active_attribute != nullptr) {
        pa_operation *o = pa_set_active_attribute(
                              pulse.pa_ctx,
                              index,
                              name,
                              NULL,
                              NULL
                          );
        pa_operation_unref(o);
    }
}

// Assembly:
movq 0x268(%rdi), %r9
testq %r9, %r9
je 0x7733
pushq %rax
movq %rsi, %rdx
leaq 0x10ef3(%rip), %rax     # 0x18608
movq 0x150(%rax), %rax
movl 0xc(%rdi), %esi
movq %rax, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq *%r9
movq %rax, %rdi
popq %rax
jmp 0x6650
retq
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa_object.cpp
// Function: PaObject::set_default(char const*)
void PaObject::set_default(const char *name)
{
    if (pa_set_default != nullptr) {
        pa_operation *o = pa_set_default(
                              pulse.pa_ctx,
                              name,
                              NULL,
                              NULL
                          );
        pa_operation_unref(o);
    }
}

// Assembly:
movq 0x270(%rdi), %rax
testq %rax, %rax
je 0x775e
pushq %rax
leaq 0x10ec0(%rip), %rcx     # 0x18608
movq 0x150(%rcx), %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq *%rax
movq %rax, %rdi
popq %rax
jmp 0x6650
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa_object.cpp
// Function: PaObject::getRelation()
uint32_t PaObject::getRelation()
{
    if (active_attribute != nullptr) {
        for (uint32_t j = 0; j < attributes.size(); j++) {
            int current = strcmp(attributes[j]->name, active_attribute->name);

            if (current == 0) {
                return j;
            }
        }
    }

    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x230(%rdi), %r14
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %r14, %r14
je 0x77b9
movq 0x238(%rdi), %r15
movq 0x240(%rdi), %r12
subq %r15, %r12
je 0x77b9
sarq $0x3, %r12
addq $0x8, %r14
xorl %r13d, %r13d
movq (%r15,%r13,8), %rdi
addq $0x8, %rdi
movq %r14, %rsi
callq 0x67f0
testl %eax, %eax
je 0x77b6
incl %r13d
cmpq %r13, %r12
ja 0x7798
jmp 0x77b9
movl %r13d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa_card.cpp
// Function: PaCard::PaCard()
PaCard::PaCard()
{
    type = pa_object_t::CARD;
    monitor_stream = nullptr;
    pa_set_active_attribute = pa_context_set_card_profile_by_index;
    pa_set_volume = nullptr;
    pa_set_mute = nullptr;
    pa_move = nullptr;
    active_attribute = nullptr;
    pa_set_default = nullptr;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x74a4
leaq 0x100d4(%rip), %rax     # 0x178b0
movq %rax, (%rbx)
movl $0x4, 0x8(%rbx)
xorl %eax, %eax
movq %rax, 0x220(%rbx)
movq 0x10782(%rip), %rcx     # 0x17f78
movq %rcx, 0x268(%rbx)
movq %rax, 0x230(%rbx)
movq %rax, 0x270(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x250(%rbx)
movq %rax, 0x260(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa_card.cpp
// Function: PaCard::updateProfiles(pa_card_profile_info*, unsigned int)
void PaCard::updateProfiles(pa_card_profile_info *pa_profiles, uint32_t n_profile)
{
    clearAttributes();

    for (uint32_t i = 0; i < n_profile; i++) {
        PaObjectAttribute *p = new PaObjectAttribute;
        snprintf(p->name, sizeof(p->name), "%s", pa_profiles[i].name);
        snprintf(
            p->description,
            sizeof(p->description),
            "%s",
            pa_profiles[i].description
        );
        attributes.push_back(p);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x7538
testl %ebp, %ebp
je 0x78ed
leaq 0x238(%r14), %rax
movq %rax, 0x10(%rsp)
movl %ebp, %ebp
shlq $0x5, %rbp
leaq 0xb09b(%rip), %r12      # 0x128f5
movl $0x107, %r15d           # imm = 0x107
xorl %r13d, %r13d
movl $0x208, %edi            # imm = 0x208
callq 0x65b0
leaq 0x10084(%rip), %rcx     # 0x178f8
movq %rcx, (%rax)
movq %rax, 0x8(%rsp)
leaq 0x8(%rax), %rdi
movq (%rbx,%r13), %rcx
movl $0xff, %esi
movq %r12, %rdx
xorl %eax, %eax
callq 0x6990
movq 0x8(%rsp), %rdi
addq %r15, %rdi
movq 0x8(%rbx,%r13), %rcx
movl $0xff, %esi
movq %r12, %rdx
xorl %eax, %eax
callq 0x6990
movq 0x240(%r14), %rsi
cmpq 0x248(%r14), %rsi
je 0x78d1
movq 0x8(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x240(%r14)
jmp 0x78e0
movq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x7920
addq $0x20, %r13
cmpq %r13, %rbp
jne 0x7863
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa_sink.cpp
// Function: PaSink::PaSink()
PaSink::PaSink()
{
    type = pa_object_t::SINK;
    monitor_stream = nullptr;

    pa_set_volume = &pa_context_set_sink_volume_by_index;
    pa_set_mute = &pa_context_set_sink_mute_by_index;
    pa_move = nullptr;
    pa_set_active_attribute = &pa_context_set_sink_port_by_index;
    pa_set_default = &pa_context_set_default_sink;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x74a4
leaq 0xfebc(%rip), %rax      # 0x17928
movq %rax, (%rbx)
movl $0x0, 0x8(%rbx)
xorl %eax, %eax
movq %rax, 0x220(%rbx)
movq 0x10562(%rip), %rcx     # 0x17fe8
movq %rcx, 0x250(%rbx)
movq 0x1052c(%rip), %rcx     # 0x17fc0
movq %rcx, 0x258(%rbx)
movq %rax, 0x260(%rbx)
movq 0x10537(%rip), %rax     # 0x17fe0
movq %rax, 0x268(%rbx)
movq 0x104b1(%rip), %rax     # 0x17f68
movq %rax, 0x270(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa_sink.cpp
// Function: PaSink::updatePorts(pa_sink_port_info**, unsigned int)
void PaSink::updatePorts(pa_sink_port_info **info, uint32_t n_ports)
{
    clearAttributes();

    for (uint32_t i = 0; i < n_ports; i++) {
        auto *p = new PaPort;

        snprintf(p->name, sizeof(p->name), "%s", info[i]->name);
        snprintf(
            p->description,
            sizeof(p->description),
            "%s",
            info[i]->description
        );
        attributes.push_back(p);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x7538
testl %ebp, %ebp
je 0x7b56
addq $0x238, %r14            # imm = 0x238
movl %ebp, %ebp
leaq 0xae09(%rip), %r15      # 0x128f5
xorl %r12d, %r12d
movl $0x210, %edi            # imm = 0x210
callq 0x65b0
movq %rax, %r13
leaq 0xfe6d(%rip), %rax      # 0x17970
movq %rax, (%r13)
leaq 0x8(%r13), %rdi
movq (%rbx,%r12,8), %rax
movq (%rax), %rcx
movl $0xff, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x6990
leaq 0x107(%r13), %rdi
movq (%rbx,%r12,8), %rax
movq 0x8(%rax), %rcx
movl $0xff, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x6990
movq %r13, (%rsp)
movq %r14, %rdi
movq %rsp, %rsi
callq 0x7b88
incq %r12
cmpq %r12, %rbp
jne 0x7aef
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa_input.cpp
// Function: PaInput::PaInput()
PaInput::PaInput()
{
    type = pa_object_t::INPUT;
    monitor_stream = nullptr;
    pa_set_volume = &pa_context_set_sink_input_volume;
    pa_set_mute = &pa_context_set_sink_input_mute;
    pa_move = &pa_context_move_sink_input_by_index;
    pa_set_active_attribute = nullptr;
    pa_set_default = nullptr;

    sink = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x74a4
leaq 0xfcfc(%rip), %rax      # 0x179a8
movq %rax, (%rbx)
leaq 0x290(%rbx), %rax
movq %rax, 0x280(%rbx)
xorl %eax, %eax
movq %rax, 0x288(%rbx)
movb $0x0, 0x290(%rbx)
movl $0x1, 0x8(%rbx)
movq %rax, 0x220(%rbx)
movq 0x102ee(%rip), %rax     # 0x17fd0
movq %rax, 0x250(%rbx)
movq 0x10290(%rip), %rax     # 0x17f80
movq %rax, 0x258(%rbx)
movq 0x1025a(%rip), %rax     # 0x17f58
movq %rax, 0x260(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x268(%rbx)
movl $0x0, 0x278(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa_source.cpp
// Function: PaSource::PaSource()
PaSource::PaSource()
{
    type = pa_object_t::SOURCE;
    monitor_stream = nullptr;

    pa_set_volume = &pa_context_set_source_volume_by_index;
    pa_set_mute = &pa_context_set_source_mute_by_index ;
    pa_move = nullptr;
    pa_set_active_attribute = &pa_context_set_source_port_by_index;
    pa_set_default = &pa_context_set_default_source;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x74a4
leaq 0xfc3c(%rip), %rax      # 0x179f0
movq %rax, (%rbx)
movl $0x2, 0x8(%rbx)
xorl %eax, %eax
movq %rax, 0x220(%rbx)
movq 0x101ca(%rip), %rcx     # 0x17f98
movq %rcx, 0x250(%rbx)
movq 0x1014c(%rip), %rcx     # 0x17f28
movq %rcx, 0x258(%rbx)
movq %rax, 0x260(%rbx)
movq 0x10147(%rip), %rax     # 0x17f38
movq %rax, 0x268(%rbx)
movq 0x10161(%rip), %rax     # 0x17f60
movq %rax, 0x270(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa_source.cpp
// Function: PaSource::updatePorts(pa_source_port_info**, unsigned int)
void PaSource::updatePorts(pa_source_port_info **info, uint32_t n_ports)
{
    clearAttributes();

    for (uint32_t i = 0; i < n_ports; i++) {
        PaPort *p = new PaPort;
        snprintf(p->name, sizeof(p->name), "%s", info[i]->name);
        snprintf(
            p->description,
            sizeof(p->description),
            "%s",
            info[i]->description
        );
        attributes.push_back(p);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x7538
testl %ebp, %ebp
je 0x7e9e
addq $0x238, %r14            # imm = 0x238
movl %ebp, %ebp
leaq 0xaac1(%rip), %r15      # 0x128f5
xorl %r12d, %r12d
movl $0x210, %edi            # imm = 0x210
callq 0x65b0
movq %rax, %r13
leaq 0xfb25(%rip), %rax      # 0x17970
movq %rax, (%r13)
leaq 0x8(%r13), %rdi
movq (%rbx,%r12,8), %rax
movq (%rax), %rcx
movl $0xff, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x6990
leaq 0x107(%r13), %rdi
movq (%rbx,%r12,8), %rax
movq 0x8(%rax), %rcx
movl $0xff, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x6990
movq %r13, (%rsp)
movq %r14, %rdi
movq %rsp, %rsi
callq 0x7b88
incq %r12
cmpq %r12, %rbp
jne 0x7e37
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa_source_output.cpp
// Function: PaSourceOutput::PaSourceOutput()
PaSourceOutput::PaSourceOutput()
{
    type = pa_object_t::SOURCE_OUTPUT;
    monitor_stream = nullptr;

    pa_set_volume = &pa_context_set_source_output_volume;
    pa_set_mute = &pa_context_set_source_output_mute;
    pa_move = &pa_context_move_source_output_by_index;
    pa_set_active_attribute = nullptr;
    pa_set_default = nullptr;

    source = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x7c9c
leaq 0xfb60(%rip), %rax      # 0x17a38
movq %rax, (%rbx)
movl $0x3, 0x8(%rbx)
movq $0x0, 0x220(%rbx)
movq 0x1009c(%rip), %rax     # 0x17f90
movq %rax, 0x250(%rbx)
movq 0x100b6(%rip), %rax     # 0x17fb8
movq %rax, 0x258(%rbx)
movq 0x10010(%rip), %rax     # 0x17f20
movq %rax, 0x260(%rbx)
movl $0x0, 0x2a0(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x268(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::clearAllPaObjects()
void Pa::clearAllPaObjects()
{
    deletePaobjects(&PA_SOURCE_OUTPUTS);
    deletePaobjects(&PA_INPUTS);
    deletePaobjects(&PA_SOURCES);
    deletePaobjects(&PA_SINKS);
    deletePaobjects(&PA_CARDS);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x98(%rdi), %rsi
callq 0x8138
leaq 0x8(%rbx), %rsi
movq %rbx, %rdi
callq 0x8138
leaq 0x68(%rbx), %rsi
movq %rbx, %rdi
callq 0x8138
leaq 0x38(%rbx), %rsi
movq %rbx, %rdi
callq 0x8138
leaq 0xc8(%rbx), %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x8138
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::exitPa()
void Pa::exitPa()
{
    if (pa_ctx) {
        pa_context_disconnect(pa_ctx);
        pa_threaded_mainloop_stop(pa_ml);
        pa_threaded_mainloop_free(pa_ml);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x150(%rdi), %rdi
testq %rdi, %rdi
je 0x8136
callq 0x6aa0
movq 0x158(%rbx), %rdi
callq 0x6b40
movq 0x158(%rbx), %rdi
popq %rbx
jmp 0x6400
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::deletePaobjects(std::map<unsigned int, PaObject*, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, PaObject*>>>*)
void Pa::deletePaobjects(std::map<uint32_t, PaObject *> *objects)
{
    std::lock_guard<std::mutex> lk(inputMtx);

    for (auto i = objects->begin(); i != objects->end(); ) {
        delete i->second;
        i = objects->erase(i);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
addq $0x100, %rbx            # imm = 0x100
movq %rbx, %rdi
callq 0x6870
testl %eax, %eax
jne 0x8198
movq 0x18(%r14), %r15
leaq 0x8(%r14), %r12
cmpq %r12, %r15
je 0x8185
movq 0x28(%r15), %rdi
testq %rdi, %rdi
je 0x8175
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x9750
movq %rax, %r15
jmp 0x8161
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x64b0
movl %eax, %edi
callq 0x6430
movq %rax, %r14
movq %rbx, %rdi
callq 0x64b0
movq %r14, %rdi
callq 0x6a80
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::do_reconnect(Pa*)
void Pa::do_reconnect(Pa *pa)
{
    if (pa->reconnect_running || pa->connected) {
        return;
    }

    pa->reconnect_running = true;
    pa->clearAllPaObjects();

    while (!pa->connected) {
        pa->pa_connect();
        usleep(500000);
    }

    pa->reconnect_running = false;
}

// Assembly:
cmpb $0x0, (%rdi)
jne 0x81ee
pushq %rbx
movq %rdi, %rbx
cmpb $0x0, 0x1(%rdi)
jne 0x81ed
movb $0x1, (%rbx)
movq %rbx, %rdi
callq 0x80c4
cmpb $0x0, 0x1(%rbx)
jne 0x81ea
movq %rbx, %rdi
callq 0x81f0
movl $0x7a120, %edi          # imm = 0x7A120
callq 0x6810
cmpb $0x1, 0x1(%rbx)
jne 0x81d2
movb $0x0, (%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::pa_connect()
bool Pa::pa_connect()
{
    if (pa_ctx) {
        return false;
    }

    pa_threaded_mainloop_lock(pa_ml);

    pa_proplist *proplist = pa_proplist_new();
    pa_proplist_sets(proplist, PA_PROP_APPLICATION_NAME, "ncpamixer");
    pa_proplist_sets(proplist, PA_PROP_APPLICATION_ID, "ncpamixer");
    pa_proplist_sets(proplist, PA_PROP_APPLICATION_ICON_NAME, "audio-card");
    pa_ctx = pa_context_new_with_proplist(pa_api, NULL, proplist);
    pa_proplist_free(proplist);

    if (!pa_ctx) {
        fprintf(stderr, "Unable to create PA context.\n");
        pa_threaded_mainloop_unlock(pa_ml);
        pa_ctx = nullptr;
        exit(EXIT_FAILURE);
        return false;
    }

    pa_context_set_state_callback(pa_ctx, &Pa::ctx_state_cb, this);
    pa_context_set_subscribe_callback(pa_ctx, &Pa::subscribe_cb, this);

    if (pa_context_connect(pa_ctx, NULL, PA_CONTEXT_NOFAIL, NULL) < 0) {
        pa_context_disconnect(pa_ctx);
        pa_context_unref(pa_ctx); // Tror ej den behövs?
        pa_threaded_mainloop_unlock(pa_ml);
        pa_ctx = nullptr;

        connectionMtx.unlock();
        reconnect();
        return false;
    }

    pa_threaded_mainloop_unlock(pa_ml);

    connectionMtx.unlock();
    return true;

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x0, 0x150(%rdi)
je 0x8206
xorl %eax, %eax
jmp 0x82e9
movq %rdi, %rbx
movq 0x158(%rdi), %rdi
callq 0x60c0
callq 0x6220
movq %rax, %r14
leaq 0x903c(%rip), %rsi      # 0x11260
leaq 0x9046(%rip), %r15      # 0x11271
movq %rax, %rdi
movq %r15, %rdx
callq 0x6ac0
leaq 0x903e(%rip), %rsi      # 0x1127b
movq %r14, %rdi
movq %r15, %rdx
callq 0x6ac0
leaq 0x903b(%rip), %rsi      # 0x1128a
leaq 0x904a(%rip), %rdx      # 0x112a0
movq %r14, %rdi
callq 0x6ac0
movq 0x160(%rbx), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x67b0
movq %rax, 0x150(%rbx)
movq %r14, %rdi
callq 0x6760
movq 0x150(%rbx), %rdi
testq %rdi, %rdi
je 0x8337
leaq 0x10d(%rip), %rsi       # 0x83a2
movq %rbx, %rdx
callq 0x6a40
movq 0x150(%rbx), %rdi
leaq 0x1c5(%rip), %rsi       # 0x8470
movq %rbx, %rdx
callq 0x6030
movq 0x150(%rbx), %rdi
xorl %esi, %esi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x6b50
testl %eax, %eax
js 0x82ef
movq 0x158(%rbx), %rdi
callq 0x6180
addq $0x128, %rbx            # imm = 0x128
movq %rbx, %rdi
callq 0x64b0
movb $0x1, %al
popq %rbx
popq %r14
popq %r15
retq
movq 0x150(%rbx), %rdi
callq 0x6aa0
movq 0x150(%rbx), %rdi
callq 0x68b0
movq 0x158(%rbx), %rdi
callq 0x6180
movq $0x0, 0x150(%rbx)
leaq 0x128(%rbx), %rdi
callq 0x64b0
movq %rbx, %rdi
callq 0x834e
jmp 0x81ff
leaq 0x150(%rbx), %rsi
addq $0x158, %rbx            # imm = 0x158
movq %rbx, %rdi
callq 0x6c68
nop
// File: /workspace/github_cpp_makefile_star2_O3/fulhax[P]ncpamixer/src/pa.cpp
// Function: Pa::ctx_state_cb(pa_context*, void*)
void Pa::ctx_state_cb(pa_context *ctx, void *instance)
{
    int state = pa_context_get_state(ctx);
    Pa *pa = reinterpret_cast<Pa *>(instance);

    switch (state) {
        case PA_CONTEXT_READY: {
            pa_operation *o = pa_context_subscribe(
                                  pa->pa_ctx,
                                  (pa_subscription_mask_t)
                                  (PA_SUBSCRIPTION_MASK_SINK |
                                   PA_SUBSCRIPTION_MASK_SOURCE |
                                   PA_SUBSCRIPTION_MASK_SINK_INPUT |
                                   PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT |
                                   PA_SUBSCRIPTION_MASK_CARD |
                                   PA_SUBSCRIPTION_MASK_SERVER
                                  ), &Pa::ctx_success_cb, instance);
            pa->wait_on_pa_operation(o);
            pa_operation_unref(o);
            pa->fetchPaobjects();

            pa->connectionMtx.lock();
            pa->connected = true;
            pa->connectionMtx.unlock();
            break;
        }

        case PA_CONTEXT_FAILED:
            pa->connectionMtx.lock();
            pa->connected = false;
            pa_context_unref(pa->pa_ctx);
            pa->pa_ctx = nullptr;
            pa->connectionMtx.unlock();
            pa->reconnect();
            break;


        case PA_CONTEXT_UNCONNECTED:
        case PA_CONTEXT_CONNECTING:
        case PA_CONTEXT_AUTHORIZING:
        case PA_CONTEXT_SETTING_NAME:
        case PA_CONTEXT_TERMINATED:
            break;
    }

    return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0x6970
cmpl $0x5, %eax
je 0x841b
cmpl $0x4, %eax
jne 0x8460
movq 0x150(%rbx), %rdi
leaq 0x24e(%rip), %rdx       # 0x8618
movl $0x28f, %esi            # imm = 0x28F
movq %rbx, %rcx
callq 0x6890
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x874a
movq %r14, %rdi
callq 0x6650
movq %rbx, %rdi
callq 0x8626
leaq 0x128(%rbx), %r14
movq %r14, %rdi
callq 0x6870
testl %eax, %eax
jne 0x8468
movb $0x1, 0x1(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x64b0
leaq 0x128(%rbx), %r14
movq %r14, %rdi
callq 0x6870
testl %eax, %eax
jne 0x8468
movb $0x0, 0x1(%rbx)
movq 0x150(%rbx), %rdi
callq 0x68b0
movq $0x0, 0x150(%rbx)
movq %r14, %rdi
callq 0x64b0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x834e
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl %eax, %edi
callq 0x6430
nop