; LLVM IR from Angelo1211/SoftwareRenderer :: src/texture.ll/ZN7TextureC2ENSt7 (cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_)

; 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.Texture = type { ptr, i32, i32, i32, i32, i32, i32 }

@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @stbi_image_free(ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @stbi_set_flip_vertically_on_load(i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local ptr @stbi_load(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7TextureC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1, ptr noundef %2) unnamed_addr #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %11 = load ptr, ptr %4, align 8
  %12 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 4
  store i32 32, ptr %12, align 4, !tbaa !9
  %13 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 5
  store i32 32, ptr %13, align 8, !tbaa !12
  call void @stbi_set_flip_vertically_on_load(i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %14 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %15 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 1
  %16 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 2
  %17 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 3
  %18 = call ptr @stbi_load(ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17, i32 noundef 0)
  store ptr %18, ptr %7, align 8, !tbaa !5
  %19 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 1
  %20 = load i32, ptr %19, align 8, !tbaa !13
  %21 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 4
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = add nsw i32 %20, %22
  %24 = sub nsw i32 %23, 1
  %25 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 4
  %26 = load i32, ptr %25, align 4, !tbaa !9
  %27 = sdiv i32 %24, %26
  %28 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 6
  store i32 %27, ptr %28, align 4, !tbaa !14
  %29 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 1
  %30 = load i32, ptr %29, align 8, !tbaa !13
  %31 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 2
  %32 = load i32, ptr %31, align 4, !tbaa !15
  %33 = mul nsw i32 %30, %32
  %34 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 3
  %35 = load i32, ptr %34, align 8, !tbaa !16
  %36 = mul nsw i32 %33, %35
  %37 = sext i32 %36 to i64
  %38 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %37, i64 4)
  %39 = extractvalue { i64, i1 } %38, 1
  %40 = extractvalue { i64, i1 } %38, 0
  %41 = select i1 %39, i64 -1, i64 %40
  %42 = call noalias noundef nonnull ptr @_Znam(i64 noundef %41) #8
  %43 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 0
  store ptr %42, ptr %43, align 8, !tbaa !17
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %148

46:                                               ; preds = %3
  %47 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef @.str.2)
  br i1 %47, label %48, label %79

48:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !18
  br label %49

49:                                               ; preds = %75, %48
  %50 = load i32, ptr %8, align 4, !tbaa !18
  %51 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 1
  %52 = load i32, ptr %51, align 8, !tbaa !13
  %53 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 2
  %54 = load i32, ptr %53, align 4, !tbaa !15
  %55 = mul nsw i32 %52, %54
  %56 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 3
  %57 = load i32, ptr %56, align 8, !tbaa !16
  %58 = mul nsw i32 %55, %57
  %59 = icmp slt i32 %50, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %78

61:                                               ; preds = %49
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = load i32, ptr %8, align 4, !tbaa !18
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i8, ptr %62, i64 %64
  %66 = load i8, ptr %65, align 1, !tbaa !19
  %67 = uitofp i8 %66 to float
  %68 = fmul float %67, 0x3F70101020000000
  %69 = call noundef float @_ZSt3powff(float noundef %68, float noundef 0x40019999A0000000)
  %70 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !17
  %72 = load i32, ptr %8, align 4, !tbaa !18
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds float, ptr %71, i64 %73
  store float %69, ptr %74, align 4, !tbaa !20
  br label %75

75:                                               ; preds = %61
  %76 = load i32, ptr %8, align 4, !tbaa !18
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %8, align 4, !tbaa !18
  br label %49, !llvm.loop !22

78:                                               ; preds = %60
  call void @_ZN7Texture8tileDataEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  br label %147

79:                                               ; preds = %46
  %80 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef @.str.3)
  br i1 %80, label %81, label %111

81:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !18
  br label %82

82:                                               ; preds = %107, %81
  %83 = load i32, ptr %9, align 4, !tbaa !18
  %84 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 1
  %85 = load i32, ptr %84, align 8, !tbaa !13
  %86 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 2
  %87 = load i32, ptr %86, align 4, !tbaa !15
  %88 = mul nsw i32 %85, %87
  %89 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 3
  %90 = load i32, ptr %89, align 8, !tbaa !16
  %91 = mul nsw i32 %88, %90
  %92 = icmp slt i32 %83, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %110

94:                                               ; preds = %82
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = load i32, ptr %9, align 4, !tbaa !18
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i8, ptr %95, i64 %97
  %99 = load i8, ptr %98, align 1, !tbaa !19
  %100 = uitofp i8 %99 to float
  %101 = call float @llvm.fmuladd.f32(float %100, float 0x3F80101020000000, float -1.000000e+00)
  %102 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !17
  %104 = load i32, ptr %9, align 4, !tbaa !18
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds float, ptr %103, i64 %105
  store float %101, ptr %106, align 4, !tbaa !20
  br label %107

107:                                              ; preds = %94
  %108 = load i32, ptr %9, align 4, !tbaa !18
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %9, align 4, !tbaa !18
  br label %82, !llvm.loop !24

110:                                              ; preds = %93
  call void @_ZN7Texture8tileDataEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  br label %146

111:                                              ; preds = %79
  %112 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef @.str.4)
  br i1 %112, label %113, label %143

113:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !18
  br label %114

114:                                              ; preds = %139, %113
  %115 = load i32, ptr %10, align 4, !tbaa !18
  %116 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 1
  %117 = load i32, ptr %116, align 8, !tbaa !13
  %118 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 2
  %119 = load i32, ptr %118, align 4, !tbaa !15
  %120 = mul nsw i32 %117, %119
  %121 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 3
  %122 = load i32, ptr %121, align 8, !tbaa !16
  %123 = mul nsw i32 %120, %122
  %124 = icmp slt i32 %115, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %142

126:                                              ; preds = %114
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = load i32, ptr %10, align 4, !tbaa !18
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i8, ptr %127, i64 %129
  %131 = load i8, ptr %130, align 1, !tbaa !19
  %132 = uitofp i8 %131 to float
  %133 = fmul float %132, 0x3F70101020000000
  %134 = getelementptr inbounds %class.Texture, ptr %11, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !17
  %136 = load i32, ptr %10, align 4, !tbaa !18
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds float, ptr %135, i64 %137
  store float %133, ptr %138, align 4, !tbaa !20
  br label %139

139:                                              ; preds = %126
  %140 = load i32, ptr %10, align 4, !tbaa !18
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %10, align 4, !tbaa !18
  br label %114, !llvm.loop !25

142:                                              ; preds = %125
  call void @_ZN7Texture8tileDataEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  br label %145

143:                                              ; preds = %111
  %144 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %145

145:                                              ; preds = %143, %142
  br label %146

146:                                              ; preds = %145, %110
  br label %147

147:                                              ; preds = %146, %78
  br label %151

148:                                              ; preds = %3
  %149 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %150 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %149)
  br label %151

151:                                              ; preds = %148, %147
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  call void @stbi_image_free(ptr noundef %152)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  ret void
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3powff(float noundef, float noundef) #5

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

declare i32 @printf(ptr noundef, ...) #6

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

!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, !11, i64 20}
!10 = !{!"_ZTS7Texture", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 24}
!13 = !{!10, !11, i64 8}
!14 = !{!10, !11, i64 28}
!15 = !{!10, !11, i64 12}
!16 = !{!10, !11, i64 16}
!17 = !{!10, !6, i64 0}
!18 = !{!11, !11, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = distinct !{!25, !23}


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

@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @stbi_image_free(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @stbi_set_flip_vertically_on_load(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local ptr @stbi_load(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7TextureC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1, ptr noundef %2) unnamed_addr #1 align 2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 32, ptr %4, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 32, ptr %5, align 8, !tbaa !11
  tail call void @stbi_set_flip_vertically_on_load(i32 noundef 1)
  %6 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = getelementptr inbounds i8, ptr %0, i64 12
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = tail call ptr @stbi_load(ptr noundef %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, i32 noundef 0)
  %11 = load i32, ptr %7, align 8, !tbaa !12
  %12 = load i32, ptr %4, align 4, !tbaa !5
  %13 = add i32 %11, -1
  %14 = add i32 %13, %12
  %15 = sdiv i32 %14, %12
  %16 = getelementptr inbounds i8, ptr %0, i64 28
  store i32 %15, ptr %16, align 4, !tbaa !13
  %17 = load i32, ptr %8, align 4, !tbaa !14
  %18 = mul nsw i32 %17, %11
  %19 = load i32, ptr %9, align 8, !tbaa !15
  %20 = mul nsw i32 %18, %19
  %21 = sext i32 %20 to i64
  %22 = icmp slt i32 %20, 0
  %23 = shl nsw i64 %21, 2
  %24 = select i1 %22, i64 -1, i64 %23
  %25 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %24) #8
  store ptr %25, ptr %0, align 8, !tbaa !16
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %132, label %26

26:                                               ; preds = %3
  %27 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull @.str.2)
  br i1 %27, label %.preheader, label %48

.preheader:                                       ; preds = %26
  %28 = load i32, ptr %7, align 8, !tbaa !12
  %29 = load i32, ptr %8, align 4, !tbaa !14
  %30 = mul nsw i32 %29, %28
  %31 = load i32, ptr %9, align 8, !tbaa !15
  %32 = mul nsw i32 %30, %31
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph27, label %._crit_edge28

._crit_edge28:                                    ; preds = %.lr.ph27, %.preheader
  tail call void @_ZN7Texture8tileDataEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  br label %135

.lr.ph27:                                         ; preds = %.preheader, %.lr.ph27
  %indvars.iv35 = phi i64 [ %indvars.iv.next36, %.lr.ph27 ], [ 0, %.preheader ]
  %34 = getelementptr inbounds i8, ptr %10, i64 %indvars.iv35
  %35 = load i8, ptr %34, align 1, !tbaa !17
  %36 = uitofp i8 %35 to float
  %37 = fmul float %36, 0x3F70101020000000
  %38 = tail call noundef float @_ZSt3powff(float noundef %37, float noundef 0x40019999A0000000)
  %39 = load ptr, ptr %0, align 8, !tbaa !16
  %40 = getelementptr inbounds float, ptr %39, i64 %indvars.iv35
  store float %38, ptr %40, align 4, !tbaa !18
  %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
  %41 = load i32, ptr %7, align 8, !tbaa !12
  %42 = load i32, ptr %8, align 4, !tbaa !14
  %43 = mul nsw i32 %42, %41
  %44 = load i32, ptr %9, align 8, !tbaa !15
  %45 = mul nsw i32 %43, %44
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next36, %46
  br i1 %47, label %.lr.ph27, label %._crit_edge28, !llvm.loop !20

48:                                               ; preds = %26
  %49 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull @.str.3)
  br i1 %49, label %.preheader20, label %84

.preheader20:                                     ; preds = %48
  %50 = load i32, ptr %7, align 8, !tbaa !12
  %51 = load i32, ptr %8, align 4, !tbaa !14
  %52 = mul nsw i32 %51, %50
  %53 = load i32, ptr %9, align 8, !tbaa !15
  %54 = mul nsw i32 %52, %53
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %.lr.ph24, label %._crit_edge25

.lr.ph24:                                         ; preds = %.preheader20
  %56 = load ptr, ptr %0, align 8, !tbaa !16
  %wide.trip.count33 = zext nneg i32 %54 to i64
  %min.iters.check48 = icmp ult i32 %54, 8
  br i1 %min.iters.check48, label %scalar.ph47.preheader, label %vector.memcheck40

scalar.ph47.preheader:                            ; preds = %middle.block46, %vector.memcheck40, %.lr.ph24
  %indvars.iv30.ph = phi i64 [ 0, %vector.memcheck40 ], [ 0, %.lr.ph24 ], [ %n.vec51, %middle.block46 ]
  %xtraiter59 = and i64 %wide.trip.count33, 1
  %lcmp.mod60.not = icmp eq i64 %xtraiter59, 0
  br i1 %lcmp.mod60.not, label %scalar.ph47.prol.loopexit, label %scalar.ph47.prol

scalar.ph47.prol:                                 ; preds = %scalar.ph47.preheader
  %57 = getelementptr inbounds i8, ptr %10, i64 %indvars.iv30.ph
  %58 = load i8, ptr %57, align 1, !tbaa !17
  %59 = uitofp i8 %58 to float
  %60 = tail call float @llvm.fmuladd.f32(float %59, float 0x3F80101020000000, float -1.000000e+00)
  %61 = getelementptr inbounds float, ptr %56, i64 %indvars.iv30.ph
  store float %60, ptr %61, align 4, !tbaa !18
  %indvars.iv.next31.prol = or disjoint i64 %indvars.iv30.ph, 1
  br label %scalar.ph47.prol.loopexit

scalar.ph47.prol.loopexit:                        ; preds = %scalar.ph47.prol, %scalar.ph47.preheader
  %indvars.iv30.unr = phi i64 [ %indvars.iv30.ph, %scalar.ph47.preheader ], [ %indvars.iv.next31.prol, %scalar.ph47.prol ]
  %62 = add nsw i64 %wide.trip.count33, -1
  %63 = icmp eq i64 %indvars.iv30.ph, %62
  br i1 %63, label %._crit_edge25, label %scalar.ph47

vector.memcheck40:                                ; preds = %.lr.ph24
  %64 = shl nuw nsw i64 %wide.trip.count33, 2
  %scevgep41 = getelementptr i8, ptr %56, i64 %64
  %scevgep42 = getelementptr i8, ptr %10, i64 %wide.trip.count33
  %bound043 = icmp ult ptr %56, %scevgep42
  %bound144 = icmp ult ptr %10, %scevgep41
  %found.conflict45 = and i1 %bound043, %bound144
  br i1 %found.conflict45, label %scalar.ph47.preheader, label %vector.ph49

vector.ph49:                                      ; preds = %vector.memcheck40
  %n.vec51 = and i64 %wide.trip.count33, 2147483640
  br label %vector.body53

vector.body53:                                    ; preds = %vector.body53, %vector.ph49
  %index54 = phi i64 [ 0, %vector.ph49 ], [ %index.next57, %vector.body53 ]
  %65 = getelementptr inbounds i8, ptr %10, i64 %index54
  %66 = getelementptr inbounds i8, ptr %65, i64 4
  %wide.load55 = load <4 x i8>, ptr %65, align 1, !tbaa !17, !alias.scope !22
  %wide.load56 = load <4 x i8>, ptr %66, align 1, !tbaa !17, !alias.scope !22
  %67 = uitofp <4 x i8> %wide.load55 to <4 x float>
  %68 = uitofp <4 x i8> %wide.load56 to <4 x float>
  %69 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %67, <4 x float> <float 0x3F80101020000000, float 0x3F80101020000000, float 0x3F80101020000000, float 0x3F80101020000000>, <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>)
  %70 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %68, <4 x float> <float 0x3F80101020000000, float 0x3F80101020000000, float 0x3F80101020000000, float 0x3F80101020000000>, <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>)
  %71 = getelementptr inbounds float, ptr %56, i64 %index54
  %72 = getelementptr inbounds i8, ptr %71, i64 16
  store <4 x float> %69, ptr %71, align 4, !tbaa !18, !alias.scope !25, !noalias !22
  store <4 x float> %70, ptr %72, align 4, !tbaa !18, !alias.scope !25, !noalias !22
  %index.next57 = add nuw i64 %index54, 8
  %73 = icmp eq i64 %index.next57, %n.vec51
  br i1 %73, label %middle.block46, label %vector.body53, !llvm.loop !27

middle.block46:                                   ; preds = %vector.body53
  %cmp.n58 = icmp eq i64 %n.vec51, %wide.trip.count33
  br i1 %cmp.n58, label %._crit_edge25, label %scalar.ph47.preheader

._crit_edge25:                                    ; preds = %scalar.ph47.prol.loopexit, %scalar.ph47, %middle.block46, %.preheader20
  tail call void @_ZN7Texture8tileDataEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  br label %135

scalar.ph47:                                      ; preds = %scalar.ph47.prol.loopexit, %scalar.ph47
  %indvars.iv30 = phi i64 [ %indvars.iv.next31.1, %scalar.ph47 ], [ %indvars.iv30.unr, %scalar.ph47.prol.loopexit ]
  %74 = getelementptr inbounds i8, ptr %10, i64 %indvars.iv30
  %75 = load i8, ptr %74, align 1, !tbaa !17
  %76 = uitofp i8 %75 to float
  %77 = tail call float @llvm.fmuladd.f32(float %76, float 0x3F80101020000000, float -1.000000e+00)
  %78 = getelementptr inbounds float, ptr %56, i64 %indvars.iv30
  store float %77, ptr %78, align 4, !tbaa !18
  %indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1
  %79 = getelementptr inbounds i8, ptr %10, i64 %indvars.iv.next31
  %80 = load i8, ptr %79, align 1, !tbaa !17
  %81 = uitofp i8 %80 to float
  %82 = tail call float @llvm.fmuladd.f32(float %81, float 0x3F80101020000000, float -1.000000e+00)
  %83 = getelementptr inbounds float, ptr %56, i64 %indvars.iv.next31
  store float %82, ptr %83, align 4, !tbaa !18
  %indvars.iv.next31.1 = add nuw nsw i64 %indvars.iv30, 2
  %exitcond34.not.1 = icmp eq i64 %indvars.iv.next31.1, %wide.trip.count33
  br i1 %exitcond34.not.1, label %._crit_edge25, label %scalar.ph47, !llvm.loop !30

84:                                               ; preds = %48
  %85 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull @.str.4)
  br i1 %85, label %.preheader21, label %130

.preheader21:                                     ; preds = %84
  %86 = load i32, ptr %7, align 8, !tbaa !12
  %87 = load i32, ptr %8, align 4, !tbaa !14
  %88 = mul nsw i32 %87, %86
  %89 = load i32, ptr %9, align 8, !tbaa !15
  %90 = mul nsw i32 %88, %89
  %91 = icmp sgt i32 %90, 0
  br i1 %91, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader21
  %92 = load ptr, ptr %0, align 8, !tbaa !16
  %wide.trip.count = zext nneg i32 %90 to i64
  %min.iters.check = icmp ult i32 %90, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %93 = getelementptr inbounds i8, ptr %10, i64 %indvars.iv.prol
  %94 = load i8, ptr %93, align 1, !tbaa !17
  %95 = uitofp i8 %94 to float
  %96 = fmul float %95, 0x3F70101020000000
  %97 = getelementptr inbounds float, ptr %92, i64 %indvars.iv.prol
  store float %96, ptr %97, align 4, !tbaa !18
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !31

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %98 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %99 = icmp ugt i64 %98, -4
  br i1 %99, label %._crit_edge, label %scalar.ph

vector.memcheck:                                  ; preds = %.lr.ph
  %100 = shl nuw nsw i64 %wide.trip.count, 2
  %scevgep = getelementptr i8, ptr %92, i64 %100
  %scevgep38 = getelementptr i8, ptr %10, i64 %wide.trip.count
  %bound0 = icmp ult ptr %92, %scevgep38
  %bound1 = icmp ult ptr %10, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %101 = getelementptr inbounds i8, ptr %10, i64 %index
  %102 = getelementptr inbounds i8, ptr %101, i64 4
  %wide.load = load <4 x i8>, ptr %101, align 1, !tbaa !17, !alias.scope !33
  %wide.load39 = load <4 x i8>, ptr %102, align 1, !tbaa !17, !alias.scope !33
  %103 = uitofp <4 x i8> %wide.load to <4 x float>
  %104 = uitofp <4 x i8> %wide.load39 to <4 x float>
  %105 = fmul <4 x float> %103, <float 0x3F70101020000000, float 0x3F70101020000000, float 0x3F70101020000000, float 0x3F70101020000000>
  %106 = fmul <4 x float> %104, <float 0x3F70101020000000, float 0x3F70101020000000, float 0x3F70101020000000, float 0x3F70101020000000>
  %107 = getelementptr inbounds float, ptr %92, i64 %index
  %108 = getelementptr inbounds i8, ptr %107, i64 16
  store <4 x float> %105, ptr %107, align 4, !tbaa !18, !alias.scope !36, !noalias !33
  store <4 x float> %106, ptr %108, align 4, !tbaa !18, !alias.scope !36, !noalias !33
  %index.next = add nuw i64 %index, 8
  %109 = icmp eq i64 %index.next, %n.vec
  br i1 %109, label %middle.block, label %vector.body, !llvm.loop !38

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %.preheader21
  tail call void @_ZN7Texture8tileDataEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  br label %135

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %110 = getelementptr inbounds i8, ptr %10, i64 %indvars.iv
  %111 = load i8, ptr %110, align 1, !tbaa !17
  %112 = uitofp i8 %111 to float
  %113 = fmul float %112, 0x3F70101020000000
  %114 = getelementptr inbounds float, ptr %92, i64 %indvars.iv
  store float %113, ptr %114, align 4, !tbaa !18
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %115 = getelementptr inbounds i8, ptr %10, i64 %indvars.iv.next
  %116 = load i8, ptr %115, align 1, !tbaa !17
  %117 = uitofp i8 %116 to float
  %118 = fmul float %117, 0x3F70101020000000
  %119 = getelementptr inbounds float, ptr %92, i64 %indvars.iv.next
  store float %118, ptr %119, align 4, !tbaa !18
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %120 = getelementptr inbounds i8, ptr %10, i64 %indvars.iv.next.1
  %121 = load i8, ptr %120, align 1, !tbaa !17
  %122 = uitofp i8 %121 to float
  %123 = fmul float %122, 0x3F70101020000000
  %124 = getelementptr inbounds float, ptr %92, i64 %indvars.iv.next.1
  store float %123, ptr %124, align 4, !tbaa !18
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %125 = getelementptr inbounds i8, ptr %10, i64 %indvars.iv.next.2
  %126 = load i8, ptr %125, align 1, !tbaa !17
  %127 = uitofp i8 %126 to float
  %128 = fmul float %127, 0x3F70101020000000
  %129 = getelementptr inbounds float, ptr %92, i64 %indvars.iv.next.2
  store float %128, ptr %129, align 4, !tbaa !18
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %scalar.ph, !llvm.loop !39

130:                                              ; preds = %84
  %131 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %135

132:                                              ; preds = %3
  %133 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %134 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef %133)
  br label %135

135:                                              ; preds = %._crit_edge28, %._crit_edge, %130, %._crit_edge25, %132
  tail call void @stbi_image_free(ptr noundef %10)
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3powff(float noundef, float noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x float> @llvm.fmuladd.v4f32(<4 x float>, <4 x float>, <4 x float>) #6

attributes #0 = { 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 #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }

!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 20}
!6 = !{!"_ZTS7Texture", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 24}
!12 = !{!6, !10, i64 8}
!13 = !{!6, !10, i64 28}
!14 = !{!6, !10, i64 12}
!15 = !{!6, !10, i64 16}
!16 = !{!6, !7, i64 0}
!17 = !{!8, !8, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"float", !8, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23}
!23 = distinct !{!23, !24}
!24 = distinct !{!24, !"LVerDomain"}
!25 = !{!26}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !21, !28, !29}
!28 = !{!"llvm.loop.isvectorized", i32 1}
!29 = !{!"llvm.loop.unroll.runtime.disable"}
!30 = distinct !{!30, !21, !28}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.unroll.disable"}
!33 = !{!34}
!34 = distinct !{!34, !35}
!35 = distinct !{!35, !"LVerDomain"}
!36 = !{!37}
!37 = distinct !{!37, !35}
!38 = distinct !{!38, !21, !28, !29}
!39 = distinct !{!39, !21, !28}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass