// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/recog_centaur.c
// Function: cpuid_identify_centaur
int cpuid_identify_centaur(struct cpu_raw_data_t* raw, struct cpu_id_t* data, struct internal_id_info_t* internal)
{
	centaur_code_and_bits_t brand;
	centaur_model_t model_code;
	int i;
	char* brand_code_str = NULL;

	if (raw->basic_cpuid[0][EAX] >= 4)
		decode_deterministic_cache_info_x86(raw->intel_fn4, MAX_INTELFN4_LEVEL, data, internal);
	decode_number_of_cores_x86(raw, data);

	brand = get_brand_code_and_bits(data);
	model_code = get_model_code(data, brand);
	for (i = 0; i < COUNT_OF(centaur_code_str); i++) {
		if (brand.code == centaur_code_str[i].code) {
			brand_code_str = centaur_code_str[i].str;
			break;
		}
	}
	if (brand_code_str)
		debugf(2, "Detected Centaur brand code: %d (%s)\n", brand.code, brand_code_str);
	else
		debugf(2, "Detected Centaur brand code: %d\n", brand.code);
	if (brand.bits) {
		debugf(2, "Detected Centaur bits: ");
		debug_print_lbits(2, brand.bits);
	}
	debugf(2, "Detected Centaur model code: %d\n", model_code);

	internal->code.centaur = brand.code;
	internal->bits = brand.bits;
	internal->score = match_cpu_codename(cpudb_centaur, COUNT_OF(cpudb_centaur), data,
		brand.code, brand.bits, model_code);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x4, (%rax)
jb 0x137fc2
movq -0x8(%rbp), %rdi
addq $0x400, %rdi            # imm = 0x400
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x8, %esi
callq 0x1365e0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1364e0
movq -0x10(%rbp), %rdi
callq 0x138120
movl %eax, -0x48(%rbp)
movq %rdx, -0x40(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x138300
movl %eax, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movslq -0x30(%rbp), %rax
cmpq $0x2, %rax
jae 0x138055
movl -0x28(%rbp), %eax
movslq -0x30(%rbp), %rdx
leaq 0xcfb5f(%rip), %rcx     # 0x207b80
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x138048
movslq -0x30(%rbp), %rcx
leaq 0xcfb49(%rip), %rax     # 0x207b80
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x138055
jmp 0x13804a
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x138009
cmpq $0x0, -0x38(%rbp)
je 0x138078
movl -0x28(%rbp), %edx
movq -0x38(%rbp), %rcx
movl $0x2, %edi
leaq 0x78e55(%rip), %rsi     # 0x1b0ec4
movb $0x0, %al
callq 0x135780
jmp 0x13808e
movl -0x28(%rbp), %edx
movl $0x2, %edi
leaq 0x78e63(%rip), %rsi     # 0x1b0eea
movb $0x0, %al
callq 0x135780
cmpq $0x0, -0x20(%rbp)
je 0x1380b6
movl $0x2, %edi
leaq 0x78e6a(%rip), %rsi     # 0x1b0f0b
movb $0x0, %al
callq 0x135780
movq -0x20(%rbp), %rsi
movl $0x2, %edi
callq 0x1361c0
movl -0x2c(%rbp), %edx
movl $0x2, %edi
leaq 0x78e5e(%rip), %rsi     # 0x1b0f23
movb $0x0, %al
callq 0x135780
movl -0x28(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdx
movl -0x28(%rbp), %ecx
movq -0x20(%rbp), %r8
movl -0x2c(%rbp), %r9d
leaq 0x782f9(%rip), %rdi     # 0x1b03f0
movl $0x17, %esi
callq 0x135860
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)