// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
callq 0x1316e0
cmpl $0x0, %eax
jne 0x131788
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x131660
movl %eax, -0x4(%rbp)
jmp 0x131a9e
movl $0x0, -0x14(%rbp)
cmpl $0x20, -0x14(%rbp)
jae 0x1317b6
movl -0x14(%rbp), %edi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
callq 0x1316f0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x13178f
movl $0x0, -0x14(%rbp)
cmpl $0x20, -0x14(%rbp)
jae 0x1317f1
movl -0x14(%rbp), %edi
addl $0x80000000, %edi       # imm = 0x80000000
movq -0x10(%rbp), %rsi
addq $0x200, %rsi            # imm = 0x200
movl -0x14(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rsi
callq 0x1316f0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1317bd
movl $0x0, -0x14(%rbp)
cmpl $0x8, -0x14(%rbp)
jae 0x131878
movq -0x10(%rbp), %rdi
addq $0x400, %rdi            # imm = 0x400
movl -0x14(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5a200
movq -0x10(%rbp), %rax
addq $0x400, %rax            # imm = 0x400
movl -0x14(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl $0x4, (%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
addq $0x400, %rax            # imm = 0x400
movl -0x14(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
addq $0x400, %rdi            # imm = 0x400
movl -0x14(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x131740
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1317f8
movl $0x0, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jae 0x1318ff
movq -0x10(%rbp), %rdi
addq $0x480, %rdi            # imm = 0x480
movl -0x14(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5a200
movq -0x10(%rbp), %rax
addq $0x480, %rax            # imm = 0x480
movl -0x14(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl $0xb, (%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
addq $0x480, %rax            # imm = 0x480
movl -0x14(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
addq $0x480, %rdi            # imm = 0x480
movl -0x14(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x131740
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x13187f
movl $0x0, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jae 0x131986
movq -0x10(%rbp), %rdi
addq $0x4c0, %rdi            # imm = 0x4C0
movl -0x14(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5a200
movq -0x10(%rbp), %rax
addq $0x4c0, %rax            # imm = 0x4C0
movl -0x14(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl $0x12, (%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
addq $0x4c0, %rax            # imm = 0x4C0
movl -0x14(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
addq $0x4c0, %rdi            # imm = 0x4C0
movl -0x14(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x131740
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x131906
movl $0x0, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jae 0x131a0d
movq -0x10(%rbp), %rdi
addq $0x500, %rdi            # imm = 0x500
movl -0x14(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5a200
movq -0x10(%rbp), %rax
addq $0x500, %rax            # imm = 0x500
movl -0x14(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl $0x14, (%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
addq $0x500, %rax            # imm = 0x500
movl -0x14(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
addq $0x500, %rdi            # imm = 0x500
movl -0x14(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x131740
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x13198d
movl $0x0, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jae 0x131a94
movq -0x10(%rbp), %rdi
addq $0x540, %rdi            # imm = 0x540
movl -0x14(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5a200
movq -0x10(%rbp), %rax
addq $0x540, %rax            # imm = 0x540
movl -0x14(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl $0x8000001d, (%rax)     # imm = 0x8000001D
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
addq $0x540, %rax            # imm = 0x540
movl -0x14(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
addq $0x540, %rdi            # imm = 0x540
movl -0x14(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x131740
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x131a14
xorl %edi, %edi
callq 0x131660
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)