; LLVM IR from sp-nitech/SPTK :: src/generation/delta_calculation.ll (ZN4sptk16DeltaCalculation7ForwardEv)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.sptk::DeltaCalculation" = type { %"class.sptk::InputSourceInterface", i32, i32, %"class.std::vector", ptr, i8, double, i8, i32, %"class.std::vector.0", %"class.std::vector.0", %"struct.sptk::DeltaCalculation::Buffer" }
%"class.sptk::InputSourceInterface" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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 }
%"struct.sptk::DeltaCalculation::Buffer" = type <{ %"class.std::vector", i32, i32, i8, [7 x i8] }>

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4sptk16DeltaCalculation7ForwardEv(ptr noundef nonnull align 8 dereferenceable(160) %0) #2 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %16 = load ptr, ptr %3, align 8
  %17 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 4
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 11
  %20 = getelementptr inbounds %"struct.sptk::DeltaCalculation::Buffer", ptr %19, i32 0, i32 0
  %21 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 11
  %22 = getelementptr inbounds %"struct.sptk::DeltaCalculation::Buffer", ptr %21, i32 0, i32 1
  %23 = load i32, ptr %22, align 8, !tbaa !24
  %24 = sext i32 %23 to i64
  %25 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %24) #4
  %26 = load ptr, ptr %18, align 8, !tbaa !25
  %27 = getelementptr inbounds ptr, ptr %26, i64 4
  %28 = load ptr, ptr %27, align 8
  %29 = call noundef zeroext i1 %28(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef %25)
  br i1 %29, label %73, label %30

30:                                               ; preds = %1
  %31 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 11
  %32 = getelementptr inbounds %"struct.sptk::DeltaCalculation::Buffer", ptr %31, i32 0, i32 2
  %33 = load i32, ptr %32, align 4, !tbaa !27
  %34 = icmp sle i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %30
  store i1 false, ptr %2, align 1
  br label %126

36:                                               ; preds = %30
  %37 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 11
  %38 = getelementptr inbounds %"struct.sptk::DeltaCalculation::Buffer", ptr %37, i32 0, i32 2
  %39 = load i32, ptr %38, align 4, !tbaa !27
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr %38, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %41 = call noundef i32 @_ZN4sptk16DeltaCalculation15GetPointerIndexEi(ptr noundef nonnull align 8 dereferenceable(160) %16, i32 noundef -1)
  store i32 %41, ptr %4, align 4, !tbaa !28
  %42 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 11
  %43 = getelementptr inbounds %"struct.sptk::DeltaCalculation::Buffer", ptr %42, i32 0, i32 0
  %44 = load i32, ptr %4, align 4, !tbaa !28
  %45 = sext i32 %44 to i64
  %46 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %43, i64 noundef %45) #4
  %47 = call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #4
  %48 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %47, ptr %48, align 8
  %49 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 11
  %50 = getelementptr inbounds %"struct.sptk::DeltaCalculation::Buffer", ptr %49, i32 0, i32 0
  %51 = load i32, ptr %4, align 4, !tbaa !28
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %52) #4
  %54 = call ptr @_ZNSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %53) #4
  %55 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %54, ptr %55, align 8
  %56 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 11
  %57 = getelementptr inbounds %"struct.sptk::DeltaCalculation::Buffer", ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 11
  %59 = getelementptr inbounds %"struct.sptk::DeltaCalculation::Buffer", ptr %58, i32 0, i32 1
  %60 = load i32, ptr %59, align 8, !tbaa !24
  %61 = sext i32 %60 to i64
  %62 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef %61) #4
  %63 = call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %62) #4
  %64 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %63, ptr %64, align 8
  %65 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8
  %67 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8
  %69 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8
  %71 = call ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES6_ET0_T_S8_S7_(ptr %66, ptr %68, ptr %70)
  %72 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %71, ptr %72, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %73

73:                                               ; preds = %36, %1
  %74 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 11
  %75 = getelementptr inbounds %"struct.sptk::DeltaCalculation::Buffer", ptr %74, i32 0, i32 3
  %76 = load i8, ptr %75, align 8, !tbaa !29, !range !30, !noundef !31
  %77 = trunc i8 %76 to i1
  br i1 %77, label %78, label %122

78:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %79 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 8
  %80 = load i32, ptr %79, align 4, !tbaa !32
  %81 = sdiv i32 %80, 2
  store i32 %81, ptr %9, align 4, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 1, ptr %10, align 4, !tbaa !28
  br label %82

82:                                               ; preds = %116, %78
  %83 = load i32, ptr %10, align 4, !tbaa !28
  %84 = load i32, ptr %9, align 4, !tbaa !28
  %85 = icmp sle i32 %83, %84
  br i1 %85, label %87, label %86

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

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %88 = load i32, ptr %10, align 4, !tbaa !28
  %89 = sub nsw i32 0, %88
  %90 = call noundef i32 @_ZN4sptk16DeltaCalculation15GetPointerIndexEi(ptr noundef nonnull align 8 dereferenceable(160) %16, i32 noundef %89)
  store i32 %90, ptr %11, align 4, !tbaa !28
  %91 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 11
  %92 = getelementptr inbounds %"struct.sptk::DeltaCalculation::Buffer", ptr %91, i32 0, i32 0
  %93 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %92, i64 noundef 0) #4
  %94 = call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %93) #4
  %95 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %94, ptr %95, align 8
  %96 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 11
  %97 = getelementptr inbounds %"struct.sptk::DeltaCalculation::Buffer", ptr %96, i32 0, i32 0
  %98 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %97, i64 noundef 0) #4
  %99 = call ptr @_ZNSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %98) #4
  %100 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %99, ptr %100, align 8
  %101 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 11
  %102 = getelementptr inbounds %"struct.sptk::DeltaCalculation::Buffer", ptr %101, i32 0, i32 0
  %103 = load i32, ptr %11, align 4, !tbaa !28
  %104 = sext i32 %103 to i64
  %105 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %102, i64 noundef %104) #4
  %106 = call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %105) #4
  %107 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %106, ptr %107, align 8
  %108 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8
  %110 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8
  %112 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8
  %114 = call ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES6_ET0_T_S8_S7_(ptr %109, ptr %111, ptr %113)
  %115 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %114, ptr %115, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %116

116:                                              ; preds = %87
  %117 = load i32, ptr %10, align 4, !tbaa !28
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %10, align 4, !tbaa !28
  br label %82, !llvm.loop !33

119:                                              ; preds = %86
  %120 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 11
  %121 = getelementptr inbounds %"struct.sptk::DeltaCalculation::Buffer", ptr %120, i32 0, i32 3
  store i8 0, ptr %121, align 8, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %122

122:                                              ; preds = %119, %73
  %123 = call noundef i32 @_ZN4sptk16DeltaCalculation15GetPointerIndexEi(ptr noundef nonnull align 8 dereferenceable(160) %16, i32 noundef 1)
  %124 = getelementptr inbounds %"class.sptk::DeltaCalculation", ptr %16, i32 0, i32 11
  %125 = getelementptr inbounds %"struct.sptk::DeltaCalculation::Buffer", ptr %124, i32 0, i32 1
  store i32 %123, ptr %125, align 8, !tbaa !24
  store i1 true, ptr %2, align 1
  br label %126

126:                                              ; preds = %122, %35
  %127 = load i1, ptr %2, align 1
  ret i1 %127
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES6_ET0_T_S8_S7_(ptr, ptr, ptr) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 #4 = { 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, !6, i64 40}
!10 = !{!"_ZTSN4sptk16DeltaCalculationE", !11, i64 0, !12, i64 8, !12, i64 12, !13, i64 16, !6, i64 40, !17, i64 48, !18, i64 56, !17, i64 64, !12, i64 68, !19, i64 72, !19, i64 96, !23, i64 120}
!11 = !{!"_ZTSN4sptk20InputSourceInterfaceE"}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTSSt6vectorIS_IdSaIdEESaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!"_ZTSSt6vectorIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTSN4sptk16DeltaCalculation6BufferE", !13, i64 0, !12, i64 24, !12, i64 28, !17, i64 32}
!24 = !{!10, !12, i64 144}
!25 = !{!26, !26, i64 0}
!26 = !{!"vtable pointer", !8, i64 0}
!27 = !{!10, !12, i64 148}
!28 = !{!12, !12, i64 0}
!29 = !{!10, !17, i64 152}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = !{!10, !12, i64 68}
!33 = distinct !{!33, !34}
!34 = !{!"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"

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4sptk16DeltaCalculation7ForwardEv(ptr noundef nonnull align 8 dereferenceable(160) %0) local_unnamed_addr #1 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 40
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 120
  %5 = getelementptr inbounds i8, ptr %0, i64 144
  %6 = load i32, ptr %5, align 8, !tbaa !23
  %7 = sext i32 %6 to i64
  %8 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %7) #3
  %9 = load ptr, ptr %3, align 8, !tbaa !24
  %10 = getelementptr inbounds i8, ptr %9, i64 32
  %11 = load ptr, ptr %10, align 8
  %12 = tail call noundef zeroext i1 %11(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull %8)
  br i1 %12, label %30, label %13

13:                                               ; preds = %1
  %14 = getelementptr inbounds i8, ptr %0, i64 148
  %15 = load i32, ptr %14, align 4, !tbaa !26
  %16 = icmp slt i32 %15, 1
  br i1 %16, label %51, label %17

17:                                               ; preds = %13
  %18 = add nsw i32 %15, -1
  store i32 %18, ptr %14, align 4, !tbaa !26
  %19 = tail call noundef i32 @_ZN4sptk16DeltaCalculation15GetPointerIndexEi(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef -1)
  %20 = sext i32 %19 to i64
  %21 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %20) #3
  %22 = tail call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #3
  %23 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %20) #3
  %24 = tail call ptr @_ZNSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #3
  %25 = load i32, ptr %5, align 8, !tbaa !23
  %26 = sext i32 %25 to i64
  %27 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %26) #3
  %28 = tail call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #3
  %29 = tail call ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES6_ET0_T_S8_S7_(ptr %22, ptr %24, ptr %28)
  br label %30

30:                                               ; preds = %17, %1
  %31 = getelementptr inbounds i8, ptr %0, i64 152
  %32 = load i8, ptr %31, align 8, !tbaa !27, !range !28, !noundef !29
  %33 = trunc nuw i8 %32 to i1
  br i1 %33, label %34, label %49

34:                                               ; preds = %30
  %35 = getelementptr inbounds i8, ptr %0, i64 68
  %36 = load i32, ptr %35, align 4, !tbaa !30
  %.not17 = icmp slt i32 %36, 2
  br i1 %.not17, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %34
  %37 = lshr i32 %36, 1
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %34
  store i8 0, ptr %31, align 8, !tbaa !27
  br label %49

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.01518 = phi i32 [ %48, %.lr.ph ], [ 1, %.lr.ph.preheader ]
  %38 = sub nsw i32 0, %.01518
  %39 = tail call noundef i32 @_ZN4sptk16DeltaCalculation15GetPointerIndexEi(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %38)
  %40 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 0) #3
  %41 = tail call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #3
  %42 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 0) #3
  %43 = tail call ptr @_ZNSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #3
  %44 = sext i32 %39 to i64
  %45 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %44) #3
  %46 = tail call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #3
  %47 = tail call ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES6_ET0_T_S8_S7_(ptr %41, ptr %43, ptr %46)
  %48 = add nuw nsw i32 %.01518, 1
  %exitcond.not = icmp eq i32 %.01518, %37
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !31

49:                                               ; preds = %._crit_edge, %30
  %50 = tail call noundef i32 @_ZN4sptk16DeltaCalculation15GetPointerIndexEi(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef 1)
  store i32 %50, ptr %5, align 8, !tbaa !23
  br label %51

51:                                               ; preds = %13, %49
  %.0 = phi i1 [ true, %49 ], [ false, %13 ]
  ret i1 %.0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4sptk16DeltaCalculation15GetPointerIndexEi(ptr noundef nonnull align 8 dereferenceable(160), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES6_ET0_T_S8_S7_(ptr, ptr, ptr) local_unnamed_addr #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 = { 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 = { 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 #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, !15, i64 40}
!6 = !{!"_ZTSN4sptk16DeltaCalculationE", !7, i64 0, !8, i64 8, !8, i64 12, !11, i64 16, !15, i64 40, !16, i64 48, !17, i64 56, !16, i64 64, !8, i64 68, !18, i64 72, !18, i64 96, !22, i64 120}
!7 = !{!"_ZTSN4sptk20InputSourceInterfaceE"}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSSt6vectorIS_IdSaIdEESaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !9, i64 0}
!16 = !{!"bool", !9, i64 0}
!17 = !{!"double", !9, i64 0}
!18 = !{!"_ZTSSt6vectorIiSaIiEE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!22 = !{!"_ZTSN4sptk16DeltaCalculation6BufferE", !11, i64 0, !8, i64 24, !8, i64 28, !16, i64 32}
!23 = !{!6, !8, i64 144}
!24 = !{!25, !25, i64 0}
!25 = !{!"vtable pointer", !10, i64 0}
!26 = !{!6, !8, i64 148}
!27 = !{!6, !16, i64 152}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = !{!6, !8, i64 68}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


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