; LLVM IR from vectozavr/3dzavr :: engine/io/Image.ll (ZN5ImageC2ERK8FilePath)

; 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.FilePath = type { %"class.std::filesystem::__cxx11::path" }
%"class.std::filesystem::__cxx11::path" = type { %"class.std::__cxx11::basic_string", %"struct.std::filesystem::__cxx11::path::_List" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.std::filesystem::__cxx11::path::_List" = type { %"class.std::unique_ptr" }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.2" }
%"struct.std::_Head_base.2" = type { ptr }
%class.Image = type { i16, i16, ptr, i8, %class.FilePath }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }

@_ZN6ConstsL20DEFAULT_TEXTURE_PATHE = external hidden global %class.FilePath, align 8
@.str.18 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [7 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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Image10invalidateEv(ptr noundef nonnull align 8 dereferenceable(64)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5ImageC2ERK8FilePath(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(40) %1) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8
  %19 = getelementptr inbounds %class.Image, ptr %18, i32 0, i32 2
  store ptr null, ptr %19, align 8, !tbaa !9
  %20 = getelementptr inbounds %class.Image, ptr %18, i32 0, i32 3
  store i8 0, ptr %20, align 8, !tbaa !25
  %21 = getelementptr inbounds %class.Image, ptr %18, i32 0, i32 4
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN8FilePathC2ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %21, ptr noundef nonnull align 8 dereferenceable(40) %22)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #11
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #11
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNK8FilePath3strB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %6, ptr noundef nonnull align 8 dereferenceable(40) %23)
          to label %24 unwind label %39

24:                                               ; preds = %2
  %25 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %6) #11
  %26 = invoke noalias ptr @fopen(ptr noundef %25, ptr noundef @.str.18)
          to label %27 unwind label %43

27:                                               ; preds = %24
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #11
  store ptr %26, ptr %5, align 8, !tbaa !5
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %62, label %30

30:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #11
  invoke void @_ZNK8FilePath3strB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %9, ptr noundef nonnull align 8 dereferenceable(40) @_ZN6ConstsL20DEFAULT_TEXTURE_PATHE)
          to label %31 unwind label %48

31:                                               ; preds = %30
  %32 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #11
  %33 = invoke noalias ptr @fopen(ptr noundef %32, ptr noundef @.str.18)
          to label %34 unwind label %52

34:                                               ; preds = %31
  store ptr %33, ptr %5, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #11
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %61, label %37

37:                                               ; preds = %34
  invoke void @_ZN5Image10invalidateEv(ptr noundef nonnull align 8 dereferenceable(64) %18)
          to label %38 unwind label %57

38:                                               ; preds = %37
  store i32 1, ptr %10, align 4
  br label %267

39:                                               ; preds = %2
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %7, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %8, align 4
  br label %47

43:                                               ; preds = %24
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %7, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #11
  br label %47

47:                                               ; preds = %43, %39
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #11
  br label %275

48:                                               ; preds = %30
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %7, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %8, align 4
  br label %56

52:                                               ; preds = %31
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %7, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #11
  br label %56

56:                                               ; preds = %52, %48
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #11
  br label %275

57:                                               ; preds = %37
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %7, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %8, align 4
  br label %275

61:                                               ; preds = %34
  br label %62

62:                                               ; preds = %61, %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #11
  %63 = invoke noalias ptr @png_create_read_struct(ptr noundef @.str.19, ptr noundef null, ptr noundef null, ptr noundef null)
          to label %64 unwind label %68

64:                                               ; preds = %62
  store ptr %63, ptr %11, align 8, !tbaa !5
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = icmp ne ptr %65, null
  br i1 %66, label %72, label %67

67:                                               ; preds = %64
  call void @abort() #12
  unreachable

68:                                               ; preds = %62
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %7, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %8, align 4
  br label %274

72:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #11
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = invoke noalias ptr @png_create_info_struct(ptr noundef %73)
          to label %75 unwind label %79

75:                                               ; preds = %72
  store ptr %74, ptr %12, align 8, !tbaa !5
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  %77 = icmp ne ptr %76, null
  br i1 %77, label %83, label %78

78:                                               ; preds = %75
  call void @abort() #12
  unreachable

79:                                               ; preds = %101, %97, %94, %91, %83, %72
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %7, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %8, align 4
  br label %273

83:                                               ; preds = %75
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = invoke ptr @png_set_longjmp_fn(ptr noundef %84, ptr noundef @longjmp, i64 noundef 200)
          to label %86 unwind label %79

86:                                               ; preds = %83
  %87 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %85, i64 0, i64 0
  %88 = call i32 @_setjmp(ptr noundef %87) #13
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %91

90:                                               ; preds = %86
  call void @abort() #12
  unreachable

91:                                               ; preds = %86
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @png_init_io(ptr noundef %92, ptr noundef %93)
          to label %94 unwind label %79

94:                                               ; preds = %91
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @png_read_info(ptr noundef %95, ptr noundef %96)
          to label %97 unwind label %79

97:                                               ; preds = %94
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = load ptr, ptr %12, align 8, !tbaa !5
  %100 = invoke i32 @png_get_image_width(ptr noundef %98, ptr noundef %99)
          to label %101 unwind label %79

101:                                              ; preds = %97
  %102 = trunc i32 %100 to i16
  %103 = getelementptr inbounds %class.Image, ptr %18, i32 0, i32 0
  store i16 %102, ptr %103, align 8, !tbaa !26
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = invoke i32 @png_get_image_height(ptr noundef %104, ptr noundef %105)
          to label %107 unwind label %79

107:                                              ; preds = %101
  %108 = trunc i32 %106 to i16
  %109 = getelementptr inbounds %class.Image, ptr %18, i32 0, i32 1
  store i16 %108, ptr %109, align 2, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #11
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = load ptr, ptr %12, align 8, !tbaa !5
  %112 = invoke zeroext i8 @png_get_color_type(ptr noundef %110, ptr noundef %111)
          to label %113 unwind label %124

113:                                              ; preds = %107
  store i8 %112, ptr %13, align 1, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #11
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = invoke zeroext i8 @png_get_bit_depth(ptr noundef %114, ptr noundef %115)
          to label %117 unwind label %128

117:                                              ; preds = %113
  store i8 %116, ptr %14, align 1, !tbaa !28
  %118 = load i8, ptr %14, align 1, !tbaa !28
  %119 = zext i8 %118 to i32
  %120 = icmp eq i32 %119, 16
  br i1 %120, label %121, label %132

121:                                              ; preds = %117
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @png_set_strip_16(ptr noundef %122)
          to label %123 unwind label %128

123:                                              ; preds = %121
  br label %132

124:                                              ; preds = %107
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %7, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %8, align 4
  br label %272

128:                                              ; preds = %185, %182, %171, %156, %150, %147, %136, %121, %113
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %7, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %8, align 4
  br label %271

132:                                              ; preds = %123, %117
  %133 = load i8, ptr %13, align 1, !tbaa !28
  %134 = zext i8 %133 to i32
  %135 = icmp eq i32 %134, 3
  br i1 %135, label %136, label %139

136:                                              ; preds = %132
  %137 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @png_set_palette_to_rgb(ptr noundef %137)
          to label %138 unwind label %128

138:                                              ; preds = %136
  br label %139

139:                                              ; preds = %138, %132
  %140 = load i8, ptr %13, align 1, !tbaa !28
  %141 = zext i8 %140 to i32
  %142 = icmp eq i32 %141, 0
  br i1 %142, label %143, label %150

143:                                              ; preds = %139
  %144 = load i8, ptr %14, align 1, !tbaa !28
  %145 = zext i8 %144 to i32
  %146 = icmp slt i32 %145, 8
  br i1 %146, label %147, label %150

147:                                              ; preds = %143
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @png_set_expand_gray_1_2_4_to_8(ptr noundef %148)
          to label %149 unwind label %128

149:                                              ; preds = %147
  br label %150

150:                                              ; preds = %149, %143, %139
  %151 = load ptr, ptr %11, align 8, !tbaa !5
  %152 = load ptr, ptr %12, align 8, !tbaa !5
  %153 = invoke i32 @png_get_valid(ptr noundef %151, ptr noundef %152, i32 noundef 16)
          to label %154 unwind label %128

154:                                              ; preds = %150
  %155 = icmp ne i32 %153, 0
  br i1 %155, label %156, label %159

156:                                              ; preds = %154
  %157 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @png_set_tRNS_to_alpha(ptr noundef %157)
          to label %158 unwind label %128

158:                                              ; preds = %156
  br label %159

159:                                              ; preds = %158, %154
  %160 = load i8, ptr %13, align 1, !tbaa !28
  %161 = zext i8 %160 to i32
  %162 = icmp eq i32 %161, 2
  br i1 %162, label %171, label %163

163:                                              ; preds = %159
  %164 = load i8, ptr %13, align 1, !tbaa !28
  %165 = zext i8 %164 to i32
  %166 = icmp eq i32 %165, 0
  br i1 %166, label %171, label %167

167:                                              ; preds = %163
  %168 = load i8, ptr %13, align 1, !tbaa !28
  %169 = zext i8 %168 to i32
  %170 = icmp eq i32 %169, 3
  br i1 %170, label %171, label %174

171:                                              ; preds = %167, %163, %159
  %172 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @png_set_filler(ptr noundef %172, i32 noundef 255, i32 noundef 1)
          to label %173 unwind label %128

173:                                              ; preds = %171
  br label %174

174:                                              ; preds = %173, %167
  %175 = load i8, ptr %13, align 1, !tbaa !28
  %176 = zext i8 %175 to i32
  %177 = icmp eq i32 %176, 0
  br i1 %177, label %182, label %178

178:                                              ; preds = %174
  %179 = load i8, ptr %13, align 1, !tbaa !28
  %180 = zext i8 %179 to i32
  %181 = icmp eq i32 %180, 4
  br i1 %181, label %182, label %185

182:                                              ; preds = %178, %174
  %183 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @png_set_gray_to_rgb(ptr noundef %183)
          to label %184 unwind label %128

184:                                              ; preds = %182
  br label %185

185:                                              ; preds = %184, %178
  %186 = load ptr, ptr %11, align 8, !tbaa !5
  %187 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @png_read_update_info(ptr noundef %186, ptr noundef %187)
          to label %188 unwind label %128

188:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #11
  %189 = load ptr, ptr %11, align 8, !tbaa !5
  %190 = load ptr, ptr %12, align 8, !tbaa !5
  %191 = invoke i64 @png_get_rowbytes(ptr noundef %189, ptr noundef %190)
          to label %192 unwind label %201

192:                                              ; preds = %188
  store i64 %191, ptr %15, align 8, !tbaa !29
  %193 = load i64, ptr %15, align 8, !tbaa !29
  %194 = getelementptr inbounds %class.Image, ptr %18, i32 0, i32 0
  %195 = load i16, ptr %194, align 8, !tbaa !26
  %196 = zext i16 %195 to i32
  %197 = mul nsw i32 4, %196
  %198 = sext i32 %197 to i64
  %199 = icmp ne i64 %193, %198
  br i1 %199, label %200, label %205

200:                                              ; preds = %192
  call void @abort() #12
  unreachable

201:                                              ; preds = %205, %188
  %202 = landingpad { ptr, i32 }
          cleanup
  %203 = extractvalue { ptr, i32 } %202, 0
  store ptr %203, ptr %7, align 8
  %204 = extractvalue { ptr, i32 } %202, 1
  store i32 %204, ptr %8, align 4
  br label %270

205:                                              ; preds = %192
  %206 = getelementptr inbounds %class.Image, ptr %18, i32 0, i32 1
  %207 = load i16, ptr %206, align 2, !tbaa !27
  %208 = zext i16 %207 to i32
  %209 = getelementptr inbounds %class.Image, ptr %18, i32 0, i32 0
  %210 = load i16, ptr %209, align 8, !tbaa !26
  %211 = zext i16 %210 to i32
  %212 = mul nsw i32 %208, %211
  %213 = mul nsw i32 %212, 4
  %214 = sext i32 %213 to i64
  %215 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %214) #14
          to label %216 unwind label %201

216:                                              ; preds = %205
  %217 = getelementptr inbounds %class.Image, ptr %18, i32 0, i32 2
  store ptr %215, ptr %217, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #11
  %218 = getelementptr inbounds %class.Image, ptr %18, i32 0, i32 1
  %219 = load i16, ptr %218, align 2, !tbaa !27
  %220 = zext i16 %219 to i64
  %221 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %220, i64 8)
  %222 = extractvalue { i64, i1 } %221, 1
  %223 = extractvalue { i64, i1 } %221, 0
  %224 = select i1 %222, i64 -1, i64 %223
  %225 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %224) #14
          to label %226 unwind label %234

226:                                              ; preds = %216
  store ptr %225, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #11
  store i64 0, ptr %17, align 8, !tbaa !29
  br label %227

227:                                              ; preds = %251, %226
  %228 = load i64, ptr %17, align 8, !tbaa !29
  %229 = getelementptr inbounds %class.Image, ptr %18, i32 0, i32 1
  %230 = load i16, ptr %229, align 2, !tbaa !27
  %231 = zext i16 %230 to i64
  %232 = icmp ult i64 %228, %231
  br i1 %232, label %238, label %233

233:                                              ; preds = %227
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #11
  br label %254

234:                                              ; preds = %264, %261, %254, %216
  %235 = landingpad { ptr, i32 }
          cleanup
  %236 = extractvalue { ptr, i32 } %235, 0
  store ptr %236, ptr %7, align 8
  %237 = extractvalue { ptr, i32 } %235, 1
  store i32 %237, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #11
  br label %270

238:                                              ; preds = %227
  %239 = getelementptr inbounds %class.Image, ptr %18, i32 0, i32 2
  %240 = load ptr, ptr %239, align 8, !tbaa !9
  %241 = load i64, ptr %17, align 8, !tbaa !29
  %242 = getelementptr inbounds %class.Image, ptr %18, i32 0, i32 0
  %243 = load i16, ptr %242, align 8, !tbaa !26
  %244 = zext i16 %243 to i64
  %245 = mul i64 %241, %244
  %246 = mul i64 %245, 4
  %247 = getelementptr inbounds i8, ptr %240, i64 %246
  %248 = load ptr, ptr %16, align 8, !tbaa !5
  %249 = load i64, ptr %17, align 8, !tbaa !29
  %250 = getelementptr inbounds ptr, ptr %248, i64 %249
  store ptr %247, ptr %250, align 8, !tbaa !5
  br label %251

251:                                              ; preds = %238
  %252 = load i64, ptr %17, align 8, !tbaa !29
  %253 = add i64 %252, 1
  store i64 %253, ptr %17, align 8, !tbaa !29
  br label %227, !llvm.loop !30

254:                                              ; preds = %233
  %255 = load ptr, ptr %11, align 8, !tbaa !5
  %256 = load ptr, ptr %16, align 8, !tbaa !5
  invoke void @png_read_image(ptr noundef %255, ptr noundef %256)
          to label %257 unwind label %234

257:                                              ; preds = %254
  %258 = load ptr, ptr %16, align 8, !tbaa !5
  %259 = icmp eq ptr %258, null
  br i1 %259, label %261, label %260

260:                                              ; preds = %257
  call void @_ZdaPv(ptr noundef %258) #15
  br label %261

261:                                              ; preds = %260, %257
  %262 = load ptr, ptr %5, align 8, !tbaa !5
  %263 = invoke i32 @fclose(ptr noundef %262)
          to label %264 unwind label %234

264:                                              ; preds = %261
  invoke void @png_destroy_read_struct(ptr noundef %11, ptr noundef %12, ptr noundef null)
          to label %265 unwind label %234

265:                                              ; preds = %264
  %266 = getelementptr inbounds %class.Image, ptr %18, i32 0, i32 3
  store i8 1, ptr %266, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #11
  store i32 0, ptr %10, align 4
  br label %267

267:                                              ; preds = %265, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #11
  %268 = load i32, ptr %10, align 4
  switch i32 %268, label %281 [
    i32 0, label %269
    i32 1, label %269
  ]

269:                                              ; preds = %267, %267
  ret void

270:                                              ; preds = %234, %201
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #11
  br label %271

271:                                              ; preds = %270, %128
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #11
  br label %272

272:                                              ; preds = %271, %124
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #11
  br label %273

273:                                              ; preds = %272, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #11
  br label %274

274:                                              ; preds = %273, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #11
  br label %275

275:                                              ; preds = %274, %57, %56, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #11
  call void @_ZN8FilePathD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %21) #11
  br label %276

276:                                              ; preds = %275
  %277 = load ptr, ptr %7, align 8
  %278 = load i32, ptr %8, align 4
  %279 = insertvalue { ptr, i32 } poison, ptr %277, 0
  %280 = insertvalue { ptr, i32 } %279, i32 %278, 1
  resume { ptr, i32 } %280

281:                                              ; preds = %267
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8FilePath3strB5cxx11Ev(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

declare noalias ptr @png_create_read_struct(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #6

; Function Attrs: noreturn nounwind
declare void @abort() #7

declare noalias ptr @png_create_info_struct(ptr noundef) #6

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) #8

declare ptr @png_set_longjmp_fn(ptr noundef, ptr noundef, i64 noundef) #6

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

declare void @png_init_io(ptr noundef, ptr noundef) #6

declare void @png_read_info(ptr noundef, ptr noundef) #6

declare i32 @png_get_image_width(ptr noundef, ptr noundef) #6

declare i32 @png_get_image_height(ptr noundef, ptr noundef) #6

declare zeroext i8 @png_get_color_type(ptr noundef, ptr noundef) #6

declare zeroext i8 @png_get_bit_depth(ptr noundef, ptr noundef) #6

declare void @png_set_strip_16(ptr noundef) #6

declare void @png_set_palette_to_rgb(ptr noundef) #6

declare void @png_set_expand_gray_1_2_4_to_8(ptr noundef) #6

declare i32 @png_get_valid(ptr noundef, ptr noundef, i32 noundef) #6

declare void @png_set_tRNS_to_alpha(ptr noundef) #6

declare void @png_set_filler(ptr noundef, i32 noundef, i32 noundef) #6

declare void @png_set_gray_to_rgb(ptr noundef) #6

declare void @png_read_update_info(ptr noundef, ptr noundef) #6

declare i64 @png_get_rowbytes(ptr noundef, ptr noundef) #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #9

declare void @png_read_image(ptr noundef, ptr noundef) #6

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

declare i32 @fclose(ptr noundef) #6

declare void @png_destroy_read_struct(ptr noundef, ptr noundef, ptr noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "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 = { 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 #8 = { nounwind returns_twice "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { 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 #11 = { nounwind }
attributes #12 = { noreturn nounwind }
attributes #13 = { nounwind returns_twice }
attributes #14 = { builtin allocsize(0) }
attributes #15 = { 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, !6, i64 8}
!10 = !{!"_ZTS5Image", !11, i64 0, !11, i64 2, !6, i64 8, !12, i64 16, !13, i64 24}
!11 = !{!"short", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTS8FilePath", !14, i64 0}
!14 = !{!"_ZTSNSt10filesystem7__cxx114pathE", !15, i64 0, !18, i64 32}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !17, i64 8, !7, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSNSt10filesystem7__cxx114path5_ListE", !19, i64 0}
!19 = !{!"_ZTSSt10unique_ptrINSt10filesystem7__cxx114path5_List5_ImplENS3_13_Impl_deleterEE", !20, i64 0}
!20 = !{!"_ZTSSt15__uniq_ptr_dataINSt10filesystem7__cxx114path5_List5_ImplENS3_13_Impl_deleterELb1ELb1EE", !21, i64 0}
!21 = !{!"_ZTSSt15__uniq_ptr_implINSt10filesystem7__cxx114path5_List5_ImplENS3_13_Impl_deleterEE", !22, i64 0}
!22 = !{!"_ZTSSt5tupleIJPNSt10filesystem7__cxx114path5_List5_ImplENS3_13_Impl_deleterEEE", !23, i64 0}
!23 = !{!"_ZTSSt11_Tuple_implILm0EJPNSt10filesystem7__cxx114path5_List5_ImplENS3_13_Impl_deleterEEE", !24, i64 0}
!24 = !{!"_ZTSSt10_Head_baseILm0EPNSt10filesystem7__cxx114path5_List5_ImplELb0EE", !6, i64 0}
!25 = !{!10, !12, i64 16}
!26 = !{!10, !11, i64 0}
!27 = !{!10, !11, i64 2}
!28 = !{!7, !7, i64 0}
!29 = !{!17, !17, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


; 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.FilePath = type { %"class.std::filesystem::__cxx11::path" }
%"class.std::filesystem::__cxx11::path" = type { %"class.std::__cxx11::basic_string", %"struct.std::filesystem::__cxx11::path::_List" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.std::filesystem::__cxx11::path::_List" = type { %"class.std::unique_ptr" }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.2" }
%"struct.std::_Head_base.2" = type { ptr }

@_ZN6ConstsL20DEFAULT_TEXTURE_PATHE = external hidden global %class.FilePath, align 8
@.str.18 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [7 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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Image10invalidateEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5ImageC2ERK8FilePath(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(40) %1) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr null, ptr %7, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  store i8 0, ptr %8, align 8, !tbaa !24
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  call void @_ZN8FilePathC2ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef nonnull align 8 dereferenceable(40) %1)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #11
  invoke void @_ZNK8FilePath3strB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %3, ptr noundef nonnull align 8 dereferenceable(40) %1)
          to label %10 unwind label %18

10:                                               ; preds = %2
  %11 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #11
  %12 = call noalias ptr @fopen(ptr noundef %11, ptr noundef nonnull @.str.18)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #11
  %.not = icmp eq ptr %12, null
  br i1 %.not, label %13, label %22

13:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #11
  invoke void @_ZNK8FilePath3strB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef nonnull align 8 dereferenceable(40) @_ZN6ConstsL20DEFAULT_TEXTURE_PATHE)
          to label %14 unwind label %20

14:                                               ; preds = %13
  %15 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #11
  %16 = call noalias ptr @fopen(ptr noundef %15, ptr noundef nonnull @.str.18)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #11
  %.not46 = icmp eq ptr %16, null
  br i1 %.not46, label %17, label %22

17:                                               ; preds = %14
  call void @_ZN5Image10invalidateEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  br label %123

18:                                               ; preds = %2
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #11
  br label %126

20:                                               ; preds = %13
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #11
  br label %126

22:                                               ; preds = %14, %10
  %.036 = phi ptr [ %12, %10 ], [ %16, %14 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #11
  %23 = invoke noalias ptr @png_create_read_struct(ptr noundef nonnull @.str.19, ptr noundef null, ptr noundef null, ptr noundef null)
          to label %24 unwind label %26

24:                                               ; preds = %22
  store ptr %23, ptr %5, align 8, !tbaa !25
  %.not47 = icmp eq ptr %23, null
  br i1 %.not47, label %25, label %28

25:                                               ; preds = %24
  call void @abort() #12
  unreachable

26:                                               ; preds = %22
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %125

28:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #11
  %29 = invoke noalias ptr @png_create_info_struct(ptr noundef nonnull %23)
          to label %30 unwind label %32

30:                                               ; preds = %28
  store ptr %29, ptr %6, align 8, !tbaa !25
  %.not48 = icmp eq ptr %29, null
  br i1 %.not48, label %31, label %34

31:                                               ; preds = %30
  call void @abort() #12
  unreachable

32:                                               ; preds = %43, %41, %40, %39, %34, %28
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %124

34:                                               ; preds = %30
  %35 = invoke ptr @png_set_longjmp_fn(ptr noundef nonnull %23, ptr noundef nonnull @longjmp, i64 noundef 200)
          to label %36 unwind label %32

36:                                               ; preds = %34
  %37 = call i32 @_setjmp(ptr noundef %35) #13
  %.not49 = icmp eq i32 %37, 0
  br i1 %.not49, label %39, label %38

38:                                               ; preds = %36
  call void @abort() #12
  unreachable

39:                                               ; preds = %36
  invoke void @png_init_io(ptr noundef nonnull %23, ptr noundef nonnull %.036)
          to label %40 unwind label %32

40:                                               ; preds = %39
  invoke void @png_read_info(ptr noundef nonnull %23, ptr noundef nonnull %29)
          to label %41 unwind label %32

41:                                               ; preds = %40
  %42 = invoke i32 @png_get_image_width(ptr noundef nonnull %23, ptr noundef nonnull %29)
          to label %43 unwind label %32

43:                                               ; preds = %41
  %44 = trunc i32 %42 to i16
  store i16 %44, ptr %0, align 8, !tbaa !26
  %45 = invoke i32 @png_get_image_height(ptr noundef nonnull %23, ptr noundef nonnull %29)
          to label %46 unwind label %32

46:                                               ; preds = %43
  %47 = trunc i32 %45 to i16
  %48 = getelementptr inbounds i8, ptr %0, i64 2
  store i16 %47, ptr %48, align 2, !tbaa !27
  %49 = invoke zeroext i8 @png_get_color_type(ptr noundef nonnull %23, ptr noundef nonnull %29)
          to label %50 unwind label %55

50:                                               ; preds = %46
  %51 = invoke zeroext i8 @png_get_bit_depth(ptr noundef nonnull %23, ptr noundef nonnull %29)
          to label %52 unwind label %57

52:                                               ; preds = %50
  %53 = icmp eq i8 %51, 16
  br i1 %53, label %54, label %59

54:                                               ; preds = %52
  invoke void @png_set_strip_16(ptr noundef nonnull %23)
          to label %59 unwind label %57

55:                                               ; preds = %46
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %124

57:                                               ; preds = %73, %72, %70, %68, %.thread, %65, %61, %54, %50
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %124

59:                                               ; preds = %54, %52
  %60 = icmp eq i8 %49, 3
  br i1 %60, label %61, label %62

61:                                               ; preds = %59
  invoke void @png_set_palette_to_rgb(ptr noundef nonnull %23)
          to label %.thread unwind label %57

62:                                               ; preds = %59
  %63 = icmp eq i8 %49, 0
  %64 = icmp ult i8 %51, 8
  %or.cond = select i1 %63, i1 %64, i1 false
  br i1 %or.cond, label %65, label %.thread

65:                                               ; preds = %62
  invoke void @png_set_expand_gray_1_2_4_to_8(ptr noundef nonnull %23)
          to label %.thread unwind label %57

.thread:                                          ; preds = %61, %65, %62
  %66 = invoke i32 @png_get_valid(ptr noundef nonnull %23, ptr noundef nonnull %29, i32 noundef 16)
          to label %67 unwind label %57

67:                                               ; preds = %.thread
  %.not50 = icmp eq i32 %66, 0
  br i1 %.not50, label %69, label %68

68:                                               ; preds = %67
  invoke void @png_set_tRNS_to_alpha(ptr noundef nonnull %23)
          to label %69 unwind label %57

69:                                               ; preds = %68, %67
  switch i8 %49, label %73 [
    i8 3, label %70
    i8 2, label %70
    i8 0, label %70
    i8 4, label %72
  ]

70:                                               ; preds = %69, %69, %69
  invoke void @png_set_filler(ptr noundef nonnull %23, i32 noundef 255, i32 noundef 1)
          to label %71 unwind label %57

71:                                               ; preds = %70
  %cond = icmp eq i8 %49, 0
  br i1 %cond, label %72, label %73

72:                                               ; preds = %71, %69
  invoke void @png_set_gray_to_rgb(ptr noundef nonnull %23)
          to label %73 unwind label %57

73:                                               ; preds = %71, %69, %72
  invoke void @png_read_update_info(ptr noundef nonnull %23, ptr noundef nonnull %29)
          to label %74 unwind label %57

74:                                               ; preds = %73
  %75 = invoke i64 @png_get_rowbytes(ptr noundef nonnull %23, ptr noundef nonnull %29)
          to label %76 unwind label %82

76:                                               ; preds = %74
  %77 = load i16, ptr %0, align 8, !tbaa !26
  %78 = zext i16 %77 to i32
  %79 = shl nuw nsw i32 %78, 2
  %80 = zext nneg i32 %79 to i64
  %.not51 = icmp eq i64 %75, %80
  br i1 %.not51, label %84, label %81

81:                                               ; preds = %76
  call void @abort() #12
  unreachable

82:                                               ; preds = %84, %74
  %83 = landingpad { ptr, i32 }
          cleanup
  br label %124

84:                                               ; preds = %76
  %85 = load i16, ptr %48, align 2, !tbaa !27
  %86 = zext i16 %85 to i32
  %87 = mul i32 %79, %86
  %88 = zext nneg i32 %87 to i64
  %89 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %88) #14
          to label %90 unwind label %82

90:                                               ; preds = %84
  store ptr %89, ptr %7, align 8, !tbaa !5
  %91 = zext i16 %85 to i64
  %92 = shl nuw nsw i64 %91, 3
  %93 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %92) #14
          to label %.preheader unwind label %101

.preheader:                                       ; preds = %90
  %.not60 = icmp eq i16 %85, 0
  br i1 %.not60, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %94 = zext i16 %77 to i64
  %95 = shl nuw nsw i64 %94, 2
  %xtraiter = and i64 %91, 3
  %96 = icmp ult i16 %85, 4
  br i1 %96, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %91, 65532
  br label %103

._crit_edge.loopexit.unr-lcssa:                   ; preds = %103, %.lr.ph
  %.059.unr = phi i64 [ 0, %.lr.ph ], [ %119, %103 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader
  %.059.epil = phi i64 [ %100, %.epil.preheader ], [ %.059.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %97 = mul nuw nsw i64 %95, %.059.epil
  %98 = getelementptr inbounds i8, ptr %89, i64 %97
  %99 = getelementptr inbounds ptr, ptr %93, i64 %.059.epil
  store ptr %98, ptr %99, align 8, !tbaa !25
  %100 = add nuw nsw i64 %.059.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !28

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader, %.preheader
  invoke void @png_read_image(ptr noundef nonnull %23, ptr noundef nonnull %93)
          to label %120 unwind label %101

101:                                              ; preds = %120, %._crit_edge, %90
  %102 = landingpad { ptr, i32 }
          cleanup
  br label %124

103:                                              ; preds = %103, %.lr.ph.new
  %.059 = phi i64 [ 0, %.lr.ph.new ], [ %119, %103 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %103 ]
  %104 = mul nuw nsw i64 %95, %.059
  %105 = getelementptr inbounds i8, ptr %89, i64 %104
  %106 = getelementptr inbounds ptr, ptr %93, i64 %.059
  store ptr %105, ptr %106, align 8, !tbaa !25
  %107 = or disjoint i64 %.059, 1
  %108 = mul nuw nsw i64 %95, %107
  %109 = getelementptr inbounds i8, ptr %89, i64 %108
  %110 = getelementptr inbounds ptr, ptr %93, i64 %107
  store ptr %109, ptr %110, align 8, !tbaa !25
  %111 = or disjoint i64 %.059, 2
  %112 = mul nuw nsw i64 %95, %111
  %113 = getelementptr inbounds i8, ptr %89, i64 %112
  %114 = getelementptr inbounds ptr, ptr %93, i64 %111
  store ptr %113, ptr %114, align 8, !tbaa !25
  %115 = or disjoint i64 %.059, 3
  %116 = mul nuw nsw i64 %95, %115
  %117 = getelementptr inbounds i8, ptr %89, i64 %116
  %118 = getelementptr inbounds ptr, ptr %93, i64 %115
  store ptr %117, ptr %118, align 8, !tbaa !25
  %119 = add nuw nsw i64 %.059, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %103, !llvm.loop !30

120:                                              ; preds = %._crit_edge
  call void @_ZdaPv(ptr noundef nonnull %93) #15
  %121 = call i32 @fclose(ptr noundef nonnull %.036)
  invoke void @png_destroy_read_struct(ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef null)
          to label %122 unwind label %101

122:                                              ; preds = %120
  store i8 1, ptr %8, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #11
  br label %123

123:                                              ; preds = %122, %17
  ret void

124:                                              ; preds = %55, %82, %101, %57, %32
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %33, %32 ], [ %56, %55 ], [ %58, %57 ], [ %102, %101 ], [ %83, %82 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #11
  br label %125

125:                                              ; preds = %124, %26
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %124 ], [ %27, %26 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #11
  br label %126

126:                                              ; preds = %125, %20, %18
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn, %125 ], [ %21, %20 ], [ %19, %18 ]
  call void @_ZN8FilePathD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #11
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8FilePath3strB5cxx11Ev(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

declare noalias ptr @png_create_read_struct(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #7

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #8

declare noalias ptr @png_create_info_struct(ptr noundef) local_unnamed_addr #7

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) local_unnamed_addr #9

declare ptr @png_set_longjmp_fn(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #7

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

declare void @png_init_io(ptr noundef, ptr noundef) local_unnamed_addr #7

declare void @png_read_info(ptr noundef, ptr noundef) local_unnamed_addr #7

declare i32 @png_get_image_width(ptr noundef, ptr noundef) local_unnamed_addr #7

declare i32 @png_get_image_height(ptr noundef, ptr noundef) local_unnamed_addr #7

declare zeroext i8 @png_get_color_type(ptr noundef, ptr noundef) local_unnamed_addr #7

declare zeroext i8 @png_get_bit_depth(ptr noundef, ptr noundef) local_unnamed_addr #7

declare void @png_set_strip_16(ptr noundef) local_unnamed_addr #7

declare void @png_set_palette_to_rgb(ptr noundef) local_unnamed_addr #7

declare void @png_set_expand_gray_1_2_4_to_8(ptr noundef) local_unnamed_addr #7

declare i32 @png_get_valid(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #7

declare void @png_set_tRNS_to_alpha(ptr noundef) local_unnamed_addr #7

declare void @png_set_filler(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #7

declare void @png_set_gray_to_rgb(ptr noundef) local_unnamed_addr #7

declare void @png_read_update_info(ptr noundef, ptr noundef) local_unnamed_addr #7

declare i64 @png_get_rowbytes(ptr noundef, ptr noundef) local_unnamed_addr #7

declare void @png_read_image(ptr noundef, ptr noundef) local_unnamed_addr #7

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

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

declare void @png_destroy_read_struct(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { "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 = { 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 #9 = { nounwind returns_twice "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 #10 = { 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 #11 = { nounwind }
attributes #12 = { noreturn nounwind }
attributes #13 = { nounwind returns_twice }
attributes #14 = { builtin allocsize(0) }
attributes #15 = { 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, !10, i64 8}
!6 = !{!"_ZTS5Image", !7, i64 0, !7, i64 2, !10, i64 8, !11, i64 16, !12, i64 24}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTS8FilePath", !13, i64 0}
!13 = !{!"_ZTSNSt10filesystem7__cxx114pathE", !14, i64 0, !17, i64 32}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !15, i64 0, !16, i64 8, !8, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !10, i64 0}
!16 = !{!"long", !8, i64 0}
!17 = !{!"_ZTSNSt10filesystem7__cxx114path5_ListE", !18, i64 0}
!18 = !{!"_ZTSSt10unique_ptrINSt10filesystem7__cxx114path5_List5_ImplENS3_13_Impl_deleterEE", !19, i64 0}
!19 = !{!"_ZTSSt15__uniq_ptr_dataINSt10filesystem7__cxx114path5_List5_ImplENS3_13_Impl_deleterELb1ELb1EE", !20, i64 0}
!20 = !{!"_ZTSSt15__uniq_ptr_implINSt10filesystem7__cxx114path5_List5_ImplENS3_13_Impl_deleterEE", !21, i64 0}
!21 = !{!"_ZTSSt5tupleIJPNSt10filesystem7__cxx114path5_List5_ImplENS3_13_Impl_deleterEEE", !22, i64 0}
!22 = !{!"_ZTSSt11_Tuple_implILm0EJPNSt10filesystem7__cxx114path5_List5_ImplENS3_13_Impl_deleterEEE", !23, i64 0}
!23 = !{!"_ZTSSt10_Head_baseILm0EPNSt10filesystem7__cxx114path5_List5_ImplELb0EE", !10, i64 0}
!24 = !{!6, !11, i64 16}
!25 = !{!10, !10, i64 0}
!26 = !{!6, !7, i64 0}
!27 = !{!6, !7, i64 2}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.unroll.disable"}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


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