; LLVM IR from DionysiosB/CodeForces :: 0400-0499 (451B-SortTheArray)

; 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 [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 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 i64, align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  %17 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %17, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %18 unwind label %25

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

19:                                               ; preds = %35, %18
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = load i64, ptr %2, align 8, !tbaa !5
  %23 = icmp slt i64 %21, %22
  br i1 %23, label %29, label %24

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

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

29:                                               ; preds = %19
  %30 = load i32, ptr %8, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %31) #5
  %33 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %32)
          to label %34 unwind label %38

34:                                               ; preds = %29
  br label %35

35:                                               ; preds = %34
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %8, align 4, !tbaa !9
  br label %19, !llvm.loop !11

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

42:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  store i8 0, ptr %9, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #5
  store i8 0, ptr %10, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  store i8 1, ptr %11, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 1, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 1, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %102, %42
  %44 = load i32, ptr %14, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = load i64, ptr %2, align 8, !tbaa !5
  %47 = icmp slt i64 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %43
  store i32 5, ptr %15, align 4
  br label %105

49:                                               ; preds = %43
  %50 = load i32, ptr %14, align 4, !tbaa !9
  %51 = sub nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %52) #5
  %54 = load i64, ptr %53, align 8, !tbaa !5
  %55 = load i32, ptr %14, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %56) #5
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = icmp sgt i64 %54, %58
  br i1 %59, label %60, label %66

60:                                               ; preds = %49
  %61 = load i8, ptr %9, align 1, !tbaa !13, !range !15, !noundef !16
  %62 = trunc i8 %61 to i1
  br i1 %62, label %66, label %63

63:                                               ; preds = %60
  store i8 1, ptr %9, align 1, !tbaa !13
  %64 = load i32, ptr %14, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  store i64 %65, ptr %12, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %63, %60, %49
  %67 = load i32, ptr %14, align 4, !tbaa !9
  %68 = sub nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %69) #5
  %71 = load i64, ptr %70, align 8, !tbaa !5
  %72 = load i32, ptr %14, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %73) #5
  %75 = load i64, ptr %74, align 8, !tbaa !5
  %76 = icmp slt i64 %71, %75
  br i1 %76, label %77, label %86

77:                                               ; preds = %66
  %78 = load i8, ptr %9, align 1, !tbaa !13, !range !15, !noundef !16
  %79 = trunc i8 %78 to i1
  br i1 %79, label %80, label %86

80:                                               ; preds = %77
  %81 = load i8, ptr %10, align 1, !tbaa !13, !range !15, !noundef !16
  %82 = trunc i8 %81 to i1
  br i1 %82, label %86, label %83

83:                                               ; preds = %80
  store i8 1, ptr %10, align 1, !tbaa !13
  %84 = load i32, ptr %14, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  store i64 %85, ptr %13, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %83, %80, %77, %66
  %87 = load i32, ptr %14, align 4, !tbaa !9
  %88 = sub nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %89) #5
  %91 = load i64, ptr %90, align 8, !tbaa !5
  %92 = load i32, ptr %14, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %93) #5
  %95 = load i64, ptr %94, align 8, !tbaa !5
  %96 = icmp sgt i64 %91, %95
  br i1 %96, label %97, label %101

97:                                               ; preds = %86
  %98 = load i8, ptr %10, align 1, !tbaa !13, !range !15, !noundef !16
  %99 = trunc i8 %98 to i1
  br i1 %99, label %100, label %101

100:                                              ; preds = %97
  store i8 0, ptr %11, align 1, !tbaa !13
  store i32 5, ptr %15, align 4
  br label %105

101:                                              ; preds = %97, %86
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %14, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %14, align 4, !tbaa !9
  br label %43, !llvm.loop !17

105:                                              ; preds = %100, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %106

106:                                              ; preds = %105
  %107 = load i8, ptr %11, align 1, !tbaa !13, !range !15, !noundef !16
  %108 = trunc i8 %107 to i1
  br i1 %108, label %109, label %117

109:                                              ; preds = %106
  %110 = load i8, ptr %9, align 1, !tbaa !13, !range !15, !noundef !16
  %111 = trunc i8 %110 to i1
  br i1 %111, label %112, label %117

112:                                              ; preds = %109
  %113 = load i8, ptr %10, align 1, !tbaa !13, !range !15, !noundef !16
  %114 = trunc i8 %113 to i1
  br i1 %114, label %117, label %115

115:                                              ; preds = %112
  %116 = load i64, ptr %2, align 8, !tbaa !5
  store i64 %116, ptr %13, align 8, !tbaa !5
  br label %117

117:                                              ; preds = %115, %112, %109, %106
  %118 = load i64, ptr %12, align 8, !tbaa !5
  %119 = icmp sgt i64 %118, 1
  br i1 %119, label %120, label %130

120:                                              ; preds = %117
  %121 = load i64, ptr %12, align 8, !tbaa !5
  %122 = sub nsw i64 %121, 2
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %122) #5
  %124 = load i64, ptr %123, align 8, !tbaa !5
  %125 = load i64, ptr %13, align 8, !tbaa !5
  %126 = sub nsw i64 %125, 1
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %126) #5
  %128 = load i64, ptr %127, align 8, !tbaa !5
  %129 = icmp sgt i64 %124, %128
  br i1 %129, label %143, label %130

130:                                              ; preds = %120, %117
  %131 = load i64, ptr %13, align 8, !tbaa !5
  %132 = load i64, ptr %2, align 8, !tbaa !5
  %133 = icmp slt i64 %131, %132
  br i1 %133, label %134, label %144

134:                                              ; preds = %130
  %135 = load i64, ptr %12, align 8, !tbaa !5
  %136 = sub nsw i64 %135, 1
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %136) #5
  %138 = load i64, ptr %137, align 8, !tbaa !5
  %139 = load i64, ptr %13, align 8, !tbaa !5
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %139) #5
  %141 = load i64, ptr %140, align 8, !tbaa !5
  %142 = icmp sgt i64 %138, %141
  br i1 %142, label %143, label %144

143:                                              ; preds = %134, %120
  store i8 0, ptr %11, align 1, !tbaa !13
  br label %144

144:                                              ; preds = %143, %134, %130
  %145 = load i8, ptr %11, align 1, !tbaa !13, !range !15, !noundef !16
  %146 = trunc i8 %145 to i1
  br i1 %146, label %154, label %147

147:                                              ; preds = %144
  %148 = invoke i32 @puts(ptr noundef @.str.2)
          to label %149 unwind label %150

149:                                              ; preds = %147
  br label %161

150:                                              ; preds = %156, %154, %147
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %6, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %163

154:                                              ; preds = %144
  %155 = invoke i32 @puts(ptr noundef @.str.3)
          to label %156 unwind label %150

156:                                              ; preds = %154
  %157 = load i64, ptr %12, align 8, !tbaa !5
  %158 = load i64, ptr %13, align 8, !tbaa !5
  %159 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %157, i64 noundef %158)
          to label %160 unwind label %150

160:                                              ; preds = %156
  br label %161

161:                                              ; preds = %160, %149
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  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
  %162 = load i32, ptr %1, align 4
  ret i32 %162

163:                                              ; preds = %150, %38
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  br label %164

164:                                              ; preds = %163, %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 %165

165:                                              ; preds = %164
  %166 = load ptr, ptr %6, align 8
  %167 = load i32, ptr %7, align 4
  %168 = insertvalue { ptr, i32 } poison, ptr %166, 0
  %169 = insertvalue { ptr, i32 } %168, i32 %167, 1
  resume { ptr, i32 } %169
}

; 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 @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !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"

%"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 [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 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 i64, align 8
  %4 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  %6 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  store i64 0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %6, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %7 unwind label %10

7:                                                ; 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 nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %8 = load i64, ptr %1, align 8
  %9 = icmp sgt i64 %8, 0
  br i1 %9, label %.lr.ph, label %.thread

.preheader:                                       ; preds = %.lr.ph
  %.not71 = icmp sgt i64 %14, 1
  br i1 %.not71, label %.lr.ph78, label %.thread

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

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

.lr.ph78:                                         ; preds = %.preheader, %40
  %indvars.iv90 = phi i64 [ %indvars.iv.next91, %40 ], [ 1, %.preheader ]
  %.03175 = phi i64 [ %.1, %40 ], [ 1, %.preheader ]
  %.03274 = phi i64 [ %.133, %40 ], [ 1, %.preheader ]
  %.03773 = phi i8 [ %.138, %40 ], [ 0, %.preheader ]
  %.04072 = phi i8 [ %.141, %40 ], [ 0, %.preheader ]
  %16 = add nsw i64 %indvars.iv90, -1
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %16) #5
  %18 = load i64, ptr %17, align 8, !tbaa !5
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv90) #5
  %20 = load i64, ptr %19, align 8, !tbaa !5
  %21 = icmp sgt i64 %18, %20
  %22 = trunc nuw i8 %.04072 to i1
  %spec.select = select i1 %22, i8 %.04072, i8 1
  %spec.select46 = select i1 %22, i64 %.03274, i64 %indvars.iv90
  %.141 = select i1 %21, i8 %spec.select, i8 %.04072
  %.133 = select i1 %21, i64 %spec.select46, i64 %.03274
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %16) #5
  %24 = load i64, ptr %23, align 8, !tbaa !5
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv90) #5
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = icmp slt i64 %24, %26
  br i1 %27, label %28, label %32

28:                                               ; preds = %.lr.ph78
  %29 = trunc nuw i8 %.141 to i1
  br i1 %29, label %30, label %32

30:                                               ; preds = %28
  %31 = trunc nuw i8 %.03773 to i1
  %spec.select47 = select i1 %31, i8 %.03773, i8 1
  %spec.select48 = select i1 %31, i64 %.03175, i64 %indvars.iv90
  br label %32

32:                                               ; preds = %30, %28, %.lr.ph78
  %.138 = phi i8 [ %.03773, %28 ], [ %.03773, %.lr.ph78 ], [ %spec.select47, %30 ]
  %.1 = phi i64 [ %.03175, %28 ], [ %.03175, %.lr.ph78 ], [ %spec.select48, %30 ]
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %16) #5
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv90) #5
  %36 = load i64, ptr %35, align 8, !tbaa !5
  %37 = icmp sgt i64 %34, %36
  br i1 %37, label %38, label %40

38:                                               ; preds = %32
  %39 = trunc nuw i8 %.138 to i1
  br i1 %39, label %.loopexit, label %40

40:                                               ; preds = %32, %38
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %41 = load i64, ptr %1, align 8
  %.not = icmp sgt i64 %41, %indvars.iv.next91
  br i1 %.not, label %.lr.ph78, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %40
  %42 = trunc nuw i8 %.141 to i1
  %43 = trunc nuw i8 %.138 to i1
  %44 = select i1 %43, i64 %.1, i64 %41
  %spec.select124 = select i1 %42, i64 %44, i64 %.1
  br label %.loopexit

.loopexit:                                        ; preds = %38, %._crit_edge
  %.not65 = phi i1 [ false, %._crit_edge ], [ true, %38 ]
  %.3 = phi i64 [ %spec.select124, %._crit_edge ], [ %.1, %38 ]
  %45 = icmp sgt i64 %.133, 1
  br i1 %45, label %46, label %54

46:                                               ; preds = %.loopexit
  %47 = add nsw i64 %.133, -2
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %47) #5
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = add nsw i64 %.3, -1
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %50) #5
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = icmp sgt i64 %49, %52
  br i1 %53, label %.thread62, label %54

54:                                               ; preds = %46, %.loopexit
  %55 = load i64, ptr %1, align 8, !tbaa !5
  %56 = icmp slt i64 %.3, %55
  br i1 %56, label %59, label %66

.thread:                                          ; preds = %.preheader, %7
  %57 = load i64, ptr %1, align 8, !tbaa !5
  %58 = icmp sgt i64 %57, 1
  br i1 %58, label %59, label %.thread114

59:                                               ; preds = %.thread, %54
  %.not65100112 = phi i1 [ false, %.thread ], [ %.not65, %54 ]
  %.23459101111 = phi i64 [ 1, %.thread ], [ %.133, %54 ]
  %.3102108 = phi i64 [ 1, %.thread ], [ %.3, %54 ]
  %60 = add nsw i64 %.23459101111, -1
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %60) #5
  %62 = load i64, ptr %61, align 8, !tbaa !5
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.3102108) #5
  %64 = load i64, ptr %63, align 8, !tbaa !5
  %65 = icmp sgt i64 %62, %64
  %brmerge = or i1 %.not65100112, %65
  br i1 %brmerge, label %.thread62, label %.thread114

66:                                               ; preds = %54
  br i1 %.not65, label %.thread62, label %.thread114

.thread62:                                        ; preds = %59, %46, %66
  %67 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %70

.thread114:                                       ; preds = %.thread, %59, %66
  %.23459101109 = phi i64 [ %.23459101111, %59 ], [ %.133, %66 ], [ 1, %.thread ]
  %.3102106 = phi i64 [ %.3102108, %59 ], [ %.3, %66 ], [ 1, %.thread ]
  %68 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %.23459101109, i64 noundef %.3102106)
  br label %70

70:                                               ; preds = %.thread114, %.thread62
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  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 @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), 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

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 = { 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}


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