// File: /workspace/github_c_makefile_star2_O2/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 0x4811f(%rip), %xmm0    # 0x10c610
movaps %xmm0, 0x20(%rsp)
movaps 0x48103(%rip), %xmm0    # 0x10c600
movaps %xmm0, 0x10(%rsp)
movabsq $0x380000001f, %rax     # imm = 0x380000001F
movq %rax, 0x30(%rsp)
leaq 0x48118(%rip), %rsi     # 0x10c630
pushq $0xc
popq %rax
leaq 0x40(%rsp), %rdi
movq %rax, %rcx
rep  movsq (%rsi), %es:(%rdi)
leaq 0x48163(%rip), %rsi     # 0x10c690
leaq 0xa0(%rsp), %rdi
movq %rax, %rcx
rep  movsq (%rsi), %es:(%rdi)
cmpl $0x80000001, 0x200(%r15) # imm = 0x80000001
jb 0xc45ea
movl 0x21c(%r15), %edx
leaq 0x10(%rsp), %rdi
pushq $0x5
popq %rsi
movq %r14, %rcx
callq 0xc33d8
movl 0x218(%r15), %edx
leaq 0x40(%rsp), %rdi
pushq $0xc
popq %rsi
movq %r14, %rcx
callq 0xc33d8
cmpl $0x80000007, 0x200(%r15) # imm = 0x80000007
jb 0xc45ea
movl 0x27c(%r15), %edx
leaq 0xa0(%rsp), %rdi
pushq $0xc
popq %rsi
movq %r14, %rcx
callq 0xc33d8
cmpl $0x8000001a, 0x200(%r15) # imm = 0x8000001A
jb 0xc45ea
movb $0x1, 0x194(%r14)
movl 0x3a0(%r15), %eax
testb $0x4, %al
jne 0xc45d2
testb $0x1, %al
jne 0xc45df
movl $0x40, 0x190(%r14)
jmp 0xc45ea
movl $0x100, 0x190(%r14) # imm = 0x100
jmp 0xc45ea
movl $0x80, 0x190(%r14)
testb $0x40, 0x21a(%r15)
je 0xc4618
testb $0x1f, 0x540(%r15)
je 0xc4618
leaq 0x540(%r15), %rdi
pushq $0x4
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xc3d54
jmp 0xc4713
movl 0x200(%r15), %eax
cmpl $0x80000005, %eax       # imm = 0x80000005
jb 0xc4713
movzbl 0x25b(%r15), %eax
movl %eax, 0xf8(%r14)
movzbl 0x25a(%r15), %eax
movl %eax, 0x110(%r14)
movzbl 0x258(%r15), %eax
movl %eax, 0x128(%r14)
movzbl 0x25f(%r15), %eax
movl %eax, 0xfc(%r14)
movzbl 0x25e(%r15), %eax
movl %eax, 0x114(%r14)
movzbl 0x25c(%r15), %eax
movl %eax, 0x12c(%r14)
je 0xc4713
movzwl 0x26a(%r15), %eax
movl %eax, 0x100(%r14)
movl 0x268(%r15), %ecx
shrl $0xa, %ecx
andl $0x3c, %ecx
leaq 0x48043(%rip), %rax     # 0x10c6f0
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 0xc46e0
pushq $-0x1
popq %rax
movl $0x104, %ecx            # imm = 0x104
jmp 0xc470f
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 $0x134, %ecx            # imm = 0x134
movl %eax, (%r14,%rcx)
pushq $-0x1
popq %rax
cmpl $0x0, (%r15)
je 0xc4737
movzbl 0x16(%r15), %ecx
cmpl $0x8, 0x200(%r15)
jb 0xc4739
movzbl 0x288(%r15), %eax
incl %eax
jmp 0xc4739
movl %eax, %ecx
cmpb $0x0, 0x72(%r14)
movq %rbx, 0x8(%rsp)
je 0xc4780
cmpl $0x2, %eax
jl 0xc4793
cmpl $0x17, 0xe4(%r14)
jl 0xc4770
cmpl $0x1e, 0x200(%r15)
jb 0xc4770
movzbl 0x3e5(%r15), %esi
incl %esi
xorl %edx, %edx
divw %si
movzwl %ax, %eax
movl %eax, 0xec(%r14)
movl %ecx, 0xf0(%r14)
jmp 0xc47ae
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0xec(%r14)
jmp 0xc47ae
movl $0x1, 0xec(%r14)
cmpl $0x3, %ecx
pushq $0x2
popq %rax
cmovgel %ecx, %eax
movl %eax, 0xf0(%r14)
movq %r14, (%rsp)
leaq 0x14(%r14), %r12
movq %r12, %rdi
callq 0x57460
movq %rax, %r13
pushq $0x8
popq %rbx
xorl %r15d, %r15d
leaq 0x9c292(%rip), %r14     # 0x160a60
cmpq $0x178, %rbx            # imm = 0x178
je 0xc47f2
movq (%rbx,%r14), %rsi
movq %r12, %rdi
callq 0xc3a37
testl %eax, %eax
je 0xc47ec
orq -0x8(%rbx,%r14), %r15
addq $0x10, %rbx
jmp 0xc47ce
leaq 0x40(%rsp), %rax
movb $0x0, 0x2(%rax)
movq %r12, %rdi
callq 0x57460
addl $-0x2, %eax
movslq %eax, %rbx
pushq $0x3
popq %r14
cmpq %rbx, %r14
jge 0xc48b9
cmpb $0x2d, (%r12,%r14)
jne 0xc48aa
callq 0x565b0
movq (%rax), %rcx
movsbq -0x1(%r12,%r14), %rax
testb $0x1, 0x1(%rcx,%rax,2)
je 0xc48aa
movsbq -0x2(%r12,%r14), %rdx
testb $0x1, 0x1(%rcx,%rdx,2)
je 0xc48aa
movsbq -0x3(%r12,%r14), %rsi
testb $0x1, 0x1(%rcx,%rsi,2)
jne 0xc48aa
movsbq 0x1(%r12,%r14), %rsi
testb $0x8, 0x1(%rcx,%rsi,2)
je 0xc48aa
movsbq 0x2(%r12,%r14), %rsi
testb $0x8, 0x1(%rcx,%rsi,2)
je 0xc48aa
movsbq 0x3(%r12,%r14), %rsi
testb $0x8, 0x1(%rcx,%rsi,2)
jne 0xc48aa
movb %dl, 0x40(%rsp)
movb %al, 0x41(%rsp)
xorl %ebp, %ebp
cmpq $0x1c, %rbp
je 0xc48aa
leaq 0x47ea2(%rip), %rax     # 0x10c730
movslq (%rbp,%rax), %rdi
addq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x58e40
addq $0x4, %rbp
testl %eax, %eax
jne 0xc4881
jmp 0xc48b2
incq %r14
jmp 0xc480d
orq $0x8000, %r15           # imm = 0x8000
leaq 0x48038(%rip), %rsi     # 0x10c8f8
movq %r12, %rdi
callq 0xc3a37
testl %eax, %eax
je 0xc497b
movq %r15, %rcx
orq $0x10000, %rcx          # imm = 0x10000
movslq %eax, %rdx
movzbl 0x5(%r12,%rdx), %esi
leal -0x33(%rsi), %edx
cmpl $0x6, %edx
ja 0xc4904
leaq 0x4012e(%rip), %rsi     # 0x104a20
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
orq $0x10008, %r15          # imm = 0x10008
jmp 0xc492b
cmpl $0x5a, %esi
jne 0xc492e
orq $0x10010000, %r15       # imm = 0x10010000
jmp 0xc492b
orq $0x10020, %r15          # imm = 0x10020
jmp 0xc492b
orq $0x10040, %r15          # imm = 0x10040
jmp 0xc492b
orq $0x10010, %r15          # imm = 0x10010
movq %r15, %rcx
addl $0x6, %eax
cltq
movq %rcx, %r15
cmpq %rax, %r13
jbe 0xc497b
movzbl (%r12,%rax), %ecx
cmpl $0x58, %ecx
je 0xc496f
cmpl $0x53, %ecx
je 0xc495d
cmpl $0x55, %ecx
je 0xc4966
cmpl $0x48, %ecx
jne 0xc4976
orq $0x80, %r15
jmp 0xc4976
orq $0x100, %r15            # imm = 0x100
jmp 0xc4976
orq $0x200, %r15            # imm = 0x200
jmp 0xc4976
orq $0x400, %r15            # imm = 0x400
incq %rax
jmp 0xc4936
leaq 0x47f84(%rip), %rsi     # 0x10c906
movq %r12, %rdi
callq 0xc3a37
testl %eax, %eax
je 0xc49c7
cltq
movzbl 0x5(%r12,%rax), %eax
cmpl $0x37, %eax
je 0xc49b7
cmpl $0x35, %eax
je 0xc49ae
cmpl $0x33, %eax
jne 0xc49c0
orq $0x8000008, %r15        # imm = 0x8000008
jmp 0xc49c7
orq $0x8000010, %r15        # imm = 0x8000010
jmp 0xc49c7
orq $0x8000020, %r15        # imm = 0x8000020
jmp 0xc49c7
orq $0x8000000, %r15        # imm = 0x8000000
pushq $-0x10
popq %rcx
pushq $0x1
popq %rbp
leaq 0x9c00c(%rip), %rbx     # 0x1609e0
leaq 0x10(%rcx), %r14
cmpq $0x80, %r14
je 0xc49f9
movq 0x18(%rcx,%rbx), %rsi
movq %r12, %rdi
callq 0xc3a37
movq %r14, %rcx
testl %eax, %eax
je 0xc49d4
movl (%r14,%rbx), %ebp
xorl %r12d, %r12d
leaq 0x9bf3d(%rip), %rax     # 0x160940
xorl %ecx, %ecx
movq 0x8(%rsp), %rbx
movq (%rsp), %r14
leaq 0x10(%rcx), %rdx
cmpq $0xb0, %rdx
je 0xc4a28
cmpl (%rcx,%rax), %ebp
movq %rdx, %rcx
jne 0xc4a0e
movq -0x8(%rdx,%rax), %r12
movl $0x300400, %esi         # imm = 0x300400
movq %r15, %rdi
callq 0xc3ba2
testl %eax, %eax
je 0xc4a54
cmpl $0x1ff, 0x100(%r14) # imm = 0x1FF
jg 0xc4a54
andq $-0x102401, %r15        # imm = 0xFFEFDBFF
orq $0x2000, %r15           # imm = 0x2000
testq %r12, %r12
je 0xc4a71
leaq 0x47d4d(%rip), %rsi     # 0x10c7ad
pushq $0x2
popq %rdi
movl %ebp, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0xc34c6
jmp 0xc4a84
leaq 0x47d57(%rip), %rsi     # 0x10c7cf
pushq $0x2
popq %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xc34c6
testq %r15, %r15
je 0xc4aa9
leaq 0x47d5c(%rip), %rsi     # 0x10c7ec
pushq $0x2
popq %r12
movl %r12d, %edi
xorl %eax, %eax
callq 0xc34c6
movl %r12d, %edi
movq %r15, %rsi
callq 0xc3bae
movl %ebp, (%rbx)
movq %r15, 0x8(%rbx)
leaq 0x3ff8a(%rip), %rdi     # 0x104a40
movl $0x108, %esi            # imm = 0x108
movq %r14, %rdx
movl %ebp, %ecx
movq %r15, %r8
xorl %r9d, %r9d
callq 0xc3577
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