; LLVM IR from jrouwe/JoltPhysics :: TestFramework/Image/LoadBMP.ll (Z7LoadBMPRSi)

; 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"

%"class.JPH::Ref" = type { ptr }
%struct.BitmapFileHeader = type <{ i8, i8, i32, i16, i16, i32 }>
%struct.BitmapInfoHeader = type { i32, i32, i32, i16, i16, i32, i32, i32, i32, i32, i32 }
%"class.std::fpos" = type { i64, %struct.__mbstate_t }
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }

@_ZN3JPH5TraceE = external global ptr, align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 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 i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7LoadBMPRSi(ptr dead_on_unwind noalias writable sret(%"class.JPH::Ref") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca %struct.BitmapFileHeader, align 1
  %7 = alloca %struct.BitmapInfoHeader, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.JPH::Ref", align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::fpos", align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %"class.std::fpos", align 8
  %24 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #8
  store i8 1, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 14, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #8
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef %6, i64 noundef 14)
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = getelementptr i8, ptr %28, i64 -24
  %30 = load i64, ptr %29, align 8
  %31 = getelementptr inbounds i8, ptr %27, i64 %30
  %32 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv(ptr noundef nonnull align 8 dereferenceable(264) %31)
  br i1 %32, label %33, label %34

33:                                               ; preds = %2
  call void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
  store i32 1, ptr %8, align 4
  br label %349

34:                                               ; preds = %2
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef %7, i64 noundef 40)
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = load ptr, ptr %37, align 8, !tbaa !11
  %39 = getelementptr i8, ptr %38, i64 -24
  %40 = load i64, ptr %39, align 8
  %41 = getelementptr inbounds i8, ptr %37, i64 %40
  %42 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv(ptr noundef nonnull align 8 dereferenceable(264) %41)
  br i1 %42, label %43, label %44

43:                                               ; preds = %34
  call void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
  store i32 1, ptr %8, align 4
  br label %349

44:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %45 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 4
  %46 = load i16, ptr %45, align 1, !tbaa !13
  %47 = zext i16 %46 to i32
  %48 = add nsw i32 %47, 7
  %49 = ashr i32 %48, 3
  store i32 %49, ptr %9, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %50 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 1
  %51 = load i32, ptr %50, align 1, !tbaa !18
  %52 = load i32, ptr %9, align 4, !tbaa !17
  %53 = mul i32 %51, %52
  %54 = add i32 %53, 3
  %55 = and i32 %54, -4
  store i32 %55, ptr %10, align 4, !tbaa !17
  %56 = getelementptr inbounds %struct.BitmapFileHeader, ptr %6, i32 0, i32 0
  %57 = load i8, ptr %56, align 1, !tbaa !19
  %58 = sext i8 %57 to i32
  %59 = icmp ne i32 %58, 66
  br i1 %59, label %65, label %60

60:                                               ; preds = %44
  %61 = getelementptr inbounds %struct.BitmapFileHeader, ptr %6, i32 0, i32 1
  %62 = load i8, ptr %61, align 1, !tbaa !21
  %63 = sext i8 %62 to i32
  %64 = icmp ne i32 %63, 77
  br i1 %64, label %65, label %67

65:                                               ; preds = %60, %44
  %66 = load ptr, ptr @_ZN3JPH5TraceE, align 8, !tbaa !5
  call void (ptr, ...) %66(ptr noundef @.str)
  call void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
  store i32 1, ptr %8, align 4
  br label %348

67:                                               ; preds = %60
  %68 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 2
  %69 = load i32, ptr %68, align 1, !tbaa !22
  %70 = icmp ule i32 %69, 0
  br i1 %70, label %71, label %73

71:                                               ; preds = %67
  %72 = load ptr, ptr @_ZN3JPH5TraceE, align 8, !tbaa !5
  call void (ptr, ...) %72(ptr noundef @.str.1)
  call void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
  store i32 1, ptr %8, align 4
  br label %348

73:                                               ; preds = %67
  %74 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 5
  %75 = load i32, ptr %74, align 1, !tbaa !23
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %79

77:                                               ; preds = %73
  %78 = load ptr, ptr @_ZN3JPH5TraceE, align 8, !tbaa !5
  call void (ptr, ...) %78(ptr noundef @.str.2)
  call void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
  store i32 1, ptr %8, align 4
  br label %348

79:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  call void @_ZN3JPH3RefI7SurfaceEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11)
  %80 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 4
  %81 = load i16, ptr %80, align 1, !tbaa !13
  %82 = zext i16 %81 to i32
  %83 = icmp eq i32 %82, 8
  br i1 %83, label %84, label %243

84:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %85 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef 1024) #9
          to label %86 unwind label %151

86:                                               ; preds = %84
  store ptr %85, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %87 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 9
  %88 = load i32, ptr %87, align 1, !tbaa !24
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %93

90:                                               ; preds = %86
  %91 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 9
  %92 = load i32, ptr %91, align 1, !tbaa !24
  br label %94

93:                                               ; preds = %86
  br label %94

94:                                               ; preds = %93, %90
  %95 = phi i32 [ %92, %90 ], [ 256, %93 ]
  %96 = mul i32 4, %95
  store i32 %96, ptr %15, align 4, !tbaa !17
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = load ptr, ptr %12, align 8, !tbaa !5
  %99 = load i32, ptr %15, align 4, !tbaa !17
  %100 = sext i32 %99 to i64
  %101 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %97, ptr noundef %98, i64 noundef %100)
          to label %102 unwind label %155

102:                                              ; preds = %94
  %103 = load i8, ptr %5, align 1, !tbaa !9, !range !25, !noundef !26
  %104 = trunc i8 %103 to i1
  br i1 %104, label %105, label %114

105:                                              ; preds = %102
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = load ptr, ptr %106, align 8, !tbaa !11
  %108 = getelementptr i8, ptr %107, i64 -24
  %109 = load i64, ptr %108, align 8
  %110 = getelementptr inbounds i8, ptr %106, i64 %109
  %111 = invoke noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv(ptr noundef nonnull align 8 dereferenceable(264) %110)
          to label %112 unwind label %155

112:                                              ; preds = %105
  %113 = xor i1 %111, true
  br label %114

114:                                              ; preds = %112, %102
  %115 = phi i1 [ false, %102 ], [ %113, %112 ]
  %116 = zext i1 %115 to i8
  store i8 %116, ptr %5, align 1, !tbaa !9
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.BitmapFileHeader, ptr %6, i32 0, i32 5
  %119 = load i32, ptr %118, align 1, !tbaa !27
  %120 = zext i32 %119 to i64
  invoke void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef %120)
          to label %121 unwind label %155

121:                                              ; preds = %114
  %122 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 0
  %123 = load i64, ptr %122, align 8
  %124 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 1
  %125 = load i64, ptr %124, align 8
  %126 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(16) %117, i64 %123, i64 %125)
          to label %127 unwind label %155

127:                                              ; preds = %121
  %128 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 64) #9
          to label %129 unwind label %155

129:                                              ; preds = %127
  %130 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 1
  %131 = load i32, ptr %130, align 1, !tbaa !18
  %132 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 2
  %133 = load i32, ptr %132, align 1, !tbaa !22
  invoke void @_ZN15SoftwareSurfaceC1Eii14ESurfaceFormati(ptr noundef nonnull align 8 dereferenceable(64) %128, i32 noundef %131, i32 noundef %133, i32 noundef 11, i32 noundef 0)
          to label %134 unwind label %159

134:                                              ; preds = %129
  %135 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH3RefI7SurfaceEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef %128)
          to label %136 unwind label %155

136:                                              ; preds = %134
  %137 = invoke noundef ptr @_ZNK3JPH3RefI7SurfaceEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %138 unwind label %155

138:                                              ; preds = %136
  invoke void @_ZNK7Surface4LockE16ESurfaceLockMode(ptr noundef nonnull align 8 dereferenceable(48) %137, i32 noundef 2)
          to label %139 unwind label %155

139:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %140 = load i32, ptr %10, align 4, !tbaa !17
  %141 = sext i32 %140 to i64
  %142 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %141) #9
          to label %143 unwind label %163

143:                                              ; preds = %139
  store ptr %142, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %144 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 2
  %145 = load i32, ptr %144, align 1, !tbaa !22
  %146 = sub i32 %145, 1
  store i32 %146, ptr %18, align 4, !tbaa !17
  br label %147

147:                                              ; preds = %224, %143
  %148 = load i32, ptr %18, align 4, !tbaa !17
  %149 = icmp sge i32 %148, 0
  br i1 %149, label %167, label %150

150:                                              ; preds = %147
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %228

151:                                              ; preds = %84
  %152 = landingpad { ptr, i32 }
          cleanup
  %153 = extractvalue { ptr, i32 } %152, 0
  store ptr %153, ptr %13, align 8
  %154 = extractvalue { ptr, i32 } %152, 1
  store i32 %154, ptr %14, align 4
  br label %242

155:                                              ; preds = %138, %136, %134, %127, %121, %114, %105, %94
  %156 = landingpad { ptr, i32 }
          cleanup
  %157 = extractvalue { ptr, i32 } %156, 0
  store ptr %157, ptr %13, align 8
  %158 = extractvalue { ptr, i32 } %156, 1
  store i32 %158, ptr %14, align 4
  br label %241

159:                                              ; preds = %129
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %13, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %14, align 4
  call void @_ZdlPvm(ptr noundef %128, i64 noundef 64) #10
  br label %241

163:                                              ; preds = %230, %228, %139
  %164 = landingpad { ptr, i32 }
          cleanup
  %165 = extractvalue { ptr, i32 } %164, 0
  store ptr %165, ptr %13, align 8
  %166 = extractvalue { ptr, i32 } %164, 1
  store i32 %166, ptr %14, align 4
  br label %240

167:                                              ; preds = %147
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = load ptr, ptr %17, align 8, !tbaa !5
  %170 = load i32, ptr %10, align 4, !tbaa !17
  %171 = sext i32 %170 to i64
  %172 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %168, ptr noundef %169, i64 noundef %171)
          to label %173 unwind label %200

173:                                              ; preds = %167
  %174 = load i8, ptr %5, align 1, !tbaa !9, !range !25, !noundef !26
  %175 = trunc i8 %174 to i1
  br i1 %175, label %176, label %185

176:                                              ; preds = %173
  %177 = load ptr, ptr %4, align 8, !tbaa !5
  %178 = load ptr, ptr %177, align 8, !tbaa !11
  %179 = getelementptr i8, ptr %178, i64 -24
  %180 = load i64, ptr %179, align 8
  %181 = getelementptr inbounds i8, ptr %177, i64 %180
  %182 = invoke noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv(ptr noundef nonnull align 8 dereferenceable(264) %181)
          to label %183 unwind label %200

183:                                              ; preds = %176
  %184 = xor i1 %182, true
  br label %185

185:                                              ; preds = %183, %173
  %186 = phi i1 [ false, %173 ], [ %184, %183 ]
  %187 = zext i1 %186 to i8
  store i8 %187, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %188 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %188, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %189 = invoke noundef ptr @_ZNK3JPH3RefI7SurfaceEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %190 unwind label %204

190:                                              ; preds = %185
  %191 = load i32, ptr %18, align 4, !tbaa !17
  %192 = invoke noundef ptr @_ZN7Surface11GetScanLineEi(ptr noundef nonnull align 8 dereferenceable(48) %189, i32 noundef %191)
          to label %193 unwind label %204

193:                                              ; preds = %190
  store ptr %192, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !17
  br label %194

194:                                              ; preds = %216, %193
  %195 = load i32, ptr %21, align 4, !tbaa !17
  %196 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 1
  %197 = load i32, ptr %196, align 1, !tbaa !18
  %198 = icmp ult i32 %195, %197
  br i1 %198, label %208, label %199

199:                                              ; preds = %194
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %223

200:                                              ; preds = %176, %167
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %13, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %14, align 4
  br label %227

204:                                              ; preds = %190, %185
  %205 = landingpad { ptr, i32 }
          cleanup
  %206 = extractvalue { ptr, i32 } %205, 0
  store ptr %206, ptr %13, align 8
  %207 = extractvalue { ptr, i32 } %205, 1
  store i32 %207, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %227

208:                                              ; preds = %194
  %209 = load ptr, ptr %12, align 8, !tbaa !5
  %210 = load ptr, ptr %19, align 8, !tbaa !5
  %211 = load i8, ptr %210, align 1, !tbaa !28
  %212 = zext i8 %211 to i64
  %213 = getelementptr inbounds i32, ptr %209, i64 %212
  %214 = load i32, ptr %213, align 4, !tbaa !17
  %215 = load ptr, ptr %20, align 8, !tbaa !5
  store i32 %214, ptr %215, align 4, !tbaa !17
  br label %216

216:                                              ; preds = %208
  %217 = load i32, ptr %21, align 4, !tbaa !17
  %218 = add i32 %217, 1
  store i32 %218, ptr %21, align 4, !tbaa !17
  %219 = load ptr, ptr %19, align 8, !tbaa !5
  %220 = getelementptr inbounds i8, ptr %219, i32 1
  store ptr %220, ptr %19, align 8, !tbaa !5
  %221 = load ptr, ptr %20, align 8, !tbaa !5
  %222 = getelementptr inbounds i32, ptr %221, i32 1
  store ptr %222, ptr %20, align 8, !tbaa !5
  br label %194, !llvm.loop !29

223:                                              ; preds = %199
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %18, align 4, !tbaa !17
  %226 = add nsw i32 %225, -1
  store i32 %226, ptr %18, align 4, !tbaa !17
  br label %147, !llvm.loop !31

227:                                              ; preds = %204, %200
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %240

228:                                              ; preds = %150
  %229 = invoke noundef ptr @_ZNK3JPH3RefI7SurfaceEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %230 unwind label %163

230:                                              ; preds = %228
  invoke void @_ZNK7Surface6UnLockEv(ptr noundef nonnull align 8 dereferenceable(48) %229)
          to label %231 unwind label %163

231:                                              ; preds = %230
  %232 = load ptr, ptr %12, align 8, !tbaa !5
  %233 = icmp eq ptr %232, null
  br i1 %233, label %235, label %234

234:                                              ; preds = %231
  call void @_ZdaPv(ptr noundef %232) #10
  br label %235

235:                                              ; preds = %234, %231
  %236 = load ptr, ptr %17, align 8, !tbaa !5
  %237 = icmp eq ptr %236, null
  br i1 %237, label %239, label %238

238:                                              ; preds = %235
  call void @_ZdaPv(ptr noundef %236) #10
  br label %239

239:                                              ; preds = %238, %235
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %334

240:                                              ; preds = %227, %163
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %241

241:                                              ; preds = %240, %159, %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %242

242:                                              ; preds = %241, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %347

243:                                              ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %244 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 4
  %245 = load i16, ptr %244, align 1, !tbaa !13
  %246 = zext i16 %245 to i32
  switch i32 %246, label %249 [
    i32 16, label %247
    i32 24, label %248
  ]

247:                                              ; preds = %243
  store i32 5, ptr %22, align 4, !tbaa !32
  br label %257

248:                                              ; preds = %243
  store i32 9, ptr %22, align 4, !tbaa !32
  br label %257

249:                                              ; preds = %243
  %250 = load ptr, ptr @_ZN3JPH5TraceE, align 8, !tbaa !5
  invoke void (ptr, ...) %250(ptr noundef @.str.3)
          to label %251 unwind label %253

251:                                              ; preds = %249
  invoke void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
          to label %252 unwind label %253

252:                                              ; preds = %251
  store i32 1, ptr %8, align 4
  br label %330

253:                                              ; preds = %328, %326, %281, %279, %277, %268, %262, %257, %251, %249
  %254 = landingpad { ptr, i32 }
          cleanup
  %255 = extractvalue { ptr, i32 } %254, 0
  store ptr %255, ptr %13, align 8
  %256 = extractvalue { ptr, i32 } %254, 1
  store i32 %256, ptr %14, align 4
  br label %333

257:                                              ; preds = %248, %247
  %258 = load ptr, ptr %4, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.BitmapFileHeader, ptr %6, i32 0, i32 5
  %260 = load i32, ptr %259, align 1, !tbaa !27
  %261 = zext i32 %260 to i64
  invoke void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16) %23, i64 noundef %261)
          to label %262 unwind label %253

262:                                              ; preds = %257
  %263 = getelementptr inbounds { i64, i64 }, ptr %23, i32 0, i32 0
  %264 = load i64, ptr %263, align 8
  %265 = getelementptr inbounds { i64, i64 }, ptr %23, i32 0, i32 1
  %266 = load i64, ptr %265, align 8
  %267 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(16) %258, i64 %264, i64 %266)
          to label %268 unwind label %253

268:                                              ; preds = %262
  %269 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 64) #9
          to label %270 unwind label %253

270:                                              ; preds = %268
  %271 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 1
  %272 = load i32, ptr %271, align 1, !tbaa !18
  %273 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 2
  %274 = load i32, ptr %273, align 1, !tbaa !22
  %275 = load i32, ptr %22, align 4, !tbaa !32
  %276 = load i32, ptr %10, align 4, !tbaa !17
  invoke void @_ZN15SoftwareSurfaceC1Eii14ESurfaceFormati(ptr noundef nonnull align 8 dereferenceable(64) %269, i32 noundef %272, i32 noundef %274, i32 noundef %275, i32 noundef %276)
          to label %277 unwind label %290

277:                                              ; preds = %270
  %278 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH3RefI7SurfaceEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef %269)
          to label %279 unwind label %253

279:                                              ; preds = %277
  %280 = invoke noundef ptr @_ZNK3JPH3RefI7SurfaceEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %281 unwind label %253

281:                                              ; preds = %279
  invoke void @_ZNK7Surface4LockE16ESurfaceLockMode(ptr noundef nonnull align 8 dereferenceable(48) %280, i32 noundef 2)
          to label %282 unwind label %253

282:                                              ; preds = %281
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %283 = getelementptr inbounds %struct.BitmapInfoHeader, ptr %7, i32 0, i32 2
  %284 = load i32, ptr %283, align 1, !tbaa !22
  %285 = sub i32 %284, 1
  store i32 %285, ptr %24, align 4, !tbaa !17
  br label %286

286:                                              ; preds = %319, %282
  %287 = load i32, ptr %24, align 4, !tbaa !17
  %288 = icmp sge i32 %287, 0
  br i1 %288, label %294, label %289

289:                                              ; preds = %286
  store i32 9, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %326

290:                                              ; preds = %270
  %291 = landingpad { ptr, i32 }
          cleanup
  %292 = extractvalue { ptr, i32 } %291, 0
  store ptr %292, ptr %13, align 8
  %293 = extractvalue { ptr, i32 } %291, 1
  store i32 %293, ptr %14, align 4
  call void @_ZdlPvm(ptr noundef %269, i64 noundef 64) #10
  br label %333

294:                                              ; preds = %286
  %295 = load ptr, ptr %4, align 8, !tbaa !5
  %296 = invoke noundef ptr @_ZNK3JPH3RefI7SurfaceEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %297 unwind label %322

297:                                              ; preds = %294
  %298 = load i32, ptr %24, align 4, !tbaa !17
  %299 = invoke noundef ptr @_ZN7Surface11GetScanLineEi(ptr noundef nonnull align 8 dereferenceable(48) %296, i32 noundef %298)
          to label %300 unwind label %322

300:                                              ; preds = %297
  %301 = load i32, ptr %10, align 4, !tbaa !17
  %302 = sext i32 %301 to i64
  %303 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %295, ptr noundef %299, i64 noundef %302)
          to label %304 unwind label %322

304:                                              ; preds = %300
  %305 = load i8, ptr %5, align 1, !tbaa !9, !range !25, !noundef !26
  %306 = trunc i8 %305 to i1
  br i1 %306, label %307, label %316

307:                                              ; preds = %304
  %308 = load ptr, ptr %4, align 8, !tbaa !5
  %309 = load ptr, ptr %308, align 8, !tbaa !11
  %310 = getelementptr i8, ptr %309, i64 -24
  %311 = load i64, ptr %310, align 8
  %312 = getelementptr inbounds i8, ptr %308, i64 %311
  %313 = invoke noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv(ptr noundef nonnull align 8 dereferenceable(264) %312)
          to label %314 unwind label %322

314:                                              ; preds = %307
  %315 = xor i1 %313, true
  br label %316

316:                                              ; preds = %314, %304
  %317 = phi i1 [ false, %304 ], [ %315, %314 ]
  %318 = zext i1 %317 to i8
  store i8 %318, ptr %5, align 1, !tbaa !9
  br label %319

319:                                              ; preds = %316
  %320 = load i32, ptr %24, align 4, !tbaa !17
  %321 = add nsw i32 %320, -1
  store i32 %321, ptr %24, align 4, !tbaa !17
  br label %286, !llvm.loop !34

322:                                              ; preds = %307, %300, %297, %294
  %323 = landingpad { ptr, i32 }
          cleanup
  %324 = extractvalue { ptr, i32 } %323, 0
  store ptr %324, ptr %13, align 8
  %325 = extractvalue { ptr, i32 } %323, 1
  store i32 %325, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %333

326:                                              ; preds = %289
  %327 = invoke noundef ptr @_ZNK3JPH3RefI7SurfaceEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %328 unwind label %253

328:                                              ; preds = %326
  invoke void @_ZNK7Surface6UnLockEv(ptr noundef nonnull align 8 dereferenceable(48) %327)
          to label %329 unwind label %253

329:                                              ; preds = %328
  store i32 0, ptr %8, align 4
  br label %330

330:                                              ; preds = %329, %252
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  %331 = load i32, ptr %8, align 4
  switch i32 %331, label %346 [
    i32 0, label %332
  ]

332:                                              ; preds = %330
  br label %334

333:                                              ; preds = %322, %290, %253
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %347

334:                                              ; preds = %332, %239
  %335 = load i8, ptr %5, align 1, !tbaa !9, !range !25, !noundef !26
  %336 = trunc i8 %335 to i1
  br i1 %336, label %337, label %339

337:                                              ; preds = %334
  invoke void @_ZN3JPH3RefI7SurfaceEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %338 unwind label %342

338:                                              ; preds = %337
  br label %341

339:                                              ; preds = %334
  invoke void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
          to label %340 unwind label %342

340:                                              ; preds = %339
  br label %341

341:                                              ; preds = %340, %338
  store i32 1, ptr %8, align 4
  br label %346

342:                                              ; preds = %339, %337
  %343 = landingpad { ptr, i32 }
          cleanup
  %344 = extractvalue { ptr, i32 } %343, 0
  store ptr %344, ptr %13, align 8
  %345 = extractvalue { ptr, i32 } %343, 1
  store i32 %345, ptr %14, align 4
  br label %347

346:                                              ; preds = %341, %330
  call void @_ZN3JPH3RefI7SurfaceED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %348

347:                                              ; preds = %342, %333, %242
  call void @_ZN3JPH3RefI7SurfaceED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 14, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #8
  br label %350

348:                                              ; preds = %346, %77, %71, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %349

349:                                              ; preds = %348, %43, %33
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 14, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #8
  ret void

350:                                              ; preds = %347
  %351 = load ptr, ptr %13, align 8
  %352 = load i32, ptr %14, align 4
  %353 = insertvalue { ptr, i32 } poison, ptr %351, 0
  %354 = insertvalue { ptr, i32 } %353, i32 %352, 1
  resume { ptr, i32 } %354
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef) #2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv(ptr noundef nonnull align 8 dereferenceable(264)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #3 align 2

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(16), i64, i64) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) unnamed_addr #6 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #5

declare void @_ZN15SoftwareSurfaceC1Eii14ESurfaceFormati(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH3RefI7SurfaceEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH3RefI7SurfaceEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

declare void @_ZNK7Surface4LockE16ESurfaceLockMode(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN7Surface11GetScanLineEi(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) #3 align 2

declare void @_ZNK7Surface6UnLockEv(ptr noundef nonnull align 8 dereferenceable(48)) #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH3RefI7SurfaceEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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 #4 = { 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 #5 = { nobuiltin allocsize(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 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 = { nobuiltin 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin nounwind }

!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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !16, i64 14}
!14 = !{!"_ZTS16BitmapInfoHeader", !15, i64 0, !15, i64 4, !15, i64 8, !16, i64 12, !16, i64 14, !15, i64 16, !15, i64 20, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36}
!15 = !{!"int", !7, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{!15, !15, i64 0}
!18 = !{!14, !15, i64 4}
!19 = !{!20, !7, i64 0}
!20 = !{!"_ZTS16BitmapFileHeader", !7, i64 0, !7, i64 1, !15, i64 2, !16, i64 6, !16, i64 8, !15, i64 10}
!21 = !{!20, !7, i64 1}
!22 = !{!14, !15, i64 8}
!23 = !{!14, !15, i64 16}
!24 = !{!14, !15, i64 32}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!20, !15, i64 10}
!28 = !{!7, !7, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}
!32 = !{!33, !33, i64 0}
!33 = !{!"_ZTS14ESurfaceFormat", !7, i64 0}
!34 = distinct !{!34, !30}


; 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"

%"class.JPH::Ref" = type { ptr }
%struct.BitmapFileHeader = type <{ i8, i8, i32, i16, i16, i32 }>
%struct.BitmapInfoHeader = type { i32, i32, i32, i16, i16, i32, i32, i32, i32, i32, i32 }
%"class.std::fpos" = type { i64, %struct.__mbstate_t }
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }

@_ZN3JPH5TraceE = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 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

declare i32 @__gxx_personality_v0(...)

; 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 uwtable
define dso_local void @_Z7LoadBMPRSi(ptr dead_on_unwind noalias writable sret(%"class.JPH::Ref") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca %struct.BitmapFileHeader, align 1
  %4 = alloca %struct.BitmapInfoHeader, align 1
  %5 = alloca %"class.JPH::Ref", align 8
  %6 = alloca %"class.std::fpos", align 8
  %7 = alloca %"class.std::fpos", align 8
  call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #8
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %3, i64 noundef 14)
  %9 = load ptr, ptr %1, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr %1, i64 %11
  %13 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv(ptr noundef nonnull align 8 dereferenceable(264) %12)
  br i1 %13, label %14, label %15

14:                                               ; preds = %2
  call void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
  br label %187

15:                                               ; preds = %2
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %4, i64 noundef 40)
  %17 = load ptr, ptr %1, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr %1, i64 %19
  %21 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv(ptr noundef nonnull align 8 dereferenceable(264) %20)
  br i1 %21, label %22, label %23

22:                                               ; preds = %15
  call void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
  br label %187

23:                                               ; preds = %15
  %24 = getelementptr inbounds i8, ptr %4, i64 14
  %25 = load i16, ptr %24, align 1, !tbaa !8
  %26 = zext i16 %25 to i32
  %27 = add nuw nsw i32 %26, 7
  %28 = lshr i32 %27, 3
  %29 = getelementptr inbounds i8, ptr %4, i64 4
  %30 = load i32, ptr %29, align 1, !tbaa !13
  %31 = mul i32 %28, %30
  %32 = add i32 %31, 3
  %33 = and i32 %32, -4
  %34 = load i8, ptr %3, align 1, !tbaa !14
  %35 = icmp ne i8 %34, 66
  %36 = getelementptr inbounds i8, ptr %3, i64 1
  %37 = load i8, ptr %36, align 1
  %38 = icmp ne i8 %37, 77
  %or.cond = select i1 %35, i1 true, i1 %38
  br i1 %or.cond, label %39, label %41

39:                                               ; preds = %23
  %40 = load ptr, ptr @_ZN3JPH5TraceE, align 8, !tbaa !16
  call void (ptr, ...) %40(ptr noundef nonnull @.str)
  call void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
  br label %187

41:                                               ; preds = %23
  %42 = getelementptr inbounds i8, ptr %4, i64 8
  %43 = load i32, ptr %42, align 1, !tbaa !18
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %45, label %47

45:                                               ; preds = %41
  %46 = load ptr, ptr @_ZN3JPH5TraceE, align 8, !tbaa !16
  call void (ptr, ...) %46(ptr noundef nonnull @.str.1)
  call void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
  br label %187

47:                                               ; preds = %41
  %48 = getelementptr inbounds i8, ptr %4, i64 16
  %49 = load i32, ptr %48, align 1, !tbaa !19
  %.not = icmp eq i32 %49, 0
  br i1 %.not, label %52, label %50

50:                                               ; preds = %47
  %51 = load ptr, ptr @_ZN3JPH5TraceE, align 8, !tbaa !16
  call void (ptr, ...) %51(ptr noundef nonnull @.str.2)
  call void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
  br label %187

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  call void @_ZN3JPH3RefI7SurfaceEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %53 = load i16, ptr %24, align 1, !tbaa !8
  switch i16 %53, label %133 [
    i16 8, label %54
    i16 16, label %138
    i16 24, label %132
  ]

54:                                               ; preds = %52
  %55 = invoke noalias noundef nonnull dereferenceable(1024) ptr @_Znam(i64 noundef 1024) #9
          to label %56 unwind label %95

56:                                               ; preds = %54
  %57 = getelementptr inbounds i8, ptr %4, i64 32
  %58 = load i32, ptr %57, align 1
  %.not65 = icmp eq i32 %58, 0
  %59 = shl i32 %58, 2
  %60 = select i1 %.not65, i32 1024, i32 %59
  %61 = sext i32 %60 to i64
  %62 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %55, i64 noundef %61)
          to label %63 unwind label %97

63:                                               ; preds = %56
  %64 = load ptr, ptr %1, align 8, !tbaa !5
  %65 = getelementptr i8, ptr %64, i64 -24
  %66 = load i64, ptr %65, align 8
  %67 = getelementptr inbounds i8, ptr %1, i64 %66
  %68 = invoke noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv(ptr noundef nonnull align 8 dereferenceable(264) %67)
          to label %69 unwind label %97

69:                                               ; preds = %63
  %70 = xor i1 %68, true
  %71 = getelementptr inbounds i8, ptr %3, i64 10
  %72 = load i32, ptr %71, align 1, !tbaa !20
  %73 = zext i32 %72 to i64
  call void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16) %6, i64 noundef %73)
  %74 = load i64, ptr %6, align 8
  %75 = getelementptr inbounds i8, ptr %6, i64 8
  %76 = load i64, ptr %75, align 8
  %77 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 %74, i64 %76)
          to label %78 unwind label %97

78:                                               ; preds = %69
  %79 = invoke noalias noundef nonnull dereferenceable(64) ptr @_Znwm(i64 noundef 64) #9
          to label %80 unwind label %97

80:                                               ; preds = %78
  %81 = load i32, ptr %29, align 1, !tbaa !13
  %82 = load i32, ptr %42, align 1, !tbaa !18
  invoke void @_ZN15SoftwareSurfaceC1Eii14ESurfaceFormati(ptr noundef nonnull align 8 dereferenceable(64) %79, i32 noundef %81, i32 noundef %82, i32 noundef 11, i32 noundef 0)
          to label %83 unwind label %99

83:                                               ; preds = %80
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH3RefI7SurfaceEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %79)
          to label %85 unwind label %97

85:                                               ; preds = %83
  %86 = call noundef ptr @_ZNK3JPH3RefI7SurfaceEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZNK7Surface4LockE16ESurfaceLockMode(ptr noundef nonnull align 8 dereferenceable(48) %86, i32 noundef 2)
          to label %87 unwind label %97

87:                                               ; preds = %85
  %88 = sext i32 %33 to i64
  %89 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %88) #9
          to label %90 unwind label %101

90:                                               ; preds = %87
  %91 = load i32, ptr %42, align 1, !tbaa !18
  %.05084 = add i32 %91, -1
  %92 = icmp sgt i32 %.05084, -1
  br i1 %92, label %.lr.ph88, label %._crit_edge89

.loopexit:                                        ; preds = %.lr.ph83, %.preheader
  %.050 = add nsw i32 %.05086, -1
  %93 = icmp sgt i32 %.05086, 0
  br i1 %93, label %.lr.ph88, label %._crit_edge89, !llvm.loop !21

._crit_edge89:                                    ; preds = %.loopexit, %90
  %.051.in.lcssa = phi i1 [ %70, %90 ], [ %114, %.loopexit ]
  %94 = call noundef ptr @_ZNK3JPH3RefI7SurfaceEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZNK7Surface6UnLockEv(ptr noundef nonnull align 8 dereferenceable(48) %94)
          to label %131 unwind label %101

95:                                               ; preds = %54
  %96 = landingpad { ptr, i32 }
          cleanup
  br label %186

97:                                               ; preds = %85, %83, %78, %69, %63, %56
  %98 = landingpad { ptr, i32 }
          cleanup
  br label %186

99:                                               ; preds = %80
  %100 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %79, i64 noundef 64) #10
  br label %186

101:                                              ; preds = %._crit_edge89, %87
  %102 = landingpad { ptr, i32 }
          cleanup
  br label %186

.lr.ph88:                                         ; preds = %90, %.loopexit
  %.05086 = phi i32 [ %.050, %.loopexit ], [ %.05084, %90 ]
  %.051.in85 = phi i1 [ %114, %.loopexit ], [ %70, %90 ]
  %103 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %89, i64 noundef %88)
          to label %104 unwind label %118

104:                                              ; preds = %.lr.ph88
  br i1 %.051.in85, label %105, label %113

105:                                              ; preds = %104
  %106 = load ptr, ptr %1, align 8, !tbaa !5
  %107 = getelementptr i8, ptr %106, i64 -24
  %108 = load i64, ptr %107, align 8
  %109 = getelementptr inbounds i8, ptr %1, i64 %108
  %110 = invoke noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv(ptr noundef nonnull align 8 dereferenceable(264) %109)
          to label %111 unwind label %118

111:                                              ; preds = %105
  %112 = xor i1 %110, true
  br label %113

113:                                              ; preds = %111, %104
  %114 = phi i1 [ false, %104 ], [ %112, %111 ]
  %115 = call noundef ptr @_ZNK3JPH3RefI7SurfaceEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %116 = invoke noundef ptr @_ZN7Surface11GetScanLineEi(ptr noundef nonnull align 8 dereferenceable(48) %115, i32 noundef %.05086)
          to label %.preheader unwind label %120

.preheader:                                       ; preds = %113
  %117 = load i32, ptr %29, align 1, !tbaa !13
  %.not91 = icmp eq i32 %117, 0
  br i1 %.not91, label %.loopexit, label %.lr.ph83

118:                                              ; preds = %105, %.lr.ph88
  %119 = landingpad { ptr, i32 }
          cleanup
  br label %186

120:                                              ; preds = %113
  %121 = landingpad { ptr, i32 }
          cleanup
  br label %186

.lr.ph83:                                         ; preds = %.preheader, %.lr.ph83
  %.04782 = phi i32 [ %126, %.lr.ph83 ], [ 0, %.preheader ]
  %.04881 = phi ptr [ %128, %.lr.ph83 ], [ %116, %.preheader ]
  %.04980 = phi ptr [ %127, %.lr.ph83 ], [ %89, %.preheader ]
  %122 = load i8, ptr %.04980, align 1, !tbaa !23
  %123 = zext i8 %122 to i64
  %124 = getelementptr inbounds i32, ptr %55, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !24
  store i32 %125, ptr %.04881, align 4, !tbaa !24
  %126 = add nuw i32 %.04782, 1
  %127 = getelementptr inbounds i8, ptr %.04980, i64 1
  %128 = getelementptr inbounds i8, ptr %.04881, i64 4
  %129 = load i32, ptr %29, align 1, !tbaa !13
  %130 = icmp ult i32 %126, %129
  br i1 %130, label %.lr.ph83, label %.loopexit, !llvm.loop !25

131:                                              ; preds = %._crit_edge89
  call void @_ZdaPv(ptr noundef nonnull %55) #10
  call void @_ZdaPv(ptr noundef nonnull %89) #10
  br i1 %.051.in.lcssa, label %181, label %182

132:                                              ; preds = %52
  br label %138

133:                                              ; preds = %52
  %134 = load ptr, ptr @_ZN3JPH5TraceE, align 8, !tbaa !16
  invoke void (ptr, ...) %134(ptr noundef nonnull @.str.3)
          to label %135 unwind label %136

135:                                              ; preds = %133
  invoke void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
          to label %185 unwind label %136

136:                                              ; preds = %._crit_edge, %153, %151, %146, %138, %135, %133
  %137 = landingpad { ptr, i32 }
          cleanup
  br label %186

138:                                              ; preds = %52, %132
  %.046 = phi i32 [ 9, %132 ], [ 5, %52 ]
  %139 = getelementptr inbounds i8, ptr %3, i64 10
  %140 = load i32, ptr %139, align 1, !tbaa !20
  %141 = zext i32 %140 to i64
  call void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef %141)
  %142 = load i64, ptr %7, align 8
  %143 = getelementptr inbounds i8, ptr %7, i64 8
  %144 = load i64, ptr %143, align 8
  %145 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 %142, i64 %144)
          to label %146 unwind label %136

146:                                              ; preds = %138
  %147 = invoke noalias noundef nonnull dereferenceable(64) ptr @_Znwm(i64 noundef 64) #9
          to label %148 unwind label %136

148:                                              ; preds = %146
  %149 = load i32, ptr %29, align 1, !tbaa !13
  %150 = load i32, ptr %42, align 1, !tbaa !18
  invoke void @_ZN15SoftwareSurfaceC1Eii14ESurfaceFormati(ptr noundef nonnull align 8 dereferenceable(64) %147, i32 noundef %149, i32 noundef %150, i32 noundef %.046, i32 noundef %33)
          to label %151 unwind label %160

151:                                              ; preds = %148
  %152 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH3RefI7SurfaceEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %147)
          to label %153 unwind label %136

153:                                              ; preds = %151
  %154 = call noundef ptr @_ZNK3JPH3RefI7SurfaceEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZNK7Surface4LockE16ESurfaceLockMode(ptr noundef nonnull align 8 dereferenceable(48) %154, i32 noundef 2)
          to label %155 unwind label %136

155:                                              ; preds = %153
  %156 = load i32, ptr %42, align 1, !tbaa !18
  %.077 = add i32 %156, -1
  %157 = icmp sgt i32 %.077, -1
  br i1 %157, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %155
  %158 = sext i32 %33 to i64
  br label %162

._crit_edge:                                      ; preds = %176, %155
  %.1.lcssa = phi i1 [ true, %155 ], [ %177, %176 ]
  %159 = call noundef ptr @_ZNK3JPH3RefI7SurfaceEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZNK7Surface6UnLockEv(ptr noundef nonnull align 8 dereferenceable(48) %159)
          to label %.thread unwind label %136

160:                                              ; preds = %148
  %161 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %147, i64 noundef 64) #10
  br label %186

162:                                              ; preds = %.lr.ph, %176
  %.079 = phi i32 [ %.077, %.lr.ph ], [ %.0, %176 ]
  %.178 = phi i1 [ true, %.lr.ph ], [ %177, %176 ]
  %163 = call noundef ptr @_ZNK3JPH3RefI7SurfaceEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %164 = invoke noundef ptr @_ZN7Surface11GetScanLineEi(ptr noundef nonnull align 8 dereferenceable(48) %163, i32 noundef %.079)
          to label %165 unwind label %179

165:                                              ; preds = %162
  %166 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %164, i64 noundef %158)
          to label %167 unwind label %179

167:                                              ; preds = %165
  br i1 %.178, label %168, label %176

168:                                              ; preds = %167
  %169 = load ptr, ptr %1, align 8, !tbaa !5
  %170 = getelementptr i8, ptr %169, i64 -24
  %171 = load i64, ptr %170, align 8
  %172 = getelementptr inbounds i8, ptr %1, i64 %171
  %173 = invoke noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv(ptr noundef nonnull align 8 dereferenceable(264) %172)
          to label %174 unwind label %179

174:                                              ; preds = %168
  %175 = xor i1 %173, true
  br label %176

176:                                              ; preds = %174, %167
  %177 = phi i1 [ false, %167 ], [ %175, %174 ]
  %.0 = add nsw i32 %.079, -1
  %178 = icmp sgt i32 %.079, 0
  br i1 %178, label %162, label %._crit_edge, !llvm.loop !26

179:                                              ; preds = %168, %165, %162
  %180 = landingpad { ptr, i32 }
          cleanup
  br label %186

.thread:                                          ; preds = %._crit_edge
  br i1 %.1.lcssa, label %181, label %182

181:                                              ; preds = %131, %.thread
  invoke void @_ZN3JPH3RefI7SurfaceEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %185 unwind label %183

182:                                              ; preds = %131, %.thread
  invoke void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
          to label %185 unwind label %183

183:                                              ; preds = %182, %181
  %184 = landingpad { ptr, i32 }
          cleanup
  br label %186

185:                                              ; preds = %135, %181, %182
  call void @_ZN3JPH3RefI7SurfaceED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %187

186:                                              ; preds = %136, %160, %179, %95, %101, %120, %118, %99, %97, %183
  %.pn66.pn.pn.pn.pn = phi { ptr, i32 } [ %184, %183 ], [ %96, %95 ], [ %98, %97 ], [ %100, %99 ], [ %102, %101 ], [ %121, %120 ], [ %119, %118 ], [ %137, %136 ], [ %180, %179 ], [ %161, %160 ]
  call void @_ZN3JPH3RefI7SurfaceED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %3) #8
  resume { ptr, i32 } %.pn66.pn.pn.pn.pn

187:                                              ; preds = %39, %45, %50, %185, %22, %14
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %3) #8
  ret void
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH3RefI7SurfaceEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #3 align 2

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #5

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(16), i64, i64) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) unnamed_addr #6 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #5

declare void @_ZN15SoftwareSurfaceC1Eii14ESurfaceFormati(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH3RefI7SurfaceEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH3RefI7SurfaceEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

declare void @_ZNK7Surface4LockE16ESurfaceLockMode(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN7Surface11GetScanLineEi(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) local_unnamed_addr #3 align 2

declare void @_ZNK7Surface6UnLockEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH3RefI7SurfaceEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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 #4 = { 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 #5 = { nobuiltin allocsize(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 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 = { nobuiltin 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin nounwind }

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !12, i64 14}
!9 = !{!"_ZTS16BitmapInfoHeader", !10, i64 0, !10, i64 4, !10, i64 8, !12, i64 12, !12, i64 14, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"short", !11, i64 0}
!13 = !{!9, !10, i64 4}
!14 = !{!15, !11, i64 0}
!15 = !{!"_ZTS16BitmapFileHeader", !11, i64 0, !11, i64 1, !10, i64 2, !12, i64 6, !12, i64 8, !10, i64 10}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !11, i64 0}
!18 = !{!9, !10, i64 8}
!19 = !{!9, !10, i64 16}
!20 = !{!15, !10, i64 10}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!11, !11, i64 0}
!24 = !{!10, !10, i64 0}
!25 = distinct !{!25, !22}
!26 = distinct !{!26, !22}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass