; LLVM IR from cornell-zhang/rosetta :: optical-flow/imageLib/ImageIO.ll (Z11ReadFilePGMR8CImageOfIhEPKc)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.CShape = type { i32, i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZTI6CError = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.17 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare noalias ptr @fopen(ptr noundef, ptr noundef) #1

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6CErrorC2EPKcS1_(ptr noundef nonnull align 8 dereferenceable(1032), ptr noundef, ptr noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZNSt9exceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3

declare void @__cxa_throw(ptr, ptr, ptr)

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6CShapeC2Eiii(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8CImageOfIhE10ReAllocateE6CShapeb(ptr noundef nonnull align 8 dereferenceable(76), i64, i32, i1 noundef zeroext) #4 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6CImage12PixelAddressEiii(ptr noundef nonnull align 8 dereferenceable(76), i32 noundef, i32 noundef, i32 noundef) #6 align 2

declare i32 @fclose(ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11read_headerP8_IO_FILEPKcccPiS3_S3_i(ptr noundef, ptr noundef, i8 noundef signext, i8 noundef signext, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #7

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11ReadFilePGMR8CImageOfIhEPKc(ptr noundef nonnull align 8 dereferenceable(76) %0, ptr noundef %1) #7 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.CShape, align 4
  %15 = alloca %struct.CShape, align 4
  %16 = alloca { i64, i32 }, align 4
  %17 = alloca %struct.CShape, align 4
  %18 = alloca { i64, i32 }, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca %"class.std::vector", align 8
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = call noalias ptr @fopen(ptr noundef %27, ptr noundef @.str)
  store ptr %28, ptr %5, align 8, !tbaa !5
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %39

31:                                               ; preds = %2
  %32 = call ptr @__cxa_allocate_exception(i64 1032) #9
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN6CErrorC2EPKcS1_(ptr noundef nonnull align 8 dereferenceable(1032) %32, ptr noundef @.str.17, ptr noundef %33)
          to label %34 unwind label %35

34:                                               ; preds = %31
  call void @__cxa_throw(ptr %32, ptr @_ZTI6CError, ptr @_ZNSt9exceptionD2Ev) #10
  unreachable

35:                                               ; preds = %31
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %6, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %7, align 4
  call void @__cxa_free_exception(ptr %32) #9
  br label %243

39:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = call noundef ptr @strrchr(ptr noundef %40, i32 noundef 46) #11
  store ptr %41, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 0, ptr %13, align 4, !tbaa !9
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = call i32 @strcmp(ptr noundef %42, ptr noundef @.str.18) #11
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %45, label %47

45:                                               ; preds = %39
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_Z11read_headerP8_IO_FILEPKcccPiS3_S3_i(ptr noundef %46, ptr noundef @.str.19, i8 noundef signext 80, i8 noundef signext 53, ptr noundef %8, ptr noundef %9, ptr noundef %10, i32 noundef 1)
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %61

47:                                               ; preds = %39
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = call i32 @strcmp(ptr noundef %48, ptr noundef @.str.20) #11
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %53

51:                                               ; preds = %47
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_Z11read_headerP8_IO_FILEPKcccPiS3_S3_i(ptr noundef %52, ptr noundef @.str.19, i8 noundef signext 80, i8 noundef signext 54, ptr noundef %8, ptr noundef %9, ptr noundef %10, i32 noundef 1)
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %60

53:                                               ; preds = %47
  %54 = load ptr, ptr %11, align 8, !tbaa !5
  %55 = call i32 @strcmp(ptr noundef %54, ptr noundef @.str.21) #11
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %59

57:                                               ; preds = %53
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_Z11read_headerP8_IO_FILEPKcccPiS3_S3_i(ptr noundef %58, ptr noundef @.str.22, i8 noundef signext 80, i8 noundef signext 57, ptr noundef %8, ptr noundef %9, ptr noundef %10, i32 noundef 1)
  store i32 0, ptr %12, align 4, !tbaa !9
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %57, %53
  br label %60

60:                                               ; preds = %59, %51
  br label %61

61:                                               ; preds = %60, %45
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #9
  %62 = load i32, ptr %8, align 4, !tbaa !9
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = load i32, ptr %12, align 4, !tbaa !9
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %61
  br label %75

67:                                               ; preds = %61
  %68 = load i32, ptr %13, align 4, !tbaa !9
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %72

70:                                               ; preds = %67
  %71 = load i32, ptr %10, align 4, !tbaa !9
  br label %73

72:                                               ; preds = %67
  br label %73

73:                                               ; preds = %72, %70
  %74 = phi i32 [ %71, %70 ], [ 4, %72 ]
  br label %75

75:                                               ; preds = %73, %66
  %76 = phi i32 [ 1, %66 ], [ %74, %73 ]
  call void @_ZN6CShapeC2Eiii(ptr noundef nonnull align 4 dereferenceable(12) %14, i32 noundef %62, i32 noundef %63, i32 noundef %76)
  %77 = load i32, ptr %13, align 4, !tbaa !9
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %85

79:                                               ; preds = %75
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %14, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %15, i64 12, i1 false)
  %81 = getelementptr inbounds { i64, i32 }, ptr %16, i32 0, i32 0
  %82 = load i64, ptr %81, align 4
  %83 = getelementptr inbounds { i64, i32 }, ptr %16, i32 0, i32 1
  %84 = load i32, ptr %83, align 4
  call void @_ZN8CImageOfIfE10ReAllocateE6CShapeb(ptr noundef nonnull align 8 dereferenceable(76) %80, i64 %82, i32 %84, i1 noundef zeroext false)
  br label %91

85:                                               ; preds = %75
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %14, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %17, i64 12, i1 false)
  %87 = getelementptr inbounds { i64, i32 }, ptr %18, i32 0, i32 0
  %88 = load i64, ptr %87, align 4
  %89 = getelementptr inbounds { i64, i32 }, ptr %18, i32 0, i32 1
  %90 = load i32, ptr %89, align 4
  call void @_ZN8CImageOfIhE10ReAllocateE6CShapeb(ptr noundef nonnull align 8 dereferenceable(76) %86, i64 %88, i32 %90, i1 noundef zeroext false)
  br label %91

91:                                               ; preds = %85, %79
  %92 = load i32, ptr %12, align 4, !tbaa !9
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %97, label %94

94:                                               ; preds = %91
  %95 = load i32, ptr %13, align 4, !tbaa !9
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %144

97:                                               ; preds = %94, %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  %98 = load i32, ptr %13, align 4, !tbaa !9
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %106

100:                                              ; preds = %97
  %101 = load i32, ptr %8, align 4, !tbaa !9
  %102 = load i32, ptr %10, align 4, !tbaa !9
  %103 = mul nsw i32 %101, %102
  %104 = sext i32 %103 to i64
  %105 = mul i64 %104, 4
  br label %110

106:                                              ; preds = %97
  %107 = getelementptr inbounds %struct.CShape, ptr %14, i32 0, i32 0
  %108 = load i32, ptr %107, align 4, !tbaa !12
  %109 = sext i32 %108 to i64
  br label %110

110:                                              ; preds = %106, %100
  %111 = phi i64 [ %105, %100 ], [ %109, %106 ]
  %112 = trunc i64 %111 to i32
  store i32 %112, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %113

113:                                              ; preds = %140, %110
  %114 = load i32, ptr %20, align 4, !tbaa !9
  %115 = getelementptr inbounds %struct.CShape, ptr %14, i32 0, i32 1
  %116 = load i32, ptr %115, align 4, !tbaa !14
  %117 = icmp slt i32 %114, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  br label %143

119:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = load i32, ptr %20, align 4, !tbaa !9
  %122 = call noundef ptr @_ZN6CImage12PixelAddressEiii(ptr noundef nonnull align 8 dereferenceable(76) %120, i32 noundef 0, i32 noundef %121, i32 noundef 0)
  store ptr %122, ptr %21, align 8, !tbaa !5
  %123 = load ptr, ptr %21, align 8, !tbaa !5
  %124 = load i32, ptr %19, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = call i64 @fread(ptr noundef %123, i64 noundef 1, i64 noundef %125, ptr noundef %126)
  %128 = trunc i64 %127 to i32
  %129 = load i32, ptr %19, align 4, !tbaa !9
  %130 = icmp ne i32 %128, %129
  br i1 %130, label %131, label %139

131:                                              ; preds = %119
  %132 = call ptr @__cxa_allocate_exception(i64 1032) #9
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN6CErrorC2EPKcS1_(ptr noundef nonnull align 8 dereferenceable(1032) %132, ptr noundef @.str.23, ptr noundef %133)
          to label %134 unwind label %135

134:                                              ; preds = %131
  call void @__cxa_throw(ptr %132, ptr @_ZTI6CError, ptr @_ZNSt9exceptionD2Ev) #10
  unreachable

135:                                              ; preds = %131
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %6, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %7, align 4
  call void @__cxa_free_exception(ptr %132) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %242

139:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %20, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %20, align 4, !tbaa !9
  br label %113, !llvm.loop !15

143:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %229

144:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  %145 = getelementptr inbounds %struct.CShape, ptr %14, i32 0, i32 0
  %146 = load i32, ptr %145, align 4, !tbaa !12
  %147 = mul nsw i32 %146, 3
  store i32 %147, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #9
  call void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #9
  %148 = load i32, ptr %22, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  invoke void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %149)
          to label %150 unwind label %157

150:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %151

151:                                              ; preds = %223, %150
  %152 = load i32, ptr %24, align 4, !tbaa !9
  %153 = getelementptr inbounds %struct.CShape, ptr %14, i32 0, i32 1
  %154 = load i32, ptr %153, align 4, !tbaa !14
  %155 = icmp slt i32 %152, %154
  br i1 %155, label %161, label %156

156:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %227

157:                                              ; preds = %144
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %6, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %7, align 4
  br label %228

161:                                              ; preds = %151
  %162 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef 0) #9
  %163 = load i32, ptr %22, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = invoke i64 @fread(ptr noundef %162, i64 noundef 1, i64 noundef %164, ptr noundef %165)
          to label %167 unwind label %175

167:                                              ; preds = %161
  %168 = trunc i64 %166 to i32
  %169 = load i32, ptr %22, align 4, !tbaa !9
  %170 = icmp ne i32 %168, %169
  br i1 %170, label %171, label %183

171:                                              ; preds = %167
  %172 = call ptr @__cxa_allocate_exception(i64 1032) #9
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN6CErrorC2EPKcS1_(ptr noundef nonnull align 8 dereferenceable(1032) %172, ptr noundef @.str.23, ptr noundef %173)
          to label %174 unwind label %179

174:                                              ; preds = %171
  invoke void @__cxa_throw(ptr %172, ptr @_ZTI6CError, ptr @_ZNSt9exceptionD2Ev) #10
          to label %249 unwind label %175

175:                                              ; preds = %174, %161
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %6, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %7, align 4
  br label %226

179:                                              ; preds = %171
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %6, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %7, align 4
  call void @__cxa_free_exception(ptr %172) #9
  br label %226

183:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = load i32, ptr %24, align 4, !tbaa !9
  %186 = invoke noundef ptr @_ZN6CImage12PixelAddressEiii(ptr noundef nonnull align 8 dereferenceable(76) %184, i32 noundef 0, i32 noundef %185, i32 noundef 0)
          to label %187 unwind label %218

187:                                              ; preds = %183
  store ptr %186, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %188

188:                                              ; preds = %192, %187
  %189 = load i32, ptr %26, align 4, !tbaa !9
  %190 = load i32, ptr %22, align 4, !tbaa !9
  %191 = icmp slt i32 %189, %190
  br i1 %191, label %192, label %222

192:                                              ; preds = %188
  %193 = load i32, ptr %26, align 4, !tbaa !9
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %26, align 4, !tbaa !9
  %195 = sext i32 %193 to i64
  %196 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %195) #9
  %197 = load i8, ptr %196, align 1, !tbaa !17
  %198 = load ptr, ptr %25, align 8, !tbaa !5
  %199 = getelementptr inbounds i8, ptr %198, i64 2
  store i8 %197, ptr %199, align 1, !tbaa !17
  %200 = load i32, ptr %26, align 4, !tbaa !9
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %26, align 4, !tbaa !9
  %202 = sext i32 %200 to i64
  %203 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %202) #9
  %204 = load i8, ptr %203, align 1, !tbaa !17
  %205 = load ptr, ptr %25, align 8, !tbaa !5
  %206 = getelementptr inbounds i8, ptr %205, i64 1
  store i8 %204, ptr %206, align 1, !tbaa !17
  %207 = load i32, ptr %26, align 4, !tbaa !9
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %26, align 4, !tbaa !9
  %209 = sext i32 %207 to i64
  %210 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %209) #9
  %211 = load i8, ptr %210, align 1, !tbaa !17
  %212 = load ptr, ptr %25, align 8, !tbaa !5
  %213 = getelementptr inbounds i8, ptr %212, i64 0
  store i8 %211, ptr %213, align 1, !tbaa !17
  %214 = load ptr, ptr %25, align 8, !tbaa !5
  %215 = getelementptr inbounds i8, ptr %214, i64 3
  store i8 -1, ptr %215, align 1, !tbaa !17
  %216 = load ptr, ptr %25, align 8, !tbaa !5
  %217 = getelementptr inbounds i8, ptr %216, i64 4
  store ptr %217, ptr %25, align 8, !tbaa !5
  br label %188, !llvm.loop !18

218:                                              ; preds = %183
  %219 = landingpad { ptr, i32 }
          cleanup
  %220 = extractvalue { ptr, i32 } %219, 0
  store ptr %220, ptr %6, align 8
  %221 = extractvalue { ptr, i32 } %219, 1
  store i32 %221, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  br label %226

222:                                              ; preds = %188
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  br label %223

223:                                              ; preds = %222
  %224 = load i32, ptr %24, align 4, !tbaa !9
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %24, align 4, !tbaa !9
  br label %151, !llvm.loop !19

226:                                              ; preds = %218, %179, %175
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %228

227:                                              ; preds = %156
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  br label %229

228:                                              ; preds = %226, %157
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  br label %242

229:                                              ; preds = %227, %143
  %230 = load ptr, ptr %5, align 8, !tbaa !5
  %231 = call i32 @fclose(ptr noundef %230)
  %232 = icmp ne i32 %231, 0
  br i1 %232, label %233, label %241

233:                                              ; preds = %229
  %234 = call ptr @__cxa_allocate_exception(i64 1032) #9
  %235 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN6CErrorC2EPKcS1_(ptr noundef nonnull align 8 dereferenceable(1032) %234, ptr noundef @.str.24, ptr noundef %235)
          to label %236 unwind label %237

236:                                              ; preds = %233
  call void @__cxa_throw(ptr %234, ptr @_ZTI6CError, ptr @_ZNSt9exceptionD2Ev) #10
  unreachable

237:                                              ; preds = %233
  %238 = landingpad { ptr, i32 }
          cleanup
  %239 = extractvalue { ptr, i32 } %238, 0
  store ptr %239, ptr %6, align 8
  %240 = extractvalue { ptr, i32 } %238, 1
  store i32 %240, ptr %7, align 4
  call void @__cxa_free_exception(ptr %234) #9
  br label %242

241:                                              ; preds = %229
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  ret void

242:                                              ; preds = %237, %228, %135
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %243

243:                                              ; preds = %242, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  br label %244

244:                                              ; preds = %243
  %245 = load ptr, ptr %6, align 8
  %246 = load i32, ptr %7, align 4
  %247 = insertvalue { ptr, i32 } poison, ptr %245, 0
  %248 = insertvalue { ptr, i32 } %247, i32 %246, 1
  resume { ptr, i32 } %248

249:                                              ; preds = %174
  unreachable
}

; Function Attrs: nounwind willreturn memory(read)
declare noundef ptr @strrchr(ptr noundef, i32 noundef) #8

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #8

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8CImageOfIfE10ReAllocateE6CShapeb(ptr noundef nonnull align 8 dereferenceable(76), i64, i32, i1 noundef zeroext) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind }
attributes #10 = { noreturn }
attributes #11 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9}
!12 = !{!13, !10, i64 0}
!13 = !{!"_ZTS6CShape", !10, i64 0, !10, i64 4, !10, i64 8}
!14 = !{!13, !10, i64 4}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.CShape = type { i32, i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZTI6CError = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.17 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6CErrorC2EPKcS1_(ptr noundef nonnull align 8 dereferenceable(1032), ptr noundef, ptr noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZNSt9exceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6CShapeC2Eiii(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8CImageOfIhE10ReAllocateE6CShapeb(ptr noundef nonnull align 8 dereferenceable(76), i64, i32, i1 noundef zeroext) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6CImage12PixelAddressEiii(ptr noundef nonnull align 8 dereferenceable(76), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11read_headerP8_IO_FILEPKcccPiS3_S3_i(ptr noundef, ptr noundef, i8 noundef signext, i8 noundef signext, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11ReadFilePGMR8CImageOfIhEPKc(ptr noundef nonnull align 8 dereferenceable(76) %0, ptr noundef %1) local_unnamed_addr #6 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.CShape, align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str)
  %9 = icmp eq ptr %8, null
  br i1 %9, label %10, label %12

10:                                               ; preds = %2
  %11 = tail call ptr @__cxa_allocate_exception(i64 1032) #8
  tail call void @_ZN6CErrorC2EPKcS1_(ptr noundef nonnull align 8 dereferenceable(1032) %11, ptr noundef nonnull @.str.17, ptr noundef %1)
  tail call void @__cxa_throw(ptr nonnull %11, ptr nonnull @_ZTI6CError, ptr nonnull @_ZNSt9exceptionD2Ev) #9
  unreachable

12:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  %13 = tail call noundef ptr @strrchr(ptr noundef nonnull dereferenceable(1) %1, i32 noundef 46) #10
  %14 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %13, ptr noundef nonnull dereferenceable(1) @.str.18) #10
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %.sink.split, label %16

16:                                               ; preds = %12
  %17 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %13, ptr noundef nonnull dereferenceable(1) @.str.20) #10
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %.sink.split, label %19

19:                                               ; preds = %16
  %20 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %13, ptr noundef nonnull dereferenceable(1) @.str.21) #10
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %27, label %22

.sink.split:                                      ; preds = %16, %12
  %.sink = phi i8 [ 53, %12 ], [ 54, %16 ]
  %.ph = phi i32 [ 1, %12 ], [ 4, %16 ]
  call void @_Z11read_headerP8_IO_FILEPKcccPiS3_S3_i(ptr noundef nonnull %8, ptr noundef nonnull @.str.19, i8 noundef signext 80, i8 noundef signext %.sink, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5, i32 noundef 1)
  br label %22

22:                                               ; preds = %.sink.split, %19
  %23 = phi i32 [ 4, %19 ], [ %.ph, %.sink.split ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #8
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = load i32, ptr %4, align 4, !tbaa !5
  call void @_ZN6CShapeC2Eiii(ptr noundef nonnull align 4 dereferenceable(12) %6, i32 noundef %24, i32 noundef %25, i32 noundef %23)
  %.sroa.022.0.copyload = load i64, ptr %6, align 8
  %.sroa.223.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.223.0.copyload = load i32, ptr %.sroa.223.0..sroa_idx, align 8, !tbaa !5
  call void @_ZN8CImageOfIhE10ReAllocateE6CShapeb(ptr noundef nonnull align 8 dereferenceable(76) %0, i64 %.sroa.022.0.copyload, i32 %.sroa.223.0.copyload, i1 noundef zeroext false)
  %26 = load i32, ptr %6, align 8, !tbaa !9
  %.fr78 = freeze i32 %26
  br i1 %15, label %35, label %51

27:                                               ; preds = %19
  call void @_Z11read_headerP8_IO_FILEPKcccPiS3_S3_i(ptr noundef nonnull %8, ptr noundef nonnull @.str.22, i8 noundef signext 80, i8 noundef signext 57, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #8
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = load i32, ptr %5, align 4
  call void @_ZN6CShapeC2Eiii(ptr noundef nonnull align 4 dereferenceable(12) %6, i32 noundef %28, i32 noundef %29, i32 noundef %30)
  %.sroa.026.0.copyload = load i64, ptr %6, align 8
  %.sroa.227.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.227.0.copyload = load i32, ptr %.sroa.227.0..sroa_idx, align 8, !tbaa !5
  call void @_ZN8CImageOfIfE10ReAllocateE6CShapeb(ptr noundef nonnull align 8 dereferenceable(76) %0, i64 %.sroa.026.0.copyload, i32 %.sroa.227.0.copyload, i1 noundef zeroext false)
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = shl i32 %31, 2
  %34 = mul i32 %33, %32
  br label %35

35:                                               ; preds = %22, %27
  %36 = phi i32 [ %34, %27 ], [ %.fr78, %22 ]
  %37 = getelementptr inbounds i8, ptr %6, i64 4
  %38 = load i32, ptr %37, align 4, !tbaa !11
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %35
  %40 = sext i32 %36 to i64
  br label %45

41:                                               ; preds = %45
  %42 = add nuw nsw i32 %.06077, 1
  %43 = load i32, ptr %37, align 4, !tbaa !11
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %45, label %.loopexit, !llvm.loop !12

45:                                               ; preds = %.lr.ph, %41
  %.06077 = phi i32 [ 0, %.lr.ph ], [ %42, %41 ]
  %46 = call noundef ptr @_ZN6CImage12PixelAddressEiii(ptr noundef nonnull align 8 dereferenceable(76) %0, i32 noundef 0, i32 noundef %.06077, i32 noundef 0)
  %47 = call i64 @fread(ptr noundef %46, i64 noundef 1, i64 noundef %40, ptr noundef nonnull %8)
  %48 = trunc i64 %47 to i32
  %.not67 = icmp eq i32 %36, %48
  br i1 %.not67, label %41, label %49

49:                                               ; preds = %45
  %50 = call ptr @__cxa_allocate_exception(i64 1032) #8
  call void @_ZN6CErrorC2EPKcS1_(ptr noundef nonnull align 8 dereferenceable(1032) %50, ptr noundef nonnull @.str.23, ptr noundef %1)
  call void @__cxa_throw(ptr nonnull %50, ptr nonnull @_ZTI6CError, ptr nonnull @_ZNSt9exceptionD2Ev) #9
  unreachable

51:                                               ; preds = %22
  %52 = mul nsw i32 %.fr78, 3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #8
  call void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  %53 = sext i32 %52 to i64
  invoke void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %53)
          to label %.preheader unwind label %80

.preheader:                                       ; preds = %51
  %54 = getelementptr inbounds i8, ptr %6, i64 4
  %55 = load i32, ptr %54, align 4, !tbaa !11
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %.lr.ph75, label %._crit_edge76

.lr.ph75:                                         ; preds = %.preheader
  %57 = icmp sgt i32 %.fr78, 0
  br i1 %57, label %.lr.ph75.split.us, label %.lr.ph75.split

.lr.ph75.split.us:                                ; preds = %.lr.ph75, %._crit_edge.us
  %.05774.us = phi i32 [ %77, %._crit_edge.us ], [ 0, %.lr.ph75 ]
  %58 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 0) #8
  %59 = call i64 @fread(ptr noundef nonnull %58, i64 noundef 1, i64 noundef %53, ptr noundef nonnull %8)
  %60 = trunc i64 %59 to i32
  %.not.us = icmp eq i32 %52, %60
  br i1 %.not.us, label %.lr.ph.us, label %.split.us

.lr.ph.us:                                        ; preds = %.lr.ph75.split.us
  %61 = call noundef ptr @_ZN6CImage12PixelAddressEiii(ptr noundef nonnull align 8 dereferenceable(76) %0, i32 noundef 0, i32 noundef %.05774.us, i32 noundef 0)
  br label %62

62:                                               ; preds = %.lr.ph.us, %62
  %indvars.iv = phi i64 [ 0, %.lr.ph.us ], [ %indvars.iv.next, %62 ]
  %.05672.us = phi ptr [ %61, %.lr.ph.us ], [ %74, %62 ]
  %63 = add nuw nsw i64 %indvars.iv, 1
  %64 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv) #8
  %65 = load i8, ptr %64, align 1, !tbaa !14
  %66 = getelementptr inbounds i8, ptr %.05672.us, i64 2
  store i8 %65, ptr %66, align 1, !tbaa !14
  %67 = add nuw nsw i64 %indvars.iv, 2
  %68 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %63) #8
  %69 = load i8, ptr %68, align 1, !tbaa !14
  %70 = getelementptr inbounds i8, ptr %.05672.us, i64 1
  store i8 %69, ptr %70, align 1, !tbaa !14
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 3
  %71 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %67) #8
  %72 = load i8, ptr %71, align 1, !tbaa !14
  store i8 %72, ptr %.05672.us, align 1, !tbaa !14
  %73 = getelementptr inbounds i8, ptr %.05672.us, i64 3
  store i8 -1, ptr %73, align 1, !tbaa !14
  %74 = getelementptr inbounds i8, ptr %.05672.us, i64 4
  %75 = trunc nuw i64 %indvars.iv.next to i32
  %76 = icmp sgt i32 %52, %75
  br i1 %76, label %62, label %._crit_edge.us, !llvm.loop !15

._crit_edge.us:                                   ; preds = %62
  %77 = add nuw nsw i32 %.05774.us, 1
  %78 = load i32, ptr %54, align 4, !tbaa !11
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %.lr.ph75.split.us, label %._crit_edge76, !llvm.loop !16

._crit_edge76:                                    ; preds = %88, %._crit_edge.us, %.preheader
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  br label %.loopexit

80:                                               ; preds = %51
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %93

.lr.ph75.split:                                   ; preds = %.lr.ph75, %88
  %.05774 = phi i32 [ %90, %88 ], [ 0, %.lr.ph75 ]
  %82 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 0) #8
  %83 = call i64 @fread(ptr noundef nonnull %82, i64 noundef 1, i64 noundef %53, ptr noundef nonnull %8)
  %84 = trunc i64 %83 to i32
  %.not = icmp eq i32 %52, %84
  br i1 %.not, label %88, label %.split.us

.split.us:                                        ; preds = %.lr.ph75.split, %.lr.ph75.split.us
  %85 = call ptr @__cxa_allocate_exception(i64 1032) #8
  call void @_ZN6CErrorC2EPKcS1_(ptr noundef nonnull align 8 dereferenceable(1032) %85, ptr noundef nonnull @.str.23, ptr noundef %1)
  invoke void @__cxa_throw(ptr nonnull %85, ptr nonnull @_ZTI6CError, ptr nonnull @_ZNSt9exceptionD2Ev) #9
          to label %98 unwind label %86

86:                                               ; preds = %.split.us
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %93

88:                                               ; preds = %.lr.ph75.split
  %89 = call noundef ptr @_ZN6CImage12PixelAddressEiii(ptr noundef nonnull align 8 dereferenceable(76) %0, i32 noundef 0, i32 noundef %.05774, i32 noundef 0)
  %90 = add nuw nsw i32 %.05774, 1
  %91 = load i32, ptr %54, align 4, !tbaa !11
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %.lr.ph75.split, label %._crit_edge76, !llvm.loop !16

93:                                               ; preds = %86, %80
  %.pn = phi { ptr, i32 } [ %87, %86 ], [ %81, %80 ]
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  resume { ptr, i32 } %.pn

.loopexit:                                        ; preds = %41, %35, %._crit_edge76
  %94 = call i32 @fclose(ptr noundef nonnull %8)
  %.not66 = icmp eq i32 %94, 0
  br i1 %.not66, label %97, label %95

95:                                               ; preds = %.loopexit
  %96 = call ptr @__cxa_allocate_exception(i64 1032) #8
  call void @_ZN6CErrorC2EPKcS1_(ptr noundef nonnull align 8 dereferenceable(1032) %96, ptr noundef nonnull @.str.24, ptr noundef %1)
  call void @__cxa_throw(ptr nonnull %96, ptr nonnull @_ZTI6CError, ptr nonnull @_ZNSt9exceptionD2Ev) #9
  unreachable

97:                                               ; preds = %.loopexit
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  ret void

98:                                               ; preds = %.split.us
  unreachable
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare noundef ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8CImageOfIfE10ReAllocateE6CShapeb(ptr noundef nonnull align 8 dereferenceable(76), i64, i32, i1 noundef zeroext) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
attributes #9 = { noreturn }
attributes #10 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTS6CShape", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass