// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/libcpuid_util.c
// Function: score
static int score(const struct match_entry_t* entry, const struct cpu_id_t* data,
                 int brand_code, uint64_t bits, int model_code)
{
	int i, tmp, res = 0;
	const struct { const char *field; int entry; int data; int score; } array[] = {
		{ "family",     entry->family,     data->family,     2 },
		{ "model",      entry->model,      data->model,      2 },
		{ "stepping",   entry->stepping,   data->stepping,   2 },
		{ "ext_family", entry->ext_family, data->ext_family, 2 },
		{ "ext_model",  entry->ext_model,  data->ext_model,  2 },
		{ "ncores",     entry->ncores,     data->num_cores,  2 },
		{ "l2cache",    entry->l2cache,    data->l2_cache,   1 },
		{ "l3cache",    entry->l3cache,    data->l3_cache,   1 },
		{ "brand_code", entry->brand_code, brand_code,       2 },
		{ "model_code", entry->model_code, model_code,       2 },
	};
	for (i = 0; i < sizeof(array) / sizeof(array[0]); i++) {
		if(array[i].entry == array[i].data) {
			res += array[i].score;
			debugf(4, "Score: %-12s matches, adding %2i (current score for this entry: %2i)\n", array[i].field, array[i].score, res);
		}
	}

	tmp = popcount64(entry->model_bits & bits) * 2;
	res += tmp;
	debugf(4, "Score: %-12s matches, adding %2i (current score for this entry: %2i)\n", "model_bits", tmp, res);
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl $0x0, -0x30(%rbp)
leaq 0x7285e(%rip), %rax     # 0x1a828a
movq %rax, -0x120(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x118(%rbp)
movq -0x10(%rbp), %rax
movl 0xd8(%rax), %eax
movl %eax, -0x114(%rbp)
movl $0x2, -0x110(%rbp)
leaq 0x72835(%rip), %rax     # 0x1a8295
movq %rax, -0x108(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x100(%rbp)
movq -0x10(%rbp), %rax
movl 0xdc(%rax), %eax
movl %eax, -0xfc(%rbp)
movl $0x2, -0xf8(%rbp)
leaq 0x727e8(%rip), %rax     # 0x1a827d
movq %rax, -0xf0(%rbp)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0xe8(%rbp)
movq -0x10(%rbp), %rax
movl 0xe0(%rax), %eax
movl %eax, -0xe4(%rbp)
movl $0x2, -0xe0(%rbp)
leaq 0x727bc(%rip), %rax     # 0x1a8286
movq %rax, -0xd8(%rbp)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0xd0(%rbp)
movq -0x10(%rbp), %rax
movl 0xe4(%rax), %eax
movl %eax, -0xcc(%rbp)
movl $0x2, -0xc8(%rbp)
leaq 0x72792(%rip), %rax     # 0x1a8291
movq %rax, -0xc0(%rbp)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0xb8(%rbp)
movq -0x10(%rbp), %rax
movl 0xe8(%rax), %eax
movl %eax, -0xb4(%rbp)
movl $0x2, -0xb0(%rbp)
leaq 0x72767(%rip), %rax     # 0x1a829b
movq %rax, -0xa8(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0xa0(%rbp)
movq -0x10(%rbp), %rax
movl 0xec(%rax), %eax
movl %eax, -0x9c(%rbp)
movl $0x2, -0x98(%rbp)
leaq 0x72739(%rip), %rax     # 0x1a82a2
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x88(%rbp)
movq -0x10(%rbp), %rax
movl 0x100(%rax), %eax
movl %eax, -0x84(%rbp)
movl $0x1, -0x80(%rbp)
leaq 0x7270f(%rip), %rax     # 0x1a82aa
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x10(%rbp), %rax
movl 0x104(%rax), %eax
movl %eax, -0x6c(%rbp)
movl $0x1, -0x68(%rbp)
leaq 0x726ee(%rip), %rax     # 0x1a82b2
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x58(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x54(%rbp)
movl $0x2, -0x50(%rbp)
leaq 0x726d7(%rip), %rax     # 0x1a82bd
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x40(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl $0x2, -0x38(%rbp)
movl $0x0, -0x28(%rbp)
movslq -0x28(%rbp), %rax
cmpq $0xa, %rax
jae 0x135cae
movslq -0x28(%rbp), %rcx
leaq -0x120(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movslq -0x28(%rbp), %rdx
leaq -0x120(%rbp), %rcx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl 0xc(%rcx), %eax
jne 0x135c9e
movslq -0x28(%rbp), %rcx
leaq -0x120(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movslq -0x28(%rbp), %rcx
leaq -0x120(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movslq -0x28(%rbp), %rcx
leaq -0x120(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movl -0x30(%rbp), %r8d
movl $0x4, %edi
leaq 0x72631(%rip), %rsi     # 0x1a82c8
movb $0x0, %al
callq 0x135780
jmp 0x135ca0
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x135c08
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
andq -0x20(%rbp), %rdi
callq 0x136900
shll %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %ecx
movl -0x30(%rbp), %r8d
movl $0x4, %edi
leaq 0x725e8(%rip), %rsi     # 0x1a82c8
leaq 0x72627(%rip), %rdx     # 0x1a830e
movb $0x0, %al
callq 0x135780
movl -0x30(%rbp), %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw (%rax,%rax)