; LLVM IR from HarshCasper/NeoAlgo :: C-Plus-Plus/other/Union_and_Intersection_of_arrays.ll (Z5UnionPiS_ii)

; 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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5UnionPiS_ii(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %118, %56, %37, %4
  %12 = load i32, ptr %9, align 4, !tbaa !9
  %13 = load i32, ptr %7, align 4, !tbaa !9
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %15, label %19

15:                                               ; preds = %11
  %16 = load i32, ptr %10, align 4, !tbaa !9
  %17 = load i32, ptr %8, align 4, !tbaa !9
  %18 = icmp slt i32 %16, %17
  br label %19

19:                                               ; preds = %15, %11
  %20 = phi i1 [ false, %11 ], [ %18, %15 ]
  br i1 %20, label %21, label %119

21:                                               ; preds = %19
  %22 = load i32, ptr %9, align 4, !tbaa !9
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %24, label %40

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

37:                                               ; preds = %24
  %38 = load i32, ptr %9, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %9, align 4, !tbaa !9
  br label %11, !llvm.loop !11

40:                                               ; preds = %24, %21
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %43, label %59

43:                                               ; preds = %40
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = load i32, ptr %10, 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 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = load i32, ptr %10, align 4, !tbaa !9
  %51 = sub nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i32, ptr %49, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = icmp eq i32 %48, %54
  br i1 %55, label %56, label %59

56:                                               ; preds = %43
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %10, align 4, !tbaa !9
  br label %11, !llvm.loop !11

59:                                               ; preds = %43, %40
  %60 = load ptr, ptr %5, 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 %6, align 8, !tbaa !5
  %66 = load i32, ptr %10, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds i32, ptr %65, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = icmp slt i32 %64, %69
  br i1 %70, label %71, label %81

71:                                               ; preds = %59
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = load i32, ptr %9, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i32, ptr %72, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !9
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %76)
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef @.str)
  %79 = load i32, ptr %9, align 4, !tbaa !9
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %9, align 4, !tbaa !9
  br label %116

81:                                               ; preds = %59
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i32, ptr %82, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !9
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i32, ptr %87, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = icmp slt i32 %86, %91
  br i1 %92, label %93, label %103

93:                                               ; preds = %81
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = load i32, ptr %10, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i32, ptr %94, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !9
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %98)
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef @.str)
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %10, align 4, !tbaa !9
  br label %115

103:                                              ; preds = %81
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = load i32, ptr %9, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds i32, ptr %104, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !9
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %108)
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %109, ptr noundef @.str)
  %111 = load i32, ptr %9, align 4, !tbaa !9
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %9, align 4, !tbaa !9
  %113 = load i32, ptr %10, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %10, align 4, !tbaa !9
  br label %115

115:                                              ; preds = %103, %93
  br label %116

116:                                              ; preds = %115, %71
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117
  br label %11, !llvm.loop !11

119:                                              ; preds = %19
  br label %120

120:                                              ; preds = %153, %140, %119
  %121 = load i32, ptr %9, align 4, !tbaa !9
  %122 = load i32, ptr %7, align 4, !tbaa !9
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %124, label %154

124:                                              ; preds = %120
  %125 = load i32, ptr %9, align 4, !tbaa !9
  %126 = icmp sgt i32 %125, 0
  br i1 %126, label %127, label %143

127:                                              ; preds = %124
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = load i32, ptr %9, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i32, ptr %128, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !9
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = load i32, ptr %9, align 4, !tbaa !9
  %135 = sub nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i32, ptr %133, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !9
  %139 = icmp eq i32 %132, %138
  br i1 %139, label %140, label %143

140:                                              ; preds = %127
  %141 = load i32, ptr %9, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %9, align 4, !tbaa !9
  br label %120, !llvm.loop !13

143:                                              ; preds = %127, %124
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = load i32, ptr %9, 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 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %148)
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %149, ptr noundef @.str)
  %151 = load i32, ptr %9, align 4, !tbaa !9
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %9, align 4, !tbaa !9
  br label %153

153:                                              ; preds = %143
  br label %120, !llvm.loop !13

154:                                              ; preds = %120
  br label %155

155:                                              ; preds = %188, %175, %154
  %156 = load i32, ptr %10, align 4, !tbaa !9
  %157 = load i32, ptr %8, align 4, !tbaa !9
  %158 = icmp slt i32 %156, %157
  br i1 %158, label %159, label %189

159:                                              ; preds = %155
  %160 = load i32, ptr %10, align 4, !tbaa !9
  %161 = icmp sgt i32 %160, 0
  br i1 %161, label %162, label %178

162:                                              ; preds = %159
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = load i32, ptr %10, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds i32, ptr %163, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !9
  %168 = load ptr, ptr %6, align 8, !tbaa !5
  %169 = load i32, ptr %10, align 4, !tbaa !9
  %170 = sub nsw i32 %169, 1
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds i32, ptr %168, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !9
  %174 = icmp eq i32 %167, %173
  br i1 %174, label %175, label %178

175:                                              ; preds = %162
  %176 = load i32, ptr %10, align 4, !tbaa !9
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %10, align 4, !tbaa !9
  br label %155, !llvm.loop !14

178:                                              ; preds = %162, %159
  %179 = load ptr, ptr %6, align 8, !tbaa !5
  %180 = load i32, ptr %10, align 4, !tbaa !9
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds i32, ptr %179, i64 %181
  %183 = load i32, ptr %182, align 4, !tbaa !9
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %183)
  %185 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %184, ptr noundef @.str)
  %186 = load i32, ptr %10, align 4, !tbaa !9
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %10, align 4, !tbaa !9
  br label %188

188:                                              ; preds = %178
  br label %155, !llvm.loop !14

189:                                              ; preds = %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #3 = { 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 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !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::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

; 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 #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5UnionPiS_ii(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #2 {
  %5 = icmp sgt i32 %2, 0
  %6 = icmp sgt i32 %3, 0
  %7 = and i1 %5, %6
  br i1 %7, label %.lr.ph, label %.preheader61

.lr.ph:                                           ; preds = %4, %.outer.backedge
  %.0.ph99 = phi i32 [ %.0.ph.be, %.outer.backedge ], [ 0, %4 ]
  %.055.ph95 = phi i32 [ %.055.ph.be, %.outer.backedge ], [ 0, %4 ]
  %8 = icmp sgt i32 %.055.ph95, 0
  br i1 %8, label %.lr.ph.split.us, label %.lr.ph.split.split.preheader

.lr.ph.split.us:                                  ; preds = %.lr.ph
  %9 = zext nneg i32 %.055.ph95 to i64
  %10 = getelementptr inbounds i32, ptr %0, i64 %9
  %11 = getelementptr i8, ptr %10, i64 -4
  %12 = load i32, ptr %10, align 4, !tbaa !5
  %13 = load i32, ptr %11, align 4, !tbaa !5
  %14 = icmp eq i32 %12, %13
  br i1 %14, label %.lr.ph.split.us.split.us, label %.lr.ph.split.us.split.split.preheader

.lr.ph.split.us.split.us:                         ; preds = %.lr.ph.split.us
  %15 = add nuw nsw i32 %.055.ph95, 1
  br label %.outer.backedge

.lr.ph.split.us.split.split.preheader:            ; preds = %.lr.ph.split.us
  %16 = zext i32 %.0.ph99 to i64
  %17 = icmp sgt i32 %.0.ph99, 0
  br label %.lr.ph.split.us.split.split

.lr.ph.split.us.split.split:                      ; preds = %.lr.ph.split.us.split.split.preheader, %24
  %indvars.iv121 = phi i64 [ %16, %.lr.ph.split.us.split.split.preheader ], [ %indvars.iv.next122, %24 ]
  br i1 %17, label %18, label %.split70.us

18:                                               ; preds = %.lr.ph.split.us.split.split
  %19 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv121
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = getelementptr i8, ptr %19, i64 -4
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = icmp eq i32 %20, %22
  br i1 %23, label %24, label %.split70.us

24:                                               ; preds = %18
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %25 = trunc nuw i64 %indvars.iv.next122 to i32
  %26 = icmp slt i32 %25, %3
  br i1 %26, label %.lr.ph.split.us.split.split, label %.preheader61, !llvm.loop !9

.lr.ph.split.split.preheader:                     ; preds = %.lr.ph
  %27 = zext i32 %.0.ph99 to i64
  %28 = icmp sgt i32 %.0.ph99, 0
  br label %.lr.ph.split.split

.preheader61:                                     ; preds = %.outer.backedge, %40, %24, %4
  %.055.ph.lcssa = phi i32 [ 0, %4 ], [ %.055.ph95, %24 ], [ %.055.ph95, %40 ], [ %.055.ph.be, %.outer.backedge ]
  %.0.lcssa = phi i32 [ 0, %4 ], [ %25, %24 ], [ %41, %40 ], [ %.0.ph.be, %.outer.backedge ]
  %29 = icmp slt i32 %.055.ph.lcssa, %2
  br i1 %29, label %.lr.ph103.preheader, label %.preheader

.lr.ph103.preheader:                              ; preds = %.preheader61
  %30 = sext i32 %.055.ph.lcssa to i64
  br label %.lr.ph103

.lr.ph.split.split:                               ; preds = %.lr.ph.split.split.preheader, %40
  %indvars.iv = phi i64 [ %27, %.lr.ph.split.split.preheader ], [ %indvars.iv.next, %40 ]
  br i1 %28, label %34, label %.split70.us

.outer.backedge:                                  ; preds = %50, %60, %56, %.lr.ph.split.us.split.us
  %.055.ph.be = phi i32 [ %15, %.lr.ph.split.us.split.us ], [ %53, %50 ], [ %.055.ph95, %56 ], [ %63, %60 ]
  %.0.ph.be = phi i32 [ %.0.ph99, %.lr.ph.split.us.split.us ], [ %.us-phi71, %50 ], [ %59, %56 ], [ %64, %60 ]
  %31 = icmp slt i32 %.055.ph.be, %2
  %32 = icmp slt i32 %.0.ph.be, %3
  %33 = select i1 %31, i1 %32, i1 false
  br i1 %33, label %.lr.ph, label %.preheader61, !llvm.loop !9

34:                                               ; preds = %.lr.ph.split.split
  %35 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv
  %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 %.split70.us

40:                                               ; preds = %34
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %41 = trunc nuw i64 %indvars.iv.next to i32
  %42 = icmp slt i32 %41, %3
  br i1 %42, label %.lr.ph.split.split, label %.preheader61, !llvm.loop !9

.split70.us:                                      ; preds = %34, %.lr.ph.split.split, %18, %.lr.ph.split.us.split.split
  %.us-phi71.in = phi i64 [ %indvars.iv121, %.lr.ph.split.us.split.split ], [ %indvars.iv121, %18 ], [ %indvars.iv, %.lr.ph.split.split ], [ %indvars.iv, %34 ]
  %.us-phi71 = trunc i64 %.us-phi71.in to i32
  %43 = sext i32 %.055.ph95 to i64
  %44 = getelementptr inbounds i32, ptr %0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %sext = shl i64 %.us-phi71.in, 32
  %46 = ashr exact i64 %sext, 30
  %47 = getelementptr inbounds i8, ptr %1, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = icmp slt i32 %45, %48
  br i1 %49, label %50, label %54

50:                                               ; preds = %.split70.us
  %51 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %45)
  %52 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull @.str)
  %53 = add i32 %.055.ph95, 1
  br label %.outer.backedge

54:                                               ; preds = %.split70.us
  %55 = icmp slt i32 %48, %45
  br i1 %55, label %56, label %60

56:                                               ; preds = %54
  %57 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %48)
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull @.str)
  %59 = add nsw i32 %.us-phi71, 1
  br label %.outer.backedge

60:                                               ; preds = %54
  %61 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %45)
  %62 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull @.str)
  %63 = add i32 %.055.ph95, 1
  %64 = add nsw i32 %.us-phi71, 1
  br label %.outer.backedge

.preheader:                                       ; preds = %.backedge62, %.preheader61
  %65 = icmp slt i32 %.0.lcssa, %3
  br i1 %65, label %.lr.ph105.preheader, label %._crit_edge

.lr.ph105.preheader:                              ; preds = %.preheader
  %66 = sext i32 %.0.lcssa to i64
  br label %.lr.ph105

.lr.ph103:                                        ; preds = %.lr.ph103.preheader, %.backedge62
  %indvars.iv124 = phi i64 [ %30, %.lr.ph103.preheader ], [ %indvars.iv.next125, %.backedge62 ]
  %67 = icmp sgt i64 %indvars.iv124, 0
  %68 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv124
  %69 = load i32, ptr %68, align 4, !tbaa !5
  br i1 %67, label %70, label %.lr.ph103._crit_edge

70:                                               ; preds = %.lr.ph103
  %71 = getelementptr i8, ptr %68, i64 -4
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = icmp eq i32 %69, %72
  br i1 %73, label %.backedge62, label %.lr.ph103._crit_edge

.backedge62:                                      ; preds = %70, %.lr.ph103._crit_edge
  %indvars.iv.next125 = add nsw i64 %indvars.iv124, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next125 to i32
  %exitcond.not = icmp eq i32 %lftr.wideiv, %2
  br i1 %exitcond.not, label %.preheader, label %.lr.ph103, !llvm.loop !11

.lr.ph103._crit_edge:                             ; preds = %.lr.ph103, %70
  %74 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %69)
  %75 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %74, ptr noundef nonnull @.str)
  br label %.backedge62

.lr.ph105:                                        ; preds = %.lr.ph105.preheader, %.backedge
  %indvars.iv127 = phi i64 [ %66, %.lr.ph105.preheader ], [ %indvars.iv.next128, %.backedge ]
  %76 = icmp sgt i64 %indvars.iv127, 0
  %77 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv127
  %78 = load i32, ptr %77, align 4, !tbaa !5
  br i1 %76, label %79, label %.lr.ph105._crit_edge

79:                                               ; preds = %.lr.ph105
  %80 = getelementptr i8, ptr %77, i64 -4
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = icmp eq i32 %78, %81
  br i1 %82, label %.backedge, label %.lr.ph105._crit_edge

.backedge:                                        ; preds = %79, %.lr.ph105._crit_edge
  %indvars.iv.next128 = add nsw i64 %indvars.iv127, 1
  %lftr.wideiv130 = trunc i64 %indvars.iv.next128 to i32
  %exitcond131.not = icmp eq i32 %lftr.wideiv130, %3
  br i1 %exitcond131.not, label %._crit_edge, label %.lr.ph105, !llvm.loop !12

.lr.ph105._crit_edge:                             ; preds = %.lr.ph105, %79
  %83 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %78)
  %84 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %83, ptr noundef nonnull @.str)
  br label %.backedge

._crit_edge:                                      ; preds = %.backedge, %.preheader
  ret void
}

attributes #0 = { 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 #1 = { "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 = { 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" }

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


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