; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/282 Division 1/Problem C/C.ll (Z7computei)

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

%struct.seg = type { i32, i32, i32, double, [5010 x double] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@q = external dso_local global i32, align 4
@s = external dso_local global [5010 x %struct.seg], align 16
@g = external dso_local global [5010 x %"class.std::vector"], align 16

; 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 uwtable
define dso_local void @_Z7computei(i32 noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @g, i64 0, i64 %15
  %17 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #4
  %18 = icmp eq i64 %17, 0
  br i1 %18, label %19, label %48

19:                                               ; preds = %1
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %21
  %23 = getelementptr inbounds %struct.seg, ptr %22, i32 0, i32 3
  %24 = load double, ptr %23, align 8, !tbaa !9
  %25 = fsub double 1.000000e+00, %24
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %27
  %29 = getelementptr inbounds %struct.seg, ptr %28, i32 0, i32 4
  %30 = getelementptr inbounds [5010 x double], ptr %29, i64 0, i64 0
  store double %25, ptr %30, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %44, %19
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = load i32, ptr @q, align 4, !tbaa !5
  %34 = icmp sle i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %47

36:                                               ; preds = %31
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %38
  %40 = getelementptr inbounds %struct.seg, ptr %39, i32 0, i32 4
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [5010 x double], ptr %40, i64 0, i64 %42
  store double 1.000000e+00, ptr %43, align 8, !tbaa !12
  br label %44

44:                                               ; preds = %36
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %3, align 4, !tbaa !5
  br label %31, !llvm.loop !13

47:                                               ; preds = %35
  br label %165

48:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @g, i64 0, i64 %50
  %52 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #4
  %53 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %52, ptr %53, align 8
  br label %54

54:                                               ; preds = %65, %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @g, i64 0, i64 %56
  %58 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %57) #4
  %59 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %58, ptr %59, align 8
  %60 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br i1 %60, label %62, label %61

61:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %67

62:                                               ; preds = %54
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %64 = load i32, ptr %63, align 4, !tbaa !5
  call void @_Z7computei(i32 noundef %64)
  br label %65

65:                                               ; preds = %62
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br label %54, !llvm.loop !15

67:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %161, %67
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = load i32, ptr @q, align 4, !tbaa !5
  %71 = icmp sle i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %164

73:                                               ; preds = %68
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %75
  %77 = getelementptr inbounds %struct.seg, ptr %76, i32 0, i32 3
  %78 = load double, ptr %77, align 8, !tbaa !9
  store double %78, ptr %6, align 8, !tbaa !12
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %80
  %82 = getelementptr inbounds %struct.seg, ptr %81, i32 0, i32 3
  %83 = load double, ptr %82, align 8, !tbaa !9
  %84 = fsub double 1.000000e+00, %83
  store double %84, ptr %7, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @g, i64 0, i64 %86
  %88 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %87) #4
  %89 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %88, ptr %89, align 8
  br label %90

90:                                               ; preds = %144, %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %91 = load i32, ptr %2, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @g, i64 0, i64 %92
  %94 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %93) #4
  %95 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %94, ptr %95, align 8
  %96 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br i1 %96, label %98, label %97

97:                                               ; preds = %90
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %146

98:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %99 = load i32, ptr %2, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %100
  %102 = getelementptr inbounds %struct.seg, ptr %101, i32 0, i32 2
  %103 = load i32, ptr %102, align 8, !tbaa !16
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %106
  %108 = getelementptr inbounds %struct.seg, ptr %107, i32 0, i32 2
  %109 = load i32, ptr %108, align 8, !tbaa !16
  %110 = sub nsw i32 %103, %109
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = add nsw i32 %110, %111
  store i32 %112, ptr %12, align 4, !tbaa !5
  %113 = load i32, ptr %12, align 4, !tbaa !5
  %114 = sub nsw i32 %113, 1
  %115 = icmp sge i32 %114, 0
  br i1 %115, label %116, label %131

116:                                              ; preds = %98
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %119
  %121 = getelementptr inbounds %struct.seg, ptr %120, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %122 = load i32, ptr %12, align 4, !tbaa !5
  %123 = sub nsw i32 %122, 1
  store i32 %123, ptr %13, align 4, !tbaa !5
  %124 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @q, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [5010 x double], ptr %121, i64 0, i64 %126
  %128 = load double, ptr %127, align 8, !tbaa !12
  %129 = load double, ptr %6, align 8, !tbaa !12
  %130 = fmul double %129, %128
  store double %130, ptr %6, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %131

131:                                              ; preds = %116, %98
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %134
  %136 = getelementptr inbounds %struct.seg, ptr %135, i32 0, i32 4
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @q, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [5010 x double], ptr %136, i64 0, i64 %139
  %141 = load double, ptr %140, align 8, !tbaa !12
  %142 = load double, ptr %7, align 8, !tbaa !12
  %143 = fmul double %142, %141
  store double %143, ptr %7, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %144

144:                                              ; preds = %131
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  br label %90, !llvm.loop !17

146:                                              ; preds = %97
  %147 = load i32, ptr %8, align 4, !tbaa !5
  %148 = icmp eq i32 %147, 0
  br i1 %148, label %149, label %150

149:                                              ; preds = %146
  store double 0.000000e+00, ptr %6, align 8, !tbaa !12
  br label %150

150:                                              ; preds = %149, %146
  %151 = load double, ptr %6, align 8, !tbaa !12
  %152 = load double, ptr %7, align 8, !tbaa !12
  %153 = fadd double %151, %152
  %154 = load i32, ptr %2, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %155
  %157 = getelementptr inbounds %struct.seg, ptr %156, i32 0, i32 4
  %158 = load i32, ptr %8, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [5010 x double], ptr %157, i64 0, i64 %159
  store double %153, ptr %160, align 8, !tbaa !12
  br label %161

161:                                              ; preds = %150
  %162 = load i32, ptr %8, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %8, align 4, !tbaa !5
  br label %68, !llvm.loop !18

164:                                              ; preds = %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %165

165:                                              ; preds = %164, %47
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 16}
!10 = !{!"_ZTS3seg", !6, i64 0, !6, i64 4, !6, i64 8, !11, i64 16, !7, i64 24}
!11 = !{!"double", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!10, !6, i64 8}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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

%struct.seg = type { i32, i32, i32, double, [5010 x double] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@q = external dso_local global i32, align 4
@s = external dso_local local_unnamed_addr global [5010 x %struct.seg], align 16
@g = external dso_local global [5010 x %"class.std::vector"], align 16

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z7computei(i32 noundef %0) local_unnamed_addr #1 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = sext i32 %0 to i64
  %9 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @g, i64 0, i64 %8
  %10 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  %11 = icmp eq i64 %10, 0
  br i1 %11, label %12, label %25

12:                                               ; preds = %1
  %13 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %8
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  %15 = load double, ptr %14, align 8, !tbaa !5
  %16 = fsub double 1.000000e+00, %15
  %17 = getelementptr inbounds i8, ptr %13, i64 24
  store double %16, ptr %17, align 8, !tbaa !11
  %18 = load i32, ptr @q, align 4, !tbaa !12
  %.not2638 = icmp slt i32 %18, 1
  br i1 %.not2638, label %.loopexit, label %.lr.ph41.preheader

.lr.ph41.preheader:                               ; preds = %12
  %19 = add nuw i32 %18, 1
  %wide.trip.count = zext i32 %19 to i64
  %20 = zext nneg i32 %18 to i64
  %min.iters.check = icmp ult i32 %18, 4
  br i1 %min.iters.check, label %.lr.ph41.preheader49, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph41.preheader
  %n.vec = and i64 %20, 2147483644
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %21 = getelementptr inbounds [5010 x double], ptr %17, i64 0, i64 %offset.idx
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %21, align 8, !tbaa !11
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %22, align 8, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %23 = icmp eq i64 %index.next, %n.vec
  br i1 %23, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %20
  br i1 %cmp.n, label %.loopexit, label %.lr.ph41.preheader49

.lr.ph41.preheader49:                             ; preds = %middle.block, %.lr.ph41.preheader
  %indvars.iv44.ph = phi i64 [ 1, %.lr.ph41.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph41

.lr.ph41:                                         ; preds = %.lr.ph41.preheader49, %.lr.ph41
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %.lr.ph41 ], [ %indvars.iv44.ph, %.lr.ph41.preheader49 ]
  %24 = getelementptr inbounds [5010 x double], ptr %17, i64 0, i64 %indvars.iv44
  store double 1.000000e+00, ptr %24, align 8, !tbaa !11
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next45, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph41, !llvm.loop !17

25:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  %26 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  store ptr %26, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %27 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  store ptr %27, ptr %3, align 8
  %28 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br i1 %28, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  %29 = load i32, ptr @q, align 4, !tbaa !12
  %.not34 = icmp slt i32 %29, 0
  br i1 %.not34, label %.loopexit, label %.lr.ph37

.lr.ph37:                                         ; preds = %._crit_edge
  %30 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %8
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  %32 = getelementptr inbounds i8, ptr %30, i64 8
  %33 = getelementptr inbounds i8, ptr %30, i64 24
  br label %39

.lr.ph:                                           ; preds = %25, %.lr.ph
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  %35 = load i32, ptr %34, align 4, !tbaa !12
  call void @_Z7computei(i32 noundef %35)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %37 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  store ptr %37, ptr %3, align 8
  %38 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br i1 %38, label %.lr.ph, label %._crit_edge, !llvm.loop !18

39:                                               ; preds = %.lr.ph37, %._crit_edge32
  %indvars.iv = phi i64 [ 0, %.lr.ph37 ], [ %indvars.iv.next, %._crit_edge32 ]
  %40 = load double, ptr %31, align 8, !tbaa !5
  %41 = fsub double 1.000000e+00, %40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %42 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  store ptr %42, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %43 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  store ptr %43, ptr %5, align 8
  %44 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br i1 %44, label %.lr.ph31.preheader, label %._crit_edge32

.lr.ph31.preheader:                               ; preds = %39
  %45 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.lr.ph31

._crit_edge32:                                    ; preds = %72, %39
  %.024.lcssa = phi double [ %40, %39 ], [ %.1, %72 ]
  %.023.lcssa = phi double [ %41, %39 ], [ %81, %72 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  %46 = icmp eq i64 %indvars.iv, 0
  %.2 = select i1 %46, double 0.000000e+00, double %.024.lcssa
  %47 = fadd double %.2, %.023.lcssa
  %48 = getelementptr inbounds [5010 x double], ptr %33, i64 0, i64 %indvars.iv
  store double %47, ptr %48, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %49 = load i32, ptr @q, align 4, !tbaa !12
  %50 = sext i32 %49 to i64
  %.not.not = icmp slt i64 %indvars.iv, %50
  br i1 %.not.not, label %39, label %.loopexit, !llvm.loop !19

.lr.ph31:                                         ; preds = %.lr.ph31.preheader, %72
  %.02329 = phi double [ %81, %72 ], [ %41, %.lr.ph31.preheader ]
  %.02428 = phi double [ %.1, %72 ], [ %40, %.lr.ph31.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  %51 = load i32, ptr %32, align 8, !tbaa !20
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %53 = load i32, ptr %52, align 4, !tbaa !12
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %54, i32 2
  %56 = load i32, ptr %55, align 8, !tbaa !20
  %57 = sub nsw i32 %51, %56
  %58 = add nsw i32 %57, %45
  store i32 %58, ptr %6, align 4, !tbaa !12
  %59 = icmp sgt i32 %58, 0
  br i1 %59, label %60, label %72

60:                                               ; preds = %.lr.ph31
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %62 = load i32, ptr %61, align 4, !tbaa !12
  %63 = sext i32 %62 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %64 = load i32, ptr %6, align 4, !tbaa !12
  %65 = add nsw i32 %64, -1
  store i32 %65, ptr %7, align 4, !tbaa !12
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @q, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %67 = load i32, ptr %66, align 4, !tbaa !12
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %63, i32 4, i64 %68
  %70 = load double, ptr %69, align 8, !tbaa !11
  %71 = fmul double %.02428, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  br label %72

72:                                               ; preds = %60, %.lr.ph31
  %.1 = phi double [ %71, %60 ], [ %.02428, %.lr.ph31 ]
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %74 = load i32, ptr %73, align 4, !tbaa !12
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @q, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %77 = load i32, ptr %76, align 4, !tbaa !12
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %75, i32 4, i64 %78
  %80 = load double, ptr %79, align 8, !tbaa !11
  %81 = fmul double %.02329, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %83 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  store ptr %83, ptr %5, align 8
  %84 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br i1 %84, label %.lr.ph31, label %._crit_edge32, !llvm.loop !21

.loopexit:                                        ; preds = %._crit_edge32, %.lr.ph41, %middle.block, %._crit_edge, %12
  ret void
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

attributes #0 = { mustprogress 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 = { 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 #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, !10, i64 16}
!6 = !{!"_ZTS3seg", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !8, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14, !16, !15}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = !{!6, !7, i64 8}
!21 = distinct !{!21, !14}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass