// File: /workspace/github_c_makefile_star2_O0/mvermeulen[P]wspy/cpu_info.c
// Function: main
int main(void){
  int i;
  inventory_cpu();

  printf("CPU information:\n");
  switch(cpu_info->vendor){
  case VENDOR_AMD:
    printf("\tAMD family %x model %x\n",cpu_info->family,cpu_info->model);
    break;
  case VENDOR_INTEL:
    printf("\tIntel family %x model %x\n",cpu_info->family,cpu_info->model);
    break;
  default:
    printf("Unknown CPU\n");
    return 0;
  }

  for (i=0;i<cpu_info->num_cores;i++){
    printf("\t   ");
    printf("%c %d ",(cpu_info->coreinfo[i].is_available)?'*':' ',i);
    switch(cpu_info->coreinfo[i].vendor){
    case CORE_AMD_ZEN:
      printf("Zen");
      break;
    case CORE_AMD_ZEN5:
      printf("Zen5");
      break;
    case CORE_INTEL_ATOM:
      printf("Atom");
      break;
    case CORE_INTEL_CORE:
      printf("Core");
      break;
    case CORE_AMD_UNKNOWN:
      printf("AMD?");
      break;
    case CORE_INTEL_UNKNOWN:
      printf("Intel?");
      break;
    default:
      printf("??");
      break;
    }
    printf("\n");
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
callq 0x1220
leaq 0x17c1(%rip), %rdi      # 0x30fc
xorl %eax, %eax
callq 0x1070
movq 0x3767(%rip), %rax      # 0x50b0
movl (%rax), %eax
movl %eax, -0xc(%rbp)
subl $0x1, %eax
je 0x195f
jmp 0x1955
movl -0xc(%rbp), %eax
subl $0x2, %eax
je 0x1983
jmp 0x19a7
movq 0x374a(%rip), %rax      # 0x50b0
movl 0x4(%rax), %esi
movq 0x3740(%rip), %rax      # 0x50b0
movl 0x8(%rax), %edx
leaq 0x1794(%rip), %rdi      # 0x310e
movb $0x0, %al
callq 0x1070
jmp 0x19c1
movq 0x3726(%rip), %rax      # 0x50b0
movl 0x4(%rax), %esi
movq 0x371c(%rip), %rax      # 0x50b0
movl 0x8(%rax), %edx
leaq 0x1789(%rip), %rdi      # 0x3127
movb $0x0, %al
callq 0x1070
jmp 0x19c1
leaq 0x1794(%rip), %rdi      # 0x3142
movb $0x0, %al
callq 0x1070
movl $0x0, -0x4(%rbp)
jmp 0x1aed
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
movq 0x36de(%rip), %rcx      # 0x50b0
cmpl 0xc(%rcx), %eax
jae 0x1aed
leaq 0x176d(%rip), %rdi      # 0x314f
xorl %eax, %eax
movb %al, -0x19(%rbp)
callq 0x1070
movb -0x19(%rbp), %al
movq 0x36ba(%rip), %rcx      # 0x50b0
movq 0x18(%rcx), %rcx
movslq -0x8(%rbp), %rsi
movl %esi, %edx
leaq (%rsi,%rsi,2), %rsi
shlq $0x5, %rsi
movb 0x4(%rcx,%rsi), %cl
testb $0x1, %cl
movl $0x2a, %ecx
movl $0x20, %esi
cmovnel %ecx, %esi
leaq 0x1731(%rip), %rdi      # 0x3154
callq 0x1070
movq 0x3681(%rip), %rax      # 0x50b0
movq 0x18(%rax), %rax
movslq -0x8(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x5, %rcx
movl (%rax,%rcx), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x5, %eax
ja 0x1ac3
movq -0x18(%rbp), %rax
leaq 0x15aa(%rip), %rcx      # 0x3004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x16f1(%rip), %rdi      # 0x315b
movb $0x0, %al
callq 0x1070
jmp 0x1ad1
leaq 0x16e5(%rip), %rdi      # 0x315f
movb $0x0, %al
callq 0x1070
jmp 0x1ad1
leaq 0x16da(%rip), %rdi      # 0x3164
movb $0x0, %al
callq 0x1070
jmp 0x1ad1
leaq 0x16cf(%rip), %rdi      # 0x3169
movb $0x0, %al
callq 0x1070
jmp 0x1ad1
leaq 0x16c4(%rip), %rdi      # 0x316e
movb $0x0, %al
callq 0x1070
jmp 0x1ad1
leaq 0x16b9(%rip), %rdi      # 0x3173
movb $0x0, %al
callq 0x1070
jmp 0x1ad1
leaq 0x16b0(%rip), %rdi      # 0x317a
movb $0x0, %al
callq 0x1070
leaq 0x1634(%rip), %rdi      # 0x310c
movb $0x0, %al
callq 0x1070
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x19c8
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)