; LLVM IR from stonne-simulator/omega :: omega-code/stonne/src/utility.ll (Z29generateMajorPointerFromDensePfjj15GENERATION_TYPE)

; 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.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = 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 }

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z29generateMajorPointerFromDensePfjj15GENERATION_TYPE(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #4 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::vector.3", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %23 = load i32, ptr %8, align 4, !tbaa !11
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %88

25:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %77, %25
  %27 = load i32, ptr %11, align 4, !tbaa !9
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = icmp ult i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %81

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %62, %31
  %33 = load i32, ptr %14, align 4, !tbaa !9
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = icmp ult i32 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %65

37:                                               ; preds = %32
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load i32, ptr %11, align 4, !tbaa !9
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = mul i32 %39, %40
  %42 = load i32, ptr %14, align 4, !tbaa !9
  %43 = add i32 %41, %42
  %44 = zext i32 %43 to i64
  %45 = getelementptr inbounds float, ptr %38, i64 %44
  %46 = load float, ptr %45, align 4, !tbaa !13
  %47 = fpext float %46 to double
  %48 = fcmp une double %47, 0.000000e+00
  br i1 %48, label %49, label %61

49:                                               ; preds = %37
  %50 = load i32, ptr %13, align 4, !tbaa !9
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %58, label %52

52:                                               ; preds = %49
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %53 unwind label %54

53:                                               ; preds = %52
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %58

54:                                               ; preds = %52
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %15, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %80

58:                                               ; preds = %53, %49
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %10, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %58, %37
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %14, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %14, align 4, !tbaa !9
  br label %32, !llvm.loop !15

65:                                               ; preds = %36
  %66 = load i32, ptr %13, align 4, !tbaa !9
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %76, label %68

68:                                               ; preds = %65
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %69 unwind label %72

69:                                               ; preds = %68
  %70 = load i32, ptr %10, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %10, align 4, !tbaa !9
  br label %76

72:                                               ; preds = %68
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %15, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %16, align 4
  br label %80

76:                                               ; preds = %69, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %11, align 4, !tbaa !9
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %11, align 4, !tbaa !9
  br label %26, !llvm.loop !17

80:                                               ; preds = %72, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %87

81:                                               ; preds = %30
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %82 unwind label %83

82:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %151

83:                                               ; preds = %81
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %15, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %16, align 4
  br label %87

87:                                               ; preds = %83, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %183

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

89:                                               ; preds = %140, %88
  %90 = load i32, ptr %18, align 4, !tbaa !9
  %91 = load i32, ptr %7, align 4, !tbaa !9
  %92 = icmp ult i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %144

94:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %125, %94
  %96 = load i32, ptr %20, align 4, !tbaa !9
  %97 = load i32, ptr %6, align 4, !tbaa !9
  %98 = icmp ult i32 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %128

100:                                              ; preds = %95
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = load i32, ptr %20, align 4, !tbaa !9
  %103 = load i32, ptr %7, align 4, !tbaa !9
  %104 = mul i32 %102, %103
  %105 = load i32, ptr %18, align 4, !tbaa !9
  %106 = add i32 %104, %105
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds float, ptr %101, i64 %107
  %109 = load float, ptr %108, align 4, !tbaa !13
  %110 = fpext float %109 to double
  %111 = fcmp une double %110, 0.000000e+00
  br i1 %111, label %112, label %124

112:                                              ; preds = %100
  %113 = load i32, ptr %19, align 4, !tbaa !9
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %121, label %115

115:                                              ; preds = %112
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %116 unwind label %117

116:                                              ; preds = %115
  store i32 1, ptr %19, align 4, !tbaa !9
  br label %121

117:                                              ; preds = %115
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %15, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %143

121:                                              ; preds = %116, %112
  %122 = load i32, ptr %17, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %17, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %121, %100
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %20, align 4, !tbaa !9
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %20, align 4, !tbaa !9
  br label %95, !llvm.loop !18

128:                                              ; preds = %99
  %129 = load i32, ptr %19, align 4, !tbaa !9
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %139, label %131

131:                                              ; preds = %128
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %132 unwind label %135

132:                                              ; preds = %131
  %133 = load i32, ptr %17, align 4, !tbaa !9
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %17, align 4, !tbaa !9
  br label %139

135:                                              ; preds = %131
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %15, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %16, align 4
  br label %143

139:                                              ; preds = %132, %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %18, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %18, align 4, !tbaa !9
  br label %89, !llvm.loop !19

143:                                              ; preds = %135, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %150

144:                                              ; preds = %93
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %145 unwind label %146

145:                                              ; preds = %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %151

146:                                              ; preds = %144
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %15, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %16, align 4
  br label %150

150:                                              ; preds = %146, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %183

151:                                              ; preds = %145, %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %152 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %153 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %152, i64 4)
  %154 = extractvalue { i64, i1 } %153, 1
  %155 = extractvalue { i64, i1 } %153, 0
  %156 = select i1 %154, i64 -1, i64 %155
  %157 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %156) #6
          to label %158 unwind label %165

158:                                              ; preds = %151
  store ptr %157, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %159

159:                                              ; preds = %178, %158
  %160 = load i32, ptr %22, align 4, !tbaa !9
  %161 = sext i32 %160 to i64
  %162 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %163 = icmp ult i64 %161, %162
  br i1 %163, label %169, label %164

164:                                              ; preds = %159
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %181

165:                                              ; preds = %151
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %15, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %183

169:                                              ; preds = %159
  %170 = load i32, ptr %22, align 4, !tbaa !9
  %171 = sext i32 %170 to i64
  %172 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %171) #5
  %173 = load i32, ptr %172, align 4, !tbaa !9
  %174 = load ptr, ptr %21, align 8, !tbaa !5
  %175 = load i32, ptr %22, align 4, !tbaa !9
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds i32, ptr %174, i64 %176
  store i32 %173, ptr %177, align 4, !tbaa !9
  br label %178

178:                                              ; preds = %169
  %179 = load i32, ptr %22, align 4, !tbaa !9
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %22, align 4, !tbaa !9
  br label %159, !llvm.loop !20

181:                                              ; preds = %164
  %182 = load ptr, ptr %21, align 8, !tbaa !5
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  ret ptr %182

183:                                              ; preds = %165, %150, %87
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  br label %184

184:                                              ; preds = %183
  %185 = load ptr, ptr %15, align 8
  %186 = load i32, ptr %16, align 4
  %187 = insertvalue { ptr, i32 } poison, ptr %185, 0
  %188 = insertvalue { ptr, i32 } %187, i32 %186, 1
  resume { ptr, i32 } %188
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 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 = { nounwind }
attributes #6 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS15GENERATION_TYPE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}


; 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.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = 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 }

; 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noalias noundef nonnull ptr @_Z29generateMajorPointerFromDensePfjj15GENERATION_TYPE(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::vector.3", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #4
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %8 = icmp eq i32 %3, 0
  br i1 %8, label %9, label %41

9:                                                ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  %.not85 = icmp eq i32 %1, 0
  br i1 %.not85, label %._crit_edge74, label %.preheader60.lr.ph

.preheader60.lr.ph:                               ; preds = %9
  %.not86 = icmp eq i32 %2, 0
  br i1 %.not86, label %.preheader60, label %.preheader60.us.preheader

.preheader60.us.preheader:                        ; preds = %.preheader60.lr.ph
  %wide.trip.count96 = zext i32 %2 to i64
  br label %.preheader60.us

.preheader60.us:                                  ; preds = %.preheader60.us.preheader, %._crit_edge.us75.thread
  %10 = phi i32 [ %16, %._crit_edge.us75.thread ], [ 0, %.preheader60.us.preheader ]
  %.03273.us = phi i32 [ %17, %._crit_edge.us75.thread ], [ 0, %.preheader60.us.preheader ]
  %11 = mul i32 %.03273.us, %2
  br label %.outer

.outer:                                           ; preds = %.thread, %.preheader60.us
  %.ph = phi i32 [ %29, %.thread ], [ %10, %.preheader60.us ]
  %indvars.iv93.ph = phi i64 [ %indvars.iv.next94107, %.thread ], [ 0, %.preheader60.us ]
  %.not54.us = phi i1 [ false, %.thread ], [ true, %.preheader60.us ]
  br label %18

12:                                               ; preds = %._crit_edge.us75
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %13 unwind label %.split78.us

13:                                               ; preds = %12
  %14 = load i32, ptr %6, align 4, !tbaa !5
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr %6, align 4, !tbaa !5
  br label %._crit_edge.us75.thread

._crit_edge.us75.thread:                          ; preds = %.thread, %13, %._crit_edge.us75
  %16 = phi i32 [ %15, %13 ], [ %.ph, %._crit_edge.us75 ], [ %29, %.thread ]
  %17 = add nuw i32 %.03273.us, 1
  %exitcond98.not = icmp eq i32 %17, %1
  br i1 %exitcond98.not, label %._crit_edge74, label %.preheader60.us, !llvm.loop !9

18:                                               ; preds = %.outer, %27
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %27 ], [ %indvars.iv93.ph, %.outer ]
  %19 = trunc nuw nsw i64 %indvars.iv93 to i32
  %20 = add i32 %11, %19
  %21 = zext i32 %20 to i64
  %22 = getelementptr inbounds float, ptr %0, i64 %21
  %23 = load float, ptr %22, align 4, !tbaa !11
  %24 = fcmp une float %23, 0.000000e+00
  br i1 %24, label %25, label %27

25:                                               ; preds = %18
  br i1 %.not54.us, label %26, label %.thread

26:                                               ; preds = %25
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %._crit_edge104 unwind label %.split81.us

._crit_edge104:                                   ; preds = %26
  %.pre105 = load i32, ptr %6, align 4, !tbaa !5
  br label %.thread

27:                                               ; preds = %18
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count96
  br i1 %exitcond97.not, label %._crit_edge.us75, label %18, !llvm.loop !13

.thread:                                          ; preds = %25, %._crit_edge104
  %28 = phi i32 [ %.pre105, %._crit_edge104 ], [ %.ph, %25 ]
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %6, align 4, !tbaa !5
  %indvars.iv.next94107 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond97.not108 = icmp eq i64 %indvars.iv.next94107, %wide.trip.count96
  br i1 %exitcond97.not108, label %._crit_edge.us75.thread, label %.outer, !llvm.loop !13

._crit_edge.us75:                                 ; preds = %27
  br i1 %.not54.us, label %12, label %._crit_edge.us75.thread

.split78.us:                                      ; preds = %12
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %40

.split81.us:                                      ; preds = %26
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %40

.preheader60:                                     ; preds = %.preheader60.lr.ph, %32
  %.03273 = phi i32 [ %35, %32 ], [ 0, %.preheader60.lr.ph ]
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %32 unwind label %.split78

._crit_edge74:                                    ; preds = %._crit_edge.us75.thread, %32, %9
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %37 unwind label %38

32:                                               ; preds = %.preheader60
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %6, align 4, !tbaa !5
  %35 = add nuw i32 %.03273, 1
  %exitcond99.not = icmp eq i32 %35, %1
  br i1 %exitcond99.not, label %._crit_edge74, label %.preheader60, !llvm.loop !9

.split78:                                         ; preds = %.preheader60
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %40

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

38:                                               ; preds = %._crit_edge74
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %40

40:                                               ; preds = %.split78, %.split78.us, %.split81.us, %38
  %.pn56.pn = phi { ptr, i32 } [ %39, %38 ], [ %31, %.split81.us ], [ %36, %.split78 ], [ %30, %.split78.us ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  br label %87

41:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %._crit_edge67, label %.preheader61.lr.ph

.preheader61.lr.ph:                               ; preds = %41
  %.not84 = icmp eq i32 %1, 0
  br i1 %.not84, label %.preheader61, label %.preheader61.us.preheader

.preheader61.us.preheader:                        ; preds = %.preheader61.lr.ph
  %wide.trip.count = zext i32 %1 to i64
  br label %.preheader61.us

.preheader61.us:                                  ; preds = %.preheader61.us.preheader, %._crit_edge.us.thread
  %42 = phi i32 [ %47, %._crit_edge.us.thread ], [ 0, %.preheader61.us.preheader ]
  %.03566.us = phi i32 [ %48, %._crit_edge.us.thread ], [ 0, %.preheader61.us.preheader ]
  br label %.outer120

.outer120:                                        ; preds = %.thread112, %.preheader61.us
  %.ph121 = phi i32 [ %61, %.thread112 ], [ %42, %.preheader61.us ]
  %indvars.iv.ph = phi i64 [ %indvars.iv.next114, %.thread112 ], [ 0, %.preheader61.us ]
  %.not.us = phi i1 [ false, %.thread112 ], [ true, %.preheader61.us ]
  br label %49

43:                                               ; preds = %._crit_edge.us
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %44 unwind label %.split.us

44:                                               ; preds = %43
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %7, align 4, !tbaa !5
  br label %._crit_edge.us.thread

._crit_edge.us.thread:                            ; preds = %.thread112, %44, %._crit_edge.us
  %47 = phi i32 [ %46, %44 ], [ %.ph121, %._crit_edge.us ], [ %61, %.thread112 ]
  %48 = add nuw i32 %.03566.us, 1
  %exitcond91.not = icmp eq i32 %48, %2
  br i1 %exitcond91.not, label %._crit_edge67, label %.preheader61.us, !llvm.loop !14

49:                                               ; preds = %.outer120, %59
  %indvars.iv = phi i64 [ %indvars.iv.next, %59 ], [ %indvars.iv.ph, %.outer120 ]
  %50 = trunc nuw nsw i64 %indvars.iv to i32
  %51 = mul i32 %50, %2
  %52 = add i32 %51, %.03566.us
  %53 = zext i32 %52 to i64
  %54 = getelementptr inbounds float, ptr %0, i64 %53
  %55 = load float, ptr %54, align 4, !tbaa !11
  %56 = fcmp une float %55, 0.000000e+00
  br i1 %56, label %57, label %59

57:                                               ; preds = %49
  br i1 %.not.us, label %58, label %.thread112

58:                                               ; preds = %57
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %._crit_edge103 unwind label %.split69.us

._crit_edge103:                                   ; preds = %58
  %.pre = load i32, ptr %7, align 4, !tbaa !5
  br label %.thread112

59:                                               ; preds = %49
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %49, !llvm.loop !15

.thread112:                                       ; preds = %57, %._crit_edge103
  %60 = phi i32 [ %.pre, %._crit_edge103 ], [ %.ph121, %57 ]
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %7, align 4, !tbaa !5
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not115 = icmp eq i64 %indvars.iv.next114, %wide.trip.count
  br i1 %exitcond.not115, label %._crit_edge.us.thread, label %.outer120, !llvm.loop !15

._crit_edge.us:                                   ; preds = %59
  br i1 %.not.us, label %43, label %._crit_edge.us.thread

.split.us:                                        ; preds = %43
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %72

.split69.us:                                      ; preds = %58
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %72

.preheader61:                                     ; preds = %.preheader61.lr.ph, %64
  %.03566 = phi i32 [ %67, %64 ], [ 0, %.preheader61.lr.ph ]
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %64 unwind label %.split

._crit_edge67:                                    ; preds = %._crit_edge.us.thread, %64, %41
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %69 unwind label %70

64:                                               ; preds = %.preheader61
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %7, align 4, !tbaa !5
  %67 = add nuw i32 %.03566, 1
  %exitcond92.not = icmp eq i32 %67, %2
  br i1 %exitcond92.not, label %._crit_edge67, label %.preheader61, !llvm.loop !14

.split:                                           ; preds = %.preheader61
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %72

69:                                               ; preds = %._crit_edge67
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br label %73

70:                                               ; preds = %._crit_edge67
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %72

72:                                               ; preds = %.split, %.split.us, %.split69.us, %70
  %.pn.pn = phi { ptr, i32 } [ %71, %70 ], [ %63, %.split69.us ], [ %68, %.split ], [ %62, %.split.us ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br label %87

73:                                               ; preds = %69, %37
  %74 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %75 = icmp ugt i64 %74, 4611686018427387903
  %76 = shl nuw i64 %74, 2
  %77 = select i1 %75, i64 -1, i64 %76
  %78 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %77) #5
          to label %.preheader unwind label %80

.preheader:                                       ; preds = %73
  %79 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %.not87 = icmp eq i64 %79, 0
  br i1 %.not87, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  ret ptr %78

80:                                               ; preds = %73
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %87

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %.lr.ph ], [ 0, %.preheader ]
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv100) #4
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = getelementptr inbounds i32, ptr %78, i64 %indvars.iv100
  store i32 %83, ptr %84, align 4, !tbaa !5
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %85 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %86 = icmp ugt i64 %85, %indvars.iv.next101
  br i1 %86, label %.lr.ph, label %._crit_edge, !llvm.loop !16

87:                                               ; preds = %80, %72, %40
  %.pn56.pn.pn = phi { ptr, i32 } [ %.pn56.pn, %40 ], [ %81, %80 ], [ %.pn.pn, %72 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  resume { ptr, i32 } %.pn56.pn.pn
}

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


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