; LLVM IR from EdoPro98/SimSiPM :: src/SiPMSensor.ll (ZN4sipm10SiPMSensor11signalShapeEv)

; 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.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.10" = type { i8 }
%"class.__gnu_cxx::__normal_iterator.16" = type { ptr }
%"class.sipm::SiPMSensor" = type { %"class.sipm::SiPMProperties", [56 x i8], %"class.sipm::SiPMRandom", i32, i32, i32, i32, i32, i32, %"class.std::vector", %"class.std::vector", %"class.std::vector.3", %"class.std::vector.8", %"class.sipm::SiPMAnalogSignal", [40 x i8] }
%"class.sipm::SiPMProperties" = type <{ double, double, i32, i32, i32, [4 x i8], double, double, i32, [4 x i8], double, double, double, double, double, double, double, double, double, double, double, double, double, float, [4 x i8], double, float, [4 x i8], double, double, %"class.std::map", i32, i8, i8, i8, i8, i8, [7 x i8] }>
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<double, std::pair<const double, double>, std::_Select1st<std::pair<const double, double>>, std::less<double>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<double, std::pair<const double, double>, std::_Select1st<std::pair<const double, double>>, std::less<double>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.sipm::SiPMRandom" = type { %"class.sipm::SiPMRng::Xorshift256plus" }
%"class.sipm::SiPMRng::Xorshift256plus" = type <{ [4 x i64], [32 x i8], [65536 x i64], i32, [60 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<sipm::SiPMHit *, std::allocator<sipm::SiPMHit *>>::_Vector_impl" }
%"struct.std::_Vector_base<sipm::SiPMHit *, std::allocator<sipm::SiPMHit *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sipm::SiPMHit *, std::allocator<sipm::SiPMHit *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sipm::SiPMHit *, std::allocator<sipm::SiPMHit *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.sipm::SiPMAnalogSignal" = type { %"class.std::vector.8", double }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sipm10SiPMSensor11signalShapeEv(ptr noundef nonnull align 64 dereferenceable(524888) %0) #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca %"class.std::vector.8", align 8
  %9 = alloca float, align 4
  %10 = alloca %"class.std::allocator.10", align 1
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca float, align 4
  %18 = alloca %"class.__gnu_cxx::__normal_iterator.16", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator.16", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator.16", align 8
  %21 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %22 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %23 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 0
  %24 = call noundef i32 @_ZNK4sipm14SiPMProperties13nSignalPointsEv(ptr noundef nonnull align 8 dereferenceable(257) %23)
  store i32 %24, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %25 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 0
  %26 = call noundef double @_ZNK4sipm14SiPMProperties8samplingEv(ptr noundef nonnull align 8 dereferenceable(257) %25)
  %27 = fptrunc double %26 to float
  store float %27, ptr %4, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %28 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 0
  %29 = call noundef double @_ZNK4sipm14SiPMProperties10risingTimeEv(ptr noundef nonnull align 8 dereferenceable(257) %28)
  %30 = load float, ptr %4, align 4, !tbaa !11
  %31 = fpext float %30 to double
  %32 = fdiv double %29, %31
  %33 = fptrunc double %32 to float
  store float %33, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %34 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 0
  %35 = call noundef double @_ZNK4sipm14SiPMProperties15fallingTimeFastEv(ptr noundef nonnull align 8 dereferenceable(257) %34)
  %36 = load float, ptr %4, align 4, !tbaa !11
  %37 = fpext float %36 to double
  %38 = fdiv double %35, %37
  %39 = fptrunc double %38 to float
  store float %39, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %40 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 0
  %41 = call noundef double @_ZNK4sipm14SiPMProperties4gainEv(ptr noundef nonnull align 8 dereferenceable(257) %40)
  %42 = fptrunc double %41 to float
  store float %42, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #6
  %43 = load i32, ptr %3, align 4, !tbaa !9
  %44 = zext i32 %43 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store float 0.000000e+00, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  call void @_ZNSaIfEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  invoke void @_ZNSt6vectorIfSaIfEEC2EmRKfRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %44, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %45 unwind label %65

45:                                               ; preds = %1
  %46 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 12
  %47 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIfSaIfEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %46, ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @_ZNSt15__new_allocatorIfED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  %48 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 0
  %49 = call noundef zeroext i1 @_ZNK4sipm14SiPMProperties16hasSlowComponentEv(ptr noundef nonnull align 8 dereferenceable(257) %48)
  br i1 %49, label %50, label %108

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %51 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 0
  %52 = call noundef double @_ZNK4sipm14SiPMProperties15fallingTimeSlowEv(ptr noundef nonnull align 8 dereferenceable(257) %51)
  %53 = load float, ptr %4, align 4, !tbaa !11
  %54 = fpext float %53 to double
  %55 = fdiv double %52, %54
  %56 = fptrunc double %55 to float
  store float %56, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %57 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 0
  %58 = call noundef double @_ZNK4sipm14SiPMProperties21slowComponentFractionEv(ptr noundef nonnull align 8 dereferenceable(257) %57)
  %59 = fptrunc double %58 to float
  store float %59, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %104, %50
  %61 = load i32, ptr %15, align 4, !tbaa !9
  %62 = load i32, ptr %3, align 4, !tbaa !9
  %63 = icmp ult i32 %61, %62
  br i1 %63, label %69, label %64

64:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %107

65:                                               ; preds = %1
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %11, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %12, align 4
  call void @_ZNSt15__new_allocatorIfED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %177

69:                                               ; preds = %60
  %70 = load float, ptr %14, align 4, !tbaa !11
  %71 = fsub float 1.000000e+00, %70
  %72 = fpext float %71 to double
  %73 = load i32, ptr %15, align 4, !tbaa !9
  %74 = uitofp i32 %73 to float
  %75 = fneg float %74
  %76 = load float, ptr %6, align 4, !tbaa !11
  %77 = fdiv float %75, %76
  %78 = fpext float %77 to double
  %79 = call double @exp(double noundef %78) #6
  %80 = load float, ptr %14, align 4, !tbaa !11
  %81 = fpext float %80 to double
  %82 = load i32, ptr %15, align 4, !tbaa !9
  %83 = uitofp i32 %82 to float
  %84 = fneg float %83
  %85 = load float, ptr %13, align 4, !tbaa !11
  %86 = fdiv float %84, %85
  %87 = fpext float %86 to double
  %88 = call double @exp(double noundef %87) #6
  %89 = fmul double %81, %88
  %90 = call double @llvm.fmuladd.f64(double %72, double %79, double %89)
  %91 = load i32, ptr %15, align 4, !tbaa !9
  %92 = uitofp i32 %91 to float
  %93 = fneg float %92
  %94 = load float, ptr %5, align 4, !tbaa !11
  %95 = fdiv float %93, %94
  %96 = fpext float %95 to double
  %97 = call double @exp(double noundef %96) #6
  %98 = fsub double %90, %97
  %99 = fptrunc double %98 to float
  %100 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 12
  %101 = load i32, ptr %15, align 4, !tbaa !9
  %102 = zext i32 %101 to i64
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %100, i64 noundef %102) #6
  store float %99, ptr %103, align 4, !tbaa !11
  br label %104

104:                                              ; preds = %69
  %105 = load i32, ptr %15, align 4, !tbaa !9
  %106 = add i32 %105, 1
  store i32 %106, ptr %15, align 4, !tbaa !9
  br label %60, !llvm.loop !13

107:                                              ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %139

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

109:                                              ; preds = %135, %108
  %110 = load i32, ptr %16, align 4, !tbaa !9
  %111 = load i32, ptr %3, align 4, !tbaa !9
  %112 = icmp ult i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %138

114:                                              ; preds = %109
  %115 = load i32, ptr %16, align 4, !tbaa !9
  %116 = uitofp i32 %115 to float
  %117 = fneg float %116
  %118 = load float, ptr %6, align 4, !tbaa !11
  %119 = fdiv float %117, %118
  %120 = fpext float %119 to double
  %121 = call double @exp(double noundef %120) #6
  %122 = load i32, ptr %16, align 4, !tbaa !9
  %123 = uitofp i32 %122 to float
  %124 = fneg float %123
  %125 = load float, ptr %5, align 4, !tbaa !11
  %126 = fdiv float %124, %125
  %127 = fpext float %126 to double
  %128 = call double @exp(double noundef %127) #6
  %129 = fsub double %121, %128
  %130 = fptrunc double %129 to float
  %131 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 12
  %132 = load i32, ptr %16, align 4, !tbaa !9
  %133 = zext i32 %132 to i64
  %134 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %131, i64 noundef %133) #6
  store float %130, ptr %134, align 4, !tbaa !11
  br label %135

135:                                              ; preds = %114
  %136 = load i32, ptr %16, align 4, !tbaa !9
  %137 = add i32 %136, 1
  store i32 %137, ptr %16, align 4, !tbaa !9
  br label %109, !llvm.loop !15

138:                                              ; preds = %113
  br label %139

139:                                              ; preds = %138, %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %140 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 12
  %141 = call ptr @_ZNSt6vectorIfSaIfEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %140) #6
  %142 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.16", ptr %19, i32 0, i32 0
  store ptr %141, ptr %142, align 8
  %143 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 12
  %144 = call ptr @_ZNSt6vectorIfSaIfEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %143) #6
  %145 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.16", ptr %20, i32 0, i32 0
  store ptr %144, ptr %145, align 8
  %146 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.16", ptr %19, i32 0, i32 0
  %147 = load ptr, ptr %146, align 8
  %148 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.16", ptr %20, i32 0, i32 0
  %149 = load ptr, ptr %148, align 8
  %150 = call ptr @_ZSt11max_elementIN9__gnu_cxx17__normal_iteratorIPfSt6vectorIfSaIfEEEEET_S7_S7_(ptr %147, ptr %149)
  %151 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.16", ptr %18, i32 0, i32 0
  store ptr %150, ptr %151, align 8
  %152 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPfSt6vectorIfSaIfEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  %153 = load float, ptr %152, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  store float %153, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %154

154:                                              ; preds = %173, %139
  %155 = load i32, ptr %21, align 4, !tbaa !9
  %156 = load i32, ptr %3, align 4, !tbaa !9
  %157 = icmp ult i32 %155, %156
  br i1 %157, label %159, label %158

158:                                              ; preds = %154
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %176

159:                                              ; preds = %154
  %160 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 12
  %161 = load i32, ptr %21, align 4, !tbaa !9
  %162 = zext i32 %161 to i64
  %163 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %160, i64 noundef %162) #6
  %164 = load float, ptr %163, align 4, !tbaa !11
  %165 = load float, ptr %17, align 4, !tbaa !11
  %166 = fdiv float %164, %165
  %167 = load float, ptr %7, align 4, !tbaa !11
  %168 = fmul float %166, %167
  %169 = getelementptr inbounds %"class.sipm::SiPMSensor", ptr %22, i32 0, i32 12
  %170 = load i32, ptr %21, align 4, !tbaa !9
  %171 = zext i32 %170 to i64
  %172 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %169, i64 noundef %171) #6
  store float %168, ptr %172, align 4, !tbaa !11
  br label %173

173:                                              ; preds = %159
  %174 = load i32, ptr %21, align 4, !tbaa !9
  %175 = add i32 %174, 1
  store i32 %175, ptr %21, align 4, !tbaa !9
  br label %154, !llvm.loop !16

176:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret void

177:                                              ; preds = %65
  %178 = load ptr, ptr %11, align 8
  %179 = load i32, ptr %12, align 4
  %180 = insertvalue { ptr, i32 } poison, ptr %178, 0
  %181 = insertvalue { ptr, i32 } %180, i32 %179, 1
  resume { ptr, i32 } %181
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4sipm14SiPMProperties13nSignalPointsEv(ptr noundef nonnull align 8 dereferenceable(257)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4sipm14SiPMProperties8samplingEv(ptr noundef nonnull align 8 dereferenceable(257)) #1 align 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 nounwind uwtable
declare dso_local noundef double @_ZNK4sipm14SiPMProperties10risingTimeEv(ptr noundef nonnull align 8 dereferenceable(257)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4sipm14SiPMProperties15fallingTimeFastEv(ptr noundef nonnull align 8 dereferenceable(257)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4sipm14SiPMProperties4gainEv(ptr noundef nonnull align 8 dereferenceable(257)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIfSaIfEEC2EmRKfRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4sipm14SiPMProperties16hasSlowComponentEv(ptr noundef nonnull align 8 dereferenceable(257)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4sipm14SiPMProperties15fallingTimeSlowEv(ptr noundef nonnull align 8 dereferenceable(257)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4sipm14SiPMProperties21slowComponentFractionEv(ptr noundef nonnull align 8 dereferenceable(257)) #1 align 2

; Function Attrs: nounwind
declare double @exp(double noundef) #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt11max_elementIN9__gnu_cxx17__normal_iteratorIPfSt6vectorIfSaIfEEEEET_S7_S7_(ptr, ptr) #5

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

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

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

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

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

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


; 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.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.10" = type { i8 }
%"class.__gnu_cxx::__normal_iterator.16" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sipm10SiPMSensor11signalShapeEv(ptr noundef nonnull align 64 dereferenceable(524888) %0) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::vector.8", align 8
  %3 = alloca float, align 4
  %4 = alloca %"class.std::allocator.10", align 1
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.16", align 8
  %6 = tail call noundef i32 @_ZNK4sipm14SiPMProperties13nSignalPointsEv(ptr noundef nonnull align 8 dereferenceable(257) %0)
  %7 = tail call noundef double @_ZNK4sipm14SiPMProperties8samplingEv(ptr noundef nonnull align 8 dereferenceable(257) %0)
  %8 = fptrunc double %7 to float
  %9 = tail call noundef double @_ZNK4sipm14SiPMProperties10risingTimeEv(ptr noundef nonnull align 8 dereferenceable(257) %0)
  %10 = fpext float %8 to double
  %11 = fdiv double %9, %10
  %12 = fptrunc double %11 to float
  %13 = tail call noundef double @_ZNK4sipm14SiPMProperties15fallingTimeFastEv(ptr noundef nonnull align 8 dereferenceable(257) %0)
  %14 = fdiv double %13, %10
  %15 = fptrunc double %14 to float
  %16 = tail call noundef double @_ZNK4sipm14SiPMProperties4gainEv(ptr noundef nonnull align 8 dereferenceable(257) %0)
  %17 = fptrunc double %16 to float
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  %18 = zext i32 %6 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store float 0.000000e+00, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZNSaIfEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorIfSaIfEEC2EmRKfRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %18, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %19 unwind label %32

19:                                               ; preds = %1
  %20 = getelementptr inbounds i8, ptr %0, i64 524832
  %21 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIfSaIfEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @_ZNSt15__new_allocatorIfED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  %22 = call noundef zeroext i1 @_ZNK4sipm14SiPMProperties16hasSlowComponentEv(ptr noundef nonnull align 8 dereferenceable(257) %0)
  br i1 %22, label %23, label %.preheader

.preheader:                                       ; preds = %19
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %.loopexit, label %.lr.ph

23:                                               ; preds = %19
  %24 = call noundef double @_ZNK4sipm14SiPMProperties15fallingTimeSlowEv(ptr noundef nonnull align 8 dereferenceable(257) %0)
  %25 = fdiv double %24, %10
  %26 = fptrunc double %25 to float
  %27 = call noundef double @_ZNK4sipm14SiPMProperties21slowComponentFractionEv(ptr noundef nonnull align 8 dereferenceable(257) %0)
  %.not42 = icmp eq i32 %6, 0
  br i1 %.not42, label %.loopexit, label %.lr.ph39

.lr.ph39:                                         ; preds = %23
  %28 = fptrunc double %27 to float
  %29 = fsub float 1.000000e+00, %28
  %30 = fpext float %29 to double
  %31 = fpext float %28 to double
  br label %34

32:                                               ; preds = %1
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIfED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  resume { ptr, i32 } %33

34:                                               ; preds = %.lr.ph39, %34
  %indvars.iv46 = phi i64 [ 0, %.lr.ph39 ], [ %indvars.iv.next47, %34 ]
  %35 = trunc nuw i64 %indvars.iv46 to i32
  %36 = uitofp i32 %35 to float
  %37 = fneg float %36
  %38 = fdiv float %37, %15
  %39 = fpext float %38 to double
  %40 = call double @exp(double noundef %39) #6
  %41 = fdiv float %37, %26
  %42 = fpext float %41 to double
  %43 = call double @exp(double noundef %42) #6
  %44 = fmul double %43, %31
  %45 = call double @llvm.fmuladd.f64(double %30, double %40, double %44)
  %46 = fdiv float %37, %12
  %47 = fpext float %46 to double
  %48 = call double @exp(double noundef %47) #6
  %49 = fsub double %45, %48
  %50 = fptrunc double %49 to float
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %indvars.iv46) #6
  store float %50, ptr %51, align 4, !tbaa !5
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %exitcond50.not = icmp eq i64 %indvars.iv.next47, %18
  br i1 %exitcond50.not, label %.loopexit, label %34, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  %52 = trunc nuw i64 %indvars.iv to i32
  %53 = uitofp i32 %52 to float
  %54 = fneg float %53
  %55 = fdiv float %54, %15
  %56 = fpext float %55 to double
  %57 = call double @exp(double noundef %56) #6
  %58 = fdiv float %54, %12
  %59 = fpext float %58 to double
  %60 = call double @exp(double noundef %59) #6
  %61 = fsub double %57, %60
  %62 = fptrunc double %61 to float
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %indvars.iv) #6
  store float %62, ptr %63, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %18
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !11

.loopexit:                                        ; preds = %.lr.ph, %34, %.preheader, %23
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %64 = call ptr @_ZNSt6vectorIfSaIfEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  %65 = call ptr @_ZNSt6vectorIfSaIfEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  %66 = call ptr @_ZSt11max_elementIN9__gnu_cxx17__normal_iteratorIPfSt6vectorIfSaIfEEEEET_S7_S7_(ptr %64, ptr %65)
  store ptr %66, ptr %5, align 8
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPfSt6vectorIfSaIfEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %68 = load float, ptr %67, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %.not43 = icmp eq i32 %6, 0
  br i1 %.not43, label %._crit_edge, label %.lr.ph41

._crit_edge:                                      ; preds = %.lr.ph41, %.loopexit
  ret void

.lr.ph41:                                         ; preds = %.loopexit, %.lr.ph41
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %.lr.ph41 ], [ 0, %.loopexit ]
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %indvars.iv51) #6
  %70 = load float, ptr %69, align 4, !tbaa !5
  %71 = fdiv float %70, %68
  %72 = fmul float %71, %17
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %indvars.iv51) #6
  store float %72, ptr %73, align 4, !tbaa !5
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %exitcond55.not = icmp eq i64 %indvars.iv.next52, %18
  br i1 %exitcond55.not, label %._crit_edge, label %.lr.ph41, !llvm.loop !12
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4sipm14SiPMProperties13nSignalPointsEv(ptr noundef nonnull align 8 dereferenceable(257)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4sipm14SiPMProperties8samplingEv(ptr noundef nonnull align 8 dereferenceable(257)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4sipm14SiPMProperties10risingTimeEv(ptr noundef nonnull align 8 dereferenceable(257)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4sipm14SiPMProperties15fallingTimeFastEv(ptr noundef nonnull align 8 dereferenceable(257)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4sipm14SiPMProperties4gainEv(ptr noundef nonnull align 8 dereferenceable(257)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIfSaIfEEC2EmRKfRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4sipm14SiPMProperties16hasSlowComponentEv(ptr noundef nonnull align 8 dereferenceable(257)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4sipm14SiPMProperties15fallingTimeSlowEv(ptr noundef nonnull align 8 dereferenceable(257)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4sipm14SiPMProperties21slowComponentFractionEv(ptr noundef nonnull align 8 dereferenceable(257)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @exp(double noundef) local_unnamed_addr #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt11max_elementIN9__gnu_cxx17__normal_iteratorIPfSt6vectorIfSaIfEEEEET_S7_S7_(ptr, ptr) local_unnamed_addr #5

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

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

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

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


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