; LLVM IR from mickypaganini/SSI2016-jet-clustering :: spartyjet-4.0.2_mac/ExternalTools (DetectorModel)

; 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.DetectorModel::RadialGaussShape" = type { %"class.DetectorModel::RadialShape", double, double, double }
%"class.DetectorModel::RadialShape" = type { ptr, double }

@_ZTVN13DetectorModel16RadialGaussShapeE = external dso_local unnamed_addr constant { [9 x ptr] }, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN13DetectorModel11RadialShapeC2Ed(ptr noundef nonnull align 8 dereferenceable(16), double noundef) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13DetectorModel16RadialGaussShapeC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = getelementptr inbounds ptr, ptr %9, i64 5
  %11 = load ptr, ptr %10, align 8
  %12 = call noundef double %11(ptr noundef nonnull align 8 dereferenceable(16) %8)
  call void @_ZN13DetectorModel11RadialShapeC2Ed(ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef %12)
  store ptr getelementptr inbounds inrange(-16, 56) ({ [9 x ptr] }, ptr @_ZTVN13DetectorModel16RadialGaussShapeE, i32 0, i32 0, i32 2), ptr %7, align 8, !tbaa !9
  %13 = getelementptr inbounds %"class.DetectorModel::RadialGaussShape", ptr %7, i32 0, i32 1
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %"class.DetectorModel::RadialGaussShape", ptr %14, i32 0, i32 1
  %16 = load double, ptr %15, align 8, !tbaa !11
  store double %16, ptr %13, align 8, !tbaa !11
  %17 = getelementptr inbounds %"class.DetectorModel::RadialGaussShape", ptr %7, i32 0, i32 2
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.DetectorModel::RadialGaussShape", ptr %18, i32 0, i32 2
  %20 = load double, ptr %19, align 8, !tbaa !15
  store double %20, ptr %17, align 8, !tbaa !15
  %21 = getelementptr inbounds %"class.DetectorModel::RadialGaussShape", ptr %7, i32 0, i32 3
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %"class.DetectorModel::RadialGaussShape", ptr %22, i32 0, i32 3
  %24 = load double, ptr %23, align 8, !tbaa !16
  store double %24, ptr %21, align 8, !tbaa !16
  invoke void @_ZN13DetectorModel16RadialGaussShape13setParametersEv(ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %25 unwind label %26

25:                                               ; preds = %2
  ret void

26:                                               ; preds = %2
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %5, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %6, align 4
  call void @_ZN13DetectorModel11RadialShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #2
  br label %30

30:                                               ; preds = %26
  %31 = load ptr, ptr %5, align 8
  %32 = load i32, ptr %6, align 4
  %33 = insertvalue { ptr, i32 } poison, ptr %31, 0
  %34 = insertvalue { ptr, i32 } %33, i32 %32, 1
  resume { ptr, i32 } %34
}

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !14, i64 16}
!12 = !{!"_ZTSN13DetectorModel16RadialGaussShapeE", !13, i64 0, !14, i64 16, !14, i64 24, !14, i64 32}
!13 = !{!"_ZTSN13DetectorModel11RadialShapeE", !14, i64 8}
!14 = !{!"double", !7, i64 0}
!15 = !{!12, !14, i64 24}
!16 = !{!12, !14, i64 32}


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

@_ZTVN13DetectorModel16RadialGaussShapeE = external dso_local unnamed_addr constant { [9 x ptr] }, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN13DetectorModel11RadialShapeC2Ed(ptr noundef nonnull align 8 dereferenceable(16), double noundef) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13DetectorModel16RadialGaussShapeC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = load ptr, ptr %1, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 40
  %5 = load ptr, ptr %4, align 8
  %6 = tail call noundef double %5(ptr noundef nonnull align 8 dereferenceable(16) %1)
  tail call void @_ZN13DetectorModel11RadialShapeC2Ed(ptr noundef nonnull align 8 dereferenceable(16) %0, double noundef %6)
  store ptr getelementptr inbounds inrange(-16, 56) (i8, ptr @_ZTVN13DetectorModel16RadialGaussShapeE, i64 16), ptr %0, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = getelementptr inbounds i8, ptr %1, i64 16
  %9 = load <2 x double>, ptr %8, align 8, !tbaa !8
  store <2 x double> %9, ptr %7, align 8, !tbaa !8
  %10 = getelementptr inbounds i8, ptr %0, i64 32
  %11 = getelementptr inbounds i8, ptr %1, i64 32
  %12 = load double, ptr %11, align 8, !tbaa !11
  store double %12, ptr %10, align 8, !tbaa !11
  invoke void @_ZN13DetectorModel16RadialGaussShape13setParametersEv(ptr noundef nonnull align 8 dereferenceable(40) %0)
          to label %13 unwind label %14

13:                                               ; preds = %2
  ret void

14:                                               ; preds = %2
  %15 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN13DetectorModel11RadialShapeD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #2
  resume { ptr, i32 } %15
}

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"double", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !9, i64 32}
!12 = !{!"_ZTSN13DetectorModel16RadialGaussShapeE", !13, i64 0, !9, i64 16, !9, i64 24, !9, i64 32}
!13 = !{!"_ZTSN13DetectorModel11RadialShapeE", !9, i64 8}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass