; LLVM IR from aap/librw :: src/d3d/d3d8.ll (ZN2rw4d3d811readAsImageEPNS_6StreamEiiiii)

; 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.rw::MemoryFunctions" = type { ptr, ptr, ptr, ptr, ptr }
%"struct.rw::Raster" = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, i32, i32, i32, ptr, i32, i32 }
%"struct.rw::Image" = type { i32, i32, i32, i32, i32, i32, ptr, ptr }

@_ZN2rw6Engine8memfuncsE = external global %"struct.rw::MemoryFunctions", align 8
@.str.11 = external hidden unnamed_addr constant [76 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

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

declare noundef i32 @_ZN2rw6Stream7readU32Ev(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN2rw4d3d811readAsImageEPNS_6StreamEiiiii(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) #3 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca [1024 x i8], align 16
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1024, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = load i32, ptr %9, align 4, !tbaa !9
  %30 = call noundef ptr @_ZN2rw5Image6createEiii(i32 noundef %28, i32 noundef %29, i32 noundef 32)
  store ptr %30, ptr %16, align 8, !tbaa !5
  %31 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN2rw5Image8allocateEv(ptr noundef nonnull align 8 dereferenceable(40) %31)
  %32 = load i32, ptr %11, align 4, !tbaa !9
  %33 = and i32 %32, 16384
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %42

35:                                               ; preds = %6
  store i32 16, ptr %14, align 4, !tbaa !9
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 0
  %38 = load ptr, ptr %36, align 8, !tbaa !11
  %39 = getelementptr inbounds ptr, ptr %38, i64 4
  %40 = load ptr, ptr %39, align 8
  %41 = call noundef i32 %40(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef %37, i32 noundef 128)
  br label %54

42:                                               ; preds = %6
  %43 = load i32, ptr %11, align 4, !tbaa !9
  %44 = and i32 %43, 8192
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %53

46:                                               ; preds = %42
  store i32 256, ptr %14, align 4, !tbaa !9
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 0
  %49 = load ptr, ptr %47, align 8, !tbaa !11
  %50 = getelementptr inbounds ptr, ptr %49, i64 4
  %51 = load ptr, ptr %50, align 8
  %52 = call noundef i32 %51(ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef %48, i32 noundef 1024)
  br label %53

53:                                               ; preds = %46, %42
  br label %54

54:                                               ; preds = %53, %35
  %55 = load i32, ptr %11, align 4, !tbaa !9
  %56 = call noundef zeroext i1 @_ZN2rw6Raster14formatHasAlphaEi(i32 noundef %55)
  br i1 %56, label %73, label %57

57:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %69, %57
  %59 = load i32, ptr %17, align 4, !tbaa !9
  %60 = load i32, ptr %14, align 4, !tbaa !9
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %72

63:                                               ; preds = %58
  %64 = load i32, ptr %17, align 4, !tbaa !9
  %65 = mul nsw i32 %64, 4
  %66 = add nsw i32 %65, 3
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 %67
  store i8 -1, ptr %68, align 1, !tbaa !13
  br label %69

69:                                               ; preds = %63
  %70 = load i32, ptr %17, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %17, align 4, !tbaa !9
  br label %58, !llvm.loop !14

72:                                               ; preds = %62
  br label %73

73:                                               ; preds = %72, %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store ptr null, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %259, %73
  %75 = load i32, ptr %19, align 4, !tbaa !9
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 5, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %262

79:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = call noundef i32 @_ZN2rw6Stream7readU32Ev(ptr noundef nonnull align 8 dereferenceable(8) %80)
  store i32 %81, ptr %21, align 4, !tbaa !9
  %82 = load ptr, ptr %18, align 8, !tbaa !5
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %95

84:                                               ; preds = %79
  %85 = load i32, ptr %19, align 4, !tbaa !9
  %86 = load ptr, ptr %18, align 8, !tbaa !5
  %87 = call noundef i32 @_ZN2rw6Raster12getNumLevelsEv(ptr noundef nonnull align 8 dereferenceable(96) %86)
  %88 = icmp sge i32 %85, %87
  br i1 %88, label %89, label %95

89:                                               ; preds = %84
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = load i32, ptr %21, align 4, !tbaa !9
  %92 = load ptr, ptr %90, align 8, !tbaa !11
  %93 = getelementptr inbounds ptr, ptr %92, i64 5
  %94 = load ptr, ptr %93, align 8
  call void %94(ptr noundef nonnull align 8 dereferenceable(8) %90, i32 noundef %91, i32 noundef 1)
  store i32 7, ptr %20, align 4
  br label %256

95:                                               ; preds = %84, %79
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = icmp eq ptr %96, null
  br i1 %97, label %98, label %103

98:                                               ; preds = %95
  %99 = load i32, ptr %21, align 4, !tbaa !9
  %100 = zext i32 %99 to i64
  %101 = mul i64 %100, 1
  %102 = call noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef %101, i32 noundef 65560, ptr noundef @.str.11)
  store ptr %102, ptr %15, align 8, !tbaa !5
  br label %103

103:                                              ; preds = %98, %95
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = load ptr, ptr %15, align 8, !tbaa !5
  %106 = load i32, ptr %21, align 4, !tbaa !9
  %107 = load ptr, ptr %104, align 8, !tbaa !11
  %108 = getelementptr inbounds ptr, ptr %107, i64 4
  %109 = load ptr, ptr %108, align 8
  %110 = call noundef i32 %109(ptr noundef nonnull align 8 dereferenceable(8) %104, ptr noundef %105, i32 noundef %106)
  %111 = load ptr, ptr %18, align 8, !tbaa !5
  %112 = icmp ne ptr %111, null
  br i1 %112, label %113, label %136

113:                                              ; preds = %103
  %114 = load ptr, ptr %18, align 8, !tbaa !5
  %115 = load i32, ptr %19, align 4, !tbaa !9
  %116 = call noundef ptr @_ZN2rw6Raster4lockEii(ptr noundef nonnull align 8 dereferenceable(96) %114, i32 noundef %115, i32 noundef 5)
  %117 = load ptr, ptr %18, align 8, !tbaa !5
  %118 = getelementptr inbounds %"struct.rw::Raster", ptr %117, i32 0, i32 5
  %119 = load i32, ptr %118, align 4, !tbaa !16
  %120 = load ptr, ptr %16, align 8, !tbaa !5
  %121 = getelementptr inbounds %"struct.rw::Image", ptr %120, i32 0, i32 1
  store i32 %119, ptr %121, align 4, !tbaa !18
  %122 = load ptr, ptr %18, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.rw::Raster", ptr %122, i32 0, i32 6
  %124 = load i32, ptr %123, align 8, !tbaa !20
  %125 = load ptr, ptr %16, align 8, !tbaa !5
  %126 = getelementptr inbounds %"struct.rw::Image", ptr %125, i32 0, i32 2
  store i32 %124, ptr %126, align 8, !tbaa !21
  %127 = load ptr, ptr %16, align 8, !tbaa !5
  %128 = getelementptr inbounds %"struct.rw::Image", ptr %127, i32 0, i32 1
  %129 = load i32, ptr %128, align 4, !tbaa !18
  %130 = load ptr, ptr %16, align 8, !tbaa !5
  %131 = getelementptr inbounds %"struct.rw::Image", ptr %130, i32 0, i32 4
  %132 = load i32, ptr %131, align 8, !tbaa !22
  %133 = mul nsw i32 %129, %132
  %134 = load ptr, ptr %16, align 8, !tbaa !5
  %135 = getelementptr inbounds %"struct.rw::Image", ptr %134, i32 0, i32 5
  store i32 %133, ptr %135, align 4, !tbaa !23
  br label %136

136:                                              ; preds = %113, %103
  %137 = load i32, ptr %11, align 4, !tbaa !9
  %138 = and i32 %137, 24576
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %230

140:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %141 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %141, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %142 = load ptr, ptr %16, align 8, !tbaa !5
  %143 = getelementptr inbounds %"struct.rw::Image", ptr %142, i32 0, i32 6
  %144 = load ptr, ptr %143, align 8, !tbaa !24
  store ptr %144, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %145

145:                                              ; preds = %226, %140
  %146 = load i32, ptr %24, align 4, !tbaa !9
  %147 = load ptr, ptr %16, align 8, !tbaa !5
  %148 = getelementptr inbounds %"struct.rw::Image", ptr %147, i32 0, i32 2
  %149 = load i32, ptr %148, align 8, !tbaa !21
  %150 = icmp slt i32 %146, %149
  br i1 %150, label %152, label %151

151:                                              ; preds = %145
  store i32 8, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  br label %229

152:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %153 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %153, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %154

154:                                              ; preds = %216, %152
  %155 = load i32, ptr %26, align 4, !tbaa !9
  %156 = load ptr, ptr %16, align 8, !tbaa !5
  %157 = getelementptr inbounds %"struct.rw::Image", ptr %156, i32 0, i32 1
  %158 = load i32, ptr %157, align 4, !tbaa !18
  %159 = icmp slt i32 %155, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %154
  store i32 11, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  br label %219

161:                                              ; preds = %154
  %162 = load ptr, ptr %22, align 8, !tbaa !5
  %163 = load i8, ptr %162, align 1, !tbaa !13
  %164 = zext i8 %163 to i32
  %165 = mul nsw i32 %164, 4
  %166 = add nsw i32 %165, 0
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 %167
  %169 = load i8, ptr %168, align 1, !tbaa !13
  %170 = load ptr, ptr %25, align 8, !tbaa !5
  %171 = getelementptr inbounds i8, ptr %170, i64 0
  store i8 %169, ptr %171, align 1, !tbaa !13
  %172 = load ptr, ptr %22, align 8, !tbaa !5
  %173 = load i8, ptr %172, align 1, !tbaa !13
  %174 = zext i8 %173 to i32
  %175 = mul nsw i32 %174, 4
  %176 = add nsw i32 %175, 1
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 %177
  %179 = load i8, ptr %178, align 1, !tbaa !13
  %180 = load ptr, ptr %25, align 8, !tbaa !5
  %181 = getelementptr inbounds i8, ptr %180, i64 1
  store i8 %179, ptr %181, align 1, !tbaa !13
  %182 = load ptr, ptr %22, align 8, !tbaa !5
  %183 = load i8, ptr %182, align 1, !tbaa !13
  %184 = zext i8 %183 to i32
  %185 = mul nsw i32 %184, 4
  %186 = add nsw i32 %185, 2
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 %187
  %189 = load i8, ptr %188, align 1, !tbaa !13
  %190 = load ptr, ptr %25, align 8, !tbaa !5
  %191 = getelementptr inbounds i8, ptr %190, i64 2
  store i8 %189, ptr %191, align 1, !tbaa !13
  %192 = load ptr, ptr %16, align 8, !tbaa !5
  %193 = getelementptr inbounds %"struct.rw::Image", ptr %192, i32 0, i32 4
  %194 = load i32, ptr %193, align 8, !tbaa !22
  %195 = icmp sgt i32 %194, 3
  br i1 %195, label %196, label %207

196:                                              ; preds = %161
  %197 = load ptr, ptr %22, align 8, !tbaa !5
  %198 = load i8, ptr %197, align 1, !tbaa !13
  %199 = zext i8 %198 to i32
  %200 = mul nsw i32 %199, 4
  %201 = add nsw i32 %200, 3
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 %202
  %204 = load i8, ptr %203, align 1, !tbaa !13
  %205 = load ptr, ptr %25, align 8, !tbaa !5
  %206 = getelementptr inbounds i8, ptr %205, i64 3
  store i8 %204, ptr %206, align 1, !tbaa !13
  br label %207

207:                                              ; preds = %196, %161
  %208 = load ptr, ptr %16, align 8, !tbaa !5
  %209 = getelementptr inbounds %"struct.rw::Image", ptr %208, i32 0, i32 4
  %210 = load i32, ptr %209, align 8, !tbaa !22
  %211 = load ptr, ptr %25, align 8, !tbaa !5
  %212 = sext i32 %210 to i64
  %213 = getelementptr inbounds i8, ptr %211, i64 %212
  store ptr %213, ptr %25, align 8, !tbaa !5
  %214 = load ptr, ptr %22, align 8, !tbaa !5
  %215 = getelementptr inbounds i8, ptr %214, i32 1
  store ptr %215, ptr %22, align 8, !tbaa !5
  br label %216

216:                                              ; preds = %207
  %217 = load i32, ptr %26, align 4, !tbaa !9
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %26, align 4, !tbaa !9
  br label %154, !llvm.loop !25

219:                                              ; preds = %160
  %220 = load ptr, ptr %16, align 8, !tbaa !5
  %221 = getelementptr inbounds %"struct.rw::Image", ptr %220, i32 0, i32 5
  %222 = load i32, ptr %221, align 4, !tbaa !23
  %223 = load ptr, ptr %23, align 8, !tbaa !5
  %224 = sext i32 %222 to i64
  %225 = getelementptr inbounds i8, ptr %223, i64 %224
  store ptr %225, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  br label %226

226:                                              ; preds = %219
  %227 = load i32, ptr %24, align 4, !tbaa !9
  %228 = add nsw i32 %227, 1
  store i32 %228, ptr %24, align 4, !tbaa !9
  br label %145, !llvm.loop !26

229:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  br label %230

230:                                              ; preds = %229, %136
  %231 = load ptr, ptr %18, align 8, !tbaa !5
  %232 = icmp eq ptr %231, null
  br i1 %232, label %233, label %250

233:                                              ; preds = %230
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  %234 = load ptr, ptr %16, align 8, !tbaa !5
  %235 = load i32, ptr %11, align 4, !tbaa !9
  %236 = and i32 %235, 7
  %237 = call noundef i32 @_ZN2rw6Raster21imageFindRasterFormatEPNS_5ImageEiPiS3_S3_S3_i(ptr noundef %234, i32 noundef %236, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %27, i32 noundef 0)
  %238 = load i32, ptr %11, align 4, !tbaa !9
  %239 = and i32 %238, 36864
  %240 = load i32, ptr %27, align 4, !tbaa !9
  %241 = or i32 %240, %239
  store i32 %241, ptr %27, align 4, !tbaa !9
  %242 = load i32, ptr %8, align 4, !tbaa !9
  %243 = load i32, ptr %9, align 4, !tbaa !9
  %244 = load i32, ptr %10, align 4, !tbaa !9
  %245 = load i32, ptr %27, align 4, !tbaa !9
  %246 = call noundef ptr @_ZN2rw6Raster6createEiiiii(i32 noundef %242, i32 noundef %243, i32 noundef %244, i32 noundef %245, i32 noundef 0)
  store ptr %246, ptr %18, align 8, !tbaa !5
  %247 = load ptr, ptr %18, align 8, !tbaa !5
  %248 = load i32, ptr %19, align 4, !tbaa !9
  %249 = call noundef ptr @_ZN2rw6Raster4lockEii(ptr noundef nonnull align 8 dereferenceable(96) %247, i32 noundef %248, i32 noundef 5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  br label %250

250:                                              ; preds = %233, %230
  %251 = load ptr, ptr %18, align 8, !tbaa !5
  %252 = load ptr, ptr %16, align 8, !tbaa !5
  %253 = call noundef ptr @_ZN2rw6Raster12setFromImageEPNS_5ImageEi(ptr noundef nonnull align 8 dereferenceable(96) %251, ptr noundef %252, i32 noundef 0)
  %254 = load ptr, ptr %18, align 8, !tbaa !5
  %255 = load i32, ptr %19, align 4, !tbaa !9
  call void @_ZN2rw6Raster6unlockEi(ptr noundef nonnull align 8 dereferenceable(96) %254, i32 noundef %255)
  store i32 0, ptr %20, align 4
  br label %256

256:                                              ; preds = %250, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  %257 = load i32, ptr %20, align 4
  switch i32 %257, label %267 [
    i32 0, label %258
    i32 7, label %259
  ]

258:                                              ; preds = %256
  br label %259

259:                                              ; preds = %258, %256
  %260 = load i32, ptr %19, align 4, !tbaa !9
  %261 = add nsw i32 %260, 1
  store i32 %261, ptr %19, align 4, !tbaa !9
  br label %74, !llvm.loop !27

262:                                              ; preds = %78
  %263 = load ptr, ptr getelementptr inbounds (%"struct.rw::MemoryFunctions", ptr @_ZN2rw6Engine8memfuncsE, i32 0, i32 2), align 8, !tbaa !28
  %264 = load ptr, ptr %15, align 8, !tbaa !5
  call void %263(ptr noundef %264)
  %265 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN2rw5Image7destroyEv(ptr noundef nonnull align 8 dereferenceable(40) %265)
  %266 = load ptr, ptr %18, align 8, !tbaa !5
  store i32 1, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 1024, ptr %13) #4
  ret ptr %266

267:                                              ; preds = %256
  unreachable
}

declare noundef ptr @_ZN2rw5Image6createEiii(i32 noundef, i32 noundef, i32 noundef) #1

declare void @_ZN2rw5Image8allocateEv(ptr noundef nonnull align 8 dereferenceable(40)) #1

declare noundef zeroext i1 @_ZN2rw6Raster14formatHasAlphaEi(i32 noundef) #1

declare noundef i32 @_ZN2rw6Raster12getNumLevelsEv(ptr noundef nonnull align 8 dereferenceable(96)) #1

declare noundef ptr @_ZN2rw6Raster4lockEii(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef, i32 noundef) #1

declare noundef i32 @_ZN2rw6Raster21imageFindRasterFormatEPNS_5ImageEiPiS3_S3_S3_i(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

declare noundef ptr @_ZN2rw6Raster6createEiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare noundef ptr @_ZN2rw6Raster12setFromImageEPNS_5ImageEi(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef, i32 noundef) #1

declare void @_ZN2rw6Raster6unlockEi(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef) #1

declare void @_ZN2rw5Image7destroyEv(ptr noundef nonnull align 8 dereferenceable(40)) #1

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 = { 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 #3 = { 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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !10, i64 20}
!17 = !{!"_ZTSN2rw6RasterE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !6, i64 80, !10, i64 88, !10, i64 92}
!18 = !{!19, !10, i64 4}
!19 = !{!"_ZTSN2rw5ImageE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !6, i64 24, !6, i64 32}
!20 = !{!17, !10, i64 24}
!21 = !{!19, !10, i64 8}
!22 = !{!19, !10, i64 16}
!23 = !{!19, !10, i64 20}
!24 = !{!19, !6, i64 24}
!25 = distinct !{!25, !15}
!26 = distinct !{!26, !15}
!27 = distinct !{!27, !15}
!28 = !{!29, !6, i64 16}
!29 = !{!"_ZTSN2rw15MemoryFunctionsE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}


; 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.rw::MemoryFunctions" = type { ptr, ptr, ptr, ptr, ptr }

@_ZN2rw6Engine8memfuncsE = external local_unnamed_addr global %"struct.rw::MemoryFunctions", align 8
@.str.11 = external hidden unnamed_addr constant [76 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare noundef i32 @_ZN2rw6Stream7readU32Ev(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN2rw4d3d811readAsImageEPNS_6StreamEiiiii(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #3 {
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca [1024 x i8], align 16
  %11 = alloca i32, align 4
  store i32 %1, ptr %7, align 4, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %10) #4
  %12 = tail call noundef ptr @_ZN2rw5Image6createEiii(i32 noundef %1, i32 noundef %2, i32 noundef 32)
  tail call void @_ZN2rw5Image8allocateEv(ptr noundef nonnull align 8 dereferenceable(40) %12)
  %13 = and i32 %4, 16384
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %17

14:                                               ; preds = %6
  %15 = and i32 %4, 8192
  %.not82 = icmp eq i32 %15, 0
  br i1 %.not82, label %.thread, label %17

.thread:                                          ; preds = %14
  %16 = tail call noundef zeroext i1 @_ZN2rw6Raster14formatHasAlphaEi(i32 noundef %4)
  br label %.loopexit87

17:                                               ; preds = %14, %6
  %.sink = phi i32 [ 128, %6 ], [ 1024, %14 ]
  %.074 = phi i64 [ 16, %6 ], [ 256, %14 ]
  %18 = load ptr, ptr %0, align 8, !tbaa !9
  %19 = getelementptr inbounds i8, ptr %18, i64 32
  %20 = load ptr, ptr %19, align 8
  %21 = call noundef i32 %20(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %10, i32 noundef %.sink)
  %22 = call noundef zeroext i1 @_ZN2rw6Raster14formatHasAlphaEi(i32 noundef %4)
  br i1 %22, label %.loopexit87, label %.lr.ph

.lr.ph:                                           ; preds = %17, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.lr.ph ], [ 0, %17 ]
  %23 = shl nsw i64 %indvars.iv, 2
  %24 = or disjoint i64 %23, 3
  %25 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 %24
  store i8 -1, ptr %25, align 1, !tbaa !11
  %indvars.iv.next = shl i64 %indvars.iv, 2
  %26 = or disjoint i64 %indvars.iv.next, 7
  %27 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 %26
  store i8 -1, ptr %27, align 1, !tbaa !11
  %indvars.iv.next.1 = shl i64 %indvars.iv, 2
  %28 = or disjoint i64 %indvars.iv.next.1, 11
  %29 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 %28
  store i8 -1, ptr %29, align 1, !tbaa !11
  %indvars.iv.next.2 = shl i64 %indvars.iv, 2
  %30 = or disjoint i64 %indvars.iv.next.2, 15
  %31 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 %30
  store i8 -1, ptr %31, align 1, !tbaa !11
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %.074
  br i1 %exitcond.not.3, label %.loopexit87, label %.lr.ph, !llvm.loop !12

.loopexit87:                                      ; preds = %.lr.ph, %.thread, %17
  %32 = icmp sgt i32 %5, 0
  br i1 %32, label %.lr.ph101, label %._crit_edge102

.lr.ph101:                                        ; preds = %.loopexit87
  %33 = getelementptr inbounds i8, ptr %12, i64 4
  %34 = getelementptr inbounds i8, ptr %12, i64 8
  %35 = getelementptr inbounds i8, ptr %12, i64 16
  %36 = getelementptr inbounds i8, ptr %12, i64 20
  %37 = and i32 %4, 24576
  %.not85 = icmp eq i32 %37, 0
  %38 = getelementptr inbounds i8, ptr %12, i64 24
  %39 = and i32 %4, 7
  %40 = and i32 %4, 36864
  br label %42

._crit_edge102:                                   ; preds = %132, %.loopexit87
  %.079.lcssa = phi ptr [ null, %.loopexit87 ], [ %.281, %132 ]
  %.076.lcssa = phi ptr [ null, %.loopexit87 ], [ %.2, %132 ]
  %41 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN2rw6Engine8memfuncsE, i64 16), align 8, !tbaa !14
  call void %41(ptr noundef %.079.lcssa)
  call void @_ZN2rw5Image7destroyEv(ptr noundef nonnull align 8 dereferenceable(40) %12)
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %10) #4
  ret ptr %.076.lcssa

42:                                               ; preds = %.lr.ph101, %132
  %.07598 = phi i32 [ 0, %.lr.ph101 ], [ %133, %132 ]
  %.07697 = phi ptr [ null, %.lr.ph101 ], [ %.2, %132 ]
  %.07996 = phi ptr [ null, %.lr.ph101 ], [ %.281, %132 ]
  %43 = call noundef i32 @_ZN2rw6Stream7readU32Ev(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %.not83 = icmp eq ptr %.07697, null
  br i1 %.not83, label %50, label %44

44:                                               ; preds = %42
  %45 = call noundef i32 @_ZN2rw6Raster12getNumLevelsEv(ptr noundef nonnull align 8 dereferenceable(96) %.07697)
  %.not84 = icmp slt i32 %.07598, %45
  br i1 %.not84, label %50, label %46

46:                                               ; preds = %44
  %47 = load ptr, ptr %0, align 8, !tbaa !9
  %48 = getelementptr inbounds i8, ptr %47, i64 40
  %49 = load ptr, ptr %48, align 8
  call void %49(ptr noundef nonnull align 8 dereferenceable(8) %0, i32 noundef %43, i32 noundef 1)
  br label %132

50:                                               ; preds = %44, %42
  %51 = icmp eq ptr %.07996, null
  br i1 %51, label %52, label %55

52:                                               ; preds = %50
  %53 = zext i32 %43 to i64
  %54 = call noundef ptr @_ZN2rw14mustmalloc_LOCEmjPKc(i64 noundef %53, i32 noundef 65560, ptr noundef nonnull @.str.11)
  br label %55

55:                                               ; preds = %52, %50
  %.180 = phi ptr [ %54, %52 ], [ %.07996, %50 ]
  %56 = load ptr, ptr %0, align 8, !tbaa !9
  %57 = getelementptr inbounds i8, ptr %56, i64 32
  %58 = load ptr, ptr %57, align 8
  %59 = call noundef i32 %58(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %.180, i32 noundef %43)
  br i1 %.not83, label %67, label %60

60:                                               ; preds = %55
  %61 = call noundef ptr @_ZN2rw6Raster4lockEii(ptr noundef nonnull align 8 dereferenceable(96) %.07697, i32 noundef %.07598, i32 noundef 5)
  %62 = getelementptr inbounds i8, ptr %.07697, i64 20
  %63 = load <2 x i32>, ptr %62, align 4, !tbaa !5
  store <2 x i32> %63, ptr %33, align 4, !tbaa !5
  %64 = load i32, ptr %35, align 8, !tbaa !17
  %65 = extractelement <2 x i32> %63, i64 0
  %66 = mul nsw i32 %64, %65
  store i32 %66, ptr %36, align 4, !tbaa !19
  br label %67

67:                                               ; preds = %60, %55
  br i1 %.not85, label %.loopexit, label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %34, align 8, !tbaa !20
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %.preheader.lr.ph, label %.loopexit

.preheader.lr.ph:                                 ; preds = %68
  %71 = load i32, ptr %33, align 4, !tbaa !21
  %72 = icmp sgt i32 %71, 0
  br i1 %72, label %.preheader.preheader, label %.loopexit

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %73 = load ptr, ptr %38, align 8, !tbaa !22
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %74 = phi i32 [ %77, %._crit_edge ], [ %69, %.preheader.preheader ]
  %75 = phi i32 [ %78, %._crit_edge ], [ %71, %.preheader.preheader ]
  %.07195 = phi i32 [ %82, %._crit_edge ], [ 0, %.preheader.preheader ]
  %.07294 = phi ptr [ %81, %._crit_edge ], [ %73, %.preheader.preheader ]
  %.07393 = phi ptr [ %.1.lcssa, %._crit_edge ], [ %.180, %.preheader.preheader ]
  %76 = icmp sgt i32 %75, 0
  br i1 %76, label %.lr.ph92, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %113
  %.pre110 = load i32, ptr %34, align 8, !tbaa !20
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %77 = phi i32 [ %74, %.preheader ], [ %.pre110, %._crit_edge.loopexit ]
  %78 = phi i32 [ %75, %.preheader ], [ %119, %._crit_edge.loopexit ]
  %.1.lcssa = phi ptr [ %.07393, %.preheader ], [ %117, %._crit_edge.loopexit ]
  %79 = load i32, ptr %36, align 4, !tbaa !19
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds i8, ptr %.07294, i64 %80
  %82 = add nuw nsw i32 %.07195, 1
  %83 = icmp slt i32 %82, %77
  br i1 %83, label %.preheader, label %.loopexit, !llvm.loop !23

.lr.ph92:                                         ; preds = %.preheader, %113
  %.091 = phi i32 [ %118, %113 ], [ 0, %.preheader ]
  %.07090 = phi ptr [ %116, %113 ], [ %.07294, %.preheader ]
  %.189 = phi ptr [ %117, %113 ], [ %.07393, %.preheader ]
  %84 = load i8, ptr %.189, align 1, !tbaa !11
  %85 = zext i8 %84 to i64
  %86 = shl nuw nsw i64 %85, 2
  %87 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 %86
  %88 = load i8, ptr %87, align 4, !tbaa !11
  store i8 %88, ptr %.07090, align 1, !tbaa !11
  %89 = load i8, ptr %.189, align 1, !tbaa !11
  %90 = zext i8 %89 to i64
  %91 = shl nuw nsw i64 %90, 2
  %92 = or disjoint i64 %91, 1
  %93 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 %92
  %94 = load i8, ptr %93, align 1, !tbaa !11
  %95 = getelementptr inbounds i8, ptr %.07090, i64 1
  store i8 %94, ptr %95, align 1, !tbaa !11
  %96 = load i8, ptr %.189, align 1, !tbaa !11
  %97 = zext i8 %96 to i64
  %98 = shl nuw nsw i64 %97, 2
  %99 = or disjoint i64 %98, 2
  %100 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 %99
  %101 = load i8, ptr %100, align 2, !tbaa !11
  %102 = getelementptr inbounds i8, ptr %.07090, i64 2
  store i8 %101, ptr %102, align 1, !tbaa !11
  %103 = load i32, ptr %35, align 8, !tbaa !17
  %104 = icmp sgt i32 %103, 3
  br i1 %104, label %105, label %113

105:                                              ; preds = %.lr.ph92
  %106 = load i8, ptr %.189, align 1, !tbaa !11
  %107 = zext i8 %106 to i64
  %108 = shl nuw nsw i64 %107, 2
  %109 = or disjoint i64 %108, 3
  %110 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !11
  %112 = getelementptr inbounds i8, ptr %.07090, i64 3
  store i8 %111, ptr %112, align 1, !tbaa !11
  %.pre = load i32, ptr %35, align 8, !tbaa !17
  br label %113

113:                                              ; preds = %105, %.lr.ph92
  %114 = phi i32 [ %.pre, %105 ], [ %103, %.lr.ph92 ]
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i8, ptr %.07090, i64 %115
  %117 = getelementptr inbounds i8, ptr %.189, i64 1
  %118 = add nuw nsw i32 %.091, 1
  %119 = load i32, ptr %33, align 4, !tbaa !21
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %.lr.ph92, label %._crit_edge.loopexit, !llvm.loop !25

.loopexit:                                        ; preds = %._crit_edge, %.preheader.lr.ph, %68, %67
  br i1 %.not83, label %121, label %130

121:                                              ; preds = %.loopexit
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  %122 = call noundef i32 @_ZN2rw6Raster21imageFindRasterFormatEPNS_5ImageEiPiS3_S3_S3_i(ptr noundef nonnull %12, i32 noundef %39, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %11, i32 noundef 0)
  %123 = load i32, ptr %11, align 4, !tbaa !5
  %124 = or i32 %123, %40
  store i32 %124, ptr %11, align 4, !tbaa !5
  %125 = load i32, ptr %7, align 4, !tbaa !5
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = load i32, ptr %9, align 4, !tbaa !5
  %128 = call noundef ptr @_ZN2rw6Raster6createEiiiii(i32 noundef %125, i32 noundef %126, i32 noundef %127, i32 noundef %124, i32 noundef 0)
  %129 = call noundef ptr @_ZN2rw6Raster4lockEii(ptr noundef nonnull align 8 dereferenceable(96) %128, i32 noundef %.07598, i32 noundef 5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  br label %130

130:                                              ; preds = %121, %.loopexit
  %.177 = phi ptr [ %128, %121 ], [ %.07697, %.loopexit ]
  %131 = call noundef ptr @_ZN2rw6Raster12setFromImageEPNS_5ImageEi(ptr noundef nonnull align 8 dereferenceable(96) %.177, ptr noundef nonnull %12, i32 noundef 0)
  call void @_ZN2rw6Raster6unlockEi(ptr noundef nonnull align 8 dereferenceable(96) %.177, i32 noundef %.07598)
  br label %132

132:                                              ; preds = %130, %46
  %.281 = phi ptr [ %.07996, %46 ], [ %.180, %130 ]
  %.2 = phi ptr [ %.07697, %46 ], [ %.177, %130 ]
  %133 = add nuw nsw i32 %.07598, 1
  %exitcond109.not = icmp eq i32 %133, %5
  br i1 %exitcond109.not, label %._crit_edge102, label %42, !llvm.loop !26
}

declare noundef ptr @_ZN2rw5Image6createEiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @_ZN2rw5Image8allocateEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1

declare noundef zeroext i1 @_ZN2rw6Raster14formatHasAlphaEi(i32 noundef) local_unnamed_addr #1

declare noundef i32 @_ZN2rw6Raster12getNumLevelsEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #1

declare noundef ptr @_ZN2rw6Raster4lockEii(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef, i32 noundef) local_unnamed_addr #1

declare noundef i32 @_ZN2rw6Raster21imageFindRasterFormatEPNS_5ImageEiPiS3_S3_S3_i(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare noundef ptr @_ZN2rw6Raster6createEiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare noundef ptr @_ZN2rw6Raster12setFromImageEPNS_5ImageEi(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @_ZN2rw6Raster6unlockEi(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef) local_unnamed_addr #1

declare void @_ZN2rw5Image7destroyEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1

attributes #0 = { mustprogress 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 = { 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 #3 = { 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !16, i64 16}
!15 = !{!"_ZTSN2rw15MemoryFunctionsE", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!18, !6, i64 16}
!18 = !{!"_ZTSN2rw5ImageE", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !16, i64 24, !16, i64 32}
!19 = !{!18, !6, i64 20}
!20 = !{!18, !6, i64 8}
!21 = !{!18, !6, i64 4}
!22 = !{!18, !16, i64 24}
!23 = distinct !{!23, !13, !24}
!24 = !{!"llvm.loop.unswitch.partial.disable"}
!25 = distinct !{!25, !13}
!26 = distinct !{!26, !13}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass