; LLVM IR from facebookresearch/habitat-sim :: src/deps/basis-universal/encoder (basisu_ssim)

; 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.basisu::color_rgba" = type { %union.anon }
%union.anon = type { [4 x i8] }
%"class.basisu::vec" = type { [4 x float] }
%"class.basisu::image" = type { i32, i32, i32, %"class.basisu::vector.2" }
%"class.basisu::vector.2" = type { ptr, i32, i32 }
%"class.basisu::imagef" = type { i32, i32, i32, %"class.basisu::vector.0" }
%"class.basisu::vector.0" = type { ptr, i32, i32 }
%struct.anon = type { i8, i8, i8, i8 }

@_ZN6basisuL13g_black_colorE = external hidden global %"class.basisu::color_rgba", align 1
@.str.3 = external hidden unnamed_addr constant [111 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu12compute_ssimERKNS_5imageES2_bb = external hidden unnamed_addr constant [69 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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu3vecILj4EfEC2Ef(ptr noundef nonnull align 4 dereferenceable(16), float noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu12compute_ssimERKNS_6imagefES2_(ptr dead_on_unwind noalias writable sret(%"class.basisu::vec") align 4, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu12compute_ssimERKNS_5imageES2_bb(ptr dead_on_unwind noalias writable sret(%"class.basisu::vec") align 4 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, i1 noundef zeroext %3, i1 noundef zeroext %4) #3 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca %"class.basisu::image", align 8
  %12 = alloca %"class.basisu::image", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"class.basisu::imagef", align 8
  %21 = alloca %"class.basisu::imagef", align 8
  %22 = alloca %"class.basisu::vec", align 4
  %23 = alloca %"class.basisu::vec", align 4
  %24 = alloca %"class.basisu::vec", align 4
  %25 = alloca %"class.basisu::vec", align 4
  store ptr %0, ptr %6, align 8
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  %26 = zext i1 %3 to i8
  store i8 %26, ptr %9, align 1, !tbaa !9
  %27 = zext i1 %4 to i8
  store i8 %27, ptr %10, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #6
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN6basisu5imageC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %28)
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN6basisu5imageC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(32) %29)
          to label %30 unwind label %68

30:                                               ; preds = %5
  %31 = invoke noundef i32 @_ZNK6basisu5image9get_widthEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %32 unwind label %72

32:                                               ; preds = %30
  %33 = invoke noundef i32 @_ZNK6basisu5image9get_widthEv(ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %34 unwind label %72

34:                                               ; preds = %32
  %35 = icmp ne i32 %31, %33
  br i1 %35, label %42, label %36

36:                                               ; preds = %34
  %37 = invoke noundef i32 @_ZNK6basisu5image10get_heightEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %38 unwind label %72

38:                                               ; preds = %36
  %39 = invoke noundef i32 @_ZNK6basisu5image10get_heightEv(ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %40 unwind label %72

40:                                               ; preds = %38
  %41 = icmp ne i32 %37, %39
  br i1 %41, label %42, label %85

42:                                               ; preds = %40, %34
  invoke void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.10)
          to label %43 unwind label %72

43:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = invoke noundef i32 @_ZNK6basisu5image9get_widthEv(ptr noundef nonnull align 8 dereferenceable(32) %44)
          to label %46 unwind label %76

46:                                               ; preds = %43
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = invoke noundef i32 @_ZNK6basisu5image9get_widthEv(ptr noundef nonnull align 8 dereferenceable(32) %47)
          to label %49 unwind label %76

49:                                               ; preds = %46
  %50 = invoke noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef %45, i32 noundef %48)
          to label %51 unwind label %76

51:                                               ; preds = %49
  store i32 %50, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = invoke noundef i32 @_ZNK6basisu5image10get_heightEv(ptr noundef nonnull align 8 dereferenceable(32) %52)
          to label %54 unwind label %80

54:                                               ; preds = %51
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = invoke noundef i32 @_ZNK6basisu5image10get_heightEv(ptr noundef nonnull align 8 dereferenceable(32) %55)
          to label %57 unwind label %80

57:                                               ; preds = %54
  %58 = invoke noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef %53, i32 noundef %56)
          to label %59 unwind label %80

59:                                               ; preds = %57
  store i32 %58, ptr %16, align 4, !tbaa !11
  %60 = load i32, ptr %15, align 4, !tbaa !11
  %61 = load i32, ptr %16, align 4, !tbaa !11
  %62 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image4cropEjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %60, i32 noundef %61, i32 noundef -1, ptr noundef nonnull align 1 dereferenceable(4) @_ZN6basisuL13g_black_colorE)
          to label %63 unwind label %80

63:                                               ; preds = %59
  %64 = load i32, ptr %15, align 4, !tbaa !11
  %65 = load i32, ptr %16, align 4, !tbaa !11
  %66 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image4cropEjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %12, i32 noundef %64, i32 noundef %65, i32 noundef -1, ptr noundef nonnull align 1 dereferenceable(4) @_ZN6basisuL13g_black_colorE)
          to label %67 unwind label %80

67:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %85

68:                                               ; preds = %5
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %13, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %14, align 4
  br label %219

72:                                               ; preds = %89, %85, %42, %38, %36, %32, %30
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %13, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %14, align 4
  br label %218

76:                                               ; preds = %49, %46, %43
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %13, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %14, align 4
  br label %84

80:                                               ; preds = %63, %59, %57, %54, %51
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %13, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %84

84:                                               ; preds = %80, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %218

85:                                               ; preds = %67, %40
  %86 = invoke noundef i32 @_ZNK6basisu5image9get_widthEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %87 unwind label %72

87:                                               ; preds = %85
  %88 = icmp ne i32 %86, 0
  br i1 %88, label %89, label %93

89:                                               ; preds = %87
  %90 = invoke noundef i32 @_ZNK6basisu5image10get_heightEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %91 unwind label %72

91:                                               ; preds = %89
  %92 = icmp ne i32 %90, 0
  br i1 %92, label %94, label %93

93:                                               ; preds = %91, %87
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.3, i32 noundef 384, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu12compute_ssimERKNS_5imageES2_bb) #7
  unreachable

94:                                               ; preds = %91
  %95 = load i8, ptr %9, align 1, !tbaa !9, !range !13, !noundef !14
  %96 = trunc i8 %95 to i1
  br i1 %96, label %97, label %173

97:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %98

98:                                               ; preds = %168, %97
  %99 = load i32, ptr %17, align 4, !tbaa !11
  %100 = invoke noundef i32 @_ZNK6basisu5image10get_heightEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %101 unwind label %104

101:                                              ; preds = %98
  %102 = icmp ult i32 %99, %100
  br i1 %102, label %108, label %103

103:                                              ; preds = %101
  store i32 2, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %172

104:                                              ; preds = %98
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %13, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %14, align 4
  br label %171

108:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !11
  br label %109

109:                                              ; preds = %164, %108
  %110 = load i32, ptr %19, align 4, !tbaa !11
  %111 = invoke noundef i32 @_ZNK6basisu5image9get_widthEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %112 unwind label %115

112:                                              ; preds = %109
  %113 = icmp ult i32 %110, %111
  br i1 %113, label %119, label %114

114:                                              ; preds = %112
  store i32 5, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %167

115:                                              ; preds = %157, %153, %149, %145, %141, %135, %131, %127, %123, %119, %109
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %13, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %171

119:                                              ; preds = %112
  %120 = load i32, ptr %19, align 4, !tbaa !11
  %121 = load i32, ptr %17, align 4, !tbaa !11
  %122 = invoke noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu5imageclEjj(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %120, i32 noundef %121)
          to label %123 unwind label %115

123:                                              ; preds = %119
  %124 = load i32, ptr %19, align 4, !tbaa !11
  %125 = load i32, ptr %17, align 4, !tbaa !11
  %126 = invoke noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu5imageclEjj(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %124, i32 noundef %125)
          to label %127 unwind label %115

127:                                              ; preds = %123
  %128 = load i8, ptr %10, align 1, !tbaa !9, !range !13, !noundef !14
  %129 = trunc i8 %128 to i1
  %130 = invoke noundef i32 @_ZNK6basisu10color_rgba8get_lumaEb(ptr noundef nonnull align 1 dereferenceable(4) %126, i1 noundef zeroext %129)
          to label %131 unwind label %115

131:                                              ; preds = %127
  %132 = load i32, ptr %19, align 4, !tbaa !11
  %133 = load i32, ptr %17, align 4, !tbaa !11
  %134 = invoke noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu5imageclEjj(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %132, i32 noundef %133)
          to label %135 unwind label %115

135:                                              ; preds = %131
  %136 = getelementptr inbounds %"class.basisu::color_rgba", ptr %134, i32 0, i32 0
  %137 = getelementptr inbounds %struct.anon, ptr %136, i32 0, i32 3
  %138 = load i8, ptr %137, align 1, !tbaa !15
  %139 = zext i8 %138 to i32
  %140 = invoke noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu10color_rgba3setEii(ptr noundef nonnull align 1 dereferenceable(4) %122, i32 noundef %130, i32 noundef %139)
          to label %141 unwind label %115

141:                                              ; preds = %135
  %142 = load i32, ptr %19, align 4, !tbaa !11
  %143 = load i32, ptr %17, align 4, !tbaa !11
  %144 = invoke noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu5imageclEjj(ptr noundef nonnull align 8 dereferenceable(32) %12, i32 noundef %142, i32 noundef %143)
          to label %145 unwind label %115

145:                                              ; preds = %141
  %146 = load i32, ptr %19, align 4, !tbaa !11
  %147 = load i32, ptr %17, align 4, !tbaa !11
  %148 = invoke noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu5imageclEjj(ptr noundef nonnull align 8 dereferenceable(32) %12, i32 noundef %146, i32 noundef %147)
          to label %149 unwind label %115

149:                                              ; preds = %145
  %150 = load i8, ptr %10, align 1, !tbaa !9, !range !13, !noundef !14
  %151 = trunc i8 %150 to i1
  %152 = invoke noundef i32 @_ZNK6basisu10color_rgba8get_lumaEb(ptr noundef nonnull align 1 dereferenceable(4) %148, i1 noundef zeroext %151)
          to label %153 unwind label %115

153:                                              ; preds = %149
  %154 = load i32, ptr %19, align 4, !tbaa !11
  %155 = load i32, ptr %17, align 4, !tbaa !11
  %156 = invoke noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu5imageclEjj(ptr noundef nonnull align 8 dereferenceable(32) %12, i32 noundef %154, i32 noundef %155)
          to label %157 unwind label %115

157:                                              ; preds = %153
  %158 = getelementptr inbounds %"class.basisu::color_rgba", ptr %156, i32 0, i32 0
  %159 = getelementptr inbounds %struct.anon, ptr %158, i32 0, i32 3
  %160 = load i8, ptr %159, align 1, !tbaa !15
  %161 = zext i8 %160 to i32
  %162 = invoke noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu10color_rgba3setEii(ptr noundef nonnull align 1 dereferenceable(4) %144, i32 noundef %152, i32 noundef %161)
          to label %163 unwind label %115

163:                                              ; preds = %157
  br label %164

164:                                              ; preds = %163
  %165 = load i32, ptr %19, align 4, !tbaa !11
  %166 = add i32 %165, 1
  store i32 %166, ptr %19, align 4, !tbaa !11
  br label %109, !llvm.loop !16

167:                                              ; preds = %114
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %17, align 4, !tbaa !11
  %170 = add i32 %169, 1
  store i32 %170, ptr %17, align 4, !tbaa !11
  br label %98, !llvm.loop !18

171:                                              ; preds = %115, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %218

172:                                              ; preds = %103
  br label %173

173:                                              ; preds = %172, %94
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #6
  invoke void @_ZN6basisu6imagefC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %174 unwind label %185

174:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #6
  invoke void @_ZN6basisu6imagefC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21)
          to label %175 unwind label %189

175:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #6
  invoke void @_ZN6basisu3vecILj4EfEC2Ef(ptr noundef nonnull align 4 dereferenceable(16) %22, float noundef 1.000000e+00)
          to label %176 unwind label %193

176:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #6
  invoke void @_ZN6basisu3vecILj4EfEC2Ef(ptr noundef nonnull align 4 dereferenceable(16) %23, float noundef 0.000000e+00)
          to label %177 unwind label %197

177:                                              ; preds = %176
  %178 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu6imagef3setERKNS_5imageERKNS_3vecILj4EfEES7_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 4 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(16) %23)
          to label %179 unwind label %197

179:                                              ; preds = %177
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #6
  invoke void @_ZN6basisu3vecILj4EfEC2Ef(ptr noundef nonnull align 4 dereferenceable(16) %24, float noundef 1.000000e+00)
          to label %180 unwind label %202

180:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #6
  invoke void @_ZN6basisu3vecILj4EfEC2Ef(ptr noundef nonnull align 4 dereferenceable(16) %25, float noundef 0.000000e+00)
          to label %181 unwind label %206

181:                                              ; preds = %180
  %182 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu6imagef3setERKNS_5imageERKNS_3vecILj4EfEES7_(ptr noundef nonnull align 8 dereferenceable(32) %21, ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 4 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(16) %25)
          to label %183 unwind label %206

183:                                              ; preds = %181
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #6
  invoke void @_ZN6basisu12compute_ssimERKNS_6imagefES2_(ptr dead_on_unwind writable sret(%"class.basisu::vec") align 4 %0, ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(32) %21)
          to label %184 unwind label %211

184:                                              ; preds = %183
  store i32 1, ptr %18, align 4
  call void @_ZN6basisu6imagefD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #6
  call void @_ZN6basisu6imagefD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #6
  call void @_ZN6basisu5imageD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  call void @_ZN6basisu5imageD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  ret void

185:                                              ; preds = %173
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %13, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %14, align 4
  br label %217

189:                                              ; preds = %174
  %190 = landingpad { ptr, i32 }
          cleanup
  %191 = extractvalue { ptr, i32 } %190, 0
  store ptr %191, ptr %13, align 8
  %192 = extractvalue { ptr, i32 } %190, 1
  store i32 %192, ptr %14, align 4
  br label %216

193:                                              ; preds = %175
  %194 = landingpad { ptr, i32 }
          cleanup
  %195 = extractvalue { ptr, i32 } %194, 0
  store ptr %195, ptr %13, align 8
  %196 = extractvalue { ptr, i32 } %194, 1
  store i32 %196, ptr %14, align 4
  br label %201

197:                                              ; preds = %177, %176
  %198 = landingpad { ptr, i32 }
          cleanup
  %199 = extractvalue { ptr, i32 } %198, 0
  store ptr %199, ptr %13, align 8
  %200 = extractvalue { ptr, i32 } %198, 1
  store i32 %200, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #6
  br label %201

201:                                              ; preds = %197, %193
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  br label %215

202:                                              ; preds = %179
  %203 = landingpad { ptr, i32 }
          cleanup
  %204 = extractvalue { ptr, i32 } %203, 0
  store ptr %204, ptr %13, align 8
  %205 = extractvalue { ptr, i32 } %203, 1
  store i32 %205, ptr %14, align 4
  br label %210

206:                                              ; preds = %181, %180
  %207 = landingpad { ptr, i32 }
          cleanup
  %208 = extractvalue { ptr, i32 } %207, 0
  store ptr %208, ptr %13, align 8
  %209 = extractvalue { ptr, i32 } %207, 1
  store i32 %209, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #6
  br label %210

210:                                              ; preds = %206, %202
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #6
  br label %215

211:                                              ; preds = %183
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %13, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %14, align 4
  br label %215

215:                                              ; preds = %211, %210, %201
  call void @_ZN6basisu6imagefD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #6
  br label %216

216:                                              ; preds = %215, %189
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #6
  call void @_ZN6basisu6imagefD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #6
  br label %217

217:                                              ; preds = %216, %185
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #6
  br label %218

218:                                              ; preds = %217, %171, %84, %72
  call void @_ZN6basisu5imageD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  br label %219

219:                                              ; preds = %218, %68
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  call void @_ZN6basisu5imageD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  br label %220

220:                                              ; preds = %219
  %221 = load ptr, ptr %13, align 8
  %222 = load i32, ptr %14, align 4
  %223 = insertvalue { ptr, i32 } poison, ptr %221, 0
  %224 = insertvalue { ptr, i32 } %223, i32 %222, 1
  resume { ptr, i32 } %224
}

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

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

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

declare void @_ZN6basisu12debug_printfEPKcz(ptr noundef, ...) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image4cropEjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 1 dereferenceable(4)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu5imageclEjj(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu10color_rgba3setEii(ptr noundef nonnull align 1 dereferenceable(4), i32 noundef, i32 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK6basisu10color_rgba8get_lumaEb(ptr noundef nonnull align 1 dereferenceable(4), i1 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu6imagef3setERKNS_5imageERKNS_3vecILj4EfEES7_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 = { "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 = { nounwind }
attributes #7 = { noreturn 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 = !{!"int", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; 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.basisu::color_rgba" = type { %union.anon }
%union.anon = type { [4 x i8] }
%"class.basisu::vec" = type { [4 x float] }
%"class.basisu::image" = type { i32, i32, i32, %"class.basisu::vector.2" }
%"class.basisu::vector.2" = type { ptr, i32, i32 }
%"class.basisu::imagef" = type { i32, i32, i32, %"class.basisu::vector.0" }
%"class.basisu::vector.0" = type { ptr, i32, i32 }

@_ZN6basisuL13g_black_colorE = external hidden global %"class.basisu::color_rgba", align 1
@.str.3 = external hidden unnamed_addr constant [111 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu12compute_ssimERKNS_5imageES2_bb = external hidden unnamed_addr constant [69 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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu3vecILj4EfEC2Ef(ptr noundef nonnull align 4 dereferenceable(16), float noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu12compute_ssimERKNS_6imagefES2_(ptr dead_on_unwind noalias writable sret(%"class.basisu::vec") align 4, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu12compute_ssimERKNS_5imageES2_bb(ptr dead_on_unwind noalias writable sret(%"class.basisu::vec") align 4 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, i1 noundef zeroext %3, i1 noundef zeroext %4) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.basisu::image", align 8
  %7 = alloca %"class.basisu::image", align 8
  %8 = alloca %"class.basisu::imagef", align 8
  %9 = alloca %"class.basisu::imagef", align 8
  %10 = alloca %"class.basisu::vec", align 4
  %11 = alloca %"class.basisu::vec", align 4
  %12 = alloca %"class.basisu::vec", align 4
  %13 = alloca %"class.basisu::vec", align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  call void @_ZN6basisu5imageC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) %1)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #6
  invoke void @_ZN6basisu5imageC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %14 unwind label %31

14:                                               ; preds = %5
  %15 = call noundef i32 @_ZNK6basisu5image9get_widthEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %16 = call noundef i32 @_ZNK6basisu5image9get_widthEv(ptr noundef nonnull align 8 dereferenceable(32) %7)
  %.not = icmp eq i32 %15, %16
  br i1 %.not, label %17, label %20

17:                                               ; preds = %14
  %18 = call noundef i32 @_ZNK6basisu5image10get_heightEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %19 = call noundef i32 @_ZNK6basisu5image10get_heightEv(ptr noundef nonnull align 8 dereferenceable(32) %7)
  %.not39 = icmp eq i32 %18, %19
  br i1 %.not39, label %37, label %20

20:                                               ; preds = %17, %14
  invoke void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.10)
          to label %21 unwind label %33

21:                                               ; preds = %20
  %22 = call noundef i32 @_ZNK6basisu5image9get_widthEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %23 = call noundef i32 @_ZNK6basisu5image9get_widthEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
  %24 = call noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef %22, i32 noundef %23)
  %25 = call noundef i32 @_ZNK6basisu5image10get_heightEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %26 = call noundef i32 @_ZNK6basisu5image10get_heightEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
  %27 = call noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef %25, i32 noundef %26)
  %28 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image4cropEjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %6, i32 noundef %24, i32 noundef %27, i32 noundef -1, ptr noundef nonnull align 1 dereferenceable(4) @_ZN6basisuL13g_black_colorE)
          to label %29 unwind label %35

29:                                               ; preds = %21
  %30 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image4cropEjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %24, i32 noundef %27, i32 noundef -1, ptr noundef nonnull align 1 dereferenceable(4) @_ZN6basisuL13g_black_colorE)
          to label %37 unwind label %35

31:                                               ; preds = %5
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %102

33:                                               ; preds = %20
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %101

35:                                               ; preds = %29, %21
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %101

37:                                               ; preds = %29, %17
  %38 = call noundef i32 @_ZNK6basisu5image9get_widthEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %.not40 = icmp eq i32 %38, 0
  br i1 %.not40, label %41, label %39

39:                                               ; preds = %37
  %40 = call noundef i32 @_ZNK6basisu5image10get_heightEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %.not41 = icmp eq i32 %40, 0
  br i1 %.not41, label %41, label %42

41:                                               ; preds = %39, %37
  call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.3, i32 noundef 384, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu12compute_ssimERKNS_5imageES2_bb) #7
  unreachable

42:                                               ; preds = %39
  br i1 %3, label %.preheader52, label %.loopexit

.preheader52:                                     ; preds = %42
  %43 = call noundef i32 @_ZNK6basisu5image10get_heightEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %.not55 = icmp eq i32 %43, 0
  br i1 %.not55, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %.preheader52, %._crit_edge
  %.03054 = phi i32 [ %45, %._crit_edge ], [ 0, %.preheader52 ]
  %44 = call noundef i32 @_ZNK6basisu5image9get_widthEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %.not56 = icmp eq i32 %44, 0
  br i1 %.not56, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %62, %.preheader
  %45 = add nuw i32 %.03054, 1
  %46 = call noundef i32 @_ZNK6basisu5image10get_heightEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %47 = icmp ult i32 %45, %46
  br i1 %47, label %.preheader, label %.loopexit, !llvm.loop !5

48:                                               ; preds = %53, %.lr.ph
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %101

.lr.ph:                                           ; preds = %.preheader, %62
  %.053 = phi i32 [ %68, %62 ], [ 0, %.preheader ]
  %50 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu5imageclEjj(ptr noundef nonnull align 8 dereferenceable(32) %6, i32 noundef %.053, i32 noundef %.03054)
  %51 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu5imageclEjj(ptr noundef nonnull align 8 dereferenceable(32) %6, i32 noundef %.053, i32 noundef %.03054)
  %52 = invoke noundef i32 @_ZNK6basisu10color_rgba8get_lumaEb(ptr noundef nonnull align 1 dereferenceable(4) %51, i1 noundef zeroext %4)
          to label %53 unwind label %48

53:                                               ; preds = %.lr.ph
  %54 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu5imageclEjj(ptr noundef nonnull align 8 dereferenceable(32) %6, i32 noundef %.053, i32 noundef %.03054)
  %55 = getelementptr inbounds i8, ptr %54, i64 3
  %56 = load i8, ptr %55, align 1, !tbaa !7
  %57 = zext i8 %56 to i32
  %58 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu10color_rgba3setEii(ptr noundef nonnull align 1 dereferenceable(4) %50, i32 noundef %52, i32 noundef %57)
  %59 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu5imageclEjj(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %.053, i32 noundef %.03054)
  %60 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu5imageclEjj(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %.053, i32 noundef %.03054)
  %61 = invoke noundef i32 @_ZNK6basisu10color_rgba8get_lumaEb(ptr noundef nonnull align 1 dereferenceable(4) %60, i1 noundef zeroext %4)
          to label %62 unwind label %48

62:                                               ; preds = %53
  %63 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu5imageclEjj(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %.053, i32 noundef %.03054)
  %64 = getelementptr inbounds i8, ptr %63, i64 3
  %65 = load i8, ptr %64, align 1, !tbaa !7
  %66 = zext i8 %65 to i32
  %67 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu10color_rgba3setEii(ptr noundef nonnull align 1 dereferenceable(4) %59, i32 noundef %61, i32 noundef %66)
  %68 = add nuw i32 %.053, 1
  %69 = call noundef i32 @_ZNK6basisu5image9get_widthEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %70 = icmp ult i32 %68, %69
  br i1 %70, label %.lr.ph, label %._crit_edge, !llvm.loop !10

.loopexit:                                        ; preds = %._crit_edge, %.preheader52, %42
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #6
  invoke void @_ZN6basisu6imagefC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %71 unwind label %82

71:                                               ; preds = %.loopexit
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #6
  invoke void @_ZN6basisu6imagefC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %72 unwind label %84

72:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #6
  invoke void @_ZN6basisu3vecILj4EfEC2Ef(ptr noundef nonnull align 4 dereferenceable(16) %10, float noundef 1.000000e+00)
          to label %73 unwind label %86

73:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  invoke void @_ZN6basisu3vecILj4EfEC2Ef(ptr noundef nonnull align 4 dereferenceable(16) %11, float noundef 0.000000e+00)
          to label %74 unwind label %88

74:                                               ; preds = %73
  %75 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu6imagef3setERKNS_5imageERKNS_3vecILj4EfEES7_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(16) %11)
          to label %76 unwind label %88

76:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  invoke void @_ZN6basisu3vecILj4EfEC2Ef(ptr noundef nonnull align 4 dereferenceable(16) %12, float noundef 1.000000e+00)
          to label %77 unwind label %91

77:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #6
  invoke void @_ZN6basisu3vecILj4EfEC2Ef(ptr noundef nonnull align 4 dereferenceable(16) %13, float noundef 0.000000e+00)
          to label %78 unwind label %93

78:                                               ; preds = %77
  %79 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu6imagef3setERKNS_5imageERKNS_3vecILj4EfEES7_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 4 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(16) %13)
          to label %80 unwind label %93

80:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  invoke void @_ZN6basisu12compute_ssimERKNS_6imagefES2_(ptr dead_on_unwind writable sret(%"class.basisu::vec") align 4 %0, ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %81 unwind label %96

81:                                               ; preds = %80
  call void @_ZN6basisu6imagefD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  call void @_ZN6basisu6imagefD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  call void @_ZN6basisu5imageD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  call void @_ZN6basisu5imageD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  ret void

82:                                               ; preds = %.loopexit
  %83 = landingpad { ptr, i32 }
          cleanup
  br label %100

84:                                               ; preds = %71
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %99

86:                                               ; preds = %72
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %90

88:                                               ; preds = %74, %73
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  br label %90

90:                                               ; preds = %88, %86
  %.pn = phi { ptr, i32 } [ %89, %88 ], [ %87, %86 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  br label %98

91:                                               ; preds = %76
  %92 = landingpad { ptr, i32 }
          cleanup
  br label %95

93:                                               ; preds = %78, %77
  %94 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  br label %95

95:                                               ; preds = %93, %91
  %.pn43 = phi { ptr, i32 } [ %94, %93 ], [ %92, %91 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  br label %98

96:                                               ; preds = %80
  %97 = landingpad { ptr, i32 }
          cleanup
  br label %98

98:                                               ; preds = %96, %95, %90
  %.pn45 = phi { ptr, i32 } [ %97, %96 ], [ %.pn43, %95 ], [ %.pn, %90 ]
  call void @_ZN6basisu6imagefD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  br label %99

99:                                               ; preds = %98, %84
  %.pn45.pn = phi { ptr, i32 } [ %.pn45, %98 ], [ %85, %84 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  call void @_ZN6basisu6imagefD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  br label %100

100:                                              ; preds = %99, %82
  %.pn45.pn.pn = phi { ptr, i32 } [ %.pn45.pn, %99 ], [ %83, %82 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  br label %101

101:                                              ; preds = %100, %48, %35, %33
  %.pn49 = phi { ptr, i32 } [ %49, %48 ], [ %.pn45.pn.pn, %100 ], [ %36, %35 ], [ %34, %33 ]
  call void @_ZN6basisu5imageD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  br label %102

102:                                              ; preds = %101, %31
  %.pn49.pn = phi { ptr, i32 } [ %.pn49, %101 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  call void @_ZN6basisu5imageD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  resume { ptr, i32 } %.pn49.pn
}

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

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

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

declare void @_ZN6basisu12debug_printfEPKcz(ptr noundef, ...) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image4cropEjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 1 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu5imageclEjj(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu10color_rgba3setEii(ptr noundef nonnull align 1 dereferenceable(4), i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK6basisu10color_rgba8get_lumaEb(ptr noundef nonnull align 1 dereferenceable(4), i1 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu6imagef3setERKNS_5imageERKNS_3vecILj4EfEES7_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #3 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 = { "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 = { nounwind }
attributes #7 = { noreturn 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = distinct !{!10, !6}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass