// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/libcpuid_util.c
// Function: generic_get_cpu_list
void generic_get_cpu_list(const struct match_entry_t* matchtable, int count,
                          struct cpu_list_t* list)
{
	int i, j, n, good;
	n = 0;
	list->names = (char**) malloc(sizeof(char*) * count);
	if (!list->names) { /* Memory allocation failure */
		cpuid_set_error(ERR_NO_MEM);
		list->num_entries = 0;
		return;
	}
	for (i = 0; i < count; i++) {
		if (strstr(matchtable[i].name, "Unknown")) continue;
		good = 1;
		for (j = n - 1; j >= 0; j--)
			if (!strcmp(list->names[j], matchtable[i].name)) {
				good = 0;
				break;
			}
		if (!good) continue;
#if defined(_MSC_VER)
		list->names[n] = _strdup(matchtable[i].name);
#else
		list->names[n] = strdup(matchtable[i].name);
#endif
		if (!list->names[n]) { /* Memory allocation failure */
			cpuid_set_error(ERR_NO_MEM);
			list->num_entries = 0;
			for (j = 0; j < n; j++) {
				free(list->names[j]);
			}
			free(list->names);
			list->names = NULL;
			return;
		}
		n++;
	}
	list->num_entries = n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movslq -0xc(%rbp), %rdi
shlq $0x3, %rdi
callq 0x5c920
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x135d56
movl $0xfffffffd, %edi       # imm = 0xFFFFFFFD
callq 0x131660
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
jmp 0x135eb3
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x135eaa
movq -0x8(%rbp), %rdi
movslq -0x1c(%rbp), %rax
imulq $0x78, %rax, %rax
addq %rax, %rdi
addq $0x34, %rdi
leaq 0x72475(%rip), %rsi     # 0x1a81f8
callq 0x5ab80
cmpq $0x0, %rax
je 0x135d93
jmp 0x135e9c
movl $0x1, -0x28(%rbp)
movl -0x24(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jl 0x135dec
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x8(%rbp), %rsi
movslq -0x1c(%rbp), %rax
imulq $0x78, %rax, %rax
addq %rax, %rsi
addq $0x34, %rsi
callq 0x5c440
cmpl $0x0, %eax
jne 0x135ddf
movl $0x0, -0x28(%rbp)
jmp 0x135dec
jmp 0x135de1
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x135da3
cmpl $0x0, -0x28(%rbp)
jne 0x135df7
jmp 0x135e9c
movq -0x8(%rbp), %rdi
movslq -0x1c(%rbp), %rax
imulq $0x78, %rax, %rax
addq %rax, %rdi
addq $0x34, %rdi
callq 0x59110
movq %rax, %rdx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x135e93
movl $0xfffffffd, %edi       # imm = 0xFFFFFFFD
callq 0x131660
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x135e78
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x59930
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x135e50
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x59930
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
jmp 0x135eb3
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x135d5d
movl -0x24(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)