; LLVM IR from DionysiosB/CodeForces :: 0900-0999 (978D-AlmostArithmeticProgression)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  %18 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %18, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %19 unwind label %25

19:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !5
  br label %20

20:                                               ; preds = %34, %19
  %21 = load i64, ptr %7, align 8, !tbaa !5
  %22 = load i64, ptr %2, align 8, !tbaa !5
  %23 = icmp slt i64 %21, %22
  br i1 %23, label %29, label %24

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %41

25:                                               ; preds = %0
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %5, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  br label %156

29:                                               ; preds = %20
  %30 = load i64, ptr %7, align 8, !tbaa !5
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %30) #5
  %32 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %31)
          to label %33 unwind label %37

33:                                               ; preds = %29
  br label %34

34:                                               ; preds = %33
  %35 = load i64, ptr %7, align 8, !tbaa !5
  %36 = add nsw i64 %35, 1
  store i64 %36, ptr %7, align 8, !tbaa !5
  br label %20, !llvm.loop !9

37:                                               ; preds = %29
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %5, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %155

41:                                               ; preds = %24
  %42 = load i64, ptr %2, align 8, !tbaa !5
  %43 = icmp sle i64 %42, 2
  br i1 %43, label %44, label %51

44:                                               ; preds = %41
  %45 = invoke i32 @puts(ptr noundef @.str.1)
          to label %46 unwind label %47

46:                                               ; preds = %44
  br label %153

47:                                               ; preds = %44
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %5, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %6, align 4
  br label %155

51:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 -1, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 -1, ptr %9, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %142, %51
  %53 = load i64, ptr %9, align 8, !tbaa !5
  %54 = icmp sle i64 %53, 1
  br i1 %54, label %56, label %55

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

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #5
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = load i64, ptr %9, align 8, !tbaa !5
  %60 = add nsw i64 %58, %59
  store i64 %60, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 -1, ptr %12, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %138, %56
  %62 = load i64, ptr %12, align 8, !tbaa !5
  %63 = icmp sle i64 %62, 1
  br i1 %63, label %65, label %64

64:                                               ; preds = %61
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %141

65:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 1) #5
  %67 = load i64, ptr %66, align 8, !tbaa !5
  %68 = load i64, ptr %12, align 8, !tbaa !5
  %69 = add nsw i64 %67, %68
  %70 = load i64, ptr %11, align 8, !tbaa !5
  %71 = sub nsw i64 %69, %70
  store i64 %71, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %72 = load i64, ptr %9, align 8, !tbaa !5
  %73 = icmp ne i64 %72, 0
  %74 = zext i1 %73 to i32
  %75 = load i64, ptr %12, align 8, !tbaa !5
  %76 = icmp ne i64 %75, 0
  %77 = zext i1 %76 to i32
  %78 = add nsw i32 %74, %77
  %79 = sext i32 %78 to i64
  store i64 %79, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 2, ptr %15, align 8, !tbaa !5
  br label %80

80:                                               ; preds = %120, %65
  %81 = load i64, ptr %15, align 8, !tbaa !5
  %82 = load i64, ptr %2, align 8, !tbaa !5
  %83 = icmp slt i64 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 11, ptr %10, align 4
  br label %123

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %86 = load i64, ptr %11, align 8, !tbaa !5
  %87 = load i64, ptr %15, align 8, !tbaa !5
  %88 = load i64, ptr %13, align 8, !tbaa !5
  %89 = mul nsw i64 %87, %88
  %90 = add nsw i64 %86, %89
  store i64 %90, ptr %16, align 8, !tbaa !5
  %91 = load i64, ptr %15, align 8, !tbaa !5
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %91) #5
  %93 = load i64, ptr %92, align 8, !tbaa !5
  %94 = load i64, ptr %16, align 8, !tbaa !5
  %95 = icmp eq i64 %93, %94
  br i1 %95, label %96, label %97

96:                                               ; preds = %85
  store i32 13, ptr %10, align 4
  br label %117

97:                                               ; preds = %85
  %98 = load i64, ptr %15, align 8, !tbaa !5
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %98) #5
  %100 = load i64, ptr %99, align 8, !tbaa !5
  %101 = load i64, ptr %16, align 8, !tbaa !5
  %102 = add nsw i64 %101, 1
  %103 = icmp eq i64 %100, %102
  br i1 %103, label %111, label %104

104:                                              ; preds = %97
  %105 = load i64, ptr %15, align 8, !tbaa !5
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %105) #5
  %107 = load i64, ptr %106, align 8, !tbaa !5
  %108 = load i64, ptr %16, align 8, !tbaa !5
  %109 = sub nsw i64 %108, 1
  %110 = icmp eq i64 %107, %109
  br i1 %110, label %111, label %114

111:                                              ; preds = %104, %97
  %112 = load i64, ptr %14, align 8, !tbaa !5
  %113 = add nsw i64 %112, 1
  store i64 %113, ptr %14, align 8, !tbaa !5
  br label %115

114:                                              ; preds = %104
  store i64 -1, ptr %14, align 8, !tbaa !5
  store i32 11, ptr %10, align 4
  br label %117

115:                                              ; preds = %111
  br label %116

116:                                              ; preds = %115
  store i32 0, ptr %10, align 4
  br label %117

117:                                              ; preds = %116, %114, %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  %118 = load i32, ptr %10, align 4
  switch i32 %118, label %123 [
    i32 0, label %119
    i32 13, label %120
  ]

119:                                              ; preds = %117
  br label %120

120:                                              ; preds = %119, %117
  %121 = load i64, ptr %15, align 8, !tbaa !5
  %122 = add nsw i64 %121, 1
  store i64 %122, ptr %15, align 8, !tbaa !5
  br label %80, !llvm.loop !11

123:                                              ; preds = %117, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %124

124:                                              ; preds = %123
  %125 = load i64, ptr %14, align 8, !tbaa !5
  %126 = icmp sge i64 %125, 0
  br i1 %126, label %127, label %137

127:                                              ; preds = %124
  %128 = load i64, ptr %8, align 8, !tbaa !5
  %129 = icmp slt i64 %128, 0
  br i1 %129, label %134, label %130

130:                                              ; preds = %127
  %131 = load i64, ptr %14, align 8, !tbaa !5
  %132 = load i64, ptr %8, align 8, !tbaa !5
  %133 = icmp slt i64 %131, %132
  br i1 %133, label %134, label %136

134:                                              ; preds = %130, %127
  %135 = load i64, ptr %14, align 8, !tbaa !5
  store i64 %135, ptr %8, align 8, !tbaa !5
  br label %136

136:                                              ; preds = %134, %130
  br label %137

137:                                              ; preds = %136, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %138

138:                                              ; preds = %137
  %139 = load i64, ptr %12, align 8, !tbaa !5
  %140 = add nsw i64 %139, 1
  store i64 %140, ptr %12, align 8, !tbaa !5
  br label %61, !llvm.loop !12

141:                                              ; preds = %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %142

142:                                              ; preds = %141
  %143 = load i64, ptr %9, align 8, !tbaa !5
  %144 = add nsw i64 %143, 1
  store i64 %144, ptr %9, align 8, !tbaa !5
  br label %52, !llvm.loop !13

145:                                              ; preds = %55
  %146 = load i64, ptr %8, align 8, !tbaa !5
  %147 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %146)
          to label %148 unwind label %149

148:                                              ; preds = %145
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %153

149:                                              ; preds = %145
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %5, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %155

153:                                              ; preds = %148, %46
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %154 = load i32, ptr %1, align 4
  ret i32 %154

155:                                              ; preds = %149, %47, %37
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  br label %156

156:                                              ; preds = %155, %25
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %157

157:                                              ; preds = %156
  %158 = load ptr, ptr %5, align 8
  %159 = load i32, ptr %6, align 4
  %160 = insertvalue { ptr, i32 } poison, ptr %158, 0
  %161 = insertvalue { ptr, i32 } %160, i32 %159, 1
  resume { ptr, i32 } %161
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; 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 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

declare i32 @puts(ptr noundef) #2

declare i32 @printf(ptr noundef, ...) #2

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

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

attributes #0 = { mustprogress norecurse 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 = { "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 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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  %5 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #6
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %5, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %6 unwind label %10

6:                                                ; preds = %0
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  %7 = load i64, ptr %1, align 8, !tbaa !5
  %8 = icmp sgt i64 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge.thread

._crit_edge:                                      ; preds = %.lr.ph
  %9 = icmp slt i64 %15, 3
  br i1 %9, label %._crit_edge.thread, label %.preheader

10:                                               ; preds = %0
  %11 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %11

.lr.ph:                                           ; preds = %6, %.lr.ph
  %.03453 = phi i64 [ %14, %.lr.ph ], [ 0, %6 ]
  %12 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03453) #6
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %12)
  %14 = add nuw nsw i64 %.03453, 1
  %15 = load i64, ptr %1, align 8, !tbaa !5
  %16 = icmp slt i64 %14, %15
  br i1 %16, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge.thread:                               ; preds = %6, %._crit_edge
  %17 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %118

18:                                               ; preds = %.thread46.2
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %116)
  br label %118

.preheader:                                       ; preds = %._crit_edge, %.thread46.2
  %.03663 = phi i64 [ %116, %.thread46.2 ], [ -1, %._crit_edge ]
  %.04062 = phi i64 [ %117, %.thread46.2 ], [ -1, %._crit_edge ]
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #6
  %21 = load i64, ptr %20, align 8, !tbaa !5
  %22 = add nsw i64 %21, %.04062
  %23 = icmp ne i64 %.04062, 0
  %24 = zext i1 %23 to i64
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 1) #6
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = xor i64 %22, -1
  %28 = add i64 %26, %27
  %29 = select i1 %23, i64 2, i64 1
  %30 = load i64, ptr %1, align 8, !tbaa !5
  %31 = icmp sgt i64 %30, 2
  br i1 %31, label %.lr.ph57, label %._crit_edge58

.lr.ph57:                                         ; preds = %.preheader, %49
  %.055 = phi i64 [ %50, %49 ], [ 2, %.preheader ]
  %.03354 = phi i64 [ %.1.ph, %49 ], [ %29, %.preheader ]
  %32 = mul nsw i64 %.055, %28
  %33 = add nsw i64 %32, %22
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.055) #6
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = icmp eq i64 %35, %33
  br i1 %36, label %49, label %37

37:                                               ; preds = %.lr.ph57
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.055) #6
  %39 = load i64, ptr %38, align 8, !tbaa !5
  %40 = add nsw i64 %33, 1
  %41 = icmp eq i64 %39, %40
  br i1 %41, label %47, label %42

42:                                               ; preds = %37
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.055) #6
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = add nsw i64 %33, -1
  %46 = icmp eq i64 %44, %45
  br i1 %46, label %47, label %.thread46

47:                                               ; preds = %42, %37
  %48 = add i64 %.03354, 1
  br label %49

49:                                               ; preds = %47, %.lr.ph57
  %.1.ph = phi i64 [ %.03354, %.lr.ph57 ], [ %48, %47 ]
  %50 = add nuw nsw i64 %.055, 1
  %51 = load i64, ptr %1, align 8, !tbaa !5
  %52 = icmp slt i64 %50, %51
  br i1 %52, label %.lr.ph57, label %._crit_edge58, !llvm.loop !11

._crit_edge58:                                    ; preds = %49, %.preheader
  %.033.lcssa = phi i64 [ %29, %.preheader ], [ %.1.ph, %49 ]
  %53 = icmp slt i64 %.03663, 0
  %54 = call i64 @llvm.smin.i64(i64 %.033.lcssa, i64 %.03663)
  %spec.select = select i1 %53, i64 %.033.lcssa, i64 %54
  %55 = icmp slt i64 %.033.lcssa, 0
  %spec.select51 = select i1 %55, i64 %.03663, i64 %spec.select
  br label %.thread46

.thread46:                                        ; preds = %42, %._crit_edge58
  %56 = phi i64 [ %spec.select51, %._crit_edge58 ], [ %.03663, %42 ]
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 1) #6
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = sub i64 %58, %22
  %60 = load i64, ptr %1, align 8, !tbaa !5
  %61 = icmp sgt i64 %60, 2
  br i1 %61, label %.lr.ph57.1, label %._crit_edge58.1

.lr.ph57.1:                                       ; preds = %.thread46, %79
  %.055.1 = phi i64 [ %80, %79 ], [ 2, %.thread46 ]
  %.03354.1 = phi i64 [ %.1.ph.1, %79 ], [ %24, %.thread46 ]
  %62 = mul nsw i64 %.055.1, %59
  %63 = add nsw i64 %62, %22
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.055.1) #6
  %65 = load i64, ptr %64, align 8, !tbaa !5
  %66 = icmp eq i64 %65, %63
  br i1 %66, label %79, label %67

67:                                               ; preds = %.lr.ph57.1
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.055.1) #6
  %69 = load i64, ptr %68, align 8, !tbaa !5
  %70 = add nsw i64 %63, 1
  %71 = icmp eq i64 %69, %70
  br i1 %71, label %77, label %72

72:                                               ; preds = %67
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.055.1) #6
  %74 = load i64, ptr %73, align 8, !tbaa !5
  %75 = add nsw i64 %63, -1
  %76 = icmp eq i64 %74, %75
  br i1 %76, label %77, label %.thread46.1

77:                                               ; preds = %72, %67
  %78 = add i64 %.03354.1, 1
  br label %79

79:                                               ; preds = %77, %.lr.ph57.1
  %.1.ph.1 = phi i64 [ %.03354.1, %.lr.ph57.1 ], [ %78, %77 ]
  %80 = add nuw nsw i64 %.055.1, 1
  %81 = load i64, ptr %1, align 8, !tbaa !5
  %82 = icmp slt i64 %80, %81
  br i1 %82, label %.lr.ph57.1, label %._crit_edge58.1, !llvm.loop !11

._crit_edge58.1:                                  ; preds = %79, %.thread46
  %.033.lcssa.1 = phi i64 [ %24, %.thread46 ], [ %.1.ph.1, %79 ]
  %83 = icmp slt i64 %56, 0
  %84 = call i64 @llvm.smin.i64(i64 %.033.lcssa.1, i64 %56)
  %spec.select.1 = select i1 %83, i64 %.033.lcssa.1, i64 %84
  %85 = icmp slt i64 %.033.lcssa.1, 0
  %spec.select51.1 = select i1 %85, i64 %56, i64 %spec.select.1
  br label %.thread46.1

.thread46.1:                                      ; preds = %72, %._crit_edge58.1
  %86 = phi i64 [ %spec.select51.1, %._crit_edge58.1 ], [ %56, %72 ]
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 1) #6
  %88 = load i64, ptr %87, align 8, !tbaa !5
  %reass.sub = sub i64 %88, %22
  %89 = add i64 %reass.sub, 1
  %90 = load i64, ptr %1, align 8, !tbaa !5
  %91 = icmp sgt i64 %90, 2
  br i1 %91, label %.lr.ph57.2, label %._crit_edge58.2

.lr.ph57.2:                                       ; preds = %.thread46.1, %109
  %.055.2 = phi i64 [ %110, %109 ], [ 2, %.thread46.1 ]
  %.03354.2 = phi i64 [ %.1.ph.2, %109 ], [ %29, %.thread46.1 ]
  %92 = mul nsw i64 %.055.2, %89
  %93 = add nsw i64 %92, %22
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.055.2) #6
  %95 = load i64, ptr %94, align 8, !tbaa !5
  %96 = icmp eq i64 %95, %93
  br i1 %96, label %109, label %97

97:                                               ; preds = %.lr.ph57.2
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.055.2) #6
  %99 = load i64, ptr %98, align 8, !tbaa !5
  %100 = add nsw i64 %93, 1
  %101 = icmp eq i64 %99, %100
  br i1 %101, label %107, label %102

102:                                              ; preds = %97
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.055.2) #6
  %104 = load i64, ptr %103, align 8, !tbaa !5
  %105 = add nsw i64 %93, -1
  %106 = icmp eq i64 %104, %105
  br i1 %106, label %107, label %.thread46.2

107:                                              ; preds = %102, %97
  %108 = add i64 %.03354.2, 1
  br label %109

109:                                              ; preds = %107, %.lr.ph57.2
  %.1.ph.2 = phi i64 [ %.03354.2, %.lr.ph57.2 ], [ %108, %107 ]
  %110 = add nuw nsw i64 %.055.2, 1
  %111 = load i64, ptr %1, align 8, !tbaa !5
  %112 = icmp slt i64 %110, %111
  br i1 %112, label %.lr.ph57.2, label %._crit_edge58.2, !llvm.loop !11

._crit_edge58.2:                                  ; preds = %109, %.thread46.1
  %.033.lcssa.2 = phi i64 [ %29, %.thread46.1 ], [ %.1.ph.2, %109 ]
  %113 = icmp slt i64 %86, 0
  %114 = call i64 @llvm.smin.i64(i64 %.033.lcssa.2, i64 %86)
  %spec.select.2 = select i1 %113, i64 %.033.lcssa.2, i64 %114
  %115 = icmp slt i64 %.033.lcssa.2, 0
  %spec.select51.2 = select i1 %115, i64 %86, i64 %spec.select.2
  br label %.thread46.2

.thread46.2:                                      ; preds = %102, %._crit_edge58.2
  %116 = phi i64 [ %spec.select51.2, %._crit_edge58.2 ], [ %86, %102 ]
  %117 = add i64 %.04062, 1
  %exitcond.not = icmp eq i64 %117, 2
  br i1 %exitcond.not, label %18, label %.preheader, !llvm.loop !12

118:                                              ; preds = %18, %._crit_edge.thread
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; 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 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

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

attributes #0 = { mustprogress norecurse 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 = { nofree 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 #3 = { 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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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