; LLVM IR from Lakhankumawat/LearnCPP :: S-SortingAlgorithms (BubbleSort)

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

@__const.main.arr = external hidden unnamed_addr constant [8 x i32], align 16
@_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 [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [8 x i32], align 16
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %2, ptr align 16 @__const.main.arr, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 8, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %42, %0
  %8 = load i32, ptr %4, align 4, !tbaa !5
  %9 = load i32, ptr %3, align 4, !tbaa !5
  %10 = icmp slt i32 %8, %9
  br i1 %10, label %11, label %45

11:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %39, %11
  %13 = load i32, ptr %5, align 4, !tbaa !5
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = sub nsw i32 %14, %15
  %17 = icmp slt i32 %13, %16
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %12
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [8 x i32], ptr %2, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [8 x i32], ptr %2, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = icmp sgt i32 %23, %28
  br i1 %29, label %30, label %38

30:                                               ; preds = %19
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [8 x i32], ptr %2, i64 0, i64 %32
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [8 x i32], ptr %2, i64 0, i64 %36
  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) %33, ptr noundef nonnull align 4 dereferenceable(4) %37) #6
  br label %38

38:                                               ; preds = %30, %19
  br label %39

39:                                               ; preds = %38
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %5, align 4, !tbaa !5
  br label %12, !llvm.loop !9

42:                                               ; preds = %18
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %4, align 4, !tbaa !5
  br label %7, !llvm.loop !11

45:                                               ; preds = %7
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %59, %45
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %62

52:                                               ; preds = %47
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [8 x i32], ptr %2, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %56)
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef @.str.1)
  br label %59

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

62:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #6
  %63 = load i32, ptr %1, align 4
  ret i32 %63
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { "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 = { 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}


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

@__const.main.arr = external hidden unnamed_addr constant [8 x i32], align 16
@_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 [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
.lr.ph.preheader:
  %0 = alloca [8 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %0) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %0, ptr noundef nonnull align 16 dereferenceable(32) @__const.main.arr, i64 32, i1 false)
  %1 = load i32, ptr %0, align 16, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 4
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %4 = icmp sgt i32 %1, %3
  br i1 %4, label %142, label %.lr.ph.128

.lr.ph.preheader.1:                               ; preds = %172, %.lr.ph.633
  %5 = load i32, ptr %0, align 16, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 4
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = icmp sgt i32 %5, %7
  br i1 %8, label %9, label %.lr.ph.1.1

9:                                                ; preds = %.lr.ph.preheader.1
  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) %0, ptr noundef nonnull align 4 dereferenceable(4) %6) #6
  %.pre40 = load i32, ptr %6, align 4, !tbaa !5
  br label %.lr.ph.1.1

.lr.ph.1.1:                                       ; preds = %9, %.lr.ph.preheader.1
  %10 = phi i32 [ %.pre40, %9 ], [ %7, %.lr.ph.preheader.1 ]
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load i32, ptr %11, align 8, !tbaa !5
  %13 = icmp sgt i32 %10, %12
  br i1 %13, label %14, label %.lr.ph.1.2

14:                                               ; preds = %.lr.ph.1.1
  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) %6, ptr noundef nonnull align 4 dereferenceable(4) %11) #6
  %.pre41 = load i32, ptr %11, align 8, !tbaa !5
  br label %.lr.ph.1.2

.lr.ph.1.2:                                       ; preds = %14, %.lr.ph.1.1
  %15 = phi i32 [ %.pre41, %14 ], [ %12, %.lr.ph.1.1 ]
  %16 = getelementptr inbounds i8, ptr %0, i64 12
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = icmp sgt i32 %15, %17
  br i1 %18, label %19, label %.lr.ph.1.3

19:                                               ; preds = %.lr.ph.1.2
  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) %11, ptr noundef nonnull align 4 dereferenceable(4) %16) #6
  %.pre42 = load i32, ptr %16, align 4, !tbaa !5
  br label %.lr.ph.1.3

.lr.ph.1.3:                                       ; preds = %19, %.lr.ph.1.2
  %20 = phi i32 [ %.pre42, %19 ], [ %17, %.lr.ph.1.2 ]
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  %22 = load i32, ptr %21, align 16, !tbaa !5
  %23 = icmp sgt i32 %20, %22
  br i1 %23, label %24, label %.lr.ph.1.4

24:                                               ; preds = %.lr.ph.1.3
  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) %16, ptr noundef nonnull align 4 dereferenceable(4) %21) #6
  %.pre43 = load i32, ptr %21, align 16, !tbaa !5
  br label %.lr.ph.1.4

.lr.ph.1.4:                                       ; preds = %24, %.lr.ph.1.3
  %25 = phi i32 [ %.pre43, %24 ], [ %22, %.lr.ph.1.3 ]
  %26 = getelementptr inbounds i8, ptr %0, i64 20
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = icmp sgt i32 %25, %27
  br i1 %28, label %29, label %.lr.ph.1.5

29:                                               ; preds = %.lr.ph.1.4
  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) %21, ptr noundef nonnull align 4 dereferenceable(4) %26) #6
  %.pre44 = load i32, ptr %26, align 4, !tbaa !5
  br label %.lr.ph.1.5

.lr.ph.1.5:                                       ; preds = %29, %.lr.ph.1.4
  %30 = phi i32 [ %.pre44, %29 ], [ %27, %.lr.ph.1.4 ]
  %31 = getelementptr inbounds i8, ptr %0, i64 24
  %32 = load i32, ptr %31, align 8, !tbaa !5
  %33 = icmp sgt i32 %30, %32
  br i1 %33, label %34, label %.lr.ph.preheader.2

34:                                               ; preds = %.lr.ph.1.5
  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) %26, ptr noundef nonnull align 4 dereferenceable(4) %31) #6
  br label %.lr.ph.preheader.2

.lr.ph.preheader.2:                               ; preds = %34, %.lr.ph.1.5
  %35 = load i32, ptr %0, align 16, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %0, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = icmp sgt i32 %35, %37
  br i1 %38, label %39, label %.lr.ph.2.1

39:                                               ; preds = %.lr.ph.preheader.2
  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) %0, ptr noundef nonnull align 4 dereferenceable(4) %36) #6
  %.pre45 = load i32, ptr %36, align 4, !tbaa !5
  br label %.lr.ph.2.1

.lr.ph.2.1:                                       ; preds = %39, %.lr.ph.preheader.2
  %40 = phi i32 [ %.pre45, %39 ], [ %37, %.lr.ph.preheader.2 ]
  %41 = getelementptr inbounds i8, ptr %0, i64 8
  %42 = load i32, ptr %41, align 8, !tbaa !5
  %43 = icmp sgt i32 %40, %42
  br i1 %43, label %44, label %.lr.ph.2.2

44:                                               ; preds = %.lr.ph.2.1
  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) %36, ptr noundef nonnull align 4 dereferenceable(4) %41) #6
  %.pre46 = load i32, ptr %41, align 8, !tbaa !5
  br label %.lr.ph.2.2

.lr.ph.2.2:                                       ; preds = %44, %.lr.ph.2.1
  %45 = phi i32 [ %.pre46, %44 ], [ %42, %.lr.ph.2.1 ]
  %46 = getelementptr inbounds i8, ptr %0, i64 12
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = icmp sgt i32 %45, %47
  br i1 %48, label %49, label %.lr.ph.2.3

49:                                               ; preds = %.lr.ph.2.2
  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) %41, ptr noundef nonnull align 4 dereferenceable(4) %46) #6
  %.pre47 = load i32, ptr %46, align 4, !tbaa !5
  br label %.lr.ph.2.3

.lr.ph.2.3:                                       ; preds = %49, %.lr.ph.2.2
  %50 = phi i32 [ %.pre47, %49 ], [ %47, %.lr.ph.2.2 ]
  %51 = getelementptr inbounds i8, ptr %0, i64 16
  %52 = load i32, ptr %51, align 16, !tbaa !5
  %53 = icmp sgt i32 %50, %52
  br i1 %53, label %54, label %.lr.ph.2.4

54:                                               ; preds = %.lr.ph.2.3
  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) %46, ptr noundef nonnull align 4 dereferenceable(4) %51) #6
  %.pre48 = load i32, ptr %51, align 16, !tbaa !5
  br label %.lr.ph.2.4

.lr.ph.2.4:                                       ; preds = %54, %.lr.ph.2.3
  %55 = phi i32 [ %.pre48, %54 ], [ %52, %.lr.ph.2.3 ]
  %56 = getelementptr inbounds i8, ptr %0, i64 20
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = icmp sgt i32 %55, %57
  br i1 %58, label %59, label %.lr.ph.preheader.3

59:                                               ; preds = %.lr.ph.2.4
  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) %51, ptr noundef nonnull align 4 dereferenceable(4) %56) #6
  br label %.lr.ph.preheader.3

.lr.ph.preheader.3:                               ; preds = %59, %.lr.ph.2.4
  %60 = load i32, ptr %0, align 16, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %0, i64 4
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp sgt i32 %60, %62
  br i1 %63, label %64, label %.lr.ph.3.1

64:                                               ; preds = %.lr.ph.preheader.3
  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) %0, ptr noundef nonnull align 4 dereferenceable(4) %61) #6
  %.pre49 = load i32, ptr %61, align 4, !tbaa !5
  br label %.lr.ph.3.1

.lr.ph.3.1:                                       ; preds = %64, %.lr.ph.preheader.3
  %65 = phi i32 [ %.pre49, %64 ], [ %62, %.lr.ph.preheader.3 ]
  %66 = getelementptr inbounds i8, ptr %0, i64 8
  %67 = load i32, ptr %66, align 8, !tbaa !5
  %68 = icmp sgt i32 %65, %67
  br i1 %68, label %69, label %.lr.ph.3.2

69:                                               ; preds = %.lr.ph.3.1
  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) %61, ptr noundef nonnull align 4 dereferenceable(4) %66) #6
  %.pre50 = load i32, ptr %66, align 8, !tbaa !5
  br label %.lr.ph.3.2

.lr.ph.3.2:                                       ; preds = %69, %.lr.ph.3.1
  %70 = phi i32 [ %.pre50, %69 ], [ %67, %.lr.ph.3.1 ]
  %71 = getelementptr inbounds i8, ptr %0, i64 12
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = icmp sgt i32 %70, %72
  br i1 %73, label %74, label %.lr.ph.3.3

74:                                               ; preds = %.lr.ph.3.2
  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) %66, ptr noundef nonnull align 4 dereferenceable(4) %71) #6
  %.pre51 = load i32, ptr %71, align 4, !tbaa !5
  br label %.lr.ph.3.3

.lr.ph.3.3:                                       ; preds = %74, %.lr.ph.3.2
  %75 = phi i32 [ %.pre51, %74 ], [ %72, %.lr.ph.3.2 ]
  %76 = getelementptr inbounds i8, ptr %0, i64 16
  %77 = load i32, ptr %76, align 16, !tbaa !5
  %78 = icmp sgt i32 %75, %77
  br i1 %78, label %79, label %.lr.ph.preheader.4

79:                                               ; preds = %.lr.ph.3.3
  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) %71, ptr noundef nonnull align 4 dereferenceable(4) %76) #6
  br label %.lr.ph.preheader.4

.lr.ph.preheader.4:                               ; preds = %79, %.lr.ph.3.3
  %80 = load i32, ptr %0, align 16, !tbaa !5
  %81 = getelementptr inbounds i8, ptr %0, i64 4
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = icmp sgt i32 %80, %82
  br i1 %83, label %84, label %.lr.ph.4.1

84:                                               ; preds = %.lr.ph.preheader.4
  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) %0, ptr noundef nonnull align 4 dereferenceable(4) %81) #6
  %.pre52 = load i32, ptr %81, align 4, !tbaa !5
  br label %.lr.ph.4.1

.lr.ph.4.1:                                       ; preds = %84, %.lr.ph.preheader.4
  %85 = phi i32 [ %.pre52, %84 ], [ %82, %.lr.ph.preheader.4 ]
  %86 = getelementptr inbounds i8, ptr %0, i64 8
  %87 = load i32, ptr %86, align 8, !tbaa !5
  %88 = icmp sgt i32 %85, %87
  br i1 %88, label %89, label %.lr.ph.4.2

89:                                               ; preds = %.lr.ph.4.1
  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) %81, ptr noundef nonnull align 4 dereferenceable(4) %86) #6
  %.pre53 = load i32, ptr %86, align 8, !tbaa !5
  br label %.lr.ph.4.2

.lr.ph.4.2:                                       ; preds = %89, %.lr.ph.4.1
  %90 = phi i32 [ %.pre53, %89 ], [ %87, %.lr.ph.4.1 ]
  %91 = getelementptr inbounds i8, ptr %0, i64 12
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = icmp sgt i32 %90, %92
  br i1 %93, label %94, label %.lr.ph.preheader.5

94:                                               ; preds = %.lr.ph.4.2
  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) %86, ptr noundef nonnull align 4 dereferenceable(4) %91) #6
  br label %.lr.ph.preheader.5

.lr.ph.preheader.5:                               ; preds = %94, %.lr.ph.4.2
  %95 = load i32, ptr %0, align 16, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %0, i64 4
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = icmp sgt i32 %95, %97
  br i1 %98, label %99, label %.lr.ph.5.1

99:                                               ; preds = %.lr.ph.preheader.5
  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) %0, ptr noundef nonnull align 4 dereferenceable(4) %96) #6
  %.pre54 = load i32, ptr %96, align 4, !tbaa !5
  br label %.lr.ph.5.1

.lr.ph.5.1:                                       ; preds = %99, %.lr.ph.preheader.5
  %100 = phi i32 [ %.pre54, %99 ], [ %97, %.lr.ph.preheader.5 ]
  %101 = getelementptr inbounds i8, ptr %0, i64 8
  %102 = load i32, ptr %101, align 8, !tbaa !5
  %103 = icmp sgt i32 %100, %102
  br i1 %103, label %104, label %.lr.ph.preheader.6

104:                                              ; preds = %.lr.ph.5.1
  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) %96, ptr noundef nonnull align 4 dereferenceable(4) %101) #6
  br label %.lr.ph.preheader.6

.lr.ph.preheader.6:                               ; preds = %104, %.lr.ph.5.1
  %105 = load i32, ptr %0, align 16, !tbaa !5
  %106 = getelementptr inbounds i8, ptr %0, i64 4
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = icmp sgt i32 %105, %107
  br i1 %108, label %109, label %._crit_edge.6

109:                                              ; preds = %.lr.ph.preheader.6
  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) %0, ptr noundef nonnull align 4 dereferenceable(4) %106) #6
  br label %._crit_edge.6

._crit_edge.6:                                    ; preds = %.lr.ph.preheader.6, %109
  %110 = 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)
  %111 = load i32, ptr %0, align 16, !tbaa !5
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %111)
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %112, ptr noundef nonnull @.str.1)
  %114 = getelementptr inbounds i8, ptr %0, i64 4
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %115)
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %116, ptr noundef nonnull @.str.1)
  %118 = getelementptr inbounds i8, ptr %0, i64 8
  %119 = load i32, ptr %118, align 8, !tbaa !5
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %119)
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %120, ptr noundef nonnull @.str.1)
  %122 = getelementptr inbounds i8, ptr %0, i64 12
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, 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 nonnull @.str.1)
  %126 = getelementptr inbounds i8, ptr %0, i64 16
  %127 = load i32, ptr %126, align 16, !tbaa !5
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %127)
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %128, ptr noundef nonnull @.str.1)
  %130 = getelementptr inbounds i8, ptr %0, i64 20
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %131)
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %132, ptr noundef nonnull @.str.1)
  %134 = getelementptr inbounds i8, ptr %0, i64 24
  %135 = load i32, ptr %134, align 8, !tbaa !5
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %135)
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %136, ptr noundef nonnull @.str.1)
  %138 = getelementptr inbounds i8, ptr %0, i64 28
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %139)
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef nonnull @.str.1)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %0) #6
  ret i32 0

142:                                              ; preds = %.lr.ph.preheader
  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) %0, ptr noundef nonnull align 4 dereferenceable(4) %2) #6
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %.lr.ph.128

.lr.ph.128:                                       ; preds = %.lr.ph.preheader, %142
  %143 = phi i32 [ %3, %.lr.ph.preheader ], [ %.pre, %142 ]
  %144 = getelementptr inbounds i8, ptr %0, i64 8
  %145 = load i32, ptr %144, align 8, !tbaa !5
  %146 = icmp sgt i32 %143, %145
  br i1 %146, label %147, label %.lr.ph.229

147:                                              ; preds = %.lr.ph.128
  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) %2, ptr noundef nonnull align 4 dereferenceable(4) %144) #6
  %.pre35 = load i32, ptr %144, align 8, !tbaa !5
  br label %.lr.ph.229

.lr.ph.229:                                       ; preds = %147, %.lr.ph.128
  %148 = phi i32 [ %.pre35, %147 ], [ %145, %.lr.ph.128 ]
  %149 = getelementptr inbounds i8, ptr %0, i64 12
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = icmp sgt i32 %148, %150
  br i1 %151, label %152, label %.lr.ph.330

152:                                              ; preds = %.lr.ph.229
  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) %144, ptr noundef nonnull align 4 dereferenceable(4) %149) #6
  %.pre36 = load i32, ptr %149, align 4, !tbaa !5
  br label %.lr.ph.330

.lr.ph.330:                                       ; preds = %152, %.lr.ph.229
  %153 = phi i32 [ %.pre36, %152 ], [ %150, %.lr.ph.229 ]
  %154 = getelementptr inbounds i8, ptr %0, i64 16
  %155 = load i32, ptr %154, align 16, !tbaa !5
  %156 = icmp sgt i32 %153, %155
  br i1 %156, label %157, label %.lr.ph.431

157:                                              ; preds = %.lr.ph.330
  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) %149, ptr noundef nonnull align 4 dereferenceable(4) %154) #6
  %.pre37 = load i32, ptr %154, align 16, !tbaa !5
  br label %.lr.ph.431

.lr.ph.431:                                       ; preds = %157, %.lr.ph.330
  %158 = phi i32 [ %.pre37, %157 ], [ %155, %.lr.ph.330 ]
  %159 = getelementptr inbounds i8, ptr %0, i64 20
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = icmp sgt i32 %158, %160
  br i1 %161, label %162, label %.lr.ph.532

162:                                              ; preds = %.lr.ph.431
  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) %154, ptr noundef nonnull align 4 dereferenceable(4) %159) #6
  %.pre38 = load i32, ptr %159, align 4, !tbaa !5
  br label %.lr.ph.532

.lr.ph.532:                                       ; preds = %162, %.lr.ph.431
  %163 = phi i32 [ %.pre38, %162 ], [ %160, %.lr.ph.431 ]
  %164 = getelementptr inbounds i8, ptr %0, i64 24
  %165 = load i32, ptr %164, align 8, !tbaa !5
  %166 = icmp sgt i32 %163, %165
  br i1 %166, label %167, label %.lr.ph.633

167:                                              ; preds = %.lr.ph.532
  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) %159, ptr noundef nonnull align 4 dereferenceable(4) %164) #6
  %.pre39 = load i32, ptr %164, align 8, !tbaa !5
  br label %.lr.ph.633

.lr.ph.633:                                       ; preds = %167, %.lr.ph.532
  %168 = phi i32 [ %.pre39, %167 ], [ %165, %.lr.ph.532 ]
  %169 = getelementptr inbounds i8, ptr %0, i64 28
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = icmp sgt i32 %168, %170
  br i1 %171, label %172, label %.lr.ph.preheader.1

172:                                              ; preds = %.lr.ph.633
  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) %164, ptr noundef nonnull align 4 dereferenceable(4) %169) #6
  br label %.lr.ph.preheader.1
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

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

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { "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 = { 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"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,SCCPPass,SROAPass,SimplifyCFGPass