; LLVM IR from ShahjalalShohag/code-library :: Math/FWHT in Any Base.ll (ZN4FWHT15constructMatrixEib)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.FWHT::Matrix" = type { [10 x [10 x i32]], i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3POWxx(i64 noundef, i64 noundef) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4FWHT6MatrixC2Eii(ptr noundef nonnull align 4 dereferenceable(408), i32 noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4FWHT15constructMatrixEib(ptr dead_on_unwind noalias writable sret(%"struct.FWHT::Matrix") align 4 %0, i32 noundef %1, i1 noundef zeroext %2) #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca i8, align 1
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i8, align 1
  %15 = alloca ptr, align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store i32 %1, ptr %4, align 4, !tbaa !5
  %24 = zext i1 %2 to i8
  store i8 %24, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #4
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 330301440, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 2, ptr %8, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %56, %3
  %26 = load i32, ptr %8, align 4, !tbaa !5
  %27 = load i32, ptr %8, align 4, !tbaa !5
  %28 = mul nsw i32 %26, %27
  %29 = load i32, ptr %7, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %59

32:                                               ; preds = %25
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = load i32, ptr %8, align 4, !tbaa !5
  %35 = srem i32 %33, %34
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %55

37:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %38 = load i32, ptr %8, align 4, !tbaa !5
  %39 = sdiv i32 330301440, %38
  store i32 %39, ptr %9, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %40 unwind label %50

40:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %41

41:                                               ; preds = %46, %40
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = load i32, ptr %8, align 4, !tbaa !5
  %44 = srem i32 %42, %43
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %54

46:                                               ; preds = %41
  %47 = load i32, ptr %8, align 4, !tbaa !5
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = sdiv i32 %48, %47
  store i32 %49, ptr %7, align 4, !tbaa !5
  br label %41, !llvm.loop !11

50:                                               ; preds = %37
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %10, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %165

54:                                               ; preds = %41
  br label %55

55:                                               ; preds = %54, %32
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %8, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %8, align 4, !tbaa !5
  br label %25, !llvm.loop !13

59:                                               ; preds = %31
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = icmp sgt i32 %60, 1
  br i1 %61, label %62, label %70

62:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = sdiv i32 330301440, %63
  store i32 %64, ptr %12, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %65 unwind label %66

65:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %70

66:                                               ; preds = %62
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %10, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %165

70:                                               ; preds = %65, %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 2, ptr %13, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %104, %70
  br label %72

72:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #4
  store i8 1, ptr %14, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store ptr %6, ptr %15, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %73 = load ptr, ptr %15, align 8, !tbaa !14
  %74 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %73) #4
  %75 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %74, ptr %75, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %76 = load ptr, ptr %15, align 8, !tbaa !14
  %77 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %76) #4
  %78 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %77, ptr %78, align 8
  br label %79

79:                                               ; preds = %93, %72
  %80 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  br i1 %80, label %82, label %81

81:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %95

82:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %84 = load i32, ptr %83, align 4, !tbaa !5
  store i32 %84, ptr %18, align 4, !tbaa !5
  %85 = load i32, ptr %13, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = load i32, ptr %18, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = call noundef i32 @_Z3POWxx(i64 noundef %86, i64 noundef %88)
  %90 = icmp eq i32 %89, 1
  br i1 %90, label %91, label %92

91:                                               ; preds = %82
  store i8 0, ptr %14, align 1, !tbaa !9
  br label %92

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

93:                                               ; preds = %92
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  br label %79

95:                                               ; preds = %81
  %96 = load i8, ptr %14, align 1, !tbaa !9, !range !16, !noundef !17
  %97 = trunc i8 %96 to i1
  br i1 %97, label %98, label %99

98:                                               ; preds = %95
  store i32 8, ptr %19, align 4
  br label %102

99:                                               ; preds = %95
  %100 = load i32, ptr %13, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %13, align 4, !tbaa !5
  store i32 0, ptr %19, align 4
  br label %102

102:                                              ; preds = %99, %98
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #4
  %103 = load i32, ptr %19, align 4
  switch i32 %103, label %171 [
    i32 0, label %104
    i32 8, label %105
  ]

104:                                              ; preds = %102
  br label %71, !llvm.loop !18

105:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %106 = load i32, ptr %13, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = load i32, ptr %4, align 4, !tbaa !5
  %109 = sdiv i32 330301440, %108
  %110 = sext i32 %109 to i64
  %111 = call noundef i32 @_Z3POWxx(i64 noundef %107, i64 noundef %110)
  store i32 %111, ptr %20, align 4, !tbaa !5
  %112 = load i32, ptr %4, align 4, !tbaa !5
  %113 = load i32, ptr %4, align 4, !tbaa !5
  invoke void @_ZN4FWHT6MatrixC2Eii(ptr noundef nonnull align 4 dereferenceable(408) %0, i32 noundef %112, i32 noundef %113)
          to label %114 unwind label %120

114:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %161, %114
  %116 = load i32, ptr %21, align 4, !tbaa !5
  %117 = load i32, ptr %4, align 4, !tbaa !5
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %124, label %119

119:                                              ; preds = %115
  store i32 11, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  br label %164

120:                                              ; preds = %105
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %10, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %165

124:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %125 = load i32, ptr %20, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = load i8, ptr %5, align 1, !tbaa !9, !range !16, !noundef !17
  %128 = trunc i8 %127 to i1
  br i1 %128, label %129, label %133

129:                                              ; preds = %124
  %130 = load i32, ptr %4, align 4, !tbaa !5
  %131 = load i32, ptr %21, align 4, !tbaa !5
  %132 = sub nsw i32 %130, %131
  br label %135

133:                                              ; preds = %124
  %134 = load i32, ptr %21, align 4, !tbaa !5
  br label %135

135:                                              ; preds = %133, %129
  %136 = phi i32 [ %132, %129 ], [ %134, %133 ]
  %137 = sext i32 %136 to i64
  %138 = call noundef i32 @_Z3POWxx(i64 noundef %126, i64 noundef %137)
  store i32 %138, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %157, %135
  %140 = load i32, ptr %23, align 4, !tbaa !5
  %141 = load i32, ptr %4, align 4, !tbaa !5
  %142 = icmp slt i32 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %139
  store i32 14, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  br label %160

144:                                              ; preds = %139
  %145 = load i32, ptr %22, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = load i32, ptr %23, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = call noundef i32 @_Z3POWxx(i64 noundef %146, i64 noundef %148)
  %150 = getelementptr inbounds %"struct.FWHT::Matrix", ptr %0, i32 0, i32 0
  %151 = load i32, ptr %21, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [10 x [10 x i32]], ptr %150, i64 0, i64 %152
  %154 = load i32, ptr %23, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [10 x i32], ptr %153, i64 0, i64 %155
  store i32 %149, ptr %156, align 4, !tbaa !5
  br label %157

157:                                              ; preds = %144
  %158 = load i32, ptr %23, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %23, align 4, !tbaa !5
  br label %139, !llvm.loop !19

160:                                              ; preds = %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %21, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %21, align 4, !tbaa !5
  br label %115, !llvm.loop !20

164:                                              ; preds = %119
  store i32 1, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #4
  ret void

165:                                              ; preds = %120, %66, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #4
  br label %166

166:                                              ; preds = %165
  %167 = load ptr, ptr %10, align 8
  %168 = load i32, ptr %11, align 4
  %169 = insertvalue { ptr, i32 } poison, ptr %167, 0
  %170 = insertvalue { ptr, i32 } %169, i32 %168, 1
  resume { ptr, i32 } %170

171:                                              ; preds = %102
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.FWHT::Matrix" = type { [10 x [10 x i32]], i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3POWxx(i64 noundef, i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4FWHT6MatrixC2Eii(ptr noundef nonnull align 4 dereferenceable(408), i32 noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4FWHT15constructMatrixEib(ptr dead_on_unwind noalias writable sret(%"struct.FWHT::Matrix") align 4 %0, i32 noundef %1, i1 noundef zeroext %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  br label %11

9:                                                ; preds = %.loopexit
  %10 = icmp sgt i32 %.2, 1
  br i1 %10, label %23, label %.preheader

.preheader:                                       ; preds = %25, %9
  br label %28

11:                                               ; preds = %3, %.loopexit
  %.04055 = phi i32 [ 330301440, %3 ], [ %.2, %.loopexit ]
  %.04254 = phi i32 [ 2, %3 ], [ %21, %.loopexit ]
  %12 = srem i32 %.04055, %.04254
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %14, label %.loopexit

14:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %15 = udiv i32 330301440, %.04254
  store i32 %15, ptr %5, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %.lr.ph.preheader unwind label %19

.lr.ph.preheader:                                 ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.153 = phi i32 [ %16, %.lr.ph ], [ %.04055, %.lr.ph.preheader ]
  %16 = sdiv i32 %.153, %.04254
  %17 = srem i32 %16, %.04254
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %.lr.ph, label %.loopexit, !llvm.loop !9

19:                                               ; preds = %14
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %57

.loopexit:                                        ; preds = %.lr.ph, %11
  %.2 = phi i32 [ %.04055, %11 ], [ %16, %.lr.ph ]
  %21 = add nuw nsw i32 %.04254, 1
  %22 = mul nuw nsw i32 %21, %21
  %.not = icmp sgt i32 %22, %.2
  br i1 %.not, label %9, label %11, !llvm.loop !11

23:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  %24 = udiv i32 330301440, %.2
  store i32 %24, ptr %6, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %25 unwind label %26

25:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  br label %.preheader

26:                                               ; preds = %23
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  br label %57

28:                                               ; preds = %.preheader, %._crit_edge
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge ], [ 2, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %29 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  store ptr %29, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %30 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  store ptr %30, ptr %8, align 8
  %31 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  br i1 %31, label %.lr.ph57, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br label %.loopexit91

._crit_edge:                                      ; preds = %.lr.ph57
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br i1 %spec.select, label %.loopexit91, label %28

.lr.ph57:                                         ; preds = %28, %.lr.ph57
  %.04656 = phi i1 [ %spec.select, %.lr.ph57 ], [ true, %28 ]
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = call noundef i32 @_Z3POWxx(i64 noundef %indvars.iv, i64 noundef %34)
  %36 = icmp ne i32 %35, 1
  %spec.select = select i1 %36, i1 %.04656, i1 false
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  %38 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  br i1 %38, label %.lr.ph57, label %._crit_edge

.loopexit91:                                      ; preds = %._crit_edge, %._crit_edge.thread
  %39 = and i64 %indvars.iv, 4294967295
  %40 = sdiv i32 330301440, %1
  %41 = sext i32 %40 to i64
  %42 = call noundef i32 @_Z3POWxx(i64 noundef %39, i64 noundef %41)
  call void @_ZN4FWHT6MatrixC2Eii(ptr noundef nonnull align 4 dereferenceable(408) %0, i32 noundef %1, i32 noundef %1)
  %43 = icmp sgt i32 %1, 0
  br i1 %43, label %.lr.ph65, label %._crit_edge66

.lr.ph65:                                         ; preds = %.loopexit91
  %44 = sext i32 %42 to i64
  %45 = zext nneg i32 %1 to i64
  br i1 %2, label %.lr.ph61.us.us.preheader, label %.lr.ph61.us

.lr.ph61.us.us.preheader:                         ; preds = %.lr.ph65
  %wide.trip.count86 = zext nneg i32 %1 to i64
  br label %.lr.ph61.us.us

.lr.ph61.us.us:                                   ; preds = %.lr.ph61.us.us.preheader, %._crit_edge62.us.us
  %indvars.iv83 = phi i64 [ 0, %.lr.ph61.us.us.preheader ], [ %indvars.iv.next84, %._crit_edge62.us.us ]
  %46 = sub nsw i64 %45, %indvars.iv83
  %47 = call noundef i32 @_Z3POWxx(i64 noundef %44, i64 noundef %46)
  %48 = sext i32 %47 to i64
  br label %49

49:                                               ; preds = %.lr.ph61.us.us, %49
  %indvars.iv78 = phi i64 [ 0, %.lr.ph61.us.us ], [ %indvars.iv.next79, %49 ]
  %50 = call noundef i32 @_Z3POWxx(i64 noundef %48, i64 noundef %indvars.iv78)
  %51 = getelementptr inbounds [10 x [10 x i32]], ptr %0, i64 0, i64 %indvars.iv83, i64 %indvars.iv78
  store i32 %50, ptr %51, align 4, !tbaa !5
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond82.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count86
  br i1 %exitcond82.not, label %._crit_edge62.us.us, label %49, !llvm.loop !12

._crit_edge62.us.us:                              ; preds = %49
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86
  br i1 %exitcond87.not, label %._crit_edge66, label %.lr.ph61.us.us, !llvm.loop !13

.lr.ph61.us:                                      ; preds = %.lr.ph65, %._crit_edge62.us
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %._crit_edge62.us ], [ 0, %.lr.ph65 ]
  %52 = call noundef i32 @_Z3POWxx(i64 noundef %44, i64 noundef %indvars.iv73)
  %53 = sext i32 %52 to i64
  br label %54

54:                                               ; preds = %.lr.ph61.us, %54
  %indvars.iv70 = phi i64 [ 0, %.lr.ph61.us ], [ %indvars.iv.next71, %54 ]
  %55 = call noundef i32 @_Z3POWxx(i64 noundef %53, i64 noundef %indvars.iv70)
  %56 = getelementptr inbounds [10 x [10 x i32]], ptr %0, i64 0, i64 %indvars.iv73, i64 %indvars.iv70
  store i32 %55, ptr %56, align 4, !tbaa !5
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next71, %45
  br i1 %exitcond.not, label %._crit_edge62.us, label %54, !llvm.loop !12

._crit_edge62.us:                                 ; preds = %54
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %exitcond77.not = icmp eq i64 %indvars.iv.next74, %45
  br i1 %exitcond77.not, label %._crit_edge66, label %.lr.ph61.us, !llvm.loop !13

._crit_edge66:                                    ; preds = %._crit_edge62.us, %._crit_edge62.us.us, %.loopexit91
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  ret void

57:                                               ; preds = %26, %19
  %.pn = phi { ptr, i32 } [ %20, %19 ], [ %27, %26 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


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