// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/recog_intel.c
// Function: decode_intel_oldstyle_cache_info
static void decode_intel_oldstyle_cache_info(struct cpu_raw_data_t* raw, struct cpu_id_t* data)
{
	uint8_t f[256] = {0};
	int reg, off;
	uint32_t x;
	for (reg = 0; reg < 4; reg++) {
		x = raw->basic_cpuid[2][reg];
		if (x & 0x80000000) continue;
		for (off = 0; off < 4; off++) {
			f[x & 0xff] = 1;
			x >>= 8;
		}
	}

	assign_cache_data(f[0x06], L1I,      8,  4,  32, data);
	assign_cache_data(f[0x08], L1I,     16,  4,  32, data);
	assign_cache_data(f[0x0A], L1D,      8,  2,  32, data);
	assign_cache_data(f[0x0C], L1D,     16,  4,  32, data);
	assign_cache_data(f[0x22],  L3,    512,  4,  64, data);
	assign_cache_data(f[0x23],  L3,   1024,  8,  64, data);
	assign_cache_data(f[0x25],  L3,   2048,  8,  64, data);
	assign_cache_data(f[0x29],  L3,   4096,  8,  64, data);
	assign_cache_data(f[0x2C], L1D,     32,  8,  64, data);
	assign_cache_data(f[0x30], L1I,     32,  8,  64, data);
	assign_cache_data(f[0x39],  L2,    128,  4,  64, data);
	assign_cache_data(f[0x3A],  L2,    192,  6,  64, data);
	assign_cache_data(f[0x3B],  L2,    128,  2,  64, data);
	assign_cache_data(f[0x3C],  L2,    256,  4,  64, data);
	assign_cache_data(f[0x3D],  L2,    384,  6,  64, data);
	assign_cache_data(f[0x3E],  L2,    512,  4,  64, data);
	assign_cache_data(f[0x41],  L2,    128,  4,  32, data);
	assign_cache_data(f[0x42],  L2,    256,  4,  32, data);
	assign_cache_data(f[0x43],  L2,    512,  4,  32, data);
	assign_cache_data(f[0x44],  L2,   1024,  4,  32, data);
	assign_cache_data(f[0x45],  L2,   2048,  4,  32, data);
	assign_cache_data(f[0x46],  L3,   4096,  4,  64, data);
	assign_cache_data(f[0x47],  L3,   8192,  8,  64, data);
	assign_cache_data(f[0x4A],  L3,   6144, 12,  64, data);
	assign_cache_data(f[0x4B],  L3,   8192, 16,  64, data);
	assign_cache_data(f[0x4C],  L3,  12288, 12,  64, data);
	assign_cache_data(f[0x4D],  L3,  16384, 16,  64, data);
	assign_cache_data(f[0x4E],  L2,   6144, 24,  64, data);
	assign_cache_data(f[0x60], L1D,     16,  8,  64, data);
	assign_cache_data(f[0x66], L1D,      8,  4,  64, data);
	assign_cache_data(f[0x67], L1D,     16,  4,  64, data);
	assign_cache_data(f[0x68], L1D,     32,  4,  64, data);
	/* The following four entries are trace cache. Intel does not
	 * specify a cache-line size, so we use -1 instead
	 */
	assign_cache_data(f[0x70], L1I,     12,  8,  -1, data);
	assign_cache_data(f[0x71], L1I,     16,  8,  -1, data);
	assign_cache_data(f[0x72], L1I,     32,  8,  -1, data);
	assign_cache_data(f[0x73], L1I,     64,  8,  -1, data);

	assign_cache_data(f[0x78],  L2,   1024,  4,  64, data);
	assign_cache_data(f[0x79],  L2,    128,  8,  64, data);
	assign_cache_data(f[0x7A],  L2,    256,  8,  64, data);
	assign_cache_data(f[0x7B],  L2,    512,  8,  64, data);
	assign_cache_data(f[0x7C],  L2,   1024,  8,  64, data);
	assign_cache_data(f[0x7D],  L2,   2048,  8,  64, data);
	assign_cache_data(f[0x7F],  L2,    512,  2,  64, data);
	assign_cache_data(f[0x82],  L2,    256,  8,  32, data);
	assign_cache_data(f[0x83],  L2,    512,  8,  32, data);
	assign_cache_data(f[0x84],  L2,   1024,  8,  32, data);
	assign_cache_data(f[0x85],  L2,   2048,  8,  32, data);
	assign_cache_data(f[0x86],  L2,    512,  4,  64, data);
	assign_cache_data(f[0x87],  L2,   1024,  8,  64, data);

	if (f[0x49]) {
		/* This flag is overloaded with two meanings. On Xeon MP
		 * (family 0xf, model 0x6) this means L3 cache. On all other
		 * CPUs (notably Conroe et al), this is L2 cache. In both cases
		 * it means 4MB, 16-way associative, 64-byte line size.
		 */
		if (data->family == 0xf && data->model == 0x6) {
			data->l3_cache = 4096;
			data->l3_assoc = 16;
			data->l3_cacheline = 64;
		} else {
			data->l2_cache = 4096;
			data->l2_assoc = 16;
			data->l2_cacheline = 64;
		}
	}
	if (f[0x40]) {
		/* Again, a special flag. It means:
		 * 1) If no L2 is specified, then CPU is w/o L2 (0 KB)
		 * 2) If L2 is specified by other flags, then, CPU is w/o L3.
		 */
		if (data->l2_cache == -1) {
			data->l2_cache = 0;
		} else {
			data->l3_cache = 0;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x5a200
movl $0x0, -0x114(%rbp)
cmpl $0x4, -0x114(%rbp)
jge 0x1389e2
movq -0x8(%rbp), %rax
movslq -0x114(%rbp), %rcx
movl 0x20(%rax,%rcx,4), %eax
movl %eax, -0x11c(%rbp)
movl -0x11c(%rbp), %eax
andl $0x80000000, %eax       # imm = 0x80000000
cmpl $0x0, %eax
je 0x138984
jmp 0x1389ce
movl $0x0, -0x118(%rbp)
cmpl $0x4, -0x118(%rbp)
jge 0x1389cc
movl -0x11c(%rbp), %eax
andl $0xff, %eax
movl %eax, %eax
movb $0x1, -0x110(%rbp,%rax)
movl -0x11c(%rbp), %eax
shrl $0x8, %eax
movl %eax, -0x11c(%rbp)
movl -0x118(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x118(%rbp)
jmp 0x13898e
jmp 0x1389ce
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
jmp 0x138950
movb -0x10a(%rbp), %al
movq -0x10(%rbp), %r9
xorl %esi, %esi
movl $0x8, %edx
movl $0x4, %ecx
movl $0x20, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0x108(%rbp), %al
movq -0x10(%rbp), %r9
xorl %esi, %esi
movl $0x10, %edx
movl $0x4, %ecx
movl $0x20, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0x106(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x1, %esi
movl $0x8, %edx
movl $0x2, %ecx
movl $0x20, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0x104(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x1, %esi
movl $0x10, %edx
movl $0x4, %ecx
movl $0x20, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xee(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x3, %esi
movl $0x200, %edx            # imm = 0x200
movl $0x4, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xed(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x3, %esi
movl $0x400, %edx            # imm = 0x400
movl $0x8, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xeb(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x3, %esi
movl $0x800, %edx            # imm = 0x800
movl $0x8, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xe7(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x3, %esi
movl $0x1000, %edx           # imm = 0x1000
movl $0x8, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xe4(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x1, %esi
movl $0x20, %edx
movl $0x8, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xe0(%rbp), %al
movq -0x10(%rbp), %r9
xorl %esi, %esi
movl $0x20, %edx
movl $0x8, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xd7(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x80, %edx
movl $0x4, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xd6(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0xc0, %edx
movl $0x6, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xd5(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %ecx
movl $0x80, %edx
movl $0x40, %r8d
movzbl %al, %edi
movl %ecx, %esi
callq 0x1363c0
movb -0xd4(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x100, %edx            # imm = 0x100
movl $0x4, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xd3(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x180, %edx            # imm = 0x180
movl $0x6, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xd2(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x200, %edx            # imm = 0x200
movl $0x4, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xcf(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x80, %edx
movl $0x4, %ecx
movl $0x20, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xce(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x100, %edx            # imm = 0x100
movl $0x4, %ecx
movl $0x20, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xcd(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x200, %edx            # imm = 0x200
movl $0x4, %ecx
movl $0x20, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xcc(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x400, %edx            # imm = 0x400
movl $0x4, %ecx
movl $0x20, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xcb(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x800, %edx            # imm = 0x800
movl $0x4, %ecx
movl $0x20, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xca(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x3, %esi
movl $0x1000, %edx           # imm = 0x1000
movl $0x4, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xc9(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x3, %esi
movl $0x2000, %edx           # imm = 0x2000
movl $0x8, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xc6(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x3, %esi
movl $0x1800, %edx           # imm = 0x1800
movl $0xc, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xc5(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x3, %esi
movl $0x2000, %edx           # imm = 0x2000
movl $0x10, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xc4(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x3, %esi
movl $0x3000, %edx           # imm = 0x3000
movl $0xc, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xc3(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x3, %esi
movl $0x4000, %edx           # imm = 0x4000
movl $0x10, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xc2(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x1800, %edx           # imm = 0x1800
movl $0x18, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xb0(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x1, %esi
movl $0x10, %edx
movl $0x8, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xaa(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x1, %esi
movl $0x8, %edx
movl $0x4, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xa9(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x1, %esi
movl $0x10, %edx
movl $0x4, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xa8(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x1, %esi
movl $0x20, %edx
movl $0x4, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0xa0(%rbp), %al
movq -0x10(%rbp), %r9
xorl %esi, %esi
movl $0xc, %edx
movl $0x8, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movzbl %al, %edi
callq 0x1363c0
movb -0x9f(%rbp), %al
movq -0x10(%rbp), %r9
xorl %esi, %esi
movl $0x10, %edx
movl $0x8, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movzbl %al, %edi
callq 0x1363c0
movb -0x9e(%rbp), %al
movq -0x10(%rbp), %r9
xorl %esi, %esi
movl $0x20, %edx
movl $0x8, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movzbl %al, %edi
callq 0x1363c0
movb -0x9d(%rbp), %al
movq -0x10(%rbp), %r9
xorl %esi, %esi
movl $0x40, %edx
movl $0x8, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movzbl %al, %edi
callq 0x1363c0
movb -0x98(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x400, %edx            # imm = 0x400
movl $0x4, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0x97(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x80, %edx
movl $0x8, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0x96(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x100, %edx            # imm = 0x100
movl $0x8, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0x95(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x200, %edx            # imm = 0x200
movl $0x8, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0x94(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x400, %edx            # imm = 0x400
movl $0x8, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0x93(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x800, %edx            # imm = 0x800
movl $0x8, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0x91(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %ecx
movl $0x200, %edx            # imm = 0x200
movl $0x40, %r8d
movzbl %al, %edi
movl %ecx, %esi
callq 0x1363c0
movb -0x8e(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x100, %edx            # imm = 0x100
movl $0x8, %ecx
movl $0x20, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0x8d(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x200, %edx            # imm = 0x200
movl $0x8, %ecx
movl $0x20, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0x8c(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x400, %edx            # imm = 0x400
movl $0x8, %ecx
movl $0x20, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0x8b(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x800, %edx            # imm = 0x800
movl $0x8, %ecx
movl $0x20, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0x8a(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x200, %edx            # imm = 0x200
movl $0x4, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
movb -0x89(%rbp), %al
movq -0x10(%rbp), %r9
movl $0x2, %esi
movl $0x400, %edx            # imm = 0x400
movl $0x8, %ecx
movl $0x40, %r8d
movzbl %al, %edi
callq 0x1363c0
cmpb $0x0, -0xc7(%rbp)
je 0x1391b9
movq -0x10(%rbp), %rax
cmpl $0xf, 0xd8(%rax)
jne 0x13918d
movq -0x10(%rbp), %rax
cmpl $0x6, 0xdc(%rax)
jne 0x13918d
movq -0x10(%rbp), %rax
movl $0x1000, 0x104(%rax)    # imm = 0x1000
movq -0x10(%rbp), %rax
movl $0x10, 0x11c(%rax)
movq -0x10(%rbp), %rax
movl $0x40, 0x134(%rax)
jmp 0x1391b7
movq -0x10(%rbp), %rax
movl $0x1000, 0x100(%rax)    # imm = 0x1000
movq -0x10(%rbp), %rax
movl $0x10, 0x118(%rax)
movq -0x10(%rbp), %rax
movl $0x40, 0x130(%rax)
jmp 0x1391b9
cmpb $0x0, -0xd0(%rbp)
je 0x1391ef
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x100(%rax)
jne 0x1391df
movq -0x10(%rbp), %rax
movl $0x0, 0x100(%rax)
jmp 0x1391ed
movq -0x10(%rbp), %rax
movl $0x0, 0x104(%rax)
jmp 0x1391ef
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopl (%rax,%rax)