; LLVM IR from sp-nitech/SPTK :: src/window/cosine_window.ll (ZN4sptk12CosineWindowC2EiRKSt6vectorIdSaIdEEb)

; 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.sptk::CosineWindow" = type { %"class.sptk::WindowInterface", i32, i8, i8, %"class.std::vector" }
%"class.sptk::WindowInterface" = type { ptr }
%"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 }

@_ZTVN4sptk12CosineWindowE = external dso_local unnamed_addr constant { [7 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk12CosineWindowC2EiRKSt6vectorIdSaIdEEb(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i1 noundef zeroext %3) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  %19 = zext i1 %3 to i8
  store i8 %19, ptr %8, align 1, !tbaa !11
  %20 = load ptr, ptr %5, align 8
  call void @_ZN4sptk15WindowInterfaceC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  store ptr getelementptr inbounds inrange(-16, 40) ({ [7 x ptr] }, ptr @_ZTVN4sptk12CosineWindowE, i32 0, i32 0, i32 2), ptr %20, align 8, !tbaa !13
  %21 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 1
  %22 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %22, ptr %21, align 8, !tbaa !15
  %23 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 2
  %24 = load i8, ptr %8, align 1, !tbaa !11, !range !22, !noundef !23
  %25 = trunc i8 %24 to i1
  %26 = zext i1 %25 to i8
  store i8 %26, ptr %23, align 4, !tbaa !24
  %27 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 3
  store i8 1, ptr %27, align 1, !tbaa !25
  %28 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 4
  call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #6
  %29 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 1
  %30 = load i32, ptr %29, align 8, !tbaa !15
  %31 = icmp sle i32 %30, 0
  br i1 %31, label %35, label %32

32:                                               ; preds = %4
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = call noundef zeroext i1 @_ZNKSt6vectorIdSaIdEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #6
  br i1 %34, label %35, label %37

35:                                               ; preds = %32, %4
  %36 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 3
  store i8 0, ptr %36, align 1, !tbaa !25
  br label %121

37:                                               ; preds = %32
  %38 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 4
  %39 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 1
  %40 = load i32, ptr %39, align 8, !tbaa !15
  %41 = sext i32 %40 to i64
  invoke void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %41)
          to label %42 unwind label %49

42:                                               ; preds = %37
  %43 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 1
  %44 = load i32, ptr %43, align 8, !tbaa !15
  %45 = icmp eq i32 1, %44
  br i1 %45, label %46, label %53

46:                                               ; preds = %42
  %47 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 4
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %47, i64 noundef 0) #6
  store double 1.000000e+00, ptr %48, align 8, !tbaa !26
  br label %121

49:                                               ; preds = %37
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %9, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %10, align 4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #6
  call void @_ZN4sptk15WindowInterfaceD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  br label %122

53:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #6
  %56 = trunc i64 %55 to i32
  store i32 %56, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %57 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 2
  %58 = load i8, ptr %57, align 4, !tbaa !24, !range !22, !noundef !23
  %59 = trunc i8 %58 to i1
  br i1 %59, label %60, label %63

60:                                               ; preds = %53
  %61 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 1
  %62 = load i32, ptr %61, align 8, !tbaa !15
  br label %67

63:                                               ; preds = %53
  %64 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 1
  %65 = load i32, ptr %64, align 8, !tbaa !15
  %66 = sub nsw i32 %65, 1
  br label %67

67:                                               ; preds = %63, %60
  %68 = phi i32 [ %62, %60 ], [ %66, %63 ]
  %69 = sitofp i32 %68 to double
  %70 = fdiv double 0x401921FB54442D18, %69
  store double %70, ptr %12, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %71 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 4
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %71, i64 noundef 0) #6
  store ptr %72, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %117, %67
  %74 = load i32, ptr %14, align 4, !tbaa !9
  %75 = getelementptr inbounds %"class.sptk::CosineWindow", ptr %20, i32 0, i32 1
  %76 = load i32, ptr %75, align 8, !tbaa !15
  %77 = icmp slt i32 %74, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %73
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %120

79:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %80, i64 noundef 0) #6
  %82 = load double, ptr %81, align 8, !tbaa !26
  store double %82, ptr %16, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 -1, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 1, ptr %18, align 4, !tbaa !9
  br label %83

83:                                               ; preds = %108, %79
  %84 = load i32, ptr %18, align 4, !tbaa !9
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %111

88:                                               ; preds = %83
  %89 = load i32, ptr %17, align 4, !tbaa !9
  %90 = sitofp i32 %89 to double
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = load i32, ptr %18, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %91, i64 noundef %93) #6
  %95 = load double, ptr %94, align 8, !tbaa !26
  %96 = fmul double %90, %95
  %97 = load i32, ptr %14, align 4, !tbaa !9
  %98 = load i32, ptr %18, align 4, !tbaa !9
  %99 = mul nsw i32 %97, %98
  %100 = sitofp i32 %99 to double
  %101 = load double, ptr %12, align 8, !tbaa !26
  %102 = fmul double %100, %101
  %103 = call double @cos(double noundef %102) #6
  %104 = load double, ptr %16, align 8, !tbaa !26
  %105 = call double @llvm.fmuladd.f64(double %96, double %103, double %104)
  store double %105, ptr %16, align 8, !tbaa !26
  %106 = load i32, ptr %17, align 4, !tbaa !9
  %107 = mul nsw i32 %106, -1
  store i32 %107, ptr %17, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %88
  %109 = load i32, ptr %18, align 4, !tbaa !9
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %18, align 4, !tbaa !9
  br label %83, !llvm.loop !28

111:                                              ; preds = %87
  %112 = load double, ptr %16, align 8, !tbaa !26
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = load i32, ptr %14, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds double, ptr %113, i64 %115
  store double %112, ptr %116, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %117

117:                                              ; preds = %111
  %118 = load i32, ptr %14, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %14, align 4, !tbaa !9
  br label %73, !llvm.loop !30

120:                                              ; preds = %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %121

121:                                              ; preds = %120, %46, %35
  ret void

122:                                              ; preds = %49
  %123 = load ptr, ptr %9, align 8
  %124 = load i32, ptr %10, align 4
  %125 = insertvalue { ptr, i32 } poison, ptr %123, 0
  %126 = insertvalue { ptr, i32 } %125, i32 %124, 1
  resume { ptr, i32 } %126
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; 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) #2 align 2

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

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

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

; Function Attrs: nounwind
declare double @cos(double noundef) #4

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk15WindowInterfaceD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 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 = { inlinehint 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 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!16, !10, i64 8}
!16 = !{!"_ZTSN4sptk12CosineWindowE", !17, i64 0, !10, i64 8, !12, i64 12, !12, i64 13, !18, i64 16}
!17 = !{!"_ZTSN4sptk15WindowInterfaceE"}
!18 = !{!"_ZTSSt6vectorIdSaIdEE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!16, !12, i64 12}
!25 = !{!16, !12, i64 13}
!26 = !{!27, !27, i64 0}
!27 = !{!"double", !7, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}


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

@_ZTVN4sptk12CosineWindowE = external dso_local unnamed_addr constant { [7 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk12CosineWindowC2EiRKSt6vectorIdSaIdEEb(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i1 noundef zeroext %3) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %5 = zext i1 %3 to i8
  tail call void @_ZN4sptk15WindowInterfaceC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  store ptr getelementptr inbounds inrange(-16, 40) (i8, ptr @_ZTVN4sptk12CosineWindowE, i64 16), ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %1, ptr %6, align 8, !tbaa !8
  %7 = getelementptr inbounds i8, ptr %0, i64 12
  store i8 %5, ptr %7, align 4, !tbaa !19
  %8 = getelementptr inbounds i8, ptr %0, i64 13
  store i8 1, ptr %8, align 1, !tbaa !20
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %10 = load i32, ptr %6, align 8, !tbaa !8
  %11 = icmp slt i32 %10, 1
  br i1 %11, label %14, label %12

12:                                               ; preds = %4
  %13 = tail call noundef zeroext i1 @_ZNKSt6vectorIdSaIdEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  br i1 %13, label %14, label %15

14:                                               ; preds = %12, %4
  store i8 0, ptr %8, align 1, !tbaa !20
  br label %.loopexit

15:                                               ; preds = %12
  %16 = load i32, ptr %6, align 8, !tbaa !8
  %17 = sext i32 %16 to i64
  invoke void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %17)
          to label %18 unwind label %23

18:                                               ; preds = %15
  %19 = load i32, ptr %6, align 8, !tbaa !8
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %21, label %25

21:                                               ; preds = %18
  %22 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef 0) #5
  store double 1.000000e+00, ptr %22, align 8, !tbaa !21
  br label %.loopexit

23:                                               ; preds = %15
  %24 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  tail call void @_ZN4sptk15WindowInterfaceD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  resume { ptr, i32 } %24

25:                                               ; preds = %18
  %26 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %27 = load i8, ptr %7, align 4, !tbaa !19, !range !23, !noundef !24
  %28 = load i32, ptr %6, align 8
  %29 = xor i8 %27, 1
  %30 = zext nneg i8 %29 to i32
  %31 = sub i32 %28, %30
  %32 = sitofp i32 %31 to double
  %33 = fdiv double 0x401921FB54442D18, %32
  %34 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef 0) #5
  %35 = load i32, ptr %6, align 8, !tbaa !8
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %.lr.ph31, label %.loopexit

.lr.ph31:                                         ; preds = %25
  %37 = trunc i64 %26 to i32
  %38 = icmp sgt i32 %37, 1
  br i1 %38, label %.lr.ph.us.preheader, label %.lr.ph31.split

.lr.ph.us.preheader:                              ; preds = %.lr.ph31
  %wide.trip.count = and i64 %26, 2147483647
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %._crit_edge.us
  %indvars.iv37 = phi i64 [ 0, %.lr.ph.us.preheader ], [ %indvars.iv.next38, %._crit_edge.us ]
  %39 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #5
  %40 = load double, ptr %39, align 8, !tbaa !21
  br label %41

41:                                               ; preds = %.lr.ph.us, %41
  %indvars.iv34 = phi i64 [ 1, %.lr.ph.us ], [ %indvars.iv.next35, %41 ]
  %.02327.us = phi i32 [ -1, %.lr.ph.us ], [ %52, %41 ]
  %.02426.us = phi double [ %40, %.lr.ph.us ], [ %51, %41 ]
  %42 = sitofp i32 %.02327.us to double
  %43 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv34) #5
  %44 = load double, ptr %43, align 8, !tbaa !21
  %45 = fmul double %44, %42
  %46 = mul nuw nsw i64 %indvars.iv34, %indvars.iv37
  %47 = trunc nuw i64 %46 to i32
  %48 = uitofp nneg i32 %47 to double
  %49 = fmul double %33, %48
  %50 = tail call double @cos(double noundef %49) #5
  %51 = tail call double @llvm.fmuladd.f64(double %45, double %50, double %.02426.us)
  %52 = sub nsw i32 0, %.02327.us
  %indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next35, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %41, !llvm.loop !25

._crit_edge.us:                                   ; preds = %41
  %53 = getelementptr inbounds double, ptr %34, i64 %indvars.iv37
  store double %51, ptr %53, align 8, !tbaa !21
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %54 = load i32, ptr %6, align 8, !tbaa !8
  %55 = sext i32 %54 to i64
  %56 = icmp slt i64 %indvars.iv.next38, %55
  br i1 %56, label %.lr.ph.us, label %.loopexit, !llvm.loop !27

.lr.ph31.split:                                   ; preds = %.lr.ph31, %.lr.ph31.split
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph31.split ], [ 0, %.lr.ph31 ]
  %57 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #5
  %58 = load double, ptr %57, align 8, !tbaa !21
  %59 = getelementptr inbounds double, ptr %34, i64 %indvars.iv
  store double %58, ptr %59, align 8, !tbaa !21
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %60 = load i32, ptr %6, align 8, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next, %61
  br i1 %62, label %.lr.ph31.split, label %.loopexit, !llvm.loop !27

.loopexit:                                        ; preds = %.lr.ph31.split, %._crit_edge.us, %25, %21, %14
  ret void
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; 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 #2 align 2

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(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 void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk15WindowInterfaceD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 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 = { inlinehint 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 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 #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 = { 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, !11, i64 8}
!9 = !{!"_ZTSN4sptk12CosineWindowE", !10, i64 0, !11, i64 8, !13, i64 12, !13, i64 13, !14, i64 16}
!10 = !{!"_ZTSN4sptk15WindowInterfaceE"}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"bool", !12, i64 0}
!14 = !{!"_ZTSSt6vectorIdSaIdEE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}
!18 = !{!"any pointer", !12, i64 0}
!19 = !{!9, !13, i64 12}
!20 = !{!9, !13, i64 13}
!21 = !{!22, !22, i64 0}
!22 = !{!"double", !12, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass