// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libcpuid/cpuid_main.c
// Function: cpuid_get_raw_data
int cpuid_get_raw_data(struct cpu_raw_data_t* data)
{
	unsigned i;
	if (!cpuid_present())
		return cpuid_set_error(ERR_NO_CPUID);
	for (i = 0; i < 32; i++)
		cpu_exec_cpuid(i, data->basic_cpuid[i]);
	for (i = 0; i < 32; i++)
		cpu_exec_cpuid(0x80000000 + i, data->ext_cpuid[i]);
	for (i = 0; i < MAX_INTELFN4_LEVEL; i++) {
		memset(data->intel_fn4[i], 0, sizeof(data->intel_fn4[i]));
		data->intel_fn4[i][EAX] = 4;
		data->intel_fn4[i][ECX] = i;
		cpu_exec_cpuid_ext(data->intel_fn4[i]);
	}
	for (i = 0; i < MAX_INTELFN11_LEVEL; i++) {
		memset(data->intel_fn11[i], 0, sizeof(data->intel_fn11[i]));
		data->intel_fn11[i][EAX] = 11;
		data->intel_fn11[i][ECX] = i;
		cpu_exec_cpuid_ext(data->intel_fn11[i]);
	}
	for (i = 0; i < MAX_INTELFN12H_LEVEL; i++) {
		memset(data->intel_fn12h[i], 0, sizeof(data->intel_fn12h[i]));
		data->intel_fn12h[i][EAX] = 0x12;
		data->intel_fn12h[i][ECX] = i;
		cpu_exec_cpuid_ext(data->intel_fn12h[i]);
	}
	for (i = 0; i < MAX_INTELFN14H_LEVEL; i++) {
		memset(data->intel_fn14h[i], 0, sizeof(data->intel_fn14h[i]));
		data->intel_fn14h[i][EAX] = 0x14;
		data->intel_fn14h[i][ECX] = i;
		cpu_exec_cpuid_ext(data->intel_fn14h[i]);
	}
	for (i = 0; i < MAX_AMDFN8000001DH_LEVEL; i++) {
		memset(data->amd_fn8000001dh[i], 0, sizeof(data->amd_fn8000001dh[i]));
		data->amd_fn8000001dh[i][EAX] = 0x8000001d;
		data->amd_fn8000001dh[i][ECX] = i;
		cpu_exec_cpuid_ext(data->amd_fn8000001dh[i]);
	}
	return cpuid_set_error(ERR_OK);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0xcd8f0
testl %eax, %eax
je 0xc83b8
xorl %r15d, %r15d
movq %rbx, %r14
movl %r15d, (%r14)
movl $0x0, 0xc(%r14)
movq $0x0, 0x4(%r14)
movq %r14, %rdi
callq 0xcd8f6
incq %r15
addq $0x10, %r14
cmpq $0x20, %r15
jne 0xc825e
leaq 0x200(%rbx), %r14
xorl %r15d, %r15d
movl %r15d, %eax
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, (%r14)
movl $0x0, 0xc(%r14)
movq $0x0, 0x4(%r14)
movq %r14, %rdi
callq 0xcd8f6
incq %r15
addq $0x10, %r14
cmpq $0x20, %r15
jne 0xc8290
leaq 0x400(%rbx), %r14
xorl %r15d, %r15d
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movl $0x4, (%r14)
movl %r15d, 0x8(%r14)
movq %r14, %rdi
callq 0xcd8f6
incq %r15
addq $0x10, %r14
cmpq $0x8, %r15
jne 0xc82ca
leaq 0x480(%rbx), %r14
xorl %r15d, %r15d
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movl $0xb, (%r14)
movl %r15d, 0x8(%r14)
movq %r14, %rdi
callq 0xcd8f6
incq %r15
addq $0x10, %r14
cmpq $0x4, %r15
jne 0xc82fb
leaq 0x4c0(%rbx), %r14
xorl %r15d, %r15d
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movl $0x12, (%r14)
movl %r15d, 0x8(%r14)
movq %r14, %rdi
callq 0xcd8f6
incq %r15
addq $0x10, %r14
cmpq $0x4, %r15
jne 0xc832c
leaq 0x500(%rbx), %r14
xorl %r15d, %r15d
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movl $0x14, (%r14)
movl %r15d, 0x8(%r14)
movq %r14, %rdi
callq 0xcd8f6
incq %r15
addq $0x10, %r14
cmpq $0x4, %r15
jne 0xc835d
addq $0x540, %rbx            # imm = 0x540
xorl %r14d, %r14d
xorl %r15d, %r15d
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl $0x8000001d, (%rbx)     # imm = 0x8000001D
movl %r15d, 0x8(%rbx)
movq %rbx, %rdi
callq 0xcd8f6
incq %r15
addq $0x10, %rbx
cmpq $0x4, %r15
jne 0xc8391
jmp 0xc83be
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
leaq 0xa3f6b(%rip), %rdi     # 0x16c330
callq 0x566e0
movl %r14d, 0x30(%rax)
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq