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

; 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::Grid" = type { ptr, %"class.std::vector", i64, i64, i64, double, double, double, double, double }
%"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 }

@_ZTVN13DetectorModel4GridE = external dso_local unnamed_addr constant { [27 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13DetectorModel4GridC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull align 8 dereferenceable(96) %1) unnamed_addr #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8
  store ptr getelementptr inbounds inrange(-16, 200) ({ [27 x ptr] }, ptr @_ZTVN13DetectorModel4GridE, i32 0, i32 0, i32 2), ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %5, i32 0, i32 1
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %7, i32 0, i32 1
  call void @_ZNSt6vectorIdSaIdEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %8)
  %9 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %5, i32 0, i32 2
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %10, i32 0, i32 2
  %12 = load i64, ptr %11, align 8, !tbaa !11
  store i64 %12, ptr %9, align 8, !tbaa !11
  %13 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %5, i32 0, i32 3
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %14, i32 0, i32 3
  %16 = load i64, ptr %15, align 8, !tbaa !19
  store i64 %16, ptr %13, align 8, !tbaa !19
  %17 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %5, i32 0, i32 4
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %18, i32 0, i32 4
  %20 = load i64, ptr %19, align 8, !tbaa !20
  store i64 %20, ptr %17, align 8, !tbaa !20
  %21 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %5, i32 0, i32 5
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %22, i32 0, i32 5
  %24 = load double, ptr %23, align 8, !tbaa !21
  store double %24, ptr %21, align 8, !tbaa !21
  %25 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %5, i32 0, i32 6
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %26, i32 0, i32 6
  %28 = load double, ptr %27, align 8, !tbaa !22
  store double %28, ptr %25, align 8, !tbaa !22
  %29 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %5, i32 0, i32 7
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %30, i32 0, i32 7
  %32 = load double, ptr %31, align 8, !tbaa !23
  store double %32, ptr %29, align 8, !tbaa !23
  %33 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %5, i32 0, i32 8
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %34, i32 0, i32 8
  %36 = load double, ptr %35, align 8, !tbaa !24
  store double %36, ptr %33, align 8, !tbaa !24
  %37 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %5, i32 0, i32 9
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %"class.DetectorModel::Grid", ptr %38, i32 0, i32 9
  %40 = load double, ptr %39, align 8, !tbaa !25
  store double %40, ptr %37, align 8, !tbaa !25
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 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" }

!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, !17, i64 32}
!12 = !{!"_ZTSN13DetectorModel4GridE", !13, i64 8, !17, i64 32, !17, i64 40, !17, i64 48, !18, i64 56, !18, i64 64, !18, i64 72, !18, i64 80, !18, i64 88}
!13 = !{!"_ZTSSt6vectorIdSaIdEE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"long", !7, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!12, !17, i64 40}
!20 = !{!12, !17, i64 48}
!21 = !{!12, !18, i64 56}
!22 = !{!12, !18, i64 64}
!23 = !{!12, !18, i64 72}
!24 = !{!12, !18, i64 80}
!25 = !{!12, !18, i64 88}


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

@_ZTVN13DetectorModel4GridE = external dso_local unnamed_addr constant { [27 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13DetectorModel4GridC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull align 8 dereferenceable(96) %1) unnamed_addr #0 align 2 {
  store ptr getelementptr inbounds inrange(-16, 200) (i8, ptr @_ZTVN13DetectorModel4GridE, i64 16), ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  tail call void @_ZNSt6vectorIdSaIdEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  %6 = getelementptr inbounds i8, ptr %1, i64 32
  %7 = load <2 x i64>, ptr %6, align 8, !tbaa !8
  store <2 x i64> %7, ptr %5, align 8, !tbaa !8
  %8 = getelementptr inbounds i8, ptr %0, i64 48
  %9 = getelementptr inbounds i8, ptr %1, i64 48
  %10 = load i64, ptr %9, align 8, !tbaa !11
  store i64 %10, ptr %8, align 8, !tbaa !11
  %11 = getelementptr inbounds i8, ptr %0, i64 56
  %12 = getelementptr inbounds i8, ptr %1, i64 56
  %13 = load <2 x double>, ptr %12, align 8, !tbaa !19
  store <2 x double> %13, ptr %11, align 8, !tbaa !19
  %14 = getelementptr inbounds i8, ptr %0, i64 72
  %15 = getelementptr inbounds i8, ptr %1, i64 72
  %16 = load <2 x double>, ptr %15, align 8, !tbaa !19
  store <2 x double> %16, ptr %14, align 8, !tbaa !19
  %17 = getelementptr inbounds i8, ptr %0, i64 88
  %18 = getelementptr inbounds i8, ptr %1, i64 88
  %19 = load double, ptr %18, align 8, !tbaa !20
  store double %19, ptr %17, align 8, !tbaa !20
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 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" }

!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 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !9, i64 48}
!12 = !{!"_ZTSN13DetectorModel4GridE", !13, i64 8, !9, i64 32, !9, i64 40, !9, i64 48, !18, i64 56, !18, i64 64, !18, i64 72, !18, i64 80, !18, i64 88}
!13 = !{!"_ZTSSt6vectorIdSaIdEE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!17 = !{!"any pointer", !10, i64 0}
!18 = !{!"double", !10, i64 0}
!19 = !{!18, !18, i64 0}
!20 = !{!12, !18, i64 88}


; Effective O3 passes: InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass