LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/libcpuid_util.c
// Function: decode_number_of_cores_x86
void decode_number_of_cores_x86(struct cpu_raw_data_t* raw, struct cpu_id_t* data)
{
	int logical_cpus = -1, num_cores = -1;

	if (raw->basic_cpuid[0][EAX] >= 1) {
		logical_cpus = (raw->basic_cpuid[1][EBX] >> 16) & 0xff;
		if (raw->basic_cpuid[0][EAX] >= 4) {
			num_cores = 1 + ((raw->basic_cpuid[4][EAX] >> 26) & 0x3f);
		}
	}
	if (data->flags[CPU_FEATURE_HT]) {
		if (num_cores > 1) {
			data->num_cores = num_cores;
			data->num_logical_cpus = logical_cpus;
		} else {
			data->num_cores = 1;
			data->num_logical_cpus = (logical_cpus >= 1 ? logical_cpus : 1);
			if (data->num_logical_cpus == 1)
				data->flags[CPU_FEATURE_HT] = 0;
		}
	} else {
		data->num_cores = data->num_logical_cpus = (logical_cpus >= 1 ? logical_cpus : 1);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
cmpl $0x1, (%rax)
jb 0x136533
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
shrl $0x10, %eax
andl $0xff, %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x4, (%rax)
jb 0x136531
movq -0x8(%rbp), %rax
movl 0x40(%rax), %eax
shrl $0x1a, %eax
andl $0x3f, %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x136533
movq -0x10(%rbp), %rax
cmpb $0x0, 0x72(%rax)
je 0x1365ab
cmpl $0x1, -0x18(%rbp)
jle 0x13655f
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xec(%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xf0(%rax)
jmp 0x1365a9
movq -0x10(%rbp), %rax
movl $0x1, 0xec(%rax)
cmpl $0x1, -0x14(%rbp)
jl 0x13657b
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x136585
movl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x136585
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xf0(%rax)
movq -0x10(%rbp), %rax
cmpl $0x1, 0xf0(%rax)
jne 0x1365a7
movq -0x10(%rbp), %rax
movb $0x0, 0x72(%rax)
jmp 0x1365a9
jmp 0x1365da
cmpl $0x1, -0x14(%rbp)
jl 0x1365b9
movl -0x14(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x1365c3
movl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1365c3
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xf0(%rax)
movq -0x10(%rbp), %rax
movl %ecx, 0xec(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/libcpuid_util.c
// Function: get_count_order
static int get_count_order(unsigned int x)
{
	int r = 32;

	if (x == 0)
		return -1;

	--x;
	if (!x)
		return 0;
	if (!(x & 0xffff0000u)) {
		x <<= 16;
		r -= 16;
	}
	if (!(x & 0xff000000u)) {
		x <<= 8;
		r -= 8;
	}
	if (!(x & 0xf0000000u)) {
		x <<= 4;
		r -= 4;
	}
	if (!(x & 0xc0000000u)) {
		x <<= 2;
		r -= 2;
	}
	if (!(x & 0x80000000u)) {
		x <<= 1;
		r -= 1;
	}
	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl $0x20, -0xc(%rbp)
cmpl $0x0, -0x8(%rbp)
jne 0x136840
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1368fb
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jne 0x13685b
movl $0x0, -0x4(%rbp)
jmp 0x1368fb
movl -0x8(%rbp), %eax
andl $0xffff0000, %eax       # imm = 0xFFFF0000
cmpl $0x0, %eax
jne 0x13687a
movl -0x8(%rbp), %eax
shll $0x10, %eax
movl %eax, -0x8(%rbp)
movl -0xc(%rbp), %eax
subl $0x10, %eax
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
cmpl $0x0, %eax
jne 0x136899
movl -0x8(%rbp), %eax
shll $0x8, %eax
movl %eax, -0x8(%rbp)
movl -0xc(%rbp), %eax
subl $0x8, %eax
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %eax
andl $0xf0000000, %eax       # imm = 0xF0000000
cmpl $0x0, %eax
jne 0x1368b8
movl -0x8(%rbp), %eax
shll $0x4, %eax
movl %eax, -0x8(%rbp)
movl -0xc(%rbp), %eax
subl $0x4, %eax
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %eax
andl $0xc0000000, %eax       # imm = 0xC0000000
cmpl $0x0, %eax
jne 0x1368d7
movl -0x8(%rbp), %eax
shll $0x2, %eax
movl %eax, -0x8(%rbp)
movl -0xc(%rbp), %eax
subl $0x2, %eax
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %eax
andl $0x80000000, %eax       # imm = 0x80000000
cmpl $0x0, %eax
jne 0x1368f5
movl -0x8(%rbp), %eax
shll %eax
movl %eax, -0x8(%rbp)
movl -0xc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/libcpuid_util.c
// Function: popcount64
static unsigned int popcount64(uint64_t mask)
{
	unsigned int num_set_bits = 0;

	while (mask) {
		mask &= mask - 1;
		num_set_bits++;
	}

	return num_set_bits;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x136931
movq -0x8(%rbp), %rax
subq $0x1, %rax
andq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x13690f
movl -0xc(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/rdtsc.c
// Function: cpu_clock_by_mark
int cpu_clock_by_mark(struct cpu_mark_t* mark)
{
	uint64_t result;

	/* Check if some subtraction resulted in a negative number: */
	if ((mark->tsc >> 63) != 0 || (mark->sys_clock >> 63) != 0) return -1;

	/* Divide-by-zero check: */
	if (mark->sys_clock == 0) return -1;

	/* Check if the result fits in 32bits */
	result = mark->tsc / mark->sys_clock;
	if (result > (uint64_t) 0x7fffffff) return -1;
	return (int) result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
shrq $0x3f, %rax
cmpq $0x0, %rax
jne 0x136a4b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x3f, %rax
cmpq $0x0, %rax
je 0x136a54
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x136a97
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x136a68
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x136a97
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divq 0x8(%rcx)
movq %rax, -0x18(%rbp)
cmpq $0x7fffffff, -0x18(%rbp) # imm = 0x7FFFFFFF
jbe 0x136a90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x136a97
movq -0x18(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/rdtsc.c
// Function: cpu_clock_by_os
int cpu_clock_by_os(void)
{
	FILE *f;
	char line[1024], *s;
	int result;

	f = fopen("/proc/cpuinfo", "rt");
	if (!f) return -1;

	while (fgets(line, sizeof(line), f)) {
		if (!strncmp(line, "cpu MHz", 7)) {
			s = strchr(line, ':');
			if (s && 1 == sscanf(s, ":%d.", &result)) {
				fclose(f);
				return result;
			}
		}
	}
	fclose(f);
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x420, %rsp            # imm = 0x420
leaq 0x71867(%rip), %rdi     # 0x1a8319
leaq 0x6f495(%rip), %rsi     # 0x1a5f4e
callq 0x5db10
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x136ad5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x136b87
jmp 0x136ad7
leaq -0x410(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x400, %esi            # imm = 0x400
callq 0x5b4e0
cmpq $0x0, %rax
je 0x136b77
leaq -0x410(%rbp), %rdi
leaq 0x71823(%rip), %rsi     # 0x1a8327
movl $0x7, %edx
callq 0x59dc0
cmpl $0x0, %eax
jne 0x136b72
leaq -0x410(%rbp), %rdi
movl $0x3a, %esi
callq 0x5af10
movq %rax, -0x418(%rbp)
cmpq $0x0, -0x418(%rbp)
je 0x136b70
movq -0x418(%rbp), %rdi
leaq 0x717ec(%rip), %rsi     # 0x1a832f
leaq -0x41c(%rbp), %rdx
movb $0x0, %al
callq 0x59470
movl %eax, %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jne 0x136b70
movq -0x10(%rbp), %rdi
callq 0x5a8f0
movl -0x41c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x136b87
jmp 0x136b72
jmp 0x136ad7
movq -0x10(%rbp), %rdi
callq 0x5a8f0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x420, %rsp            # imm = 0x420
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/rdtsc.c
// Function: busy_loop_delay
int busy_loop_delay(int milliseconds)
{
	int cycles = 0, r = 0, first = 1;
	uint64_t a, b, c;
	sys_precise_clock(&a);
	while (1) {
		sys_precise_clock(&c);
		if ((c - a) / 1000 > milliseconds) return r;
		r += busy_loop(cycles);
		if (first) {
			first = 0;
		} else {
			if (c - b < 1000) cycles *= 2;
			if (c - b > 10000) cycles /= 2;
		}
		b = c;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x1, -0x10(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x136940
leaq -0x28(%rbp), %rdi
callq 0x136940
movq -0x28(%rbp), %rax
subq -0x18(%rbp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divq %rcx
movslq -0x4(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x136bf6
movl -0xc(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
movl -0x8(%rbp), %edi
callq 0x136c60
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x136c13
movl $0x0, -0x10(%rbp)
jmp 0x136c4b
movq -0x28(%rbp), %rax
subq -0x20(%rbp), %rax
cmpq $0x3e8, %rax            # imm = 0x3E8
jae 0x136c2b
movl -0x8(%rbp), %eax
shll %eax
movl %eax, -0x8(%rbp)
movq -0x28(%rbp), %rax
subq -0x20(%rbp), %rax
cmpq $0x2710, %rax           # imm = 0x2710
jbe 0x136c49
movl -0x8(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x8(%rbp)
jmp 0x136c4b
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x136bc9
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/rdtsc.c
// Function: busy_loop
static int busy_loop(int amount)
{
	int i, j, k, s = 0;
	static volatile int data[42] = {32, 12, -1, 5, 23, 0 };
	for (i = 0; i < amount; i++)
		for (j = 0; j < 65536; j++)
			for (k = 0; k < 42; k++)
				s += data[k];
	return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x136cd3
movl $0x0, -0xc(%rbp)
cmpl $0x10000, -0xc(%rbp)    # imm = 0x10000
jge 0x136cc6
movl $0x0, -0x10(%rbp)
cmpl $0x2a, -0x10(%rbp)
jge 0x136cb9
movslq -0x10(%rbp), %rcx
leaq 0xd4f9b(%rip), %rax     # 0x20bc40
movl (%rax,%rcx,4), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x136c94
jmp 0x136cbb
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x136c84
jmp 0x136cc8
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x136c75
movl -0x14(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/rdtsc.c
// Function: adjust_march_ic_multiplier
static void adjust_march_ic_multiplier(const struct cpu_id_t* id, int* numerator, int* denom)
{
	/*
	 * for cpu_clock_by_ic: we need to know how many clocks does a typical ADDPS instruction
	 * take, when issued in rapid succesion without dependencies. The whole idea of
	 * cpu_clock_by_ic was that this is easy to determine, at least it was back in 2010. Now
	 * it's getting progressively more hairy, but here are the current measurements:
	 *
	 * 1. For CPUs with  64-bit SSE units, ADDPS issue rate is 0.5 IPC (one insn in 2 clocks)
	 * 2. For CPUs with 128-bit SSE units, issue rate is exactly 1.0 IPC
	 * 3. For Bulldozer and later, it is 1.4 IPC (we multiply by 5/7)
	 * 4. For Skylake and later, it is 1.6 IPC (we multiply by 5/8)
	 */
	//
	if (id->sse_size < 128) {
		debugf(1, "SSE execution path is 64-bit\n");
		// on a CPU with half SSE unit length, SSE instructions execute at 0.5 IPC;
		// the resulting value must be multiplied by 2:
		*numerator = 2;
	} else {
		debugf(1, "SSE execution path is 128-bit\n");
	}
	//
	// Bulldozer or later: assume 1.4 IPC
	if ((id->vendor == VENDOR_AMD && id->ext_family >= 21) || (id->vendor == VENDOR_HYGON)) {
		debugf(1, "cpu_clock_by_ic: Bulldozer (or later) detected, dividing result by 1.4\n");
		*numerator = 5;
		*denom = 7; // multiply by 5/7, to divide by 1.4
	}
	//
	// Skylake or later: assume 1.6 IPC
	if (id->vendor == VENDOR_INTEL && id->ext_model >= 94) {
		debugf(1, "cpu_clock_by_ic: Skylake (or later) detected, dividing result by 1.6\n");
		*numerator = 5;
		*denom = 8; // to divide by 1.6, multiply by 5/8
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x80, 0x190(%rax)
jge 0x1372a3
movl $0x1, %edi
leaq 0x710cb(%rip), %rsi     # 0x1a835b
movb $0x0, %al
callq 0x135780
movq -0x10(%rbp), %rax
movl $0x2, (%rax)
jmp 0x1372b6
movl $0x1, %edi
leaq 0x710ca(%rip), %rsi     # 0x1a8379
movb $0x0, %al
callq 0x135780
movq -0x8(%rbp), %rax
cmpl $0x1, 0x54(%rax)
jne 0x1372cd
movq -0x8(%rbp), %rax
cmpl $0x15, 0xe4(%rax)
jge 0x1372d7
movq -0x8(%rbp), %rax
cmpl $0xa, 0x54(%rax)
jne 0x1372fe
movl $0x1, %edi
leaq 0x710b5(%rip), %rsi     # 0x1a8398
movb $0x0, %al
callq 0x135780
movq -0x10(%rbp), %rax
movl $0x5, (%rax)
movq -0x18(%rbp), %rax
movl $0x7, (%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x54(%rax)
jne 0x13733c
movq -0x8(%rbp), %rax
cmpl $0x5e, 0xe8(%rax)
jl 0x13733c
movl $0x1, %edi
leaq 0x710bf(%rip), %rsi     # 0x1a83e0
movb $0x0, %al
callq 0x135780
movq -0x10(%rbp), %rax
movl $0x5, (%rax)
movq -0x18(%rbp), %rax
movl $0x8, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/rdtsc.c
// Function: cpu_clock
int cpu_clock(void)
{
	int result;
	result = cpu_clock_by_os();
	if (result <= 0)
		result = cpu_clock_measure(200, 1);
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0x136aa0
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jg 0x137378
movl $0xc8, %edi
movl $0x1, %esi
callq 0x136ce0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/recog_amd.c
// Function: cpuid_identify_amd
int cpuid_identify_amd(struct cpu_raw_data_t* raw, struct cpu_id_t* data, struct internal_id_info_t* internal)
{
	load_amd_features(raw, data);
	if ((EXTRACTS_BIT(raw->ext_cpuid[1][ECX], 22) == 1) && (EXTRACTS_BITS(raw->amd_fn8000001dh[0][EAX], 4, 0) != 0)) /* TopologyExtensions supported */
		decode_deterministic_cache_info_x86(raw->amd_fn8000001dh, MAX_AMDFN8000001DH_LEVEL, data, internal);
	else
		decode_amd_cache_info(raw, data);
	decode_amd_number_of_cores(raw, data);
	decode_amd_codename(data, internal);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x137430
movq -0x8(%rbp), %rax
movl 0x218(%rax), %eax
shrl $0x16, %eax
andl $0x1, %eax
cmpl $0x1, %eax
jne 0x1373fe
movq -0x8(%rbp), %rax
movl 0x540(%rax), %eax
shrl $0x0, %eax
movl %eax, %eax
andq $0x1f, %rax
cmpq $0x0, %rax
je 0x1373fe
movq -0x8(%rbp), %rdi
addq $0x540, %rdi            # imm = 0x540
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x4, %esi
callq 0x1365e0
jmp 0x13740b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x137580
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x137770
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x137890
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/recog_amd.c
// Function: decode_amd_number_of_cores
static void decode_amd_number_of_cores(struct cpu_raw_data_t* raw, struct cpu_id_t* data)
{
	int logical_cpus = -1, num_cores = -1;

	if (raw->basic_cpuid[0][EAX] >= 1) {
		logical_cpus = (raw->basic_cpuid[1][EBX] >> 16) & 0xff;
		if (raw->ext_cpuid[0][EAX] >= 8) {
			num_cores = 1 + (raw->ext_cpuid[8][ECX] & 0xff);
		}
	}
	if (data->flags[CPU_FEATURE_HT]) {
		if (num_cores > 1) {
			if ((data->ext_family >= 23) && (raw->ext_cpuid[0][EAX] >= 30))
				/* Ryzen 3 has SMT flag, but in fact cores count is equal to threads count.
				Ryzen 5/7 reports twice as many "real" cores (e.g. 16 cores instead of 8) because of SMT. */
				/* On PPR 17h, page 82:
				CPUID_Fn8000001E_EBX [Core Identifiers][15:8] is ThreadsPerCore
				ThreadsPerCore: [...] The number of threads per core is ThreadsPerCore+1 */
				num_cores /= ((raw->ext_cpuid[30][EBX] >> 8) & 0xff) + 1;
			data->num_cores = num_cores;
			data->num_logical_cpus = logical_cpus;
		} else {
			data->num_cores = 1;
			data->num_logical_cpus = (logical_cpus >= 2 ? logical_cpus : 2);
		}
	} else {
		data->num_cores = data->num_logical_cpus = 1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
cmpl $0x1, (%rax)
jb 0x1377c9
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
shrl $0x10, %eax
andl $0xff, %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x8, 0x200(%rax)
jb 0x1377c7
movq -0x8(%rbp), %rax
movl 0x288(%rax), %eax
andl $0xff, %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1377c9
movq -0x10(%rbp), %rax
cmpb $0x0, 0x72(%rax)
je 0x137868
cmpl $0x1, -0x18(%rbp)
jle 0x137833
movq -0x10(%rbp), %rax
cmpl $0x17, 0xe4(%rax)
jl 0x137817
movq -0x8(%rbp), %rax
cmpl $0x1e, 0x200(%rax)
jb 0x137817
movq -0x8(%rbp), %rax
movl 0x3e4(%rax), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
addl $0x1, %ecx
movl -0x18(%rbp), %eax
xorl %edx, %edx
divl %ecx
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xec(%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xf0(%rax)
jmp 0x137866
movq -0x10(%rbp), %rax
movl $0x1, 0xec(%rax)
cmpl $0x2, -0x14(%rbp)
jl 0x13784f
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x137859
movl $0x2, %eax
movl %eax, -0x1c(%rbp)
jmp 0x137859
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xf0(%rax)
jmp 0x137884
movq -0x10(%rbp), %rax
movl $0x1, 0xf0(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0xec(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/recog_centaur.c
// Function: get_model_code
static centaur_model_t get_model_code(struct cpu_id_t* data, centaur_code_and_bits_t brand)
{
	int i = 0;
	int l = (int) strlen(data->brand_str);
	const char *bs = data->brand_str;

	if (brand.code == ZHAOXIN) {
		if ((i = match_pattern(bs, "KaiSheng KH-")) != 0) {
			i += 11;
			if (i + 4 >= l) return UNKNOWN;
			switch(bs[i]) {
				case '2': return _20000;
				case '3': return _30000;
				case '4': return _40000;
				default: return UNKNOWN;
			}
		}
		else if ((i = match_pattern(bs, "KaiXian KX-")) != 0) {
			i += 10;
			if (bs[i] == 'U') i++;
			if (i + 3 >= l) return UNKNOWN;
			switch(bs[i]) {
				case '4': return _4000;
				case '5': return _5000;
				case '6': return _6000;
				case '7': return _7000;
				default: return UNKNOWN;
			}
		}
	}

	return UNKNOWN;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %esi, -0x18(%rbp)
movq %rdx, -0x10(%rbp)
movq %rdi, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x20(%rbp), %rdi
addq $0x14, %rdi
callq 0x5a790
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $0x14, %rax
movq %rax, -0x30(%rbp)
cmpl $0xbb9, -0x18(%rbp)     # imm = 0xBB9
jne 0x138487
movq -0x30(%rbp), %rdi
leaq 0x78c4c(%rip), %rsi     # 0x1b0f9a
callq 0x135ec0
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
je 0x1383d5
movl -0x24(%rbp), %eax
addl $0xb, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addl $0x4, %eax
cmpl -0x28(%rbp), %eax
jl 0x13837b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13848e
movq -0x30(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x34(%rbp)
subl $0x32, %eax
je 0x1383a5
jmp 0x138391
movl -0x34(%rbp), %eax
subl $0x33, %eax
je 0x1383b1
jmp 0x13839b
movl -0x34(%rbp), %eax
subl $0x34, %eax
je 0x1383bd
jmp 0x1383c9
movl $0x3e8, -0x4(%rbp)      # imm = 0x3E8
jmp 0x13848e
movl $0x3e9, -0x4(%rbp)      # imm = 0x3E9
jmp 0x13848e
movl $0x3ea, -0x4(%rbp)      # imm = 0x3EA
jmp 0x13848e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13848e
movq -0x30(%rbp), %rdi
leaq 0x78bc7(%rip), %rsi     # 0x1b0fa7
callq 0x135ec0
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
je 0x138483
movl -0x24(%rbp), %eax
addl $0xa, %eax
movl %eax, -0x24(%rbp)
movq -0x30(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x55, %eax
jne 0x138414
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addl $0x3, %eax
cmpl -0x28(%rbp), %eax
jl 0x138428
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13848e
movq -0x30(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $-0x34, %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x3, %eax
ja 0x13847a
movq -0x40(%rbp), %rax
leaq 0x77f93(%rip), %rcx     # 0x1b03e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x64, -0x4(%rbp)
jmp 0x13848e
movl $0x65, -0x4(%rbp)
jmp 0x13848e
movl $0x66, -0x4(%rbp)
jmp 0x13848e
movl $0x67, -0x4(%rbp)
jmp 0x13848e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13848e
jmp 0x138485
jmp 0x138487
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/recog_intel.c
// Function: cpuid_get_epc
struct cpu_epc_t cpuid_get_epc(int index, const struct cpu_raw_data_t* raw)
{
	uint32_t regs[4];
	struct cpu_epc_t retval = {0, 0};
	if (raw && index < MAX_INTELFN12H_LEVEL - 2) {
		// this was queried already, use the data:
		memcpy(regs, raw->intel_fn12h[2 + index], sizeof(regs));
	} else {
		// query this ourselves:
		regs[0] = 0x12;
		regs[2] = 2 + index;
		regs[1] = regs[3] = 0;
		cpu_exec_cpuid_ext(regs);
	}

	// decode values:
	if ((regs[0] & 0xf) == 0x1) {
		retval.start_addr |= (regs[0] & 0xfffff000); // bits [12, 32) -> bits [12, 32)
		retval.start_addr |= ((uint64_t) (regs[1] & 0x000fffff)) << 32; // bits [0, 20) -> bits [32, 52)
		retval.length     |= (regs[2] & 0xfffff000); // bits [12, 32) -> bits [12, 32)
		retval.length     |= ((uint64_t) (regs[3] & 0x000fffff)) << 32; // bits [0, 20) -> bits [32, 52)
	}
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x14(%rbp)
movq %rsi, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5a200
cmpq $0x0, -0x20(%rbp)
je 0x138527
cmpl $0x2, -0x14(%rbp)
jge 0x138527
movq -0x20(%rbp), %rax
addq $0x4c0, %rax            # imm = 0x4C0
movl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x13854e
movl $0x12, -0x30(%rbp)
movl -0x14(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x2c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x131740
movl -0x30(%rbp), %eax
andl $0xf, %eax
cmpl $0x1, %eax
jne 0x1385a9
movl -0x30(%rbp), %eax
andl $0xfffff000, %eax       # imm = 0xFFFFF000
movl %eax, %eax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movl -0x2c(%rbp), %eax
andl $0xfffff, %eax          # imm = 0xFFFFF
movl %eax, %eax
shlq $0x20, %rax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movl -0x28(%rbp), %eax
andl $0xfffff000, %eax       # imm = 0xFFFFF000
movl %eax, %eax
orq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movl -0x24(%rbp), %eax
andl $0xfffff, %eax          # imm = 0xFFFFF
movl %eax, %eax
shlq $0x20, %rax
orq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/recog_intel.c
// Function: decode_intel_extended_topology
static int decode_intel_extended_topology(struct cpu_raw_data_t* raw, struct cpu_id_t* data)
{
	int i, level_type, num_smt = -1, num_core = -1;

	for (i = 0; (raw->intel_fn11[i][EAX] != 0x0) && (raw->intel_fn11[i][EBX] != 0x0) && (i < MAX_INTELFN11_LEVEL); i++) {
		level_type = EXTRACTS_BITS(raw->intel_fn11[i][ECX], 15, 8);
		switch (level_type) {
			case 0x01:
				num_smt = EXTRACTS_BITS(raw->intel_fn11[i][EBX], 15, 0);
				break;
			case 0x02:
				num_core = EXTRACTS_BITS(raw->intel_fn11[i][EBX], 15, 0);
				break;
			default:
				break;
		}
	}
	if (num_smt == -1 || num_core == -1) return 0;
	data->num_logical_cpus = num_core;
	data->num_cores = num_core / num_smt;
	// make sure num_cores is at least 1. In VMs, the CPUID instruction
	// is rigged and may give nonsensical results, but we should at least
	// avoid outputs like data->num_cores == 0.
	if (data->num_cores <= 0) data->num_cores = 1;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rcx
addq $0x480, %rcx            # imm = 0x480
movslq -0x1c(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
xorl %eax, %eax
cmpl $0x0, (%rcx)
movb %al, -0x29(%rbp)
je 0x13926c
movq -0x10(%rbp), %rcx
addq $0x480, %rcx            # imm = 0x480
movslq -0x1c(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
xorl %eax, %eax
cmpl $0x0, 0x4(%rcx)
movb %al, -0x29(%rbp)
je 0x13926c
cmpl $0x4, -0x1c(%rbp)
setl %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x139278
jmp 0x139308
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x4, %rcx
movzbl 0x489(%rax,%rcx), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x30(%rbp)
subl $0x1, %eax
je 0x1392a6
jmp 0x13929c
movl -0x30(%rbp), %eax
subl $0x2, %eax
je 0x1392ce
jmp 0x1392f6
movq -0x10(%rbp), %rax
addq $0x480, %rax            # imm = 0x480
movslq -0x1c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
shrl $0x0, %eax
movl %eax, %eax
andq $0xffff, %rax           # imm = 0xFFFF
movl %eax, -0x24(%rbp)
jmp 0x1392f8
movq -0x10(%rbp), %rax
addq $0x480, %rax            # imm = 0x480
movslq -0x1c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
shrl $0x0, %eax
movl %eax, %eax
andq $0xffff, %rax           # imm = 0xFFFF
movl %eax, -0x28(%rbp)
jmp 0x1392f8
jmp 0x1392f8
jmp 0x1392fa
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x139221
cmpl $-0x1, -0x24(%rbp)
je 0x139314
cmpl $-0x1, -0x28(%rbp)
jne 0x13931d
movl $0x0, -0x4(%rbp)
jmp 0x13935f
movl -0x28(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xf0(%rax)
movl -0x28(%rbp), %eax
cltd
idivl -0x24(%rbp)
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xec(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0xec(%rax)
jg 0x139358
movq -0x18(%rbp), %rax
movl $0x1, 0xec(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/recog_intel.c
// Function: cpuid_identify_purpose_intel
cpu_purpose_t cpuid_identify_purpose_intel(struct cpu_raw_data_t* raw)
{
	/* Check for hybrid architecture
	From Intel® 64 and IA-32 Architectures Software Developer’s Manual Combined Volumes: 1, 2A, 2B, 2C, 2D, 3A, 3B, 3C, 3D, and 4
	Available at https://cdrdv2.intel.com/v1/dl/getContent/671200

	- CPUID[7h] is Structured Extended Feature Flags Enumeration Leaf (Output depends on ECX input value)
	  EDX, bit 15: Hybrid. If 1, the processor is identified as a hybrid part.

	- CPUID[1Ah] is Hybrid Information Enumeration Leaf (EAX = 1AH, ECX = 0)
	  EAX, bits 31-24: Core type
	*/
	if (EXTRACTS_BIT(raw->basic_cpuid[0x7][EDX], 15) == 0x1) {
		debugf(3, "Detected Intel CPU hybrid architecture\n");
		switch (EXTRACTS_BITS(raw->basic_cpuid[0x1a][EAX], 31, 24)) {
			case 0x20: /* Atom */ return PURPOSE_EFFICIENCY;
			case 0x40: /* Core */ return PURPOSE_PERFORMANCE;
			default:              return PURPOSE_GENERAL;
		}
	}

	return PURPOSE_GENERAL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x7c(%rax), %eax
shrl $0xf, %eax
andl $0x1, %eax
cmpl $0x1, %eax
jne 0x1393e2
leaq 0x82b26(%rip), %rsi     # 0x1bbebb
xorl %eax, %eax
movl $0x3, %edi
callq 0x135780
movq -0x10(%rbp), %rax
movl 0x1a0(%rax), %eax
shrl $0x18, %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x20, %eax
je 0x1393c7
jmp 0x1393bb
movq -0x18(%rbp), %rax
subq $0x40, %rax
je 0x1393d0
jmp 0x1393d9
movl $0x2, -0x4(%rbp)
jmp 0x1393e9
movl $0x1, -0x4(%rbp)
jmp 0x1393e9
movl $0x0, -0x4(%rbp)
jmp 0x1393e9
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/buffer_dec.c
// Function: WebPFlipBuffer
VP8StatusCode WebPFlipBuffer(WebPDecBuffer* const buffer) {
  if (buffer == NULL) {
    return VP8_STATUS_INVALID_PARAM;
  }
  if (WebPIsRGBMode(buffer->colorspace)) {
    WebPRGBABuffer* const buf = &buffer->u.RGBA;
    buf->rgba += (int64_t)(buffer->height - 1) * buf->stride;
    buf->stride = -buf->stride;
  } else {
    WebPYUVABuffer* const buf = &buffer->u.YUVA;
    const int64_t H = buffer->height;
    buf->y += (H - 1) * buf->y_stride;
    buf->y_stride = -buf->y_stride;
    buf->u += ((H - 1) >> 1) * buf->u_stride;
    buf->u_stride = -buf->u_stride;
    buf->v += ((H - 1) >> 1) * buf->v_stride;
    buf->v_stride = -buf->v_stride;
    if (buf->a != NULL) {
      buf->a += (H - 1) * buf->a_stride;
      buf->a_stride = -buf->a_stride;
    }
  }
  return VP8_STATUS_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x13a70f
movl $0x2, -0x4(%rbp)
jmp 0x13a853
movq -0x10(%rbp), %rax
movl (%rax), %edi
callq 0x13a860
cmpl $0x0, %eax
je 0x13a763
movq -0x10(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
subl $0x1, %eax
movslq %eax, %rcx
movq -0x18(%rbp), %rax
movslq 0x8(%rax), %rax
imulq %rax, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
xorl %ecx, %ecx
subl 0x8(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x13a84c
movq -0x10(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movslq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
movq -0x20(%rbp), %rax
movslq 0x20(%rax), %rax
imulq %rax, %rcx
movq -0x20(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
xorl %ecx, %ecx
subl 0x20(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
sarq %rcx
movq -0x20(%rbp), %rax
movslq 0x24(%rax), %rax
imulq %rax, %rcx
movq -0x20(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
xorl %ecx, %ecx
subl 0x24(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
sarq %rcx
movq -0x20(%rbp), %rax
movslq 0x28(%rax), %rax
imulq %rax, %rcx
movq -0x20(%rbp), %rax
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
xorl %ecx, %ecx
subl 0x28(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x13a84a
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
movq -0x20(%rbp), %rax
movslq 0x2c(%rax), %rax
imulq %rax, %rcx
movq -0x20(%rbp), %rax
addq 0x18(%rax), %rcx
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rax
xorl %ecx, %ecx
subl 0x2c(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2c(%rax)
jmp 0x13a84c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/buffer_dec.c
// Function: WebPInitDecBufferInternal
int WebPInitDecBufferInternal(WebPDecBuffer* buffer, int version) {
  if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DECODER_ABI_VERSION)) {
    return 0;  // version mismatch
  }
  if (buffer == NULL) return 0;
  memset(buffer, 0, sizeof(*buffer));
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl -0x14(%rbp), %eax
sarl $0x8, %eax
cmpl $0x2, %eax
je 0x13aca3
movl $0x0, -0x4(%rbp)
jmp 0x13acca
cmpq $0x0, -0x10(%rbp)
jne 0x13acb3
movl $0x0, -0x4(%rbp)
jmp 0x13acca
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x78, %edx
callq 0x5a200
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/buffer_dec.c
// Function: WebPFreeDecBuffer
void WebPFreeDecBuffer(WebPDecBuffer* buffer) {
  if (buffer != NULL) {
    if (buffer->is_external_memory <= 0) {
      WebPSafeFree(buffer->private_memory);
    }
    buffer->private_memory = NULL;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x13ad16
movq -0x8(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jg 0x13ad0a
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x5b920
movq -0x8(%rbp), %rax
movq $0x0, 0x70(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/buffer_dec.c
// Function: WebPCopyDecBuffer
void WebPCopyDecBuffer(const WebPDecBuffer* const src,
                       WebPDecBuffer* const dst) {
  if (src != NULL && dst != NULL) {
    *dst = *src;
    if (src->private_memory != NULL) {
      dst->is_external_memory = 1;   // dst buffer doesn't own the memory.
      dst->private_memory = NULL;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x13ad74
cmpq $0x0, -0x10(%rbp)
je 0x13ad74
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x78, %edx
callq 0x593a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x13ad72
movq -0x10(%rbp), %rax
movl $0x1, 0xc(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x70(%rax)
jmp 0x13ad74
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/buffer_dec.c
// Function: WebPGrabDecBuffer
void WebPGrabDecBuffer(WebPDecBuffer* const src, WebPDecBuffer* const dst) {
  if (src != NULL && dst != NULL) {
    *dst = *src;
    if (src->private_memory != NULL) {
      src->is_external_memory = 1;   // src relinquishes ownership
      src->private_memory = NULL;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x13add4
cmpq $0x0, -0x10(%rbp)
je 0x13add4
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x78, %edx
callq 0x593a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x13add2
movq -0x8(%rbp), %rax
movl $0x1, 0xc(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x70(%rax)
jmp 0x13add4
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/buffer_dec.c
// Function: WebPAvoidSlowMemory
int WebPAvoidSlowMemory(const WebPDecBuffer* const output,
                        const WebPBitstreamFeatures* const features) {
  assert(output != NULL);
  return (output->is_external_memory >= 2) &&
         WebPIsPremultipliedMode(output->colorspace) &&
         (features != NULL && features->has_alpha);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x13b3f9
jmp 0x13b418
leaq 0x80dcf(%rip), %rdi     # 0x1bc1cf
leaq 0x80d30(%rip), %rsi     # 0x1bc137
movl $0x130, %edx            # imm = 0x130
leaq 0x80dcb(%rip), %rcx     # 0x1bc1de
callq 0x598a0
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl $0x2, 0xc(%rcx)
movb %al, -0x11(%rbp)
jl 0x13b45e
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x13b470
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x11(%rbp)
je 0x13b45e
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x12(%rbp)
je 0x13b458
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
setne %al
movb %al, -0x12(%rbp)
movb -0x12(%rbp), %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/webp_dec.c
// Function: WebPParseHeaders
VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers) {
  // status is marked volatile as a workaround for a clang-3.8 (aarch64) bug
  volatile VP8StatusCode status;
  int has_animation = 0;
  assert(headers != NULL);
  // fill out headers, ignore width/height/has_alpha.
  status = ParseHeadersInternal(headers->data, headers->data_size,
                                NULL, NULL, NULL, &has_animation,
                                NULL, headers);
  if (status == VP8_STATUS_OK || status == VP8_STATUS_NOT_ENOUGH_DATA) {
    // The WebPDemux API + libwebp can be used to decode individual
    // uncomposited frames or the WebPAnimDecoder can be used to fully
    // reconstruct them (see webp/demux.h).
    if (has_animation) {
      status = VP8_STATUS_UNSUPPORTED_FEATURE;
    }
  }
  return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x13b4fc
jmp 0x13b51b
leaq 0x80d40(%rip), %rdi     # 0x1bc243
leaq 0x80d49(%rip), %rsi     # 0x1bc253
movl $0x1a5, %edx            # imm = 0x1A5
leaq 0x80d50(%rip), %rcx     # 0x1bc266
callq 0x598a0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %r8d
leaq -0x10(%rbp), %r9
movq %r8, %rdx
movq %r8, %rcx
movq $0x0, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x13b580
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl $0x0, %eax
je 0x13b562
movl -0xc(%rbp), %eax
cmpl $0x7, %eax
jne 0x13b571
cmpl $0x0, -0x10(%rbp)
je 0x13b56f
movl $0x4, -0xc(%rbp)
jmp 0x13b571
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/webp_dec.c
// Function: DecodeIntoRGBABuffer
WEBP_NODISCARD static uint8_t* DecodeIntoRGBABuffer(WEBP_CSP_MODE colorspace,
                                                    const uint8_t* const data,
                                                    size_t data_size,
                                                    uint8_t* const rgba,
                                                    int stride, size_t size) {
  WebPDecParams params;
  WebPDecBuffer buf;
  if (rgba == NULL || !WebPInitDecBuffer(&buf)) {
    return NULL;
  }
  WebPResetDecParams(&params);
  params.output = &buf;
  buf.colorspace    = colorspace;
  buf.u.RGBA.rgba   = rgba;
  buf.u.RGBA.stride = stride;
  buf.u.RGBA.size   = size;
  buf.is_external_memory = 1;
  if (DecodeInto(data, data_size, &params) != VP8_STATUS_OK) {
    return NULL;
  }
  return rgba;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movq %r9, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x13bada
leaq -0x120(%rbp), %rdi
callq 0x13bd90
cmpl $0x0, %eax
jne 0x13bae4
movq $0x0, -0x8(%rbp)
jmp 0x13bb5b
leaq -0xa8(%rbp), %rdi
callq 0x13ba30
leaq -0x120(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x120(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x110(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x108(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x100(%rbp)
movl $0x1, -0x114(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
callq 0x13bdb0
cmpl $0x0, %eax
je 0x13bb53
movq $0x0, -0x8(%rbp)
jmp 0x13bb5b
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/webp_dec.c
// Function: WebPDecodeYUVInto
uint8_t* WebPDecodeYUVInto(const uint8_t* data, size_t data_size,
                           uint8_t* luma, size_t luma_size, int luma_stride,
                           uint8_t* u, size_t u_size, int u_stride,
                           uint8_t* v, size_t v_size, int v_stride) {
  WebPDecParams params;
  WebPDecBuffer output;
  if (luma == NULL || !WebPInitDecBuffer(&output)) return NULL;
  WebPResetDecParams(&params);
  params.output = &output;
  output.colorspace      = MODE_YUV;
  output.u.YUVA.y        = luma;
  output.u.YUVA.y_stride = luma_stride;
  output.u.YUVA.y_size   = luma_size;
  output.u.YUVA.u        = u;
  output.u.YUVA.u_stride = u_stride;
  output.u.YUVA.u_size   = u_size;
  output.u.YUVA.v        = v;
  output.u.YUVA.v_stride = v_stride;
  output.u.YUVA.v_size   = v_size;
  output.is_external_memory = 1;
  if (DecodeInto(data, data_size, &params) != VP8_STATUS_OK) {
    return NULL;
  }
  return luma;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movl 0x30(%rbp), %eax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movq %r9, -0x38(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x13bcbd
leaq -0x120(%rbp), %rdi
callq 0x13bd90
cmpl $0x0, %eax
jne 0x13bcca
movq $0x0, -0x8(%rbp)
jmp 0x13bd80
leaq -0xa8(%rbp), %rdi
callq 0x13ba30
leaq -0x120(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl $0xb, -0x120(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x110(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0xf0(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x108(%rbp)
movl 0x18(%rbp), %eax
movl %eax, -0xec(%rbp)
movq 0x10(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq 0x20(%rbp), %rax
movq %rax, -0x100(%rbp)
movl 0x30(%rbp), %eax
movl %eax, -0xe8(%rbp)
movq 0x28(%rbp), %rax
movq %rax, -0xd0(%rbp)
movl $0x1, -0x114(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
callq 0x13bdb0
cmpl $0x0, %eax
je 0x13bd78
movq $0x0, -0x8(%rbp)
jmp 0x13bd80
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/webp_dec.c
// Function: Decode
WEBP_NODISCARD static uint8_t* Decode(WEBP_CSP_MODE mode,
                                      const uint8_t* const data,
                                      size_t data_size, int* const width,
                                      int* const height,
                                      WebPDecBuffer* const keep_info) {
  WebPDecParams params;
  WebPDecBuffer output;

  if (!WebPInitDecBuffer(&output)) {
    return NULL;
  }
  WebPResetDecParams(&params);
  params.output = &output;
  output.colorspace = mode;

  // Retrieve (and report back) the required dimensions from bitstream.
  if (!WebPGetInfo(data, data_size, &output.width, &output.height)) {
    return NULL;
  }
  if (width != NULL) *width = output.width;
  if (height != NULL) *height = output.height;

  // Decode
  if (DecodeInto(data, data_size, &params) != VP8_STATUS_OK) {
    return NULL;
  }
  if (keep_info != NULL) {    // keep track of the side-info
    WebPCopyDecBuffer(&output, keep_info);
  }
  // return decoded samples (don't clear 'output'!)
  return WebPIsRGBMode(mode) ? output.u.RGBA.rgba : output.u.YUVA.y;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x13bd90
cmpl $0x0, %eax
jne 0x13c120
movq $0x0, -0x8(%rbp)
jmp 0x13c20e
leaq -0xa8(%rbp), %rdi
callq 0x13ba30
leaq -0x120(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x120(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x120(%rbp), %rdx
addq $0x4, %rdx
leaq -0x120(%rbp), %rcx
addq $0x8, %rcx
callq 0x5bef0
cmpl $0x0, %eax
jne 0x13c178
movq $0x0, -0x8(%rbp)
jmp 0x13c20e
cmpq $0x0, -0x28(%rbp)
je 0x13c18b
movl -0x11c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x30(%rbp)
je 0x13c19e
movl -0x118(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
callq 0x13bdb0
cmpl $0x0, %eax
je 0x13c1c1
movq $0x0, -0x8(%rbp)
jmp 0x13c20e
cmpq $0x0, -0x38(%rbp)
je 0x13c1d8
movq -0x38(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x13ad20
movl -0xc(%rbp), %edi
callq 0x13cb50
cmpl $0x0, %eax
je 0x13c1f5
movq -0x110(%rbp), %rax
movq %rax, -0x128(%rbp)
jmp 0x13c203
movq -0x110(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/webp_dec.c
// Function: WebPDecodeYUV
uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size,
                       int* width, int* height, uint8_t** u, uint8_t** v,
                       int* stride, int* uv_stride) {
  // data, width and height are checked by Decode().
  if (u == NULL || v == NULL || stride == NULL || uv_stride == NULL) {
    return NULL;
  }

  {
    WebPDecBuffer output;   // only to preserve the side-infos
    uint8_t* const out = Decode(MODE_YUV, data, data_size,
                                width, height, &output);

    if (out != NULL) {
      const WebPYUVABuffer* const buf = &output.u.YUVA;
      *u = buf->u;
      *v = buf->v;
      *stride = buf->y_stride;
      *uv_stride = buf->u_stride;
      assert(buf->u_stride == buf->v_stride);
    }
    return out;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x13c367
cmpq $0x0, -0x38(%rbp)
je 0x13c367
cmpq $0x0, 0x10(%rbp)
je 0x13c367
cmpq $0x0, 0x18(%rbp)
jne 0x13c374
movq $0x0, -0x8(%rbp)
jmp 0x13c444
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movl $0xb, %edi
leaq -0xb0(%rbp), %r9
callq 0x13c0e0
movq %rax, -0xb8(%rbp)
cmpq $0x0, -0xb8(%rbp)
je 0x13c439
leaq -0xb0(%rbp), %rax
addq $0x10, %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0xc0(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0xc0(%rbp), %rax
movl 0x20(%rax), %ecx
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0xc0(%rbp), %rax
movl 0x24(%rax), %ecx
movq 0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0xc0(%rbp), %rax
movl 0x24(%rax), %eax
movq -0xc0(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jne 0x13c418
jmp 0x13c437
leaq 0x7fe82(%rip), %rdi     # 0x1bc2a1
leaq 0x7fe2d(%rip), %rsi     # 0x1bc253
movl $0x2ad, %edx            # imm = 0x2AD
leaq 0x7fe8e(%rip), %rcx     # 0x1bc2c0
callq 0x598a0
jmp 0x13c439
movq -0xb8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/webp_dec.c
// Function: WebPGetInfo
int WebPGetInfo(const uint8_t* data, size_t data_size,
                int* width, int* height) {
  WebPBitstreamFeatures features;

  if (GetFeatures(data, data_size, &features) != VP8_STATUS_OK) {
    return 0;
  }

  if (width != NULL) {
    *width  = features.width;
  }
  if (height != NULL) {
    *height = features.height;
  }

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x13c4d0
cmpl $0x0, %eax
je 0x13c497
movl $0x0, -0x4(%rbp)
jmp 0x13c4be
cmpq $0x0, -0x20(%rbp)
je 0x13c4a7
movl -0x50(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x28(%rbp)
je 0x13c4b7
movl -0x4c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)