signed int readppm(char *name, signed int *xres, signed int *yres,
                   unsigned char **imgdata) {
  char data[256l];
  struct _IO_FILE$link40 *ifp;
  signed int i;
  signed int bytesread;
  signed int datasize;
  ifp = fopen(name, "r");
  if (ifp == ((struct _IO_FILE$link40 *)((void *)0)))
    return 1;
  fscanf(ifp, "%s", (const void *)data);
  signed int tmp_statement_expression$1;
  unsigned long int __s1_len;
  unsigned long int __s2_len;
  _Bool tmp_if_expr$3;
  unsigned int return_value___builtin_strlen$2;
  if ((_Bool)1) {
    if (!((unsigned long int)("P6" + 1l) + -((unsigned long int)"P6") == 1ul))
      goto __CPROVER_DUMP_L2;
    return_value___builtin_strlen$2 = __builtin_strlen("P6");
    __s2_len = (unsigned long int)return_value___builtin_strlen$2;
    tmp_if_expr$3 = __s2_len < (unsigned long int)4 ? (_Bool)1 : (_Bool)0;
  } else {
  __CPROVER_DUMP_L2:;
    tmp_if_expr$3 = (_Bool)0;
  }
  signed int tmp_if_expr$6;
  signed int tmp_statement_expression$4;
  signed int return_value___builtin_strcmp$5;
  if (tmp_if_expr$3) {
    const unsigned char *__s1 = (const unsigned char *)(const char *)data;
    signed int __result =
        (signed int)__s1[(signed long int)0] -
        (signed int)((
            const unsigned char *)(const char *)"P6")[(signed long int)0];
    if (__s2_len > 0ul) {
      if (__result == 0) {
        __result =
            (signed int)__s1[(signed long int)1] -
            (signed int)((
                const unsigned char *)(const char *)"P6")[(signed long int)1];
        if (__s2_len > 1ul) {
          if (__result == 0) {
            __result = (signed int)__s1[(signed long int)2] -
                       (signed int)((const unsigned char *)(const char *)"P6")[(
                           signed long int)2];
            if (__s2_len > 2ul) {
              if (__result == 0)
                __result =
                    (signed int)__s1[(signed long int)3] -
                    (signed int)((const unsigned char
                                      *)(const char *)"P6")[(signed long int)3];
            }
          }
        }
      }
    }
    tmp_statement_expression$4 = __result;
    tmp_if_expr$6 = tmp_statement_expression$4;
  } else {
    return_value___builtin_strcmp$5 = __builtin_strcmp(data, "P6");
    tmp_if_expr$6 = return_value___builtin_strcmp$5;
  }
  tmp_statement_expression$1 = tmp_if_expr$6;
  if (!(tmp_statement_expression$1 == 0)) {
    fclose(ifp);
    return 2;
  }
  *xres = getint(ifp);
  *yres = getint(ifp);
  i = getint(ifp);
  fread((void *)&i, (unsigned long int)1, (unsigned long int)1, ifp);
  datasize = 3 * *xres * *yres;
  void *return_value_malloc$7;
  return_value_malloc$7 = malloc((unsigned long int)datasize);
  *imgdata = (unsigned char *)return_value_malloc$7;
  unsigned long int return_value_fread$8;
  return_value_fread$8 = fread((void *)*imgdata, (unsigned long int)1,
                               (unsigned long int)datasize, ifp);
  bytesread = (signed int)return_value_fread$8;
  fclose(ifp);
  if (!(bytesread == datasize))
    return 4;
  return 0;
}


x86 assembly (clang, -O0):
<readppm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe6a(%rip),%rsi
mov    $0x0,%al
call   1090 <fopen@plt>
cltq
mov    %rax,-0x138(%rbp)
cmpq   $0x0,-0x138(%rbp)
jne    11c0 <readppm+0x50>
movl   $0x1,-0x4(%rbp)
jmp    14a7 <readppm+0x337>
mov    -0x138(%rbp),%rdi
lea    -0x130(%rbp),%rdx
lea    0xe2d(%rip),%rsi
mov    $0x0,%al
call   1050 <fscanf@plt>
mov    $0x1,%al
test   $0x1,%al
jne    11eb <readppm+0x7b>
jmp    123e <readppm+0xce>
mov    $0x1,%al
test   %al,%al
jne    11ff <readppm+0x8f>
jmp    11fa <readppm+0x8a>
jmp    1243 <readppm+0xd3>
movl   $0x2,-0x160(%rbp)
mov    -0x160(%rbp),%eax
mov    %rax,-0x158(%rbp)
mov    -0x158(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x4,%rdx
cmovb  %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x159(%rbp)
jmp    124a <readppm+0xda>
jmp    1243 <readppm+0xd3>
movb   $0x0,-0x159(%rbp)
testb  $0x1,-0x159(%rbp)
je     1353 <readppm+0x1e3>
lea    -0x130(%rbp),%rax
mov    %rax,-0x178(%rbp)
mov    -0x178(%rbp),%rax
movzbl (%rax),%eax
movzbl 0xd8f(%rip),%ecx
sub    %ecx,%eax
mov    %eax,-0x17c(%rbp)
cmpq   $0x0,-0x158(%rbp)
jbe    1336 <readppm+0x1c6>
cmpl   $0x0,-0x17c(%rbp)
jne    1331 <readppm+0x1c1>
mov    -0x178(%rbp),%rax
movzbl 0x1(%rax),%eax
movzbl 0xd5b(%rip),%ecx
sub    %ecx,%eax
mov    %eax,-0x17c(%rbp)
cmpq   $0x1,-0x158(%rbp)
01
jbe    132c <readppm+0x1bc>
cmpl   $0x0,-0x17c(%rbp)
jne    1327 <readppm+0x1b7>
mov    -0x178(%rbp),%rax
movzbl 0x2(%rax),%eax
movzbl 0xd27(%rip),%ecx
sub    %ecx,%eax
mov    %eax,-0x17c(%rbp)
cmpq   $0x2,-0x158(%rbp)
02
jbe    1322 <readppm+0x1b2>
cmpl   $0x0,-0x17c(%rbp)
jne    131d <readppm+0x1ad>
mov    -0x178(%rbp),%rax
movzbl 0x3(%rax),%eax
movzbl 0xcf3(%rip),%ecx
sub    %ecx,%eax
mov    %eax,-0x17c(%rbp)
jmp    1322 <readppm+0x1b2>
jmp    1327 <readppm+0x1b7>
jmp    132c <readppm+0x1bc>
jmp    1331 <readppm+0x1c1>
jmp    1336 <readppm+0x1c6>
mov    -0x17c(%rbp),%eax
mov    %eax,-0x168(%rbp)
mov    -0x168(%rbp),%eax
mov    %eax,-0x164(%rbp)
jmp    1378 <readppm+0x208>
lea    -0x130(%rbp),%rdi
lea    0xca4(%rip),%rsi
call   1070 <strcmp@plt>
mov    %eax,-0x16c(%rbp)
mov    -0x16c(%rbp),%eax
mov    %eax,-0x164(%rbp)
mov    -0x164(%rbp),%eax
mov    %eax,-0x148(%rbp)
cmpl   $0x0,-0x148(%rbp)
je     13ab <readppm+0x23b>
mov    -0x138(%rbp),%rdi
mov    $0x0,%al
call   1040 <fclose@plt>
movl   $0x2,-0x4(%rbp)
jmp    14a7 <readppm+0x337>
mov    -0x138(%rbp),%rdi
mov    $0x0,%al
call   1060 <getint@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x138(%rbp),%rdi
mov    $0x0,%al
call   1060 <getint@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x138(%rbp),%rdi
mov    $0x0,%al
call   1060 <getint@plt>
mov    %eax,-0x13c(%rbp)
lea    -0x13c(%rbp),%rdi
mov    -0x138(%rbp),%rcx
mov    $0x1,%edx
mov    %rdx,%rsi
mov    $0x0,%al
call   1030 <fread@plt>
mov    -0x18(%rbp),%rax
imul   $0x3,(%rax),%eax
mov    -0x20(%rbp),%rcx
imul   (%rcx),%eax
mov    %eax,-0x144(%rbp)
movslq -0x144(%rbp),%rdi
call   1080 <malloc@plt>
mov    %rax,-0x188(%rbp)
mov    -0x188(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
movslq -0x144(%rbp),%rdx
mov    -0x138(%rbp),%rcx
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <fread@plt>
cltq
mov    %rax,-0x190(%rbp)
mov    -0x190(%rbp),%rax
mov    %eax,-0x140(%rbp)
mov    -0x138(%rbp),%rdi
mov    $0x0,%al
call   1040 <fclose@plt>
mov    -0x140(%rbp),%eax
cmp    -0x144(%rbp),%eax
je     14a0 <readppm+0x330>
movl   $0x4,-0x4(%rbp)
jmp    14a7 <readppm+0x337>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readppm>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x110,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
lea    0xe71(%rip),%rsi
xor    %eax,%eax
call   1090 <fopen@plt>
test   %eax,%eax
je     11d5 <readppm+0x65>
movslq %eax,%rbx
lea    0xe5e(%rip),%rsi
xor    %ebp,%ebp
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <fscanf@plt>
test   %bpl,%bpl
jne    11df <readppm+0x6f>
movzbl 0x10(%rsp),%eax
add    $0xffffffb0,%eax
jne    11f0 <readppm+0x80>
movzbl 0x11(%rsp),%eax
add    $0xffffffca,%eax
jne    11f0 <readppm+0x80>
movzbl 0x12(%rsp),%eax
jmp    11f0 <readppm+0x80>
mov    $0x1,%ebp
jmp    128f <readppm+0x11f>
lea    0xe1f(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1208 <readppm+0x98>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fclose@plt>
mov    $0x2,%ebp
jmp    128f <readppm+0x11f>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <getint@plt>
mov    %eax,(%r12)
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <getint@plt>
mov    %eax,(%r15)
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <getint@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
xor    %eax,%eax
call   1030 <fread@plt>
movslq (%r12),%rax
movslq (%r15),%rcx
imul   %rax,%rcx
lea    (%rcx,%rcx,2),%r15
mov    %r15,%rdi
call   1080 <malloc@plt>
mov    %rax,(%r14)
mov    $0x1,%esi
mov    %rax,%rdi
mov    %r15,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1030 <fread@plt>
xor    %ebp,%ebp
cmp    %r15d,%eax
setne  %bpl
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fclose@plt>
shl    $0x2,%ebp
mov    %ebp,%eax
add    $0x110,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%"struct._IO_FILE$link40" = type opaque
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [3 x i8] c"P6\00"
define i32 @readppm(i8* %0, i32* %1, i32* %2, i8** %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i8**
%10 = alloca [256 x i8]
%11 = alloca %"struct._IO_FILE$link40"*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i64
%17 = alloca i64
%18 = alloca i8
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i8*
%24 = alloca i32
%25 = alloca i8*
%26 = alloca i64
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i8** %3, i8*** %9
%27 = load i8*, i8** %6
%28 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fopen to i32 (i8*, i8*, ...)*)(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to %"struct._IO_FILE$link40"*
store %"struct._IO_FILE$link40"* %30, %"struct._IO_FILE$link40"** %11
%31 = load %"struct._IO_FILE$link40"*, %"struct._IO_FILE$link40"** %11
%32 = icmp eq %"struct._IO_FILE$link40"* %31, null
br i1 %32, label %33, label %34
33: ; preds = %4
store i32 1, i32* %5
br label %160
34: ; preds = %4
%35 = load %"struct._IO_FILE$link40"*, %"struct._IO_FILE$link40"** %11
%36 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%37 = call i32 (%"struct._IO_FILE$link40"*, i8*, i8*, ...) bitcast (i32 (...)* @fscanf to i32 (%"struct._IO_FILE$link40"*, i8*, i8*, ...)*)(%"struct._IO_FILE$link40"* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %36)
br i1 true, label %38, label %49
38: ; preds = %34
br i1 icmp eq (i64 add (i64 ptrtoint (i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 1) to i64), i64 sub (i64 0, i64 ptrtoint ([3 x i8]* @.str.2 to i64))), i64 1), label %40, label %39
39: ; preds = %38
br label %50
40: ; preds = %38
store i32 2, i32* %19
%41 = load i32, i32* %19
%42 = zext i32 %41 to i64
store i64 %42, i64* %17
%43 = load i64, i64* %17
%44 = icmp ult i64 %43, 4
%45 = zext i1 %44 to i64
%46 = select i1 %44, i32 1, i32 0
%47 = icmp ne i32 %46, 0
%48 = zext i1 %47 to i8
store i8 %48, i8* %18
br label %51
49: ; preds = %34
br label %50
50: ; preds = %49, %39
store i8 0, i8* %18
br label %51
51: ; preds = %50, %40
%52 = load i8, i8* %18
%53 = trunc i8 %52 to i1
br i1 %53, label %54, label %110
54: ; preds = %51
%55 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
store i8* %55, i8** %23
%56 = load i8*, i8** %23
%57 = getelementptr inbounds i8, i8* %56, i64 0
%58 = load i8, i8* %57
%59 = zext i8 %58 to i32
%60 = load i8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%61 = zext i8 %60 to i32
%62 = sub nsw i32 %59, %61
store i32 %62, i32* %24
%63 = load i64, i64* %17
%64 = icmp ugt i64 %63, 0
br i1 %64, label %65, label %107
65: ; preds = %54
%66 = load i32, i32* %24
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %106
68: ; preds = %65
%69 = load i8*, i8** %23
%70 = getelementptr inbounds i8, i8* %69, i64 1
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = load i8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 1)
%74 = zext i8 %73 to i32
%75 = sub nsw i32 %72, %74
store i32 %75, i32* %24
%76 = load i64, i64* %17
%77 = icmp ugt i64 %76, 1
br i1 %77, label %78, label %105
78: ; preds = %68
%79 = load i32, i32* %24
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %104
81: ; preds = %78
%82 = load i8*, i8** %23
%83 = getelementptr inbounds i8, i8* %82, i64 2
%84 = load i8, i8* %83
%85 = zext i8 %84 to i32
%86 = load i8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 2)
%87 = zext i8 %86 to i32
%88 = sub nsw i32 %85, %87
store i32 %88, i32* %24
%89 = load i64, i64* %17
%90 = icmp ugt i64 %89, 2
br i1 %90, label %91, label %103
91: ; preds = %81
%92 = load i32, i32* %24
%93 = icmp eq i32 %92, 0
br i1 %93, label %94, label %102
94: ; preds = %91
%95 = load i8*, i8** %23
%96 = getelementptr inbounds i8, i8* %95, i64 3
%97 = load i8, i8* %96
%98 = zext i8 %97 to i32
%99 = load i8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 1, i64 0)
%100 = zext i8 %99 to i32
%101 = sub nsw i32 %98, %100
store i32 %101, i32* %24
br label %102
102: ; preds = %94, %91
br label %103
103: ; preds = %102, %81
br label %104
104: ; preds = %103, %78
br label %105
105: ; preds = %104, %68
br label %106
106: ; preds = %105, %65
br label %107
107: ; preds = %106, %54
%108 = load i32, i32* %24
store i32 %108, i32* %21
%109 = load i32, i32* %21
store i32 %109, i32* %20
br label %114
110: ; preds = %51
%111 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%112 = call i32 @strcmp(i8* %111, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 %112, i32* %22
%113 = load i32, i32* %22
store i32 %113, i32* %20
br label %114
114: ; preds = %110, %107
%115 = load i32, i32* %20
store i32 %115, i32* %15
%116 = load i32, i32* %15
%117 = icmp eq i32 %116, 0
br i1 %117, label %121, label %118
118: ; preds = %114
%119 = load %"struct._IO_FILE$link40"*, %"struct._IO_FILE$link40"** %11
%120 = call i32 (%"struct._IO_FILE$link40"*, ...) bitcast (i32 (...)* @fclose to i32 (%"struct._IO_FILE$link40"*, ...)*)(%"struct._IO_FILE$link40"* %119)
store i32 2, i32* %5
br label %160
121: ; preds = %114
%122 = load %"struct._IO_FILE$link40"*, %"struct._IO_FILE$link40"** %11
%123 = call i32 (%"struct._IO_FILE$link40"*, ...) bitcast (i32 (...)* @getint to i32 (%"struct._IO_FILE$link40"*, ...)*)(%"struct._IO_FILE$link40"* %122)
%124 = load i32*, i32** %7
store i32 %123, i32* %124
%125 = load %"struct._IO_FILE$link40"*, %"struct._IO_FILE$link40"** %11
%126 = call i32 (%"struct._IO_FILE$link40"*, ...) bitcast (i32 (...)* @getint to i32 (%"struct._IO_FILE$link40"*, ...)*)(%"struct._IO_FILE$link40"* %125)
%127 = load i32*, i32** %8
store i32 %126, i32* %127
%128 = load %"struct._IO_FILE$link40"*, %"struct._IO_FILE$link40"** %11
%129 = call i32 (%"struct._IO_FILE$link40"*, ...) bitcast (i32 (...)* @getint to i32 (%"struct._IO_FILE$link40"*, ...)*)(%"struct._IO_FILE$link40"* %128)
store i32 %129, i32* %12
%130 = bitcast i32* %12 to i8*
%131 = load %"struct._IO_FILE$link40"*, %"struct._IO_FILE$link40"** %11
%132 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link40"*, ...) bitcast (i32 (...)* @fread to i32 (i8*, i64, i64, %"struct._IO_FILE$link40"*, ...)*)(i8* %130, i64 1, i64 1, %"struct._IO_FILE$link40"* %131)
%133 = load i32*, i32** %7
%134 = load i32, i32* %133
%135 = mul nsw i32 3, %134
%136 = load i32*, i32** %8
%137 = load i32, i32* %136
%138 = mul nsw i32 %135, %137
store i32 %138, i32* %14
%139 = load i32, i32* %14
%140 = sext i32 %139 to i64
%141 = call i8* @malloc(i64 %140)
store i8* %141, i8** %25
%142 = load i8*, i8** %25
%143 = load i8**, i8*** %9
store i8* %142, i8** %143
%144 = load i8**, i8*** %9
%145 = load i8*, i8** %144
%146 = load i32, i32* %14
%147 = sext i32 %146 to i64
%148 = load %"struct._IO_FILE$link40"*, %"struct._IO_FILE$link40"** %11
%149 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link40"*, ...) bitcast (i32 (...)* @fread to i32 (i8*, i64, i64, %"struct._IO_FILE$link40"*, ...)*)(i8* %145, i64 1, i64 %147, %"struct._IO_FILE$link40"* %148)
%150 = sext i32 %149 to i64
store i64 %150, i64* %26
%151 = load i64, i64* %26
%152 = trunc i64 %151 to i32
store i32 %152, i32* %13
%153 = load %"struct._IO_FILE$link40"*, %"struct._IO_FILE$link40"** %11
%154 = call i32 (%"struct._IO_FILE$link40"*, ...) bitcast (i32 (...)* @fclose to i32 (%"struct._IO_FILE$link40"*, ...)*)(%"struct._IO_FILE$link40"* %153)
%155 = load i32, i32* %13
%156 = load i32, i32* %14
%157 = icmp eq i32 %155, %156
br i1 %157, label %159, label %158
158: ; preds = %121
store i32 4, i32* %5
br label %160
159: ; preds = %121
store i32 0, i32* %5
br label %160
160: ; preds = %159, %158, %118, %33
%161 = load i32, i32* %5
ret i32 %161
}

LLVM IR (-O2):
%"struct._IO_FILE$link40" = type opaque
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [3 x i8] c"P6\00"
define i32 @readppm(i8* %0, i32* nocapture %1, i32* nocapture %2, i8** nocapture writeonly %3) {
%5 = alloca [256 x i8]
%6 = alloca i32
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%8 = bitcast i32* %6 to i8*
%9 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fopen to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to %"struct._IO_FILE$link40"*
%12 = icmp eq i32 %9, 0
br i1 %12, label %52, label %13
13: ; preds = %4
%14 = call i32 (%"struct._IO_FILE$link40"*, i8*, i8*, ...) bitcast (i32 (...)* @fscanf to i32 (%"struct._IO_FILE$link40"*, i8*, i8*, ...)*)(%"struct._IO_FILE$link40"* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br i1 icmp eq (i64 add (i64 ptrtoint (i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 1) to i64), i64 sub (i64 0, i64 ptrtoint ([3 x i8]* @.str.2 to i64))), i64 1), label %15, label %30
15: ; preds = %13
%16 = load i8, i8* %7
%17 = zext i8 %16 to i32
%18 = add nsw i32 %17, -80
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %32
20: ; preds = %15
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 1
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = add nsw i32 %23, -54
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %20
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 2
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
br label %32
30: ; preds = %13
%31 = call i32 @strcmp(i8* %7, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %32
32: ; preds = %15, %20, %26, %30
%33 = phi i32 [ %31, %30 ], [ %29, %26 ], [ %24, %20 ], [ %18, %15 ]
%34 = icmp eq i32 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %32
%36 = call i32 (%"struct._IO_FILE$link40"*, ...) bitcast (i32 (...)* @fclose to i32 (%"struct._IO_FILE$link40"*, ...)*)(%"struct._IO_FILE$link40"* %11)
br label %52
37: ; preds = %32
%38 = call i32 (%"struct._IO_FILE$link40"*, ...) bitcast (i32 (...)* @getint to i32 (%"struct._IO_FILE$link40"*, ...)*)(%"struct._IO_FILE$link40"* %11)
store i32 %38, i32* %1
%39 = call i32 (%"struct._IO_FILE$link40"*, ...) bitcast (i32 (...)* @getint to i32 (%"struct._IO_FILE$link40"*, ...)*)(%"struct._IO_FILE$link40"* %11)
store i32 %39, i32* %2
%40 = call i32 (%"struct._IO_FILE$link40"*, ...) bitcast (i32 (...)* @getint to i32 (%"struct._IO_FILE$link40"*, ...)*)(%"struct._IO_FILE$link40"* %11)
store i32 %40, i32* %6
%41 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link40"*, ...) bitcast (i32 (...)* @fread to i32 (i8*, i64, i64, %"struct._IO_FILE$link40"*, ...)*)(i8* %8, i64 1, i64 1, %"struct._IO_FILE$link40"* %11)
%42 = load i32, i32* %1
%43 = mul nsw i32 %42, 3
%44 = load i32, i32* %2
%45 = mul nsw i32 %43, %44
%46 = sext i32 %45 to i64
%47 = call i8* @malloc(i64 %46)
store i8* %47, i8** %3
%48 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link40"*, ...) bitcast (i32 (...)* @fread to i32 (i8*, i64, i64, %"struct._IO_FILE$link40"*, ...)*)(i8* %47, i64 1, i64 %46, %"struct._IO_FILE$link40"* %11)
%49 = call i32 (%"struct._IO_FILE$link40"*, ...) bitcast (i32 (...)* @fclose to i32 (%"struct._IO_FILE$link40"*, ...)*)(%"struct._IO_FILE$link40"* %11)
%50 = icmp eq i32 %48, %45
%51 = select i1 %50, i32 0, i32 4
br label %52
52: ; preds = %35, %37, %4
%53 = phi i32 [ 1, %4 ], [ 2, %35 ], [ %51, %37 ]
ret i32 %53
}