#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*/ buffer;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, char *);
int /*<<< orphan*/ printf(char *, int, int, char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int cpu_type(FILE *fo) {
  int nbr_cpu = 0, phys_cpu_id = -1, nbr_cores = 0;
  char buffer[1024], model[80] = {0};
  FILE *f = fopen("/proc/cpuinfo", "r");
  if (f) {
    while (fgets(buffer, sizeof(buffer), f)) {
      if (!strncmp(buffer, "processor\t:", 11))
        nbr_cpu++;
      else if (!strncmp(buffer, "physical id\t:", 13)) {
        int id = atoi(buffer + 14);
        if (id > phys_cpu_id)
          phys_cpu_id = id;
      } else if (!*model && !strncmp(buffer, "model name\t:", 12)) {
        char *s = buffer + 13, *d = model;
        while (*s) {
          *d++ = *s;
          if (*s++ == ' ') {
            while (*s == ' ')
              s++;
            *d++ = *s++;
          }
        }
      }
      if (!nbr_cores && !strncmp(buffer, "cpu cores\t:", 11))
        nbr_cores = atoi(buffer + 12);
    }
    fclose(f);
  }
  nbr_cores = 8;
  if (nbr_cores > 0)
    nbr_cpu = nbr_cores;
  printf("Machine: %d x %u-Core CPU(s) %s",
         phys_cpu_id >= 0 ? phys_cpu_id + 1 : 1, nbr_cores, model);
  fprintf(fo, "Machine: %d x %u-Core CPU(s) %s",
          phys_cpu_id >= 0 ? phys_cpu_id + 1 : 1, nbr_cores, model);
  return nbr_cpu << 16 | nbr_cores;
}


x86 assembly (clang, -O0):
<cpu_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4b0,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x470(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1060 <memset@plt>
lea    0xe42(%rip),%rdi
lea    0xe49(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x478(%rbp)
cmpq   $0x0,-0x478(%rbp)
je     13e8 <cpu_type+0x268>
jmp    11e4 <cpu_type+0x64>
lea    -0x420(%rbp),%rdi
mov    -0x478(%rbp),%rdx
mov    $0x400,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     13dc <cpu_type+0x25c>
lea    -0x420(%rbp),%rdi
lea    0xdfc(%rip),%rsi
mov    $0xb,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1235 <cpu_type+0xb5>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1399 <cpu_type+0x219>
lea    -0x420(%rbp),%rdi
lea    0xdd9(%rip),%rsi
mov    $0xd,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1289 <cpu_type+0x109>
lea    -0x420(%rbp),%rdi
add    $0xe,%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x47c(%rbp)
mov    -0x47c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1284 <cpu_type+0x104>
mov    -0x47c(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1394 <cpu_type+0x214>
cmpb   $0x0,-0x470(%rbp)
jne    138f <cpu_type+0x20f>
lea    -0x420(%rbp),%rdi
lea    0xd86(%rip),%rsi
mov    $0xc,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    138f <cpu_type+0x20f>
lea    -0x420(%rbp),%rax
add    $0xd,%rax
mov    %rax,-0x488(%rbp)
lea    -0x470(%rbp),%rax
mov    %rax,-0x490(%rbp)
mov    -0x488(%rbp),%rax
cmpb   $0x0,(%rax)
je     138a <cpu_type+0x20a>
mov    -0x488(%rbp),%rax
mov    (%rax),%cl
mov    -0x490(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x490(%rbp)
mov    %cl,(%rax)
mov    -0x488(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x488(%rbp)
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1385 <cpu_type+0x205>
jmp    132d <cpu_type+0x1ad>
mov    -0x488(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1357 <cpu_type+0x1d7>
mov    -0x488(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x488(%rbp)
jmp    132d <cpu_type+0x1ad>
mov    -0x488(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x488(%rbp)
mov    (%rax),%cl
mov    -0x490(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x490(%rbp)
mov    %cl,(%rax)
jmp    12d7 <cpu_type+0x157>
jmp    138f <cpu_type+0x20f>
jmp    1394 <cpu_type+0x214>
jmp    1399 <cpu_type+0x219>
cmpl   $0x0,-0x14(%rbp)
jne    13d7 <cpu_type+0x257>
lea    -0x420(%rbp),%rdi
lea    0xc86(%rip),%rsi
mov    $0xb,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    13d7 <cpu_type+0x257>
lea    -0x420(%rbp),%rdi
add    $0xc,%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    11e4 <cpu_type+0x64>
mov    -0x478(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x8,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    13ff <cpu_type+0x27f>
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     141a <cpu_type+0x29a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x494(%rbp)
jmp    142a <cpu_type+0x2aa>
mov    $0x1,%eax
mov    %eax,-0x494(%rbp)
jmp    142a <cpu_type+0x2aa>
mov    -0x494(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    -0x470(%rbp),%rcx
lea    0xc02(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x4a0(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     146c <cpu_type+0x2ec>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4a4(%rbp)
jmp    147c <cpu_type+0x2fc>
mov    $0x1,%eax
mov    %eax,-0x4a4(%rbp)
jmp    147c <cpu_type+0x2fc>
mov    -0x4a0(%rbp),%rdi
mov    -0x4a4(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    -0x470(%rbp),%r8
lea    0xba9(%rip),%rsi
call   1080 <fprintf@plt>
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
or     -0x14(%rbp),%eax
add    $0x4b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_type>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x468,%rsp
mov    %rdi,%r15
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0xe59(%rip),%rdi
lea    0xe60(%rip),%rsi
call   1080 <fopen@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     1338 <cpu_type+0x1c8>
mov    %rax,%rbx
lea    0x60(%rsp),%rdi
mov    $0x400,%esi
mov    %rax,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1330 <cpu_type+0x1c0>
mov    %r15,0x8(%rsp)
xor    %r15d,%r15d
mov    $0xffffffff,%r12d
lea    0xe1c(%rip),%r13
lea    0x60(%rsp),%rbp
lea    0xe1c(%rip),%r14
jmp    1243 <cpu_type+0xd3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x6e(%rsp),%rdi
call   1090 <atoi@plt>
cmp    %r12d,%eax
cmovg  %eax,%r12d
test   %r15d,%r15d
je     12e0 <cpu_type+0x170>
mov    %rbp,%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1311 <cpu_type+0x1a1>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0xb,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1221 <cpu_type+0xb1>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    $0xd,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1210 <cpu_type+0xa0>
cmpb   $0x0,0x10(%rsp)
jne    1221 <cpu_type+0xb1>
mov    %rbp,%rdi
lea    0xdae(%rip),%rsi
mov    $0xc,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1221 <cpu_type+0xb1>
mov    0x6d(%rsp),%dl
test   %dl,%dl
je     1221 <cpu_type+0xb1>
lea    0x10(%rsp),%rax
lea    0x6d(%rsp),%rsi
jmp    12b1 <cpu_type+0x141>
xchg   %ax,%ax
add    $0x1,%rax
mov    (%rcx),%dl
mov    %rcx,%rsi
test   %dl,%dl
je     1221 <cpu_type+0xb1>
mov    %dl,(%rax)
lea    0x1(%rsi),%rcx
cmpb   $0x20,(%rsi)
jne    12a0 <cpu_type+0x130>
nopl   0x0(%rax)
movzbl (%rcx),%edx
add    $0x1,%rcx
cmp    $0x20,%dl
je     12c0 <cpu_type+0x150>
mov    %dl,0x1(%rax)
add    $0x2,%rax
jmp    12a4 <cpu_type+0x134>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
lea    0xd4d(%rip),%rsi
mov    $0xb,%edx
call   1030 <strncmp@plt>
xor    %r15d,%r15d
test   %eax,%eax
jne    122a <cpu_type+0xba>
lea    0x6c(%rsp),%rdi
call   1090 <atoi@plt>
mov    %eax,%r15d
jmp    122a <cpu_type+0xba>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0x1(%r12),%eax
test   %r12d,%r12d
mov    $0x1,%ebp
cmovns %eax,%ebp
mov    0x8(%rsp),%r15
jmp    1338 <cpu_type+0x1c8>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xd04(%rip),%rbx
lea    0x10(%rsp),%r14
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x8,%edx
mov    %r14,%rcx
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    $0x8,%ecx
mov    %r14,%r8
call   1070 <fprintf@plt>
mov    $0x80008,%eax
add    $0x468,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/proc/cpuinfo\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [12 x i8] c"processor\09:\00"
@.str.3 = [14 x i8] c"physical id\09:\00"
@.str.4 = [13 x i8] c"model name\09:\00"
@.str.5 = [12 x i8] c"cpu cores\09:\00"
@.str.6 = [32 x i8] c"Machine: %d x %u-Core CPU(s) %s\00"
define i32 @cpu_type(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [1024 x i8]
%7 = alloca [80 x i8]
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
store i32* %0, i32** %2
store i32 0, i32* %3
store i32 -1, i32* %4
store i32 0, i32* %5
%12 = bitcast [80 x i8]* %7 to i8*
%13 = 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* %13, i32** %8
%14 = load i32*, i32** %8
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %103
16: ; preds = %1
br label %17
17: ; preds = %99, %16
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%19 = load i32*, i32** %8
%20 = call i64 @fgets(i8* %18, i32 1024, i32* %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %100
22: ; preds = %17
%23 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%24 = call i32 @strncmp(i8* %23, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 11)
%25 = icmp ne i32 %24, 0
br i1 %25, label %29, label %26
26: ; preds = %22
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %88
29: ; preds = %22
%30 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%31 = call i32 @strncmp(i8* %30, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 13)
%32 = icmp ne i32 %31, 0
br i1 %32, label %43, label %33
33: ; preds = %29
%34 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%35 = getelementptr inbounds i8, i8* %34, i64 14
%36 = call i32 @atoi(i8* %35)
store i32 %36, i32* %9
%37 = load i32, i32* %9
%38 = load i32, i32* %4
%39 = icmp sgt i32 %37, %38
br i1 %39, label %40, label %42
40: ; preds = %33
%41 = load i32, i32* %9
store i32 %41, i32* %4
br label %42
42: ; preds = %40, %33
br label %87
43: ; preds = %29
%44 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%45 = load i8, i8* %44
%46 = icmp ne i8 %45, 0
br i1 %46, label %86, label %47
47: ; preds = %43
%48 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%49 = call i32 @strncmp(i8* %48, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 12)
%50 = icmp ne i32 %49, 0
br i1 %50, label %86, label %51
51: ; preds = %47
%52 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%53 = getelementptr inbounds i8, i8* %52, i64 13
store i8* %53, i8** %10
%54 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
store i8* %54, i8** %11
br label %55
55: ; preds = %84, %51
%56 = load i8*, i8** %10
%57 = load i8, i8* %56
%58 = icmp ne i8 %57, 0
br i1 %58, label %59, label %85
59: ; preds = %55
%60 = load i8*, i8** %10
%61 = load i8, i8* %60
%62 = load i8*, i8** %11
%63 = getelementptr inbounds i8, i8* %62, i32 1
store i8* %63, i8** %11
store i8 %61, i8* %62
%64 = load i8*, i8** %10
%65 = getelementptr inbounds i8, i8* %64, i32 1
store i8* %65, i8** %10
%66 = load i8, i8* %64
%67 = sext i8 %66 to i32
%68 = icmp eq i32 %67, 32
br i1 %68, label %69, label %84
69: ; preds = %59
br label %70
70: ; preds = %75, %69
%71 = load i8*, i8** %10
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = icmp eq i32 %73, 32
br i1 %74, label %75, label %78
75: ; preds = %70
%76 = load i8*, i8** %10
%77 = getelementptr inbounds i8, i8* %76, i32 1
store i8* %77, i8** %10
br label %70
78: ; preds = %70
%79 = load i8*, i8** %10
%80 = getelementptr inbounds i8, i8* %79, i32 1
store i8* %80, i8** %10
%81 = load i8, i8* %79
%82 = load i8*, i8** %11
%83 = getelementptr inbounds i8, i8* %82, i32 1
store i8* %83, i8** %11
store i8 %81, i8* %82
br label %84
84: ; preds = %78, %59
br label %55
85: ; preds = %55
br label %86
86: ; preds = %85, %47, %43
br label %87
87: ; preds = %86, %42
br label %88
88: ; preds = %87, %26
%89 = load i32, i32* %5
%90 = icmp ne i32 %89, 0
br i1 %90, label %99, label %91
91: ; preds = %88
%92 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%93 = call i32 @strncmp(i8* %92, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 11)
%94 = icmp ne i32 %93, 0
br i1 %94, label %99, label %95
95: ; preds = %91
%96 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%97 = getelementptr inbounds i8, i8* %96, i64 12
%98 = call i32 @atoi(i8* %97)
store i32 %98, i32* %5
br label %99
99: ; preds = %95, %91, %88
br label %17
100: ; preds = %17
%101 = load i32*, i32** %8
%102 = call i32 @fclose(i32* %101)
br label %103
103: ; preds = %100, %1
store i32 8, i32* %5
%104 = load i32, i32* %5
%105 = icmp sgt i32 %104, 0
br i1 %105, label %106, label %108
106: ; preds = %103
%107 = load i32, i32* %5
store i32 %107, i32* %3
br label %108
108: ; preds = %106, %103
%109 = load i32, i32* %4
%110 = icmp sge i32 %109, 0
br i1 %110, label %111, label %114
111: ; preds = %108
%112 = load i32, i32* %4
%113 = add nsw i32 %112, 1
br label %115
114: ; preds = %108
br label %115
115: ; preds = %114, %111
%116 = phi i32 [ %113, %111 ], [ 1, %114 ]
%117 = load i32, i32* %5
%118 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%119 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 %116, i32 %117, i8* %118)
%120 = load i32*, i32** %2
%121 = load i32, i32* %4
%122 = icmp sge i32 %121, 0
br i1 %122, label %123, label %126
123: ; preds = %115
%124 = load i32, i32* %4
%125 = add nsw i32 %124, 1
br label %127
126: ; preds = %115
br label %127
127: ; preds = %126, %123
%128 = phi i32 [ %125, %123 ], [ 1, %126 ]
%129 = load i32, i32* %5
%130 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%131 = call i32 @fprintf(i32* %120, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 %128, i32 %129, i8* %130)
%132 = load i32, i32* %3
%133 = shl i32 %132, 16
%134 = load i32, i32* %5
%135 = or i32 %133, %134
ret i32 %135
}

LLVM IR (-O2):
@.str = [14 x i8] c"/proc/cpuinfo\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [12 x i8] c"processor\09:\00"
@.str.3 = [14 x i8] c"physical id\09:\00"
@.str.4 = [13 x i8] c"model name\09:\00"
@.str.5 = [12 x i8] c"cpu cores\09:\00"
@.str.6 = [32 x i8] c"Machine: %d x %u-Core CPU(s) %s\00"
define i32 @cpu_type(i32* nocapture %0) {
%2 = alloca [1024 x i8]
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = 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))
%7 = icmp eq i32* %6, null
br i1 %7, label %75, label %8
8: ; preds = %1
%9 = call i64 @fgets(i8* %4, i32 1024, i32* %6)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @fclose(i32* %6)
br label %75
13: ; preds = %8
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 13
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 14
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 12
br label %17
17: ; preds = %13, %66
%18 = phi i32 [ -1, %13 ], [ %59, %66 ]
%19 = phi i32 [ 0, %13 ], [ %67, %66 ]
%20 = call i32 @strncmp(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 11)
%21 = icmp eq i32 %20, 0
br i1 %21, label %58, label %22
22: ; preds = %17
%23 = call i32 @strncmp(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 13)
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = call i32 @atoi(i8* %15)
%27 = icmp sgt i32 %26, %18
%28 = select i1 %27, i32 %26, i32 %18
br label %58
29: ; preds = %22
%30 = load i8, i8* %5
%31 = icmp eq i8 %30, 0
br i1 %31, label %32, label %58
32: ; preds = %29
%33 = call i32 @strncmp(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 12)
%34 = icmp ne i32 %33, 0
%35 = load i8, i8* %14
%36 = icmp eq i8 %35, 0
%37 = select i1 %34, i1 true, i1 %36
br i1 %37, label %58, label %38
38: ; preds = %32, %53
%39 = phi i8 [ %56, %53 ], [ %35, %32 ]
%40 = phi i8* [ %55, %53 ], [ %5, %32 ]
%41 = phi i8* [ %54, %53 ], [ %14, %32 ]
%42 = getelementptr inbounds i8, i8* %40, i64 1
store i8 %39, i8* %40
%43 = getelementptr inbounds i8, i8* %41, i64 1
%44 = load i8, i8* %41
%45 = icmp eq i8 %44, 32
br i1 %45, label %46, label %53
46: ; preds = %38, %46
%47 = phi i8* [ %50, %46 ], [ %43, %38 ]
%48 = load i8, i8* %47
%49 = icmp eq i8 %48, 32
%50 = getelementptr inbounds i8, i8* %47, i64 1
br i1 %49, label %46, label %51
51: ; preds = %46
%52 = getelementptr inbounds i8, i8* %40, i64 2
store i8 %48, i8* %42
br label %53
53: ; preds = %51, %38
%54 = phi i8* [ %50, %51 ], [ %43, %38 ]
%55 = phi i8* [ %52, %51 ], [ %42, %38 ]
%56 = load i8, i8* %54
%57 = icmp eq i8 %56, 0
br i1 %57, label %58, label %38
58: ; preds = %53, %17, %25, %32, %29
%59 = phi i32 [ %18, %29 ], [ %18, %32 ], [ %28, %25 ], [ %18, %17 ], [ %18, %53 ]
%60 = icmp eq i32 %19, 0
br i1 %60, label %61, label %66
61: ; preds = %58
%62 = call i32 @strncmp(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 11)
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %61
%65 = call i32 @atoi(i8* %16)
br label %66
66: ; preds = %64, %61, %58
%67 = phi i32 [ %19, %58 ], [ 0, %61 ], [ %65, %64 ]
%68 = call i64 @fgets(i8* %4, i32 1024, i32* %6)
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %17
70: ; preds = %66
%71 = call i32 @fclose(i32* %6)
%72 = icmp sgt i32 %59, -1
%73 = add nsw i32 %59, 1
%74 = select i1 %72, i32 %73, i32 1
br label %75
75: ; preds = %70, %11, %1
%76 = phi i32 [ 1, %1 ], [ 1, %11 ], [ %74, %70 ]
%77 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 %76, i32 8, i8* %5)
%78 = call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 %76, i32 8, i8* %5)
ret i32 524296
}