; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/SNACKDOWN/16/Pre-Elimination A/Problem E/E.ll (Z10preprocessv)

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

@n = external dso_local global i32, align 4
@fst = external dso_local global [1001000 x i32], align 16
@s = external dso_local global [100100 x %struct.seg], align 16
@v = external dso_local global [1001000 x %"class.std::vector"], align 16
@jump = external dso_local global [20 x [100100 x i32]], align 16
@_ZL3INF = external hidden constant i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10preprocessv() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %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 i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 1000000000, ptr getelementptr inbounds ([1001000 x i32], ptr @fst, i64 0, i64 1000999), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store i32 1000998, ptr %1, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %78, %0
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %15, label %14

14:                                               ; preds = %11
  store i32 2, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  br label %81

15:                                               ; preds = %11
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = add nsw i32 %16, 1
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [1001000 x i32], ptr @fst, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [1001000 x i32], ptr @fst, i64 0, i64 %22
  store i32 %20, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1000000000, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1000000000, ptr %4, align 4, !tbaa !5
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [1001000 x i32], ptr @fst, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = icmp ne i32 %27, 1000000000
  br i1 %28, label %29, label %39

29:                                               ; preds = %15
  %30 = load i32, ptr %1, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [1001000 x i32], ptr @fst, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  store i32 %33, ptr %4, align 4, !tbaa !5
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100100 x %struct.seg], ptr @s, i64 0, i64 %35
  %37 = getelementptr inbounds %struct.seg, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !9
  store i32 %38, ptr %3, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %29, %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %40 = load i32, ptr %1, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [1001000 x %"class.std::vector"], ptr @v, i64 0, i64 %41
  %43 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #5
  %44 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %43, ptr %44, align 8
  br label %45

45:                                               ; preds = %71, %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %46 = load i32, ptr %1, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [1001000 x %"class.std::vector"], ptr @v, i64 0, i64 %47
  %49 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %48) #5
  %50 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %49, ptr %50, align 8
  %51 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br i1 %51, label %53, label %52

52:                                               ; preds = %45
  store i32 5, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %73

53:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %55 = load i32, ptr %54, align 4, !tbaa !5
  store i32 %55, ptr %7, align 4, !tbaa !5
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [100100 x %struct.seg], ptr @s, i64 0, i64 %57
  %59 = getelementptr inbounds %struct.seg, ptr %58, i32 0, i32 1
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %63, label %70

63:                                               ; preds = %53
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100100 x %struct.seg], ptr @s, i64 0, i64 %65
  %67 = getelementptr inbounds %struct.seg, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !9
  store i32 %68, ptr %3, align 4, !tbaa !5
  %69 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %69, ptr %4, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %63, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %71

71:                                               ; preds = %70
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br label %45, !llvm.loop !11

73:                                               ; preds = %52
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = load i32, ptr %1, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [1001000 x i32], ptr @fst, i64 0, i64 %76
  store i32 %74, ptr %77, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %78

78:                                               ; preds = %73
  %79 = load i32, ptr %1, align 4, !tbaa !5
  %80 = add nsw i32 %79, -1
  store i32 %80, ptr %1, align 4, !tbaa !5
  br label %11, !llvm.loop !13

81:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %100, %81
  %83 = load i32, ptr %8, align 4, !tbaa !5
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %85 = icmp sle i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 8, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %103

87:                                               ; preds = %82
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [100100 x %struct.seg], ptr @s, i64 0, i64 %89
  %91 = getelementptr inbounds %struct.seg, ptr %90, i32 0, i32 1
  %92 = load i32, ptr %91, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [1001000 x i32], ptr @fst, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100100 x i32], ptr @jump, i64 0, i64 %98
  store i32 %96, ptr %99, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %87
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %8, align 4, !tbaa !5
  br label %82, !llvm.loop !14

103:                                              ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %160, %103
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = icmp slt i32 %105, 20
  br i1 %106, label %108, label %107

107:                                              ; preds = %104
  store i32 11, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %163

108:                                              ; preds = %104
  %109 = load i32, ptr %9, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %110
  %112 = getelementptr inbounds [100100 x i32], ptr %111, i64 0, i64 0
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %114
  %116 = getelementptr inbounds [100100 x i32], ptr %115, i64 0, i64 0
  %117 = getelementptr inbounds i32, ptr %116, i64 100100
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef %112, ptr noundef %117, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3INF)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %156, %108
  %119 = load i32, ptr %10, align 4, !tbaa !5
  %120 = load i32, ptr @n, align 4, !tbaa !5
  %121 = icmp sle i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 14, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %159

123:                                              ; preds = %118
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = sub nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %126
  %128 = load i32, ptr %10, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100100 x i32], ptr %127, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = icmp ne i32 %131, 1000000000
  br i1 %132, label %133, label %155

133:                                              ; preds = %123
  %134 = load i32, ptr %9, align 4, !tbaa !5
  %135 = sub nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %136
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = sub nsw i32 %138, 1
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %140
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100100 x i32], ptr %141, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [100100 x i32], ptr %137, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = load i32, ptr %9, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %150
  %152 = load i32, ptr %10, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [100100 x i32], ptr %151, i64 0, i64 %153
  store i32 %148, ptr %154, align 4, !tbaa !5
  br label %155

155:                                              ; preds = %133, %123
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %10, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %10, align 4, !tbaa !5
  br label %118, !llvm.loop !15

159:                                              ; preds = %122
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %9, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %9, align 4, !tbaa !5
  br label %104, !llvm.loop !16

163:                                              ; preds = %107
  ret void
}

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

; 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: 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 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 uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #4

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


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

@n = external dso_local local_unnamed_addr global i32, align 4
@fst = external dso_local local_unnamed_addr global [1001000 x i32], align 16
@s = external dso_local local_unnamed_addr global [100100 x %struct.seg], align 16
@v = external dso_local global [1001000 x %"class.std::vector"], align 16
@jump = external dso_local global [20 x [100100 x i32]], align 16
@_ZL3INF = external hidden constant i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10preprocessv() local_unnamed_addr #0 {
  %1 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i32 1000000000, ptr getelementptr inbounds (i8, ptr @fst, i64 4003996), align 4, !tbaa !5
  br label %13

.preheader46:                                     ; preds = %._crit_edge
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %.not50 = icmp slt i32 %3, 1
  br i1 %.not50, label %.preheader.preheader, label %.lr.ph52.preheader

.preheader.preheader.loopexit.unr-lcssa:          ; preds = %.lr.ph52, %.lr.ph52.preheader
  %indvars.iv60.unr = phi i64 [ 1, %.lr.ph52.preheader ], [ %indvars.iv.next61.1, %.lr.ph52 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader.preheader, label %.lr.ph52.epil

.lr.ph52.epil:                                    ; preds = %.preheader.preheader.loopexit.unr-lcssa
  %4 = getelementptr inbounds [100100 x %struct.seg], ptr @s, i64 0, i64 %indvars.iv60.unr, i32 1
  %5 = load i32, ptr %4, align 4, !tbaa !9
  %6 = add nsw i32 %5, 1
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds [1001000 x i32], ptr @fst, i64 0, i64 %7
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = getelementptr inbounds [100100 x i32], ptr @jump, i64 0, i64 %indvars.iv60.unr
  store i32 %9, ptr %10, align 4, !tbaa !5
  br label %.preheader.preheader

.preheader.preheader:                             ; preds = %.lr.ph52.epil, %.preheader.preheader.loopexit.unr-lcssa, %.preheader46
  br label %.preheader

.lr.ph52.preheader:                               ; preds = %.preheader46
  %11 = zext nneg i32 %3 to i64
  %xtraiter = and i64 %11, 1
  %12 = icmp eq i32 %3, 1
  br i1 %12, label %.preheader.preheader.loopexit.unr-lcssa, label %.lr.ph52.preheader.new

.lr.ph52.preheader.new:                           ; preds = %.lr.ph52.preheader
  %unroll_iter = and i64 %11, 2147483646
  br label %.lr.ph52

13:                                               ; preds = %0, %._crit_edge
  %14 = phi i32 [ 1000000000, %0 ], [ %.1.lcssa, %._crit_edge ]
  %indvars.iv = phi i64 [ 1000998, %0 ], [ %indvars.iv.next, %._crit_edge ]
  %15 = getelementptr inbounds [1001000 x i32], ptr @fst, i64 0, i64 %indvars.iv
  store i32 %14, ptr %15, align 4, !tbaa !5
  %.not44 = icmp eq i32 %14, 1000000000
  br i1 %.not44, label %20, label %16

16:                                               ; preds = %13
  %17 = sext i32 %14 to i64
  %18 = getelementptr inbounds [100100 x %struct.seg], ptr @s, i64 0, i64 %17, i32 1
  %19 = load i32, ptr %18, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %16, %13
  %.036 = phi i32 [ %19, %16 ], [ 1000000000, %13 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %21 = getelementptr inbounds [1001000 x %"class.std::vector"], ptr @v, i64 0, i64 %indvars.iv
  %22 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  store ptr %22, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %23 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  store ptr %23, ptr %2, align 8
  %24 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br i1 %24, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %20
  %.1.lcssa = phi i32 [ %14, %20 ], [ %spec.select45, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  store i32 %.1.lcssa, ptr %15, align 4, !tbaa !5
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %25 = icmp ugt i64 %indvars.iv, 1
  br i1 %25, label %13, label %.preheader46, !llvm.loop !11

.lr.ph:                                           ; preds = %20, %.lr.ph
  %.148 = phi i32 [ %spec.select45, %.lr.ph ], [ %14, %20 ]
  %.13747 = phi i32 [ %spec.select, %.lr.ph ], [ %.036, %20 ]
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #6
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [100100 x %struct.seg], ptr @s, i64 0, i64 %28, i32 1
  %30 = load i32, ptr %29, align 4, !tbaa !9
  %31 = icmp slt i32 %30, %.13747
  %spec.select = call i32 @llvm.smin.i32(i32 %30, i32 %.13747)
  %spec.select45 = select i1 %31, i32 %27, i32 %.148
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %33 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  store ptr %33, ptr %2, align 8
  %34 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br i1 %34, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.lr.ph52:                                         ; preds = %.lr.ph52, %.lr.ph52.preheader.new
  %indvars.iv60 = phi i64 [ 1, %.lr.ph52.preheader.new ], [ %indvars.iv.next61.1, %.lr.ph52 ]
  %niter = phi i64 [ 0, %.lr.ph52.preheader.new ], [ %niter.next.1, %.lr.ph52 ]
  %35 = getelementptr inbounds [100100 x %struct.seg], ptr @s, i64 0, i64 %indvars.iv60, i32 1
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = add nsw i32 %36, 1
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [1001000 x i32], ptr @fst, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = getelementptr inbounds [100100 x i32], ptr @jump, i64 0, i64 %indvars.iv60
  store i32 %40, ptr %41, align 4, !tbaa !5
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %42 = getelementptr inbounds [100100 x %struct.seg], ptr @s, i64 0, i64 %indvars.iv.next61, i32 1
  %43 = load i32, ptr %42, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [1001000 x i32], ptr @fst, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = getelementptr inbounds [100100 x i32], ptr @jump, i64 0, i64 %indvars.iv.next61
  store i32 %47, ptr %48, align 4, !tbaa !5
  %indvars.iv.next61.1 = add nuw nsw i64 %indvars.iv60, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader.preheader.loopexit.unr-lcssa, label %.lr.ph52, !llvm.loop !14

49:                                               ; preds = %._crit_edge57
  ret void

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge57
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %._crit_edge57 ], [ 1, %.preheader.preheader ]
  %50 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %indvars.iv68
  %51 = getelementptr inbounds i8, ptr %50, i64 400400
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull %50, ptr noundef nonnull %51, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3INF)
  %52 = load i32, ptr @n, align 4, !tbaa !5
  %.not4253 = icmp slt i32 %52, 1
  br i1 %.not4253, label %._crit_edge57, label %.lr.ph56

.lr.ph56:                                         ; preds = %.preheader
  %53 = add nsw i64 %indvars.iv68, -1
  %54 = zext nneg i32 %52 to i64
  %xtraiter72 = and i64 %54, 1
  %55 = icmp eq i32 %52, 1
  br i1 %55, label %._crit_edge57.loopexit.unr-lcssa, label %.lr.ph56.new

.lr.ph56.new:                                     ; preds = %.lr.ph56
  %unroll_iter74 = and i64 %54, 2147483646
  br label %63

._crit_edge57.loopexit.unr-lcssa:                 ; preds = %79, %.lr.ph56
  %indvars.iv63.unr = phi i64 [ 1, %.lr.ph56 ], [ %indvars.iv.next64.1, %79 ]
  %lcmp.mod73.not = icmp eq i64 %xtraiter72, 0
  br i1 %lcmp.mod73.not, label %._crit_edge57, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge57.loopexit.unr-lcssa
  %56 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %53, i64 %indvars.iv63.unr
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %.not43.epil = icmp eq i32 %57, 1000000000
  br i1 %.not43.epil, label %._crit_edge57, label %58

58:                                               ; preds = %.epil.preheader
  %59 = sext i32 %57 to i64
  %60 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %53, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %indvars.iv68, i64 %indvars.iv63.unr
  store i32 %61, ptr %62, align 4, !tbaa !5
  br label %._crit_edge57

._crit_edge57:                                    ; preds = %._crit_edge57.loopexit.unr-lcssa, %58, %.epil.preheader, %.preheader
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %exitcond71.not = icmp eq i64 %indvars.iv.next69, 20
  br i1 %exitcond71.not, label %49, label %.preheader, !llvm.loop !15

63:                                               ; preds = %79, %.lr.ph56.new
  %indvars.iv63 = phi i64 [ 1, %.lr.ph56.new ], [ %indvars.iv.next64.1, %79 ]
  %niter75 = phi i64 [ 0, %.lr.ph56.new ], [ %niter75.next.1, %79 ]
  %64 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %53, i64 %indvars.iv63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %.not43 = icmp eq i32 %65, 1000000000
  br i1 %.not43, label %71, label %66

66:                                               ; preds = %63
  %67 = sext i32 %65 to i64
  %68 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %53, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %indvars.iv68, i64 %indvars.iv63
  store i32 %69, ptr %70, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %63, %66
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %72 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %53, i64 %indvars.iv.next64
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %.not43.1 = icmp eq i32 %73, 1000000000
  br i1 %.not43.1, label %79, label %74

74:                                               ; preds = %71
  %75 = sext i32 %73 to i64
  %76 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %53, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = getelementptr inbounds [20 x [100100 x i32]], ptr @jump, i64 0, i64 %indvars.iv68, i64 %indvars.iv.next64
  store i32 %77, ptr %78, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %74, %71
  %indvars.iv.next64.1 = add nuw nsw i64 %indvars.iv63, 2
  %niter75.next.1 = add i64 %niter75, 2
  %niter75.ncmp.1 = icmp eq i64 %niter75.next.1, %unroll_iter74
  br i1 %niter75.ncmp.1, label %._crit_edge57.loopexit.unr-lcssa, label %63, !llvm.loop !16
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #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)) local_unnamed_addr #3

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

; Function Attrs: mustprogress 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 nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #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)) local_unnamed_addr #2 align 2

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

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

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


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass