; LLVM IR from ShahjalalShohag/code-library :: Basics (Selection Sort)

; 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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %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
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %13 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %15
  %17 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %18 = 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)
  %19 = load i32, ptr %2, align 4, !tbaa !8
  %20 = add nsw i32 %19, 1
  %21 = zext i32 %20 to i64
  %22 = call ptr @llvm.stacksave.p0()
  store ptr %22, ptr %3, align 8
  %23 = alloca i32, i64 %21, align 16
  store i64 %21, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 1, ptr %5, align 4, !tbaa !8
  br label %24

24:                                               ; preds = %34, %0
  %25 = load i32, ptr %5, align 4, !tbaa !8
  %26 = load i32, ptr %2, align 4, !tbaa !8
  %27 = icmp sle i32 %25, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %24
  %30 = load i32, ptr %5, align 4, !tbaa !8
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds i32, ptr %23, i64 %31
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %32)
  br label %34

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

37:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !8
  br label %38

38:                                               ; preds = %82, %37
  %39 = load i32, ptr %7, align 4, !tbaa !8
  %40 = load i32, ptr %2, align 4, !tbaa !8
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %85

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %44 = load i32, ptr %7, align 4, !tbaa !8
  store i32 %44, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %45 = load i32, ptr %7, align 4, !tbaa !8
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %10, align 4, !tbaa !8
  br label %47

47:                                               ; preds = %65, %43
  %48 = load i32, ptr %10, align 4, !tbaa !8
  %49 = load i32, ptr %2, align 4, !tbaa !8
  %50 = icmp sle i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %68

52:                                               ; preds = %47
  %53 = load i32, ptr %10, align 4, !tbaa !8
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i32, ptr %23, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !8
  %57 = load i32, ptr %9, align 4, !tbaa !8
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds i32, ptr %23, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !8
  %61 = icmp slt i32 %56, %60
  br i1 %61, label %62, label %64

62:                                               ; preds = %52
  %63 = load i32, ptr %10, align 4, !tbaa !8
  store i32 %63, ptr %9, align 4, !tbaa !8
  br label %64

64:                                               ; preds = %62, %52
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %10, align 4, !tbaa !8
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %10, align 4, !tbaa !8
  br label %47, !llvm.loop !13

68:                                               ; preds = %51
  %69 = load i32, ptr %7, align 4, !tbaa !8
  %70 = load i32, ptr %9, align 4, !tbaa !8
  %71 = icmp ne i32 %69, %70
  br i1 %71, label %72, label %81

72:                                               ; preds = %68
  %73 = load i32, ptr %7, align 4, !tbaa !8
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i32, ptr %23, i64 %74
  %76 = load i32, ptr %9, align 4, !tbaa !8
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds i32, ptr %23, i64 %77
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %75, ptr noundef nonnull align 4 dereferenceable(4) %78) #7
  %79 = load i32, ptr %6, align 4, !tbaa !8
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %6, align 4, !tbaa !8
  br label %81

81:                                               ; preds = %72, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %7, align 4, !tbaa !8
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %7, align 4, !tbaa !8
  br label %38, !llvm.loop !14

85:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 1, ptr %11, align 4, !tbaa !8
  br label %86

86:                                               ; preds = %102, %85
  %87 = load i32, ptr %11, align 4, !tbaa !8
  %88 = load i32, ptr %2, align 4, !tbaa !8
  %89 = icmp sle i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %105

91:                                               ; preds = %86
  %92 = load i32, ptr %11, align 4, !tbaa !8
  %93 = icmp sgt i32 %92, 1
  br i1 %93, label %94, label %96

94:                                               ; preds = %91
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 32)
  br label %96

96:                                               ; preds = %94, %91
  %97 = load i32, ptr %11, align 4, !tbaa !8
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds i32, ptr %23, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !8
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %100)
  br label %102

102:                                              ; preds = %96
  %103 = load i32, ptr %11, align 4, !tbaa !8
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %11, align 4, !tbaa !8
  br label %86, !llvm.loop !15

105:                                              ; preds = %90
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  %107 = load i32, ptr %6, align 4, !tbaa !8
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %107)
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %108, i8 noundef signext 10)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %110 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %110)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %111 = load i32, ptr %1, align 4
  ret i32 %111
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #6

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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 = { "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 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind willreturn }
attributes #5 = { inlinehint 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 #6 = { 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 #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 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !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_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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %8 = 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)
  %9 = load i32, ptr %1, align 4, !tbaa !8
  %10 = add nsw i32 %9, 1
  %11 = zext i32 %10 to i64
  %12 = call ptr @llvm.stacksave.p0()
  %13 = alloca i32, i64 %11, align 16
  %14 = load i32, ptr %1, align 4, !tbaa !8
  %.not34 = icmp slt i32 %14, 1
  br i1 %.not34, label %._crit_edge48, label %.lr.ph

.preheader33:                                     ; preds = %.lr.ph
  %.not2940 = icmp slt i32 %17, 1
  br i1 %.not2940, label %._crit_edge48, label %.lr.ph43

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %15 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = load i32, ptr %1, align 4, !tbaa !8
  %18 = sext i32 %17 to i64
  %.not.not = icmp slt i64 %indvars.iv, %18
  br i1 %.not.not, label %.lr.ph, label %.preheader33, !llvm.loop !11

.preheader:                                       ; preds = %71
  %19 = icmp slt i32 %72, 1
  br i1 %19, label %._crit_edge48, label %.lr.ph47.preheader._crit_edge

.lr.ph47.preheader._crit_edge:                    ; preds = %.preheader
  %.phi.trans.insert = getelementptr inbounds i8, ptr %13, i64 4
  %.pre62 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !8
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.pre62)
  %21 = load i32, ptr %1, align 4, !tbaa !8
  %.not30.not.peel = icmp sgt i32 %21, 1
  br i1 %.not30.not.peel, label %.lr.ph47.peel.next, label %._crit_edge48

.lr.ph43:                                         ; preds = %.preheader33, %71
  %indvar = phi i32 [ %indvar.next, %71 ], [ 0, %.preheader33 ]
  %22 = phi i32 [ %72, %71 ], [ %17, %.preheader33 ]
  %indvars.iv55 = phi i64 [ %indvars.iv.next56, %71 ], [ 1, %.preheader33 ]
  %indvars.iv50 = phi i64 [ %indvars.iv.next51, %71 ], [ 2, %.preheader33 ]
  %.02641 = phi i32 [ %.127, %71 ], [ 0, %.preheader33 ]
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %23 = sext i32 %22 to i64
  %.not3136.not = icmp slt i64 %indvars.iv55, %23
  %24 = trunc nuw nsw i64 %indvars.iv55 to i32
  br i1 %.not3136.not, label %.lr.ph39.preheader, label %._crit_edge

.lr.ph39.preheader:                               ; preds = %.lr.ph43
  %25 = xor i32 %indvar, -1
  %26 = add nuw i32 %22, 1
  %27 = add i32 %22, %25
  %reass.sub = sub i32 %22, %indvar
  %28 = add i32 %reass.sub, -2
  %xtraiter = and i32 %27, 3
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph39.prol.loopexit, label %.lr.ph39.prol

.lr.ph39.prol:                                    ; preds = %.lr.ph39.preheader, %.lr.ph39.prol
  %indvars.iv52.prol = phi i64 [ %indvars.iv.next53.prol, %.lr.ph39.prol ], [ %indvars.iv50, %.lr.ph39.preheader ]
  %.02437.prol = phi i32 [ %spec.select.prol, %.lr.ph39.prol ], [ %24, %.lr.ph39.preheader ]
  %prol.iter = phi i32 [ %prol.iter.next, %.lr.ph39.prol ], [ 0, %.lr.ph39.preheader ]
  %29 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv52.prol
  %30 = load i32, ptr %29, align 4, !tbaa !8
  %31 = sext i32 %.02437.prol to i64
  %32 = getelementptr inbounds i32, ptr %13, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !8
  %34 = icmp slt i32 %30, %33
  %35 = trunc nuw i64 %indvars.iv52.prol to i32
  %spec.select.prol = select i1 %34, i32 %35, i32 %.02437.prol
  %indvars.iv.next53.prol = add nuw nsw i64 %indvars.iv52.prol, 1
  %prol.iter.next = add i32 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph39.prol.loopexit, label %.lr.ph39.prol, !llvm.loop !13

.lr.ph39.prol.loopexit:                           ; preds = %.lr.ph39.prol, %.lr.ph39.preheader
  %spec.select.lcssa.unr = phi i32 [ poison, %.lr.ph39.preheader ], [ %spec.select.prol, %.lr.ph39.prol ]
  %indvars.iv52.unr = phi i64 [ %indvars.iv50, %.lr.ph39.preheader ], [ %indvars.iv.next53.prol, %.lr.ph39.prol ]
  %.02437.unr = phi i32 [ %24, %.lr.ph39.preheader ], [ %spec.select.prol, %.lr.ph39.prol ]
  %36 = icmp ult i32 %28, 3
  br i1 %36, label %._crit_edge, label %.lr.ph39

._crit_edge:                                      ; preds = %.lr.ph39.prol.loopexit, %.lr.ph39, %.lr.ph43
  %.024.lcssa = phi i32 [ %24, %.lr.ph43 ], [ %spec.select.lcssa.unr, %.lr.ph39.prol.loopexit ], [ %spec.select.3, %.lr.ph39 ]
  %37 = zext i32 %.024.lcssa to i64
  %.not32 = icmp eq i64 %indvars.iv55, %37
  br i1 %.not32, label %71, label %66

.lr.ph39:                                         ; preds = %.lr.ph39.prol.loopexit, %.lr.ph39
  %indvars.iv52 = phi i64 [ %indvars.iv.next53.3, %.lr.ph39 ], [ %indvars.iv52.unr, %.lr.ph39.prol.loopexit ]
  %.02437 = phi i32 [ %spec.select.3, %.lr.ph39 ], [ %.02437.unr, %.lr.ph39.prol.loopexit ]
  %38 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv52
  %39 = load i32, ptr %38, align 4, !tbaa !8
  %40 = sext i32 %.02437 to i64
  %41 = getelementptr inbounds i32, ptr %13, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !8
  %43 = icmp slt i32 %39, %42
  %44 = trunc nuw i64 %indvars.iv52 to i32
  %spec.select = select i1 %43, i32 %44, i32 %.02437
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %45 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv.next53
  %46 = load i32, ptr %45, align 4, !tbaa !8
  %47 = sext i32 %spec.select to i64
  %48 = getelementptr inbounds i32, ptr %13, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !8
  %50 = icmp slt i32 %46, %49
  %51 = trunc nuw i64 %indvars.iv.next53 to i32
  %spec.select.1 = select i1 %50, i32 %51, i32 %spec.select
  %indvars.iv.next53.1 = add nuw nsw i64 %indvars.iv52, 2
  %52 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv.next53.1
  %53 = load i32, ptr %52, align 4, !tbaa !8
  %54 = sext i32 %spec.select.1 to i64
  %55 = getelementptr inbounds i32, ptr %13, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !8
  %57 = icmp slt i32 %53, %56
  %58 = trunc nuw i64 %indvars.iv.next53.1 to i32
  %spec.select.2 = select i1 %57, i32 %58, i32 %spec.select.1
  %indvars.iv.next53.2 = add nuw nsw i64 %indvars.iv52, 3
  %59 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv.next53.2
  %60 = load i32, ptr %59, align 4, !tbaa !8
  %61 = sext i32 %spec.select.2 to i64
  %62 = getelementptr inbounds i32, ptr %13, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !8
  %64 = icmp slt i32 %60, %63
  %65 = trunc nuw i64 %indvars.iv.next53.2 to i32
  %spec.select.3 = select i1 %64, i32 %65, i32 %spec.select.2
  %indvars.iv.next53.3 = add nuw nsw i64 %indvars.iv52, 4
  %lftr.wideiv.3 = trunc i64 %indvars.iv.next53.3 to i32
  %exitcond.not.3 = icmp eq i32 %26, %lftr.wideiv.3
  br i1 %exitcond.not.3, label %._crit_edge, label %.lr.ph39, !llvm.loop !15

66:                                               ; preds = %._crit_edge
  %67 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv55
  %68 = sext i32 %.024.lcssa to i64
  %69 = getelementptr inbounds i32, ptr %13, i64 %68
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %67, ptr noundef nonnull align 4 dereferenceable(4) %69) #7
  %70 = add nsw i32 %.02641, 1
  %.pre = load i32, ptr %1, align 4, !tbaa !8
  br label %71

71:                                               ; preds = %66, %._crit_edge
  %72 = phi i32 [ %.pre, %66 ], [ %22, %._crit_edge ]
  %.127 = phi i32 [ %70, %66 ], [ %.02641, %._crit_edge ]
  %73 = sext i32 %72 to i64
  %.not29.not = icmp slt i64 %indvars.iv55, %73
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %indvar.next = add i32 %indvar, 1
  br i1 %.not29.not, label %.lr.ph43, label %.preheader, !llvm.loop !16

._crit_edge48:                                    ; preds = %.lr.ph47.peel.next, %0, %.preheader33, %.lr.ph47.preheader._crit_edge, %.preheader
  %.026.lcssa66 = phi i32 [ %.127, %.preheader ], [ %.127, %.lr.ph47.preheader._crit_edge ], [ 0, %.preheader33 ], [ 0, %0 ], [ %.127, %.lr.ph47.peel.next ]
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.026.lcssa66)
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %75, i8 noundef signext 10)
  call void @llvm.stackrestore.p0(ptr %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.lr.ph47.peel.next:                               ; preds = %.lr.ph47.preheader._crit_edge, %.lr.ph47.peel.next
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %.lr.ph47.peel.next ], [ 2, %.lr.ph47.preheader._crit_edge ]
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 32)
  %78 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv58
  %79 = load i32, ptr %78, align 4, !tbaa !8
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %79)
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %81 = load i32, ptr %1, align 4, !tbaa !8
  %82 = sext i32 %81 to i64
  %.not30.not = icmp slt i64 %indvars.iv58, %82
  br i1 %.not30.not, label %.lr.ph47.peel.next, label %._crit_edge48, !llvm.loop !17
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #6

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 nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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 = { "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 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { inlinehint 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 #6 = { 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 #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 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12, !18}
!18 = !{!"llvm.loop.peeled.count", i32 1}


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