; LLVM IR from gnikit/md-sim :: src/isomorph.ll (ZN8Isomorph7GenLineEm)

; 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::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { %"class.std::vector" }
%"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 }
%"struct.std::_Head_base.1" = type { %"class.std::vector" }
%class.Isomorph = type { %"class.std::vector", %"class.std::vector", %"class.std::vector", double, double, double, double, double, double }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN8Isomorph6getRhoEdddm(ptr noundef nonnull align 8 dereferenceable(120), double noundef, double noundef, double noundef, i64 noundef) #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN8Isomorph4getAEdddm(ptr noundef nonnull align 8 dereferenceable(120), double noundef, double noundef, double noundef, i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Isomorph7GenLineEm(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 8 %0, ptr noundef nonnull align 8 dereferenceable(120) %1, i64 noundef %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  %8 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %9

9:                                                ; preds = %43, %3
  %10 = load i64, ptr %7, align 8, !tbaa !9
  %11 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 0
  %12 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  %13 = icmp ult i64 %10, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %46

15:                                               ; preds = %9
  %16 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 0
  %17 = load i64, ptr %7, align 8, !tbaa !9
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %17) #3
  %19 = load double, ptr %18, align 8, !tbaa !11
  %20 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 7
  store double %19, ptr %20, align 8, !tbaa !13
  %21 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 3
  %22 = load double, ptr %21, align 8, !tbaa !19
  %23 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 4
  %24 = load double, ptr %23, align 8, !tbaa !20
  %25 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 7
  %26 = load double, ptr %25, align 8, !tbaa !13
  %27 = load i64, ptr %6, align 8, !tbaa !9
  %28 = call noundef double @_ZN8Isomorph6getRhoEdddm(ptr noundef nonnull align 8 dereferenceable(120) %8, double noundef %22, double noundef %24, double noundef %26, i64 noundef %27)
  %29 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 6
  store double %28, ptr %29, align 8, !tbaa !21
  %30 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 5
  %31 = load double, ptr %30, align 8, !tbaa !22
  %32 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 3
  %33 = load double, ptr %32, align 8, !tbaa !19
  %34 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 6
  %35 = load double, ptr %34, align 8, !tbaa !21
  %36 = load i64, ptr %6, align 8, !tbaa !9
  %37 = call noundef double @_ZN8Isomorph4getAEdddm(ptr noundef nonnull align 8 dereferenceable(120) %8, double noundef %31, double noundef %33, double noundef %35, i64 noundef %36)
  %38 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 8
  store double %37, ptr %38, align 8, !tbaa !23
  %39 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 1
  %40 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 6
  call void @_ZNSt6vectorIdSaIdEE9push_backERKd(ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 8 dereferenceable(8) %40)
  %41 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 2
  %42 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 8
  call void @_ZNSt6vectorIdSaIdEE9push_backERKd(ptr noundef nonnull align 8 dereferenceable(24) %41, ptr noundef nonnull align 8 dereferenceable(8) %42)
  br label %43

43:                                               ; preds = %15
  %44 = load i64, ptr %7, align 8, !tbaa !9
  %45 = add i64 %44, 1
  store i64 %45, ptr %7, align 8, !tbaa !9
  br label %9, !llvm.loop !24

46:                                               ; preds = %14
  %47 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 1
  %48 = getelementptr inbounds %class.Isomorph, ptr %8, i32 0, i32 2
  call void @_ZSt10make_tupleIJRSt6vectorIdSaIdEES3_EESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS7_(ptr dead_on_unwind writable sret(%"class.std::tuple") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %47, ptr noundef nonnull align 8 dereferenceable(24) %48)
  ret void
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt10make_tupleIJRSt6vectorIdSaIdEES3_EESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS7_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !12, i64 104}
!14 = !{!"_ZTS8Isomorph", !15, i64 0, !15, i64 24, !15, i64 48, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112}
!15 = !{!"_ZTSSt6vectorIdSaIdEE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!14, !12, i64 72}
!20 = !{!14, !12, i64 80}
!21 = !{!14, !12, i64 96}
!22 = !{!14, !12, i64 88}
!23 = !{!14, !12, i64 112}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; 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::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { %"class.std::vector" }
%"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 }
%"struct.std::_Head_base.1" = type { %"class.std::vector" }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN8Isomorph6getRhoEdddm(ptr noundef nonnull align 8 dereferenceable(120), double noundef, double noundef, double noundef, i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN8Isomorph4getAEdddm(ptr noundef nonnull align 8 dereferenceable(120), double noundef, double noundef, double noundef, i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Isomorph7GenLineEm(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 8 %0, ptr noundef nonnull align 8 dereferenceable(120) %1, i64 noundef %2) local_unnamed_addr #1 align 2 {
  %4 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #2
  %.not = icmp eq i64 %4, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %5 = getelementptr inbounds i8, ptr %1, i64 104
  %6 = getelementptr inbounds i8, ptr %1, i64 72
  %7 = getelementptr inbounds i8, ptr %1, i64 80
  %8 = getelementptr inbounds i8, ptr %1, i64 96
  %9 = getelementptr inbounds i8, ptr %1, i64 88
  %10 = getelementptr inbounds i8, ptr %1, i64 112
  %11 = getelementptr inbounds i8, ptr %1, i64 24
  %12 = getelementptr inbounds i8, ptr %1, i64 48
  br label %15

._crit_edge:                                      ; preds = %15, %3
  %13 = getelementptr inbounds i8, ptr %1, i64 24
  %14 = getelementptr inbounds i8, ptr %1, i64 48
  tail call void @_ZSt10make_tupleIJRSt6vectorIdSaIdEES3_EESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS7_(ptr dead_on_unwind writable sret(%"class.std::tuple") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %14)
  ret void

15:                                               ; preds = %.lr.ph, %15
  %.05 = phi i64 [ 0, %.lr.ph ], [ %24, %15 ]
  %16 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.05) #2
  %17 = load double, ptr %16, align 8, !tbaa !5
  store double %17, ptr %5, align 8, !tbaa !9
  %18 = load double, ptr %6, align 8, !tbaa !16
  %19 = load double, ptr %7, align 8, !tbaa !17
  %20 = tail call noundef double @_ZN8Isomorph6getRhoEdddm(ptr noundef nonnull align 8 dereferenceable(120) %1, double noundef %18, double noundef %19, double noundef %17, i64 noundef %2)
  store double %20, ptr %8, align 8, !tbaa !18
  %21 = load double, ptr %9, align 8, !tbaa !19
  %22 = load double, ptr %6, align 8, !tbaa !16
  %23 = tail call noundef double @_ZN8Isomorph4getAEdddm(ptr noundef nonnull align 8 dereferenceable(120) %1, double noundef %21, double noundef %22, double noundef %20, i64 noundef %2)
  store double %23, ptr %10, align 8, !tbaa !20
  tail call void @_ZNSt6vectorIdSaIdEE9push_backERKd(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(8) %8)
  tail call void @_ZNSt6vectorIdSaIdEE9push_backERKd(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %24 = add nuw i64 %.05, 1
  %25 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #2
  %26 = icmp ult i64 %24, %25
  br i1 %26, label %15, label %._crit_edge, !llvm.loop !21
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt10make_tupleIJRSt6vectorIdSaIdEES3_EESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS7_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 104}
!10 = !{!"_ZTS8Isomorph", !11, i64 0, !11, i64 24, !11, i64 48, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112}
!11 = !{!"_ZTSSt6vectorIdSaIdEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!10, !6, i64 72}
!17 = !{!10, !6, i64 80}
!18 = !{!10, !6, i64 96}
!19 = !{!10, !6, i64 88}
!20 = !{!10, !6, i64 112}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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