// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libcpuid/recog_intel.c
// Function: get_model_code
static intel_model_t get_model_code(struct cpu_id_t* data)
{
	int i = 0;
	int l = (int) strlen(data->brand_str);
	const char *bs = data->brand_str;
	int mod_flags = 0, model_no = 0, ndigs = 0;
	/* If the CPU is a Core ix, then just return the model number generation: */
	if ((i = match_pattern(bs, "Core(TM) i[3579]")) != 0) {
		i += 11;
		if (i + 4 >= l) return UNKNOWN;
		if (bs[i] == '2') return _2xxx;
		if (bs[i] == '3') return _3xxx;
		if (bs[i] == '4') return _4xxx;
		if (bs[i] == '5') return _5xxx;
		if (bs[i] == '6') return _6xxx;
		if (bs[i] == '7') return _7xxx;
		if (bs[i] == '8') return _8xxx;
		if (bs[i] == '9') return _9xxx;
		if ((bs[i] == '1') && (bs[i+1] == '0')) return _10xxx;
		if ((bs[i] == '1') && (bs[i+1] == '1')) return _11xxx;
		if ((bs[i] == '1') && (bs[i+1] == '2')) return _12xxx;
		if ((bs[i] == '1') && (bs[i+1] == '3')) return _13xxx;
		return UNKNOWN;
	}
	else if ((i = match_pattern(bs, "Xeon(R) [WBSGP]")) != 0) {
		i = 0;
		if                   ((i = match_pattern(bs, "Xeon(R) W-"))       != 0)  i += 10;
		else if ((i == 0) && ((i = match_pattern(bs, "Xeon(R) Bronze"))   != 0)) i += 15;
		else if ((i == 0) && ((i = match_pattern(bs, "Xeon(R) Silver"))   != 0)) i += 15;
		else if ((i == 0) && ((i = match_pattern(bs, "Xeon(R) Gold"))     != 0)) i += 13;
		else if ((i == 0) && ((i = match_pattern(bs, "Xeon(R) Platinum")) != 0)) i += 17;
		else if ((i == 0) && ((i = match_pattern(bs, "Xeon(R) Max"))      != 0)) i += 12;

		if (i == 0) return UNKNOWN;
		if (bs[i] == '1') return _x1xx;
		if (bs[i] == '2') return _x2xx;
		if (bs[i] == '3') return _x3xx;
		if (bs[i] == '4') return _x4xx;
		return UNKNOWN;
	}

	/* For Core2-based Xeons: */
	while (i < l - 3) {
		if (bs[i] == 'C' && bs[i+1] == 'P' && bs[i+2] == 'U')
			break;
		i++;
	}
	if (i >= l - 3) return UNKNOWN;
	i += 3;
	while (i < l - 4 && bs[i] == ' ') i++;
	if (i >= l - 4) return UNKNOWN;
	while (i < l - 4 && !isdigit(bs[i])) {
		if (bs[i] >= 'A' && bs[i] <= 'Z')
			mod_flags |= (1 << (bs[i] - 'A'));
		i++;
	}
	if (i >= l - 4) return UNKNOWN;
	while (isdigit(bs[i])) {
		ndigs++;
		model_no = model_no * 10 + (int) (bs[i] - '0');
		i++;
	}
	if (ndigs != 4) return UNKNOWN;
#define HAVE(ch, flags) ((flags & (1 << ((int)(ch-'A')))) != 0)
	switch (model_no / 100) {
		case 30: return _3000;
		case 31: return _3100;
		case 32:
		{
			return (HAVE('X', mod_flags)) ? X3200 : _3200;
		}
		case 33:
		{
			return (HAVE('X', mod_flags)) ? X3300 : _3300;
		}
		case 51: return _5100;
		case 52: return _5200;
		case 53: return _5300;
		case 54: return _5400;
		default:
			return UNKNOWN;
	}
#undef HAVE
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
addq $0x14, %rdi
callq 0x5a790
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x14, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x8255b(%rip), %rsi     # 0x1bc01a
callq 0x135ec0
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x139cb0
movl -0x14(%rbp), %eax
addl $0xb, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x4, %eax
cmpl -0x18(%rbp), %eax
jl 0x139af0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x32, %eax
jne 0x139b0d
movl $0x6e, -0x4(%rbp)
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x33, %eax
jne 0x139b2a
movl $0x6f, -0x4(%rbp)
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x34, %eax
jne 0x139b47
movl $0x70, -0x4(%rbp)
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x35, %eax
jne 0x139b64
movl $0x71, -0x4(%rbp)
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x36, %eax
jne 0x139b81
movl $0x72, -0x4(%rbp)
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x37, %eax
jne 0x139b9e
movl $0x73, -0x4(%rbp)
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x38, %eax
jne 0x139bbb
movl $0x74, -0x4(%rbp)
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x39, %eax
jne 0x139bd8
movl $0x75, -0x4(%rbp)
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x31, %eax
jne 0x139c0b
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x30, %eax
jne 0x139c0b
movl $0x76, -0x4(%rbp)
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x31, %eax
jne 0x139c3e
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x31, %eax
jne 0x139c3e
movl $0x77, -0x4(%rbp)
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x31, %eax
jne 0x139c71
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x32, %eax
jne 0x139c71
movl $0x78, -0x4(%rbp)
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x31, %eax
jne 0x139ca4
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x33, %eax
jne 0x139ca4
movl $0x79, -0x4(%rbp)
jmp 0x13a102
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13a102
movq -0x20(%rbp), %rdi
leaq 0x82370(%rip), %rsi     # 0x1bc02b
callq 0x135ec0
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x139e63
movl $0x0, -0x14(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x8235d(%rip), %rsi     # 0x1bc03b
callq 0x135ec0
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x139cf9
movl -0x14(%rbp), %eax
addl $0xa, %eax
movl %eax, -0x14(%rbp)
jmp 0x139dd1
cmpl $0x0, -0x14(%rbp)
jne 0x139d25
movq -0x20(%rbp), %rdi
leaq 0x8233c(%rip), %rsi     # 0x1bc046
callq 0x135ec0
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x139d25
movl -0x14(%rbp), %eax
addl $0xf, %eax
movl %eax, -0x14(%rbp)
jmp 0x139dcf
cmpl $0x0, -0x14(%rbp)
jne 0x139d4e
movq -0x20(%rbp), %rdi
leaq 0x8231f(%rip), %rsi     # 0x1bc055
callq 0x135ec0
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x139d4e
movl -0x14(%rbp), %eax
addl $0xf, %eax
movl %eax, -0x14(%rbp)
jmp 0x139dcd
cmpl $0x0, -0x14(%rbp)
jne 0x139d77
movq -0x20(%rbp), %rdi
leaq 0x82305(%rip), %rsi     # 0x1bc064
callq 0x135ec0
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x139d77
movl -0x14(%rbp), %eax
addl $0xd, %eax
movl %eax, -0x14(%rbp)
jmp 0x139dcb
cmpl $0x0, -0x14(%rbp)
jne 0x139da0
movq -0x20(%rbp), %rdi
leaq 0x822e9(%rip), %rsi     # 0x1bc071
callq 0x135ec0
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x139da0
movl -0x14(%rbp), %eax
addl $0x11, %eax
movl %eax, -0x14(%rbp)
jmp 0x139dc9
cmpl $0x0, -0x14(%rbp)
jne 0x139dc7
movq -0x20(%rbp), %rdi
leaq 0x822d1(%rip), %rsi     # 0x1bc082
callq 0x135ec0
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x139dc7
movl -0x14(%rbp), %eax
addl $0xc, %eax
movl %eax, -0x14(%rbp)
jmp 0x139dc9
jmp 0x139dcb
jmp 0x139dcd
jmp 0x139dcf
jmp 0x139dd1
cmpl $0x0, -0x14(%rbp)
jne 0x139de3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x31, %eax
jne 0x139e00
movl $0x7a, -0x4(%rbp)
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x32, %eax
jne 0x139e1d
movl $0x7b, -0x4(%rbp)
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x33, %eax
jne 0x139e3a
movl $0x7c, -0x4(%rbp)
jmp 0x13a102
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x34, %eax
jne 0x139e57
movl $0x7d, -0x4(%rbp)
jmp 0x13a102
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13a102
jmp 0x139e65
jmp 0x139e67
movl -0x14(%rbp), %eax
movl -0x18(%rbp), %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jge 0x139ebe
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x43, %eax
jne 0x139eb3
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x50, %eax
jne 0x139eb3
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x55, %eax
jne 0x139eb3
jmp 0x139ebe
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x139e67
movl -0x14(%rbp), %eax
movl -0x18(%rbp), %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jl 0x139ed7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13a102
movl -0x14(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %edx
subl $0x4, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x2d(%rbp)
jge 0x139f07
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
sete %al
movb %al, -0x2d(%rbp)
movb -0x2d(%rbp), %al
testb $0x1, %al
jne 0x139f10
jmp 0x139f1b
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x139ee0
movl -0x14(%rbp), %eax
movl -0x18(%rbp), %ecx
subl $0x4, %ecx
cmpl %ecx, %eax
jl 0x139f34
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13a102
jmp 0x139f36
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %edx
subl $0x4, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x2e(%rbp)
jge 0x139f73
callq 0x596d0
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x2e(%rbp)
movb -0x2e(%rbp), %al
testb $0x1, %al
jne 0x139f7c
jmp 0x139fc8
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x41, %eax
jl 0x139fba
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x5a, %eax
jg 0x139fba
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
subl $0x41, %ecx
movl $0x1, %eax
shll %cl, %eax
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x139f36
movl -0x14(%rbp), %eax
movl -0x18(%rbp), %ecx
subl $0x4, %ecx
cmpl %ecx, %eax
jl 0x139fe1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13a102
jmp 0x139fe3
callq 0x596d0
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x13a034
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
imull $0xa, -0x28(%rbp), %eax
movq -0x20(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x28(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x139fe3
cmpl $0x4, -0x2c(%rbp)
je 0x13a046
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13a102
movslq -0x28(%rbp), %rax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rcx
sarq $0x25, %rcx
movl %ecx, %edx
shrq $0x3f, %rax
movl %eax, %ecx
movl %edx, %eax
leal -0x1e(%rax,%rcx), %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x18, %eax
ja 0x13a0fb
movq -0x38(%rbp), %rax
leaq 0x76fbc(%rip), %rcx     # 0x1b103c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x64, -0x4(%rbp)
jmp 0x13a102
movl $0x65, -0x4(%rbp)
jmp 0x13a102
movl -0x24(%rbp), %edx
andl $0x800000, %edx         # imm = 0x800000
movl $0x66, %eax
movl $0x67, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x13a102
movl -0x24(%rbp), %edx
andl $0x800000, %edx         # imm = 0x800000
movl $0x68, %eax
movl $0x69, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x13a102
movl $0x6a, -0x4(%rbp)
jmp 0x13a102
movl $0x6b, -0x4(%rbp)
jmp 0x13a102
movl $0x6c, -0x4(%rbp)
jmp 0x13a102
movl $0x6d, -0x4(%rbp)
jmp 0x13a102
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)