; LLVM IR from MakeContributions/DSA :: algorithms/CPlusPlus/Arrays/three-sum.ll (Z11findTripletPiii)

; 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_ostream" = type { ptr, %"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 }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11findTripletPiii(ptr noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = load i32, ptr %5, align 4, !tbaa !9
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds i32, ptr %13, i64 %15
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef %12, ptr noundef %16)
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #4
  store i8 0, ptr %8, align 1, !tbaa !11
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %17

17:                                               ; preds = %161, %3
  %18 = load i32, ptr %7, align 4, !tbaa !9
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = sub nsw i32 %19, 2
  %21 = icmp slt i32 %18, %20
  br i1 %21, label %22, label %164

22:                                               ; preds = %17
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %38, label %25

25:                                               ; preds = %22
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr %26, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !9
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = sub nsw i32 %32, 1
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i32, ptr %31, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = icmp sgt i32 %30, %36
  br i1 %37, label %38, label %160

38:                                               ; preds = %25, %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = sub nsw i32 %41, 1
  store i32 %42, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %43 = load i32, ptr %6, align 4, !tbaa !9
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %44, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = sub nsw i32 %43, %48
  store i32 %49, ptr %11, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %158, %93, %72, %38
  %51 = load i32, ptr %9, align 4, !tbaa !9
  %52 = load i32, ptr %10, align 4, !tbaa !9
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %54, label %159

54:                                               ; preds = %50
  %55 = load i32, ptr %9, align 4, !tbaa !9
  %56 = load i32, ptr %7, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  %58 = icmp sgt i32 %55, %57
  br i1 %58, label %59, label %75

59:                                               ; preds = %54
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i32, ptr %60, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = load i32, ptr %9, align 4, !tbaa !9
  %67 = sub nsw i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i32, ptr %65, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !9
  %71 = icmp eq i32 %64, %70
  br i1 %71, label %72, label %75

72:                                               ; preds = %59
  %73 = load i32, ptr %9, align 4, !tbaa !9
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %9, align 4, !tbaa !9
  br label %50, !llvm.loop !13

75:                                               ; preds = %59, %54
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = load i32, ptr %5, align 4, !tbaa !9
  %78 = sub nsw i32 %77, 1
  %79 = icmp slt i32 %76, %78
  br i1 %79, label %80, label %96

80:                                               ; preds = %75
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = load i32, ptr %10, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i32, ptr %81, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = load i32, ptr %10, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i32, ptr %86, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = icmp eq i32 %85, %91
  br i1 %92, label %93, label %96

93:                                               ; preds = %80
  %94 = load i32, ptr %10, align 4, !tbaa !9
  %95 = add nsw i32 %94, -1
  store i32 %95, ptr %10, align 4, !tbaa !9
  br label %50, !llvm.loop !13

96:                                               ; preds = %80, %75
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %98, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !9
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = load i32, ptr %10, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds i32, ptr %103, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !9
  %108 = add nsw i32 %102, %107
  %109 = icmp eq i32 %97, %108
  br i1 %109, label %110, label %137

110:                                              ; preds = %96
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = load i32, ptr %7, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr %112, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !9
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %111, i32 noundef %116)
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %117, ptr noundef @.str.1)
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = load i32, ptr %9, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds i32, ptr %119, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !9
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %118, i32 noundef %123)
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %124, ptr noundef @.str.1)
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = load i32, ptr %10, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds i32, ptr %126, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !9
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %125, i32 noundef %130)
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %131, ptr noundef @.str.2)
  store i8 1, ptr %8, align 1, !tbaa !11
  %133 = load i32, ptr %9, align 4, !tbaa !9
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %9, align 4, !tbaa !9
  %135 = load i32, ptr %10, align 4, !tbaa !9
  %136 = add nsw i32 %135, -1
  store i32 %136, ptr %10, align 4, !tbaa !9
  br label %158

137:                                              ; preds = %96
  %138 = load i32, ptr %11, align 4, !tbaa !9
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = load i32, ptr %9, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i32, ptr %139, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !9
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = load i32, ptr %10, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds i32, ptr %144, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !9
  %149 = add nsw i32 %143, %148
  %150 = icmp sgt i32 %138, %149
  br i1 %150, label %151, label %154

151:                                              ; preds = %137
  %152 = load i32, ptr %9, align 4, !tbaa !9
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %9, align 4, !tbaa !9
  br label %157

154:                                              ; preds = %137
  %155 = load i32, ptr %10, align 4, !tbaa !9
  %156 = add nsw i32 %155, -1
  store i32 %156, ptr %10, align 4, !tbaa !9
  br label %157

157:                                              ; preds = %154, %151
  br label %158

158:                                              ; preds = %157, %110
  br label %50, !llvm.loop !13

159:                                              ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %160

160:                                              ; preds = %159, %25
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %7, align 4, !tbaa !9
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %7, align 4, !tbaa !9
  br label %17, !llvm.loop !15

164:                                              ; preds = %17
  %165 = load i8, ptr %8, align 1, !tbaa !11, !range !16, !noundef !17
  %166 = trunc i8 %165 to i1
  %167 = zext i1 %166 to i32
  %168 = icmp eq i32 %167, 0
  br i1 %168, label %169, label %172

169:                                              ; preds = %164
  %170 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  %171 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %170, ptr noundef @.str.4)
  br label %172

172:                                              ; preds = %169, %164
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret void
}

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

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

; 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) #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{i8 0, i8 2}
!17 = !{}


; 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_ostream" = type { ptr, %"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 }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11findTripletPiii(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = sext i32 %1 to i64
  %5 = getelementptr inbounds i32, ptr %0, i64 %4
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef %0, ptr noundef %5)
  %6 = icmp sgt i32 %1, 2
  br i1 %6, label %.lr.ph94, label %._crit_edge.thread

.lr.ph94:                                         ; preds = %3
  %7 = add nsw i32 %1, -2
  %8 = add nsw i32 %1, -1
  %wide.trip.count = zext nneg i32 %7 to i64
  br label %9

9:                                                ; preds = %.lr.ph94, %.loopexit
  %indvars.iv117 = phi i64 [ 0, %.lr.ph94 ], [ %indvars.iv.next118.pre-phi, %.loopexit ]
  %indvars.iv = phi i32 [ 1, %.lr.ph94 ], [ %indvars.iv.next, %.loopexit ]
  %.05592 = phi i8 [ 0, %.lr.ph94 ], [ %.3, %.loopexit ]
  %10 = icmp eq i64 %indvars.iv117, 0
  br i1 %10, label %._crit_edge119, label %11

._crit_edge119:                                   ; preds = %9
  %.pre = load i32, ptr %0, align 4, !tbaa !5
  br label %.lr.ph.lr.ph.preheader

11:                                               ; preds = %9
  %12 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv117
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = getelementptr i8, ptr %12, i64 -4
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = icmp sgt i32 %13, %15
  br i1 %16, label %.lr.ph.lr.ph.preheader, label %..loopexit_crit_edge120

..loopexit_crit_edge120:                          ; preds = %11
  %.pre121 = add nuw nsw i64 %indvars.iv117, 1
  br label %.loopexit

.lr.ph.lr.ph.preheader:                           ; preds = %11, %._crit_edge119
  %17 = phi i32 [ %.pre, %._crit_edge119 ], [ %13, %11 ]
  %18 = add nuw nsw i64 %indvars.iv117, 1
  %19 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv117
  %20 = sub nsw i32 %2, %17
  %21 = trunc nuw nsw i64 %18 to i32
  br label %.lr.ph.lr.ph

.lr.ph.lr.ph:                                     ; preds = %.lr.ph.lr.ph.preheader, %.outer
  %.052.ph90 = phi i32 [ %.1, %.outer ], [ %8, %.lr.ph.lr.ph.preheader ]
  %.053.ph89 = phi i32 [ %.154, %.outer ], [ %21, %.lr.ph.lr.ph.preheader ]
  %.156.ph87 = phi i8 [ %.2, %.outer ], [ %.05592, %.lr.ph.lr.ph.preheader ]
  %22 = sext i32 %.053.ph89 to i64
  %23 = sext i32 %.052.ph90 to i64
  %24 = icmp sgt i32 %.053.ph89, %indvars.iv
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.lr.ph, %.lr.ph.split.us.split.us
  %indvars.iv108 = phi i64 [ %22, %.lr.ph.lr.ph ], [ %indvars.iv.next109, %.lr.ph.split.us.split.us ]
  br i1 %24, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph
  %25 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv108
  %26 = getelementptr i8, ptr %25, i64 -4
  %27 = load i32, ptr %25, align 4, !tbaa !5
  %28 = load i32, ptr %26, align 4, !tbaa !5
  %29 = icmp eq i32 %27, %28
  br i1 %29, label %.lr.ph.split.us.split.us, label %.lr.ph.split.us.split

.lr.ph.split.us.split.us:                         ; preds = %.lr.ph.split.us
  %indvars.iv.next109 = add nsw i64 %indvars.iv108, 1
  %30 = icmp slt i64 %indvars.iv.next109, %23
  br i1 %30, label %.lr.ph, label %.loopexit, !llvm.loop !9

.lr.ph.split.us.split:                            ; preds = %.lr.ph.split.us
  %sext122 = shl i64 %indvars.iv108, 32
  %31 = ashr exact i64 %sext122, 32
  %32 = icmp slt i32 %.052.ph90, %8
  br label %33

33:                                               ; preds = %40, %.lr.ph.split.us.split
  %indvars.iv114 = phi i64 [ %indvars.iv.next115, %40 ], [ %23, %.lr.ph.split.us.split ]
  br i1 %32, label %34, label %.split68.us

34:                                               ; preds = %33
  %35 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv114
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = getelementptr i8, ptr %35, i64 4
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = icmp eq i32 %36, %38
  br i1 %39, label %40, label %.split68.us

40:                                               ; preds = %34
  %indvars.iv.next115 = add nsw i64 %indvars.iv114, -1
  %41 = icmp slt i64 %31, %indvars.iv.next115
  br i1 %41, label %33, label %.loopexit, !llvm.loop !9

.lr.ph.split:                                     ; preds = %.lr.ph
  %sext = shl i64 %indvars.iv108, 32
  %42 = ashr exact i64 %sext, 32
  %43 = icmp slt i32 %.052.ph90, %8
  br label %44

44:                                               ; preds = %.lr.ph.split, %51
  %indvars.iv111 = phi i64 [ %23, %.lr.ph.split ], [ %indvars.iv.next112, %51 ]
  br i1 %43, label %45, label %.split68.us

45:                                               ; preds = %44
  %46 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv111
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = getelementptr i8, ptr %46, i64 4
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp eq i32 %47, %49
  br i1 %50, label %51, label %.split68.us

51:                                               ; preds = %45
  %indvars.iv.next112 = add nsw i64 %indvars.iv111, -1
  %52 = icmp slt i64 %42, %indvars.iv.next112
  br i1 %52, label %44, label %.loopexit, !llvm.loop !9

.split68.us:                                      ; preds = %44, %45, %33, %34
  %.pre-phi = phi i64 [ %31, %34 ], [ %31, %33 ], [ %42, %45 ], [ %42, %44 ]
  %.us-phi70.in = phi i64 [ %indvars.iv114, %34 ], [ %indvars.iv114, %33 ], [ %indvars.iv111, %45 ], [ %indvars.iv111, %44 ]
  %.us-phi70 = trunc i64 %.us-phi70.in to i32
  %.053.ph6084102 = trunc i64 %indvars.iv108 to i32
  %53 = getelementptr inbounds i32, ptr %0, i64 %.pre-phi
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %sext123 = shl i64 %.us-phi70.in, 32
  %55 = ashr exact i64 %sext123, 30
  %56 = getelementptr inbounds i8, ptr %0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = add nsw i32 %57, %54
  %59 = icmp eq i32 %20, %58
  br i1 %59, label %60, label %73

60:                                               ; preds = %.split68.us
  %61 = tail 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)
  %62 = load i32, ptr %19, align 4, !tbaa !5
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %61, i32 noundef %62)
  %64 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull @.str.1)
  %65 = load i32, ptr %53, align 4, !tbaa !5
  %66 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %64, i32 noundef %65)
  %67 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef nonnull @.str.1)
  %68 = load i32, ptr %56, align 4, !tbaa !5
  %69 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %67, i32 noundef %68)
  %70 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef nonnull @.str.2)
  %71 = add nsw i32 %.053.ph6084102, 1
  %72 = add nsw i32 %.us-phi70, -1
  br label %.outer

73:                                               ; preds = %.split68.us
  %74 = icmp sgt i32 %20, %58
  br i1 %74, label %75, label %77

75:                                               ; preds = %73
  %76 = add nsw i32 %.053.ph6084102, 1
  br label %.outer

77:                                               ; preds = %73
  %78 = add nsw i32 %.us-phi70, -1
  br label %.outer

.outer:                                           ; preds = %75, %77, %60
  %.2 = phi i8 [ 1, %60 ], [ %.156.ph87, %75 ], [ %.156.ph87, %77 ]
  %.154 = phi i32 [ %71, %60 ], [ %76, %75 ], [ %.053.ph6084102, %77 ]
  %.1 = phi i32 [ %72, %60 ], [ %.us-phi70, %75 ], [ %78, %77 ]
  %79 = icmp slt i32 %.154, %.1
  br i1 %79, label %.lr.ph.lr.ph, label %.loopexit, !llvm.loop !9

.loopexit:                                        ; preds = %.outer, %.lr.ph.split.us.split.us, %51, %40, %..loopexit_crit_edge120
  %indvars.iv.next118.pre-phi = phi i64 [ %.pre121, %..loopexit_crit_edge120 ], [ %18, %40 ], [ %18, %51 ], [ %18, %.lr.ph.split.us.split.us ], [ %18, %.outer ]
  %.3 = phi i8 [ %.05592, %..loopexit_crit_edge120 ], [ %.156.ph87, %40 ], [ %.156.ph87, %51 ], [ %.156.ph87, %.lr.ph.split.us.split.us ], [ %.2, %.outer ]
  %indvars.iv.next = add nuw i32 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next118.pre-phi, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %9, !llvm.loop !11

._crit_edge:                                      ; preds = %.loopexit
  %80 = and i8 %.3, 1
  %81 = icmp eq i8 %80, 0
  br i1 %81, label %._crit_edge.thread, label %84

._crit_edge.thread:                               ; preds = %3, %._crit_edge
  %82 = tail 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.3)
  %83 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef nonnull @.str.4)
  br label %84

84:                                               ; preds = %._crit_edge.thread, %._crit_edge
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #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 #1

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #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" }

!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}


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