#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sscanf(char *, char *, unsigned int *);
char *strstr(char *, char *);
unsigned int getCPUID() {
  static unsigned int cpu_id = 0;
  if (cpu_id == 0) {
    char buf[256];
    char *numStr;
    FILE *file;
    unsigned int res;
    file = fopen("/proc/cpuinfo", "r");
    if (file) {
      while (fgets(buf, 255, file)) {
        if (strstr(buf, "CPU implementer")) {
          numStr = strstr(&buf[14], ": ");
          (void)sscanf(&numStr[4], "%x", &res);
          cpu_id = (res & 0xff) << 24;
        } else if (strstr(buf, "CPU variant")) {
          numStr = strstr(&buf[10], ": ");
          (void)sscanf(&numStr[4], "%x", &res);
          cpu_id |= (((res << 4) & 0xf0) | 0xf) << 16;
        } else if (strstr(buf, "CPU part")) {
          numStr = strstr(&buf[8], ": ");
          (void)sscanf(&numStr[4], "%x", &res);
          cpu_id |= (res & 0xfff) << 4;
        } else if (strstr(buf, "CPU revision")) {
          numStr = strstr(&buf[11], ": ");
          (void)sscanf(&numStr[2], "%u", &res);
          cpu_id |= (res & 0xf);
        }
      }
      fclose(file);
    } else {
      printf("CPU info not available!");
      exit(-1);
    }
    cpu_id >>= 4;
    file = fopen("/sys/bus/soc/devices/soc0/soc_id", "r");
    if (file) {
      while (fgets(buf, 255, file)) {
        if (strstr(buf, "i.MX6")) {
          cpu_id += 4;
        }
      }
      fclose(file);
    }
  }
  return cpu_id;
}


x86 assembly (clang, -O0):
<getCPUID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
cmpl   $0x0,0x2eda(%rip)
jne    1488 <getCPUID+0x318>
lea    0xe71(%rip),%rdi
lea    0xe86(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x110(%rbp)
cmpq   $0x0,-0x110(%rbp)
je     13d2 <getCPUID+0x262>
jmp    11b5 <getCPUID+0x45>
lea    -0x100(%rbp),%rdi
mov    -0x110(%rbp),%rdx
mov    $0xff,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     13c1 <getCPUID+0x251>
lea    -0x100(%rbp),%rdi
lea    0xe29(%rip),%rsi
call   1090 <strstr@plt>
cmp    $0x0,%rax
je     1249 <getCPUID+0xd9>
lea    -0x100(%rbp),%rdi
add    $0xe,%rdi
lea    0xe18(%rip),%rsi
call   1090 <strstr@plt>
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rdi
add    $0x4,%rdi
lea    0xdfd(%rip),%rsi
lea    -0x114(%rbp),%rdx
call   1060 <sscanf@plt>
mov    -0x114(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    %eax,0x2e18(%rip)
jmp    13bc <getCPUID+0x24c>
lea    -0x100(%rbp),%rdi
lea    0xdcd(%rip),%rsi
call   1090 <strstr@plt>
cmp    $0x0,%rax
je     12c7 <getCPUID+0x157>
lea    -0x100(%rbp),%rdi
add    $0xa,%rdi
lea    0xda6(%rip),%rsi
call   1090 <strstr@plt>
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rdi
add    $0x4,%rdi
lea    0xd8b(%rip),%rsi
lea    -0x114(%rbp),%rdx
call   1060 <sscanf@plt>
mov    -0x114(%rbp),%eax
shl    $0x4,%eax
and    $0xf0,%eax
or     $0xf,%eax
shl    $0x10,%eax
or     0x2da0(%rip),%eax
mov    %eax,0x2d9a(%rip)
jmp    13b7 <getCPUID+0x247>
lea    -0x100(%rbp),%rdi
lea    0xd5b(%rip),%rsi
call   1090 <strstr@plt>
cmp    $0x0,%rax
je     133f <getCPUID+0x1cf>
lea    -0x100(%rbp),%rdi
add    $0x8,%rdi
lea    0xd28(%rip),%rsi
call   1090 <strstr@plt>
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rdi
add    $0x4,%rdi
lea    0xd0d(%rip),%rsi
lea    -0x114(%rbp),%rdx
call   1060 <sscanf@plt>
mov    -0x114(%rbp),%eax
and    $0xfff,%eax
shl    $0x4,%eax
or     0x2d28(%rip),%eax
mov    %eax,0x2d22(%rip)
jmp    13b2 <getCPUID+0x242>
lea    -0x100(%rbp),%rdi
lea    0xcec(%rip),%rsi
call   1090 <strstr@plt>
cmp    $0x0,%rax
je     13ad <getCPUID+0x23d>
lea    -0x100(%rbp),%rdi
add    $0xb,%rdi
lea    0xcb0(%rip),%rsi
call   1090 <strstr@plt>
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rdi
add    $0x2,%rdi
lea    0xcba(%rip),%rsi
lea    -0x114(%rbp),%rdx
call   1060 <sscanf@plt>
mov    -0x114(%rbp),%eax
and    $0xf,%eax
or     0x2cb5(%rip),%eax
mov    %eax,0x2caf(%rip)
jmp    13b2 <getCPUID+0x242>
jmp    13b7 <getCPUID+0x247>
jmp    13bc <getCPUID+0x24c>
jmp    11b5 <getCPUID+0x45>
mov    -0x110(%rbp),%rdi
call   1030 <fclose@plt>
jmp    13e8 <getCPUID+0x278>
lea    0xc70(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
mov    0x2c6e(%rip),%eax
shr    $0x4,%eax
mov    %eax,0x2c65(%rip)
lea    0xc63(%rip),%rdi
lea    0xc17(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x110(%rbp)
cmpq   $0x0,-0x110(%rbp)
je     1483 <getCPUID+0x313>
jmp    1424 <getCPUID+0x2b4>
lea    -0x100(%rbp),%rdi
mov    -0x110(%rbp),%rdx
mov    $0xff,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     1477 <getCPUID+0x307>
lea    -0x100(%rbp),%rdi
lea    0xc2e(%rip),%rsi
call   1090 <strstr@plt>
cmp    $0x0,%rax
je     1472 <getCPUID+0x302>
mov    0x2bf3(%rip),%eax
add    $0x4,%eax
mov    %eax,0x2bea(%rip)
jmp    1424 <getCPUID+0x2b4>
mov    -0x110(%rbp),%rdi
call   1030 <fclose@plt>
jmp    1488 <getCPUID+0x318>
mov    0x2bce(%rip),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCPUID>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    0x2ed5(%rip),%eax
test   %eax,%eax
jne    13ac <getCPUID+0x23c>
lea    0xe6a(%rip),%rdi
lea    0xe7f(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     13be <getCPUID+0x24e>
mov    %rax,%rbx
lea    0x10(%rsp),%rdi
mov    $0xff,%esi
mov    %rax,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     131f <getCPUID+0x1af>
lea    0xe3e(%rip),%rbp
lea    0x10(%rsp),%r13
lea    0xe42(%rip),%r15
lea    0xc(%rsp),%r12
lea    0xe39(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %rbp,%rsi
call   1090 <strstr@plt>
test   %rax,%rax
je     1230 <getCPUID+0xc0>
lea    0x1e(%rsp),%rdi
mov    %r15,%rsi
call   1090 <strstr@plt>
lea    0x4(%rax),%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1060 <sscanf@plt>
mov    0xc(%rsp),%eax
shl    $0x18,%eax
jmp    1300 <getCPUID+0x190>
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
lea    0xdea(%rip),%rsi
call   1090 <strstr@plt>
test   %rax,%rax
je     127a <getCPUID+0x10a>
lea    0x1a(%rsp),%rdi
mov    %r15,%rsi
call   1090 <strstr@plt>
lea    0x4(%rax),%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1060 <sscanf@plt>
mov    0xc(%rsp),%eax
and    $0xf,%eax
shl    $0x14,%eax
or     0x2dec(%rip),%eax
or     $0xf0000,%eax
jmp    1300 <getCPUID+0x190>
mov    %r13,%rdi
lea    0xdac(%rip),%rsi
call   1090 <strstr@plt>
test   %rax,%rax
je     12b6 <getCPUID+0x146>
lea    0x18(%rsp),%rdi
mov    %r15,%rsi
call   1090 <strstr@plt>
lea    0x4(%rax),%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1060 <sscanf@plt>
mov    0xc(%rsp),%eax
shl    $0x4,%eax
movzwl %ax,%eax
jmp    12f1 <getCPUID+0x181>
mov    %r13,%rdi
lea    0xd79(%rip),%rsi
call   1090 <strstr@plt>
test   %rax,%rax
je     1306 <getCPUID+0x196>
lea    0x1b(%rsp),%rdi
mov    %r15,%rsi
call   1090 <strstr@plt>
lea    0x2(%rax),%rdi
lea    0xd64(%rip),%rsi
mov    %r12,%rdx
call   1060 <sscanf@plt>
mov    0xc(%rsp),%eax
and    $0xf,%eax
or     0x2d65(%rip),%eax
nopw   0x0(%rax,%rax,1)
mov    %eax,0x2d56(%rip)
mov    %r13,%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
jne    11f0 <getCPUID+0x80>
mov    %rbx,%rdi
call   1030 <fclose@plt>
shrl   $0x4,0x2d2e(%rip)
lea    0xd2c(%rip),%rdi
lea    0xce0(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     13a6 <getCPUID+0x236>
mov    %rax,%rbx
lea    0x10(%rsp),%rdi
mov    $0xff,%esi
mov    %rax,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     139e <getCPUID+0x22e>
lea    0xd1b(%rip),%r14
lea    0x10(%rsp),%rbp
jmp    1385 <getCPUID+0x215>
xchg   %ax,%ax
mov    %rbp,%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     139e <getCPUID+0x22e>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1090 <strstr@plt>
test   %rax,%rax
je     1370 <getCPUID+0x200>
addl   $0x4,0x2cc0(%rip)
jmp    1370 <getCPUID+0x200>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    0x2cb0(%rip),%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc84(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@getCPUID.cpu_id = internal global i32 0
@.str = [14 x i8] c"/proc/cpuinfo\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [16 x i8] c"CPU implementer\00"
@.str.3 = [3 x i8] c": \00"
@.str.4 = [3 x i8] c"%x\00"
@.str.5 = [12 x i8] c"CPU variant\00"
@.str.6 = [9 x i8] c"CPU part\00"
@.str.7 = [13 x i8] c"CPU revision\00"
@.str.8 = [3 x i8] c"%u\00"
@.str.9 = [24 x i8] c"CPU info not available!\00"
@.str.10 = [33 x i8] c"/sys/bus/soc/devices/soc0/soc_id\00"
@.str.11 = [6 x i8] c"i.MX6\00"
define i32 @getCPUID() {
%1 = alloca [256 x i8]
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
%5 = load i32, i32* @getCPUID.cpu_id
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %110
7: ; preds = %0
%8 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %83
11: ; preds = %7
br label %12
12: ; preds = %79, %11
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%14 = load i32*, i32** %3
%15 = call i64 @fgets(i8* %13, i32 255, i32* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %80
17: ; preds = %12
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%19 = call i8* @strstr(i8* %18, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %30
21: ; preds = %17
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 14
%23 = call i8* @strstr(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i8* %23, i8** %2
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 4
%26 = call i32 @sscanf(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%27 = load i32, i32* %4
%28 = and i32 %27, 255
%29 = shl i32 %28, 24
store i32 %29, i32* @getCPUID.cpu_id
br label %79
30: ; preds = %17
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%32 = call i8* @strstr(i8* %31, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%33 = icmp ne i8* %32, null
br i1 %33, label %34, label %47
34: ; preds = %30
%35 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 10
%36 = call i8* @strstr(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i8* %36, i8** %2
%37 = load i8*, i8** %2
%38 = getelementptr inbounds i8, i8* %37, i64 4
%39 = call i32 @sscanf(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%40 = load i32, i32* %4
%41 = shl i32 %40, 4
%42 = and i32 %41, 240
%43 = or i32 %42, 15
%44 = shl i32 %43, 16
%45 = load i32, i32* @getCPUID.cpu_id
%46 = or i32 %45, %44
store i32 %46, i32* @getCPUID.cpu_id
br label %78
47: ; preds = %30
%48 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%49 = call i8* @strstr(i8* %48, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%50 = icmp ne i8* %49, null
br i1 %50, label %51, label %62
51: ; preds = %47
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 8
%53 = call i8* @strstr(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i8* %53, i8** %2
%54 = load i8*, i8** %2
%55 = getelementptr inbounds i8, i8* %54, i64 4
%56 = call i32 @sscanf(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%57 = load i32, i32* %4
%58 = and i32 %57, 4095
%59 = shl i32 %58, 4
%60 = load i32, i32* @getCPUID.cpu_id
%61 = or i32 %60, %59
store i32 %61, i32* @getCPUID.cpu_id
br label %77
62: ; preds = %47
%63 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%64 = call i8* @strstr(i8* %63, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%65 = icmp ne i8* %64, null
br i1 %65, label %66, label %76
66: ; preds = %62
%67 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 11
%68 = call i8* @strstr(i8* %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i8* %68, i8** %2
%69 = load i8*, i8** %2
%70 = getelementptr inbounds i8, i8* %69, i64 2
%71 = call i32 @sscanf(i8* %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %4)
%72 = load i32, i32* %4
%73 = and i32 %72, 15
%74 = load i32, i32* @getCPUID.cpu_id
%75 = or i32 %74, %73
store i32 %75, i32* @getCPUID.cpu_id
br label %76
76: ; preds = %66, %62
br label %77
77: ; preds = %76, %51
br label %78
78: ; preds = %77, %34
br label %79
79: ; preds = %78, %21
br label %12
80: ; preds = %12
%81 = load i32*, i32** %3
%82 = call i32 @fclose(i32* %81)
br label %86
83: ; preds = %7
%84 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
%85 = call i32 @exit(i32 -1)
unreachable
86: ; preds = %80
%87 = load i32, i32* @getCPUID.cpu_id
%88 = lshr i32 %87, 4
store i32 %88, i32* @getCPUID.cpu_id
%89 = call i32* @fopen(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %89, i32** %3
%90 = load i32*, i32** %3
%91 = icmp ne i32* %90, null
br i1 %91, label %92, label %109
92: ; preds = %86
br label %93
93: ; preds = %105, %92
%94 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%95 = load i32*, i32** %3
%96 = call i64 @fgets(i8* %94, i32 255, i32* %95)
%97 = icmp ne i64 %96, 0
br i1 %97, label %98, label %106
98: ; preds = %93
%99 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%100 = call i8* @strstr(i8* %99, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
%101 = icmp ne i8* %100, null
br i1 %101, label %102, label %105
102: ; preds = %98
%103 = load i32, i32* @getCPUID.cpu_id
%104 = add i32 %103, 4
store i32 %104, i32* @getCPUID.cpu_id
br label %105
105: ; preds = %102, %98
br label %93
106: ; preds = %93
%107 = load i32*, i32** %3
%108 = call i32 @fclose(i32* %107)
br label %109
109: ; preds = %106, %86
br label %110
110: ; preds = %109, %0
%111 = load i32, i32* @getCPUID.cpu_id
ret i32 %111
}

LLVM IR (-O2):
@getCPUID.cpu_id = internal unnamed_addr global i32 0
@.str = [14 x i8] c"/proc/cpuinfo\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [16 x i8] c"CPU implementer\00"
@.str.3 = [3 x i8] c": \00"
@.str.4 = [3 x i8] c"%x\00"
@.str.5 = [12 x i8] c"CPU variant\00"
@.str.6 = [9 x i8] c"CPU part\00"
@.str.7 = [13 x i8] c"CPU revision\00"
@.str.8 = [3 x i8] c"%u\00"
@.str.9 = [24 x i8] c"CPU info not available!\00"
@.str.10 = [33 x i8] c"/sys/bus/soc/devices/soc0/soc_id\00"
@.str.11 = [6 x i8] c"i.MX6\00"
define i32 @getCPUID() {
%1 = alloca [256 x i8]
%2 = alloca i32
%3 = load i32, i32* @getCPUID.cpu_id
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %93
5: ; preds = %0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%7 = bitcast i32* %2 to i8*
%8 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %77, label %10
10: ; preds = %5
%11 = call i64 @fgets(i8* %6, i32 255, i32* %8)
%12 = icmp eq i64 %11, 0
br i1 %12, label %68, label %13
13: ; preds = %10
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 14
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 10
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 8
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 11
br label %18
18: ; preds = %13, %65
%19 = call i8* @strstr(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i8* %19, null
br i1 %20, label %27, label %21
21: ; preds = %18
%22 = call i8* @strstr(i8* %14, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%23 = getelementptr inbounds i8, i8* %22, i64 4
%24 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%25 = load i32, i32* %2
%26 = shl i32 %25, 24
br label %63
27: ; preds = %18
%28 = call i8* @strstr(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%29 = icmp eq i8* %28, null
br i1 %29, label %40, label %30
30: ; preds = %27
%31 = call i8* @strstr(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%32 = getelementptr inbounds i8, i8* %31, i64 4
%33 = call i32 @sscanf(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%34 = load i32, i32* %2
%35 = shl i32 %34, 20
%36 = and i32 %35, 15728640
%37 = load i32, i32* @getCPUID.cpu_id
%38 = or i32 %37, %36
%39 = or i32 %38, 983040
br label %63
40: ; preds = %27
%41 = call i8* @strstr(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%42 = icmp eq i8* %41, null
br i1 %42, label %52, label %43
43: ; preds = %40
%44 = call i8* @strstr(i8* %16, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%45 = getelementptr inbounds i8, i8* %44, i64 4
%46 = call i32 @sscanf(i8* %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%47 = load i32, i32* %2
%48 = shl i32 %47, 4
%49 = and i32 %48, 65520
%50 = load i32, i32* @getCPUID.cpu_id
%51 = or i32 %49, %50
br label %63
52: ; preds = %40
%53 = call i8* @strstr(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%54 = icmp eq i8* %53, null
br i1 %54, label %65, label %55
55: ; preds = %52
%56 = call i8* @strstr(i8* %17, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%57 = getelementptr inbounds i8, i8* %56, i64 2
%58 = call i32 @sscanf(i8* %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %2)
%59 = load i32, i32* %2
%60 = and i32 %59, 15
%61 = load i32, i32* @getCPUID.cpu_id
%62 = or i32 %61, %60
br label %63
63: ; preds = %21, %43, %55, %30
%64 = phi i32 [ %39, %30 ], [ %62, %55 ], [ %51, %43 ], [ %26, %21 ]
store i32 %64, i32* @getCPUID.cpu_id
br label %65
65: ; preds = %63, %52
%66 = call i64 @fgets(i8* %6, i32 255, i32* %8)
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %18
68: ; preds = %65, %10
%69 = call i32 @fclose(i32* %8)
%70 = load i32, i32* @getCPUID.cpu_id
%71 = lshr i32 %70, 4
store i32 %71, i32* @getCPUID.cpu_id
%72 = call i32* @fopen(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%73 = icmp eq i32* %72, null
br i1 %73, label %91, label %74
74: ; preds = %68
%75 = call i64 @fgets(i8* %6, i32 255, i32* %72)
%76 = icmp eq i64 %75, 0
br i1 %76, label %89, label %80
77: ; preds = %5
%78 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
%79 = tail call i32 @exit(i32 -1)
unreachable
80: ; preds = %74, %86
%81 = call i8* @strstr(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
%82 = icmp eq i8* %81, null
br i1 %82, label %86, label %83
83: ; preds = %80
%84 = load i32, i32* @getCPUID.cpu_id
%85 = add i32 %84, 4
store i32 %85, i32* @getCPUID.cpu_id
br label %86
86: ; preds = %83, %80
%87 = call i64 @fgets(i8* %6, i32 255, i32* %72)
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %80
89: ; preds = %86, %74
%90 = call i32 @fclose(i32* %72)
br label %91
91: ; preds = %89, %68
%92 = load i32, i32* @getCPUID.cpu_id
br label %93
93: ; preds = %91, %0
%94 = phi i32 [ %92, %91 ], [ %3, %0 ]
ret i32 %94
}