; LLVM IR from upupming/algorithm :: AdvancedLevel_C++/1089. Insert or Merge (25) (main)

; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [100 x i32], align 16
  %4 = alloca [100 x i32], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 400, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 400, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %22, %0
  %13 = load i32, ptr %7, align 4, !tbaa !5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %25

17:                                               ; preds = %12
  %18 = load i32, ptr %7, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 %19
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %20)
  br label %22

22:                                               ; preds = %17
  %23 = load i32, ptr %7, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %7, align 4, !tbaa !5
  br label %12, !llvm.loop !9

25:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %36, %25
  %27 = load i32, ptr %8, align 4, !tbaa !5
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %26
  %32 = load i32, ptr %8, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100 x i32], ptr %4, i64 0, i64 %33
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %34)
  br label %36

36:                                               ; preds = %31
  %37 = load i32, ptr %8, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %8, align 4, !tbaa !5
  br label %26, !llvm.loop !11

39:                                               ; preds = %30
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %59, %39
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = sub nsw i32 %42, 1
  %44 = icmp slt i32 %41, %43
  br i1 %44, label %45, label %56

45:                                               ; preds = %40
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100 x i32], ptr %4, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100 x i32], ptr %4, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = icmp sle i32 %49, %54
  br label %56

56:                                               ; preds = %45, %40
  %57 = phi i1 [ false, %40 ], [ %55, %45 ]
  br i1 %57, label %58, label %62

58:                                               ; preds = %56
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %5, align 4, !tbaa !5
  br label %40, !llvm.loop !12

62:                                               ; preds = %56
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %6, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %82, %62
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100 x i32], ptr %4, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp eq i32 %69, %73
  br i1 %74, label %75, label %79

75:                                               ; preds = %65
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = icmp slt i32 %76, %77
  br label %79

79:                                               ; preds = %75, %65
  %80 = phi i1 [ false, %65 ], [ %78, %75 ]
  br i1 %80, label %81, label %85

81:                                               ; preds = %79
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %6, align 4, !tbaa !5
  br label %65, !llvm.loop !13

85:                                               ; preds = %79
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = load i32, ptr %2, align 4, !tbaa !5
  %88 = icmp eq i32 %86, %87
  br i1 %88, label %89, label %98

89:                                               ; preds = %85
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %92 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 0
  %93 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 0
  %94 = load i32, ptr %5, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr %93, i64 %95
  %97 = getelementptr inbounds i32, ptr %96, i64 2
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef %92, ptr noundef %97)
  br label %164

98:                                               ; preds = %85
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %150, %98
  %102 = load i32, ptr %10, align 4, !tbaa !5
  %103 = icmp ne i32 %102, 0
  br i1 %103, label %104, label %163

104:                                              ; preds = %101
  store i32 0, ptr %10, align 4, !tbaa !5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %121, %104
  %106 = load i32, ptr %5, align 4, !tbaa !5
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %124

109:                                              ; preds = %105
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = load i32, ptr %5, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100 x i32], ptr %4, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = icmp ne i32 %113, %117
  br i1 %118, label %119, label %120

119:                                              ; preds = %109
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %119, %109
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %5, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %5, align 4, !tbaa !5
  br label %105, !llvm.loop !14

124:                                              ; preds = %105
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = mul nsw i32 %125, 2
  store i32 %126, ptr %9, align 4, !tbaa !5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %147, %124
  %128 = load i32, ptr %5, align 4, !tbaa !5
  %129 = load i32, ptr %2, align 4, !tbaa !5
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = sdiv i32 %129, %130
  %132 = icmp slt i32 %128, %131
  br i1 %132, label %133, label %150

133:                                              ; preds = %127
  %134 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 0
  %135 = load i32, ptr %5, align 4, !tbaa !5
  %136 = load i32, ptr %9, align 4, !tbaa !5
  %137 = mul nsw i32 %135, %136
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds i32, ptr %134, i64 %138
  %140 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 0
  %141 = load i32, ptr %5, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  %143 = load i32, ptr %9, align 4, !tbaa !5
  %144 = mul nsw i32 %142, %143
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds i32, ptr %140, i64 %145
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef %139, ptr noundef %146)
  br label %147

147:                                              ; preds = %133
  %148 = load i32, ptr %5, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %5, align 4, !tbaa !5
  br label %127, !llvm.loop !15

150:                                              ; preds = %127
  %151 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 0
  %152 = load i32, ptr %2, align 4, !tbaa !5
  %153 = load i32, ptr %9, align 4, !tbaa !5
  %154 = sdiv i32 %152, %153
  %155 = load i32, ptr %9, align 4, !tbaa !5
  %156 = mul nsw i32 %154, %155
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds i32, ptr %151, i64 %157
  %159 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 0
  %160 = load i32, ptr %2, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds i32, ptr %159, i64 %161
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef %158, ptr noundef %162)
  br label %101, !llvm.loop !16

163:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %164

164:                                              ; preds = %163, %89
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %165

165:                                              ; preds = %180, %164
  %166 = load i32, ptr %6, align 4, !tbaa !5
  %167 = load i32, ptr %2, align 4, !tbaa !5
  %168 = icmp slt i32 %166, %167
  br i1 %168, label %169, label %183

169:                                              ; preds = %165
  %170 = load i32, ptr %6, align 4, !tbaa !5
  %171 = icmp ne i32 %170, 0
  br i1 %171, label %172, label %174

172:                                              ; preds = %169
  %173 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %174

174:                                              ; preds = %172, %169
  %175 = load i32, ptr %6, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %178)
  br label %180

180:                                              ; preds = %174
  %181 = load i32, ptr %6, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %6, align 4, !tbaa !5
  br label %165, !llvm.loop !17

183:                                              ; preds = %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 400, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 400, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #3

declare i32 @printf(ptr noundef, ...) #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 = { 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 #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 = !{!"int", !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}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca [100 x i32], align 16
  %3 = alloca [100 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %3) #7
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %5 = load i32, ptr %1, align 4
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %.preheader48

.preheader49:                                     ; preds = %.lr.ph
  %7 = icmp sgt i32 %10, 0
  br i1 %7, label %.lr.ph54, label %.preheader48

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %8 = getelementptr inbounds [100 x i32], ptr %2, i64 0, i64 %indvars.iv
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %10 = load i32, ptr %1, align 4
  %11 = sext i32 %10 to i64
  %12 = icmp slt i64 %indvars.iv.next, %11
  br i1 %12, label %.lr.ph, label %.preheader49, !llvm.loop !5

.preheader48:                                     ; preds = %.lr.ph54, %0, %.preheader49
  %.lcssa51 = phi i32 [ %10, %.preheader49 ], [ %5, %0 ], [ %16, %.lr.ph54 ]
  %13 = call i32 @llvm.smax.i32(i32 %.lcssa51, i32 1)
  %smax = add nsw i32 %13, -1
  %wide.trip.count = zext nneg i32 %smax to i64
  br label %19

.lr.ph54:                                         ; preds = %.preheader49, %.lr.ph54
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %.lr.ph54 ], [ 0, %.preheader49 ]
  %14 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 %indvars.iv74
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %16 = load i32, ptr %1, align 4
  %17 = sext i32 %16 to i64
  %18 = icmp slt i64 %indvars.iv.next75, %17
  br i1 %18, label %.lr.ph54, label %.preheader48, !llvm.loop !7

19:                                               ; preds = %.preheader48, %20
  %indvars.iv77 = phi i64 [ 0, %.preheader48 ], [ %indvars.iv.next78, %20 ]
  %exitcond.not = icmp eq i64 %indvars.iv77, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %20

20:                                               ; preds = %19
  %21 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 %indvars.iv77
  %22 = load i32, ptr %21, align 4, !tbaa !8
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %23 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 %indvars.iv.next78
  %24 = load i32, ptr %23, align 4, !tbaa !8
  %.not = icmp sgt i32 %22, %24
  br i1 %.not, label %..critedge_crit_edge, label %19, !llvm.loop !12

..critedge_crit_edge:                             ; preds = %20
  %.pre95 = and i64 %indvars.iv77, 4294967295
  br label %.critedge

.critedge:                                        ; preds = %19, %..critedge_crit_edge
  %.pre-phi = phi i64 [ %.pre95, %..critedge_crit_edge ], [ %wide.trip.count, %19 ]
  %25 = sext i32 %.lcssa51 to i64
  br label %26

26:                                               ; preds = %26, %.critedge
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %26 ], [ %.pre-phi, %.critedge ]
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %27 = getelementptr inbounds [100 x i32], ptr %2, i64 0, i64 %indvars.iv.next81
  %28 = load i32, ptr %27, align 4, !tbaa !8
  %29 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 %indvars.iv.next81
  %30 = load i32, ptr %29, align 4, !tbaa !8
  %31 = icmp eq i32 %28, %30
  %32 = icmp slt i64 %indvars.iv.next81, %25
  %33 = and i1 %32, %31
  br i1 %33, label %26, label %34, !llvm.loop !13

34:                                               ; preds = %26
  %35 = trunc nuw nsw i64 %indvars.iv.next81 to i32
  %36 = icmp eq i32 %.lcssa51, %35
  br i1 %36, label %37, label %42

37:                                               ; preds = %34
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %40 = getelementptr inbounds i32, ptr %2, i64 %.pre-phi
  %41 = getelementptr inbounds i8, ptr %40, i64 8
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull %2, ptr noundef nonnull %41)
  br label %.loopexit

42:                                               ; preds = %34
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %.preheader

.preheader:                                       ; preds = %42, %._crit_edge62
  %.03665 = phi i32 [ 1, %42 ], [ %61, %._crit_edge62 ]
  %45 = load i32, ptr %1, align 4, !tbaa !8
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %.lr.ph57.preheader, label %._crit_edge

.lr.ph57.preheader:                               ; preds = %.preheader
  %wide.trip.count86 = zext nneg i32 %45 to i64
  %min.iters.check = icmp ult i32 %45, 8
  br i1 %min.iters.check, label %.lr.ph57.preheader111, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph57.preheader
  %n.vec = and i64 %wide.trip.count86, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %53, %vector.body ]
  %vec.phi106 = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %54, %vector.body ]
  %47 = getelementptr inbounds [100 x i32], ptr %2, i64 0, i64 %index
  %48 = getelementptr inbounds i8, ptr %47, i64 16
  %wide.load = load <4 x i32>, ptr %47, align 16, !tbaa !8
  %wide.load107 = load <4 x i32>, ptr %48, align 16, !tbaa !8
  %49 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 %index
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  %wide.load108 = load <4 x i32>, ptr %49, align 16, !tbaa !8
  %wide.load109 = load <4 x i32>, ptr %50, align 16, !tbaa !8
  %51 = icmp ne <4 x i32> %wide.load, %wide.load108
  %52 = icmp ne <4 x i32> %wide.load107, %wide.load109
  %53 = or <4 x i1> %vec.phi, %51
  %54 = or <4 x i1> %vec.phi106, %52
  %index.next = add nuw i64 %index, 8
  %55 = icmp eq i64 %index.next, %n.vec
  br i1 %55, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %bin.rdx = or <4 x i1> %54, %53
  %bin.rdx.fr = freeze <4 x i1> %bin.rdx
  %56 = bitcast <4 x i1> %bin.rdx.fr to i4
  %.not110 = icmp ne i4 %56, 0
  %rdx.select = zext i1 %.not110 to i32
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count86
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph57.preheader111

.lr.ph57.preheader111:                            ; preds = %middle.block, %.lr.ph57.preheader
  %indvars.iv83.ph = phi i64 [ 0, %.lr.ph57.preheader ], [ %n.vec, %middle.block ]
  %.156.ph = phi i32 [ 0, %.lr.ph57.preheader ], [ %rdx.select, %middle.block ]
  br label %.lr.ph57

.lr.ph57:                                         ; preds = %.lr.ph57.preheader111, %.lr.ph57
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %.lr.ph57 ], [ %indvars.iv83.ph, %.lr.ph57.preheader111 ]
  %.156 = phi i32 [ %spec.select, %.lr.ph57 ], [ %.156.ph, %.lr.ph57.preheader111 ]
  %57 = getelementptr inbounds [100 x i32], ptr %2, i64 0, i64 %indvars.iv83
  %58 = load i32, ptr %57, align 4, !tbaa !8
  %59 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 %indvars.iv83
  %60 = load i32, ptr %59, align 4, !tbaa !8
  %.not46 = icmp eq i32 %58, %60
  %spec.select = select i1 %.not46, i32 %.156, i32 1
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86
  br i1 %exitcond87.not, label %._crit_edge, label %.lr.ph57, !llvm.loop !17

._crit_edge:                                      ; preds = %.lr.ph57, %middle.block, %.preheader
  %.1.lcssa = phi i32 [ 0, %.preheader ], [ %rdx.select, %middle.block ], [ %spec.select, %.lr.ph57 ]
  %61 = shl nsw i32 %.03665, 1
  %62 = sdiv i32 %45, %61
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %.lr.ph61.preheader, label %._crit_edge62

.lr.ph61.preheader:                               ; preds = %._crit_edge
  %64 = sext i32 %61 to i64
  br label %.lr.ph61

.lr.ph61:                                         ; preds = %.lr.ph61.preheader, %.lr.ph61
  %indvars.iv88 = phi i64 [ 0, %.lr.ph61.preheader ], [ %indvars.iv.next89, %.lr.ph61 ]
  %65 = mul nsw i64 %indvars.iv88, %64
  %66 = getelementptr inbounds i32, ptr %2, i64 %65
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %67 = mul nsw i64 %indvars.iv.next89, %64
  %68 = getelementptr inbounds i32, ptr %2, i64 %67
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull %66, ptr noundef nonnull %68)
  %69 = load i32, ptr %1, align 4, !tbaa !8
  %70 = sdiv i32 %69, %61
  %71 = sext i32 %70 to i64
  %72 = icmp slt i64 %indvars.iv.next89, %71
  br i1 %72, label %.lr.ph61, label %._crit_edge62, !llvm.loop !18

._crit_edge62:                                    ; preds = %.lr.ph61, %._crit_edge
  %.lcssa50 = phi i32 [ %45, %._crit_edge ], [ %69, %.lr.ph61 ]
  %.lcssa = phi i32 [ %62, %._crit_edge ], [ %70, %.lr.ph61 ]
  %73 = mul nsw i32 %.lcssa, %61
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i32, ptr %2, i64 %74
  %76 = sext i32 %.lcssa50 to i64
  %77 = getelementptr inbounds i32, ptr %2, i64 %76
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull %75, ptr noundef nonnull %77)
  %.not45 = icmp eq i32 %.1.lcssa, 0
  br i1 %.not45, label %.loopexit, label %.preheader, !llvm.loop !19

.loopexit:                                        ; preds = %._crit_edge62, %37
  %78 = load i32, ptr %1, align 4, !tbaa !8
  %79 = icmp sgt i32 %78, 0
  br i1 %79, label %.lr.ph68.preheader._crit_edge, label %._crit_edge69

.lr.ph68.preheader._crit_edge:                    ; preds = %.loopexit
  %.pre = load i32, ptr %2, align 16, !tbaa !8
  %80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.pre)
  %81 = load i32, ptr %1, align 4, !tbaa !8
  %82 = icmp sgt i32 %81, 1
  br i1 %82, label %.lr.ph68.peel.next, label %._crit_edge69

.lr.ph68.peel.next:                               ; preds = %.lr.ph68.preheader._crit_edge, %.lr.ph68.peel.next
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %.lr.ph68.peel.next ], [ 1, %.lr.ph68.preheader._crit_edge ]
  %83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %84 = getelementptr inbounds [100 x i32], ptr %2, i64 0, i64 %indvars.iv91
  %85 = load i32, ptr %84, align 4, !tbaa !8
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %85)
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %87 = load i32, ptr %1, align 4, !tbaa !8
  %88 = sext i32 %87 to i64
  %89 = icmp slt i64 %indvars.iv.next92, %88
  br i1 %89, label %.lr.ph68.peel.next, label %._crit_edge69, !llvm.loop !20

._crit_edge69:                                    ; preds = %.lr.ph68.peel.next, %.lr.ph68.preheader._crit_edge, %.loopexit
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

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 = { "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 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 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !6, !16, !15}
!18 = distinct !{!18, !6}
!19 = distinct !{!19, !6}
!20 = distinct !{!20, !6, !21}
!21 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass