// File: /workspace/github_c_makefile_star2_O3/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 0x5195f(%rip), %xmm0    # 0x11c780
movaps %xmm0, 0x20(%rsp)
movaps 0x51943(%rip), %xmm0    # 0x11c770
movaps %xmm0, 0x10(%rsp)
movabsq $0x380000001f, %rax     # imm = 0x380000001F
movq %rax, 0x30(%rsp)
leaq 0x51958(%rip), %rsi     # 0x11c7a0
leaq 0x40(%rsp), %rdi
movl $0xc, %ecx
rep  movsq (%rsi), %es:(%rdi)
leaq 0x519a4(%rip), %rsi     # 0x11c800
leaq 0xa0(%rsp), %rdi
movl $0xc, %ecx
rep  movsq (%rsi), %es:(%rdi)
cmpl $0x80000001, 0x200(%r15) # imm = 0x80000001
jb 0xcaf21
movl 0x21c(%r15), %edx
leaq 0x10(%rsp), %rdi
movl $0x5, %esi
movq %r14, %rcx
callq 0xc9b5c
movl 0x218(%r15), %edx
leaq 0x40(%rsp), %rdi
movl $0xc, %esi
movq %r14, %rcx
callq 0xc9b5c
cmpl $0x80000007, 0x200(%r15) # imm = 0x80000007
jb 0xcaf21
movl 0x27c(%r15), %edx
leaq 0xa0(%rsp), %rdi
movl $0xc, %esi
movq %r14, %rcx
callq 0xc9b5c
cmpl $0x8000001a, 0x200(%r15) # imm = 0x8000001A
jb 0xcaf21
movb $0x1, 0x194(%r14)
movl 0x3a0(%r15), %eax
testb $0x4, %al
jne 0xcaf09
testb $0x1, %al
jne 0xcaf16
movl $0x40, 0x190(%r14)
jmp 0xcaf21
movl $0x100, 0x190(%r14) # imm = 0x100
jmp 0xcaf21
movl $0x80, 0x190(%r14)
testb $0x40, 0x21a(%r15)
je 0xcaf51
testb $0x1f, 0x540(%r15)
je 0xcaf51
leaq 0x540(%r15), %rdi
movl $0x4, %esi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xca50a
jmp 0xcb04e
movl 0x200(%r15), %eax
cmpl $0x80000005, %eax       # imm = 0x80000005
jb 0xcb04e
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 0xcb04e
movzwl 0x26a(%r15), %eax
movl %eax, 0x100(%r14)
movl 0x268(%r15), %ecx
shrl $0xa, %ecx
andl $0x3c, %ecx
leaq 0x5187a(%rip), %rax     # 0x11c860
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 0xcb01b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x104, %ecx            # imm = 0x104
jmp 0xcb04a
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)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x0, (%r15)
je 0xcb074
movzbl 0x16(%r15), %ecx
cmpl $0x8, 0x200(%r15)
jb 0xcb079
movzbl 0x288(%r15), %eax
incl %eax
jmp 0xcb079
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpb $0x0, 0x72(%r14)
movq %rbx, 0x8(%rsp)
je 0xcb0c0
cmpl $0x2, %eax
jl 0xcb0d3
cmpl $0x17, 0xe4(%r14)
jl 0xcb0b0
cmpl $0x1e, 0x200(%r15)
jb 0xcb0b0
movzbl 0x3e5(%r15), %esi
incl %esi
xorl %edx, %edx
divw %si
movzwl %ax, %eax
movl %eax, 0xec(%r14)
movl %ecx, 0xf0(%r14)
jmp 0xcb0f0
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0xec(%r14)
jmp 0xcb0f0
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, %ebx
xorl %r12d, %r12d
leaq 0x9f92e(%rip), %r14     # 0x16aa40
movq (%rbx,%r14), %rsi
movq %r15, %rdi
callq 0xca1ca
testl %eax, %eax
je 0xcb127
orq -0x8(%rbx,%r14), %r12
addq $0x10, %rbx
cmpq $0x178, %rbx            # imm = 0x178
jne 0xcb112
movb $0x0, 0x42(%rsp)
movq %r15, %rdi
callq 0x56370
movq %rax, %rbx
cmpl $0x6, %ebx
jl 0xcb200
addl $-0x2, %ebx
movl $0x3, %ebp
cmpb $0x2d, (%r15,%rbp)
jne 0xcb1f4
callq 0x55570
movq (%rax), %rcx
movsbq -0x1(%r15,%rbp), %rax
testb $0x1, 0x1(%rcx,%rax,2)
je 0xcb1f4
movsbq -0x2(%r15,%rbp), %rdx
testb $0x1, 0x1(%rcx,%rdx,2)
je 0xcb1f4
movsbq -0x3(%r15,%rbp), %rsi
testb $0x1, 0x1(%rcx,%rsi,2)
jne 0xcb1f4
movsbq 0x1(%r15,%rbp), %rsi
testb $0x8, 0x1(%rcx,%rsi,2)
je 0xcb1f4
movsbq 0x2(%r15,%rbp), %rsi
testb $0x8, 0x1(%rcx,%rsi,2)
je 0xcb1f4
movsbq 0x3(%r15,%rbp), %rsi
testb $0x8, 0x1(%rcx,%rsi,2)
jne 0xcb1f4
movb %dl, 0x40(%rsp)
movb %al, 0x41(%rsp)
movl $0x1, %r14d
leaq 0x518b5(%rip), %rdi     # 0x11ca80
leaq 0x40(%rsp), %rsi
callq 0x57bc0
testl %eax, %eax
je 0xcb438
leaq 0x516bc(%rip), %rax     # 0x11c8a0
movslq (%rax,%r14,4), %rdi
addq %rax, %rdi
incq %r14
cmpq $0x8, %r14
jne 0xcb1cb
incq %rbp
cmpq %rbx, %rbp
jne 0xcb155
leaq 0x51861(%rip), %rsi     # 0x11ca68
movq %r15, %rdi
callq 0xca1ca
testl %eax, %eax
je 0xcb247
movq %r12, %rbx
orq $0x10000, %rbx          # imm = 0x10000
movslq %eax, %rcx
movzbl 0x5(%r15,%rcx), %edx
leal -0x33(%rdx), %ecx
cmpl $0x6, %ecx
ja 0xcb24c
leaq 0x4995b(%rip), %rdx     # 0x114b90
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
orq $0x10008, %r12          # imm = 0x10008
jmp 0xcb273
movq %r12, %rbx
jmp 0xcb2c8
cmpl $0x5a, %edx
jne 0xcb276
orq $0x10010000, %r12       # imm = 0x10010000
jmp 0xcb273
orq $0x10020, %r12          # imm = 0x10020
jmp 0xcb273
orq $0x10040, %r12          # imm = 0x10040
jmp 0xcb273
orq $0x10010, %r12          # imm = 0x10010
movq %r12, %rbx
addl $0x6, %eax
cltq
cmpq %rax, %r13
jbe 0xcb2c8
movzbl (%r15,%rax), %ecx
cmpl $0x54, %ecx
jg 0xcb29d
cmpl $0x48, %ecx
je 0xcb2b0
cmpl $0x53, %ecx
jne 0xcb2c0
orq $0x100, %rbx            # imm = 0x100
jmp 0xcb2c0
cmpl $0x55, %ecx
je 0xcb2b9
cmpl $0x58, %ecx
jne 0xcb2c0
orq $0x400, %rbx            # imm = 0x400
jmp 0xcb2c0
orq $0x80, %rbx
jmp 0xcb2c0
orq $0x200, %rbx            # imm = 0x200
incq %rax
cmpq %rax, %r13
jne 0xcb280
leaq 0x517a7(%rip), %rsi     # 0x11ca76
movq %r15, %rdi
callq 0xca1ca
testl %eax, %eax
je 0xcb314
cltq
movzbl 0x5(%r15,%rax), %eax
cmpl $0x37, %eax
je 0xcb304
cmpl $0x35, %eax
je 0xcb2fb
cmpl $0x33, %eax
jne 0xcb30d
orq $0x8000008, %rbx        # imm = 0x8000008
jmp 0xcb314
orq $0x8000010, %rbx        # imm = 0x8000010
jmp 0xcb314
orq $0x8000020, %rbx        # imm = 0x8000020
jmp 0xcb314
orq $0x8000000, %rbx        # imm = 0x8000000
xorl %r14d, %r14d
leaq 0x9f6a2(%rip), %r12     # 0x16a9c0
movq 0x8(%r14,%r12), %rsi
movq %r15, %rdi
callq 0xca1ca
testl %eax, %eax
jne 0xcb343
addq $0x10, %r14
cmpq $0x80, %r14
jne 0xcb31e
movl $0x1, %ebp
jmp 0xcb347
movl (%r14,%r12), %ebp
movl $0x8, %eax
leaq 0x9f5cd(%rip), %rcx     # 0x16a920
xorl %r15d, %r15d
movq (%rsp), %r12
cmpl -0x8(%rax,%rcx), %ebp
je 0xcb36e
addq $0x10, %rax
cmpq $0xa8, %rax
jne 0xcb35a
jmp 0xcb372
movq (%rax,%rcx), %r15
movl $0x300400, %esi         # imm = 0x300400
movq %rbx, %rdi
callq 0xca34a
testl %eax, %eax
je 0xcb39f
cmpl $0x1ff, 0x100(%r12) # imm = 0x1FF
jg 0xcb39f
andq $-0x102401, %rbx        # imm = 0xFFEFDBFF
orq $0x2000, %rbx           # imm = 0x2000
testq %r15, %r15
je 0xcb3be
leaq 0x51572(%rip), %rsi     # 0x11c91d
movl $0x2, %edi
movl %ebp, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0xc9c3a
jmp 0xcb3d3
leaq 0x5157a(%rip), %rsi     # 0x11c93f
movl $0x2, %edi
movl %ebp, %edx
xorl %eax, %eax
callq 0xc9c3a
testq %rbx, %rbx
je 0xcb3f8
leaq 0x5157d(%rip), %rsi     # 0x11c95c
movl $0x2, %edi
xorl %eax, %eax
callq 0xc9c3a
movl $0x2, %edi
movq %rbx, %rsi
callq 0xca356
movq 0x8(%rsp), %r14
movl %ebp, (%r14)
movq %rbx, 0x8(%r14)
leaq 0x497a5(%rip), %rdi     # 0x114bb0
movl $0x108, %esi            # imm = 0x108
movq %r12, %rdx
movl %ebp, %ecx
movq %rbx, %r8
xorl %r9d, %r9d
callq 0xc9ceb
movl %eax, 0x10(%r14)
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
orq $0x8000, %r12           # imm = 0x8000
jmp 0xcb200