// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libcpuid/recog_amd.c
// Function: cpuid_identify_amd
int cpuid_identify_amd(struct cpu_raw_data_t* raw, struct cpu_id_t* data, struct internal_id_info_t* internal)
{
	load_amd_features(raw, data);
	if ((EXTRACTS_BIT(raw->ext_cpuid[1][ECX], 22) == 1) && (EXTRACTS_BITS(raw->amd_fn8000001dh[0][EAX], 4, 0) != 0)) /* TopologyExtensions supported */
		decode_deterministic_cache_info_x86(raw->amd_fn8000001dh, MAX_AMDFN8000001DH_LEVEL, data, internal);
	else
		decode_amd_cache_info(raw, data);
	decode_amd_number_of_cores(raw, data);
	decode_amd_codename(data, internal);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movaps 0x5194b(%rip), %xmm0    # 0x11d570
movaps %xmm0, 0x20(%rsp)
movaps 0x5192f(%rip), %xmm0    # 0x11d560
movaps %xmm0, 0x10(%rsp)
movabsq $0x380000001f, %rax     # imm = 0x380000001F
movq %rax, 0x30(%rsp)
leaq 0x51944(%rip), %rsi     # 0x11d590
leaq 0x40(%rsp), %rdi
movl $0xc, %ecx
rep  movsq (%rsi), %es:(%rdi)
leaq 0x51990(%rip), %rsi     # 0x11d5f0
leaq 0xa0(%rsp), %rdi
movl $0xc, %ecx
rep  movsq (%rsi), %es:(%rdi)
cmpl $0x80000001, 0x200(%r15) # imm = 0x80000001
jb 0xcbcaf
movl 0x21c(%r15), %edx
leaq 0x10(%rsp), %rdi
movl $0x5, %esi
movq %r14, %rcx
callq 0xca938
movl 0x218(%r15), %edx
leaq 0x40(%rsp), %rdi
movl $0xc, %esi
movq %r14, %rcx
callq 0xca938
cmpl $0x80000007, 0x200(%r15) # imm = 0x80000007
jb 0xcbcd8
movl 0x27c(%r15), %edx
leaq 0xa0(%rsp), %rdi
movl $0xc, %esi
movq %r14, %rcx
callq 0xca938
cmpl $0x8000001a, 0x200(%r15) # imm = 0x8000001A
jb 0xcbd21
movb $0x1, 0x194(%r14)
movl 0x3a0(%r15), %eax
testb $0x4, %al
jne 0xcbd09
testb $0x1, %al
jne 0xcbd16
movl $0x40, 0x190(%r14)
jmp 0xcbd21
movl $0x100, 0x190(%r14) # imm = 0x100
jmp 0xcbd21
movl $0x80, 0x190(%r14)
testb $0x40, 0x21a(%r15)
je 0xcbd51
testb $0x1f, 0x540(%r15)
je 0xcbd51
leaq 0x540(%r15), %rdi
movl $0x4, %esi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xcb300
jmp 0xcbe4e
movl 0x200(%r15), %eax
cmpl $0x80000005, %eax       # imm = 0x80000005
jb 0xcbdb9
movzbl 0x25b(%r15), %ecx
movl %ecx, 0xf8(%r14)
movzbl 0x25a(%r15), %ecx
movl %ecx, 0x110(%r14)
movzbl 0x258(%r15), %ecx
movl %ecx, 0x128(%r14)
movzbl 0x25f(%r15), %ecx
movl %ecx, 0xfc(%r14)
movzbl 0x25e(%r15), %ecx
movl %ecx, 0x114(%r14)
movzbl 0x25c(%r15), %ecx
movl %ecx, 0x12c(%r14)
cmpl $0x80000006, %eax       # imm = 0x80000006
jb 0xcbe4e
movzwl 0x26a(%r15), %eax
movl %eax, 0x100(%r14)
movl 0x268(%r15), %ecx
shrl $0xa, %ecx
andl $0x3c, %ecx
leaq 0x51869(%rip), %rax     # 0x11d650
movl (%rcx,%rax), %ecx
movl %ecx, 0x118(%r14)
movzbl 0x268(%r15), %ecx
movl %ecx, 0x130(%r14)
movl 0x26c(%r15), %ecx
cmpq $0x40000, %rcx          # imm = 0x40000
jae 0xcbe1d
movl $0xffffffff, 0x104(%r14) # imm = 0xFFFFFFFF
jmp 0xcbe4e
movl %ecx, %edx
shrl $0x9, %edx
andl $0x7ffe00, %edx         # imm = 0x7FFE00
movl %edx, 0x104(%r14)
shrl $0xa, %ecx
andl $0x3c, %ecx
movl (%rcx,%rax), %eax
movl %eax, 0x11c(%r14)
movzbl 0x26c(%r15), %eax
movl %eax, 0x134(%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x0, (%r15)
je 0xcbe74
movzbl 0x16(%r15), %ecx
cmpl $0x8, 0x200(%r15)
jb 0xcbe79
movzbl 0x288(%r15), %eax
incl %eax
jmp 0xcbe79
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpb $0x0, 0x72(%r14)
movq %rbx, 0x8(%rsp)
je 0xcbebc
cmpl $0x2, %eax
jl 0xcbecf
cmpl $0x17, 0xe4(%r14)
jl 0xcbeac
cmpl $0x1e, 0x200(%r15)
jb 0xcbeac
movzbl 0x3e5(%r15), %esi
incl %esi
xorl %edx, %edx
divl %esi
movl %eax, 0xec(%r14)
movl %ecx, 0xf0(%r14)
jmp 0xcbeec
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0xec(%r14)
jmp 0xcbeec
movl $0x1, 0xec(%r14)
cmpl $0x3, %ecx
movl $0x2, %eax
cmovgel %ecx, %eax
movl %eax, 0xf0(%r14)
movq %r14, (%rsp)
leaq 0x14(%r14), %r15
movq %r15, %rdi
callq 0x56370
movq %rax, %r13
movl $0x8, %r14d
xorl %ebx, %ebx
leaq 0x9fb32(%rip), %r12     # 0x16ba40
movq (%r14,%r12), %rsi
movq %r15, %rdi
callq 0xcafaa
testl %eax, %eax
je 0xcbf23
orq -0x8(%r14,%r12), %rbx
addq $0x10, %r14
cmpq $0x178, %r14            # imm = 0x178
jne 0xcbf0e
movb $0x0, 0x42(%rsp)
movw $0x0, 0x40(%rsp)
movq %r15, %rdi
callq 0x56370
movq %rax, %r12
movb $0x1, %al
cmpl $0x6, %r12d
jl 0xcc009
addl $-0x2, %r12d
movl $0x3, %ebp
cmpb $0x2d, (%r15,%rbp)
jne 0xcbffb
callq 0x55570
movq (%rax), %rcx
movsbq -0x1(%r15,%rbp), %rax
testb $0x1, 0x1(%rcx,%rax,2)
je 0xcbffb
movsbq -0x2(%r15,%rbp), %rdx
testb $0x1, 0x1(%rcx,%rdx,2)
je 0xcbffb
movsbq -0x3(%r15,%rbp), %rsi
testb $0x1, 0x1(%rcx,%rsi,2)
jne 0xcbffb
movsbq 0x1(%r15,%rbp), %rsi
testb $0x8, 0x1(%rcx,%rsi,2)
je 0xcbffb
movsbq 0x2(%r15,%rbp), %rsi
testb $0x8, 0x1(%rcx,%rsi,2)
je 0xcbffb
movsbq 0x3(%r15,%rbp), %rsi
testb $0x8, 0x1(%rcx,%rsi,2)
jne 0xcbffb
movb %dl, 0x40(%rsp)
movb %al, 0x41(%rsp)
movl $0x1, %r14d
leaq 0x5189e(%rip), %rdi     # 0x11d870
leaq 0x40(%rsp), %rsi
callq 0x57bc0
testl %eax, %eax
je 0xcc24d
leaq 0x516a5(%rip), %rax     # 0x11d690
movslq (%rax,%r14,4), %rdi
addq %rax, %rdi
incq %r14
cmpq $0x8, %r14
jne 0xcbfd2
incq %rbp
cmpq %r12, %rbp
jne 0xcbf5c
movb $0x1, %al
movq %rbx, %r14
orq $0x8000, %r14           # imm = 0x8000
testb %al, %al
cmovneq %rbx, %r14
leaq 0x51838(%rip), %rsi     # 0x11d858
movq %r15, %rdi
callq 0xcafaa
testl %eax, %eax
je 0xcc060
movq %r14, %r12
orq $0x10000, %r12          # imm = 0x10000
movslq %eax, %rcx
movzbl 0x5(%r15,%rcx), %edx
leal -0x33(%rdx), %ecx
cmpl $0x6, %ecx
ja 0xcc065
leaq 0x49932(%rip), %rdx     # 0x115980
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
orq $0x10008, %r14          # imm = 0x10008
jmp 0xcc08c
movq %r14, %r12
jmp 0xcc0e1
cmpl $0x5a, %edx
jne 0xcc08f
orq $0x10010000, %r14       # imm = 0x10010000
jmp 0xcc08c
orq $0x10020, %r14          # imm = 0x10020
jmp 0xcc08c
orq $0x10040, %r14          # imm = 0x10040
jmp 0xcc08c
orq $0x10010, %r14          # imm = 0x10010
movq %r14, %r12
addl $0x6, %eax
cltq
cmpq %rax, %r13
jbe 0xcc0e1
movzbl (%r15,%rax), %ecx
cmpl $0x54, %ecx
jg 0xcc0b6
cmpl $0x48, %ecx
je 0xcc0c9
cmpl $0x53, %ecx
jne 0xcc0d9
orq $0x100, %r12            # imm = 0x100
jmp 0xcc0d9
cmpl $0x55, %ecx
je 0xcc0d2
cmpl $0x58, %ecx
jne 0xcc0d9
orq $0x400, %r12            # imm = 0x400
jmp 0xcc0d9
orq $0x80, %r12
jmp 0xcc0d9
orq $0x200, %r12            # imm = 0x200
incq %rax
cmpq %rax, %r13
jne 0xcc099
leaq 0x5177e(%rip), %rsi     # 0x11d866
movq %r15, %rdi
callq 0xcafaa
testl %eax, %eax
je 0xcc12d
cltq
movzbl 0x5(%r15,%rax), %eax
cmpl $0x37, %eax
je 0xcc11d
cmpl $0x35, %eax
je 0xcc114
cmpl $0x33, %eax
jne 0xcc126
orq $0x8000008, %r12        # imm = 0x8000008
jmp 0xcc12d
orq $0x8000010, %r12        # imm = 0x8000010
jmp 0xcc12d
orq $0x8000020, %r12        # imm = 0x8000020
jmp 0xcc12d
orq $0x8000000, %r12        # imm = 0x8000000
xorl %ebx, %ebx
leaq 0x9f88a(%rip), %r14     # 0x16b9c0
movq 0x8(%rbx,%r14), %rsi
movq %r15, %rdi
callq 0xcafaa
testl %eax, %eax
jne 0xcc15b
addq $0x10, %rbx
cmpq $0x80, %rbx
jne 0xcc136
movl $0x1, %ebp
jmp 0xcc15f
movl (%rbx,%r14), %ebp
movl $0x8, %eax
leaq 0x9f7b5(%rip), %rcx     # 0x16b920
xorl %r15d, %r15d
movq 0x8(%rsp), %rbx
movq (%rsp), %r14
cmpl -0x8(%rax,%rcx), %ebp
je 0xcc18b
addq $0x10, %rax
cmpq $0xa8, %rax
jne 0xcc177
jmp 0xcc18f
movq (%rax,%rcx), %r15
movl $0x300400, %esi         # imm = 0x300400
movq %r12, %rdi
callq 0xcb140
testl %eax, %eax
je 0xcc1bb
cmpl $0x1ff, 0x100(%r14) # imm = 0x1FF
jg 0xcc1bb
andq $-0x102401, %r12        # imm = 0xFFEFDBFF
orq $0x2000, %r12           # imm = 0x2000
testq %r15, %r15
je 0xcc1da
leaq 0x51546(%rip), %rsi     # 0x11d70d
movl $0x2, %edi
movl %ebp, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0xcaa16
jmp 0xcc1ef
leaq 0x5154e(%rip), %rsi     # 0x11d72f
movl $0x2, %edi
movl %ebp, %edx
xorl %eax, %eax
callq 0xcaa16
testq %r12, %r12
je 0xcc214
leaq 0x51551(%rip), %rsi     # 0x11d74c
movl $0x2, %edi
xorl %eax, %eax
callq 0xcaa16
movl $0x2, %edi
movq %r12, %rsi
callq 0xcb14c
movl %ebp, (%rbx)
movq %r12, 0x8(%rbx)
leaq 0x4977f(%rip), %rdi     # 0x1159a0
movl $0x108, %esi            # imm = 0x108
movq %r14, %rdx
movl %ebp, %ecx
movq %r12, %r8
xorl %r9d, %r9d
callq 0xcaac7
movl %eax, 0x10(%rbx)
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0xcc009