; LLVM IR from AdarshGaur/Competitive-Programming :: Codeforces/Codeforces Round #750 (Div. 2)/D. Vupsen, Pupsen and 0.ll (Z5solvev)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca i64, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %20 = load i64, ptr %1, align 8, !tbaa !5
  %21 = call ptr @llvm.stacksave.p0()
  store ptr %21, ptr %2, align 8
  %22 = alloca i64, i64 %20, align 16
  store i64 %20, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store ptr %22, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %23 = load ptr, ptr %4, align 8, !tbaa !9
  store ptr %23, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %24 = load ptr, ptr %4, align 8, !tbaa !9
  %25 = mul nuw i64 8, %20
  %26 = udiv i64 %25, 8
  %27 = getelementptr inbounds i64, ptr %24, i64 %26
  store ptr %27, ptr %6, align 8, !tbaa !9
  br label %28

28:                                               ; preds = %37, %0
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  %30 = load ptr, ptr %6, align 8, !tbaa !9
  %31 = icmp ne ptr %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %40

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  store ptr %34, ptr %7, align 8, !tbaa !9
  %35 = load ptr, ptr %7, align 8, !tbaa !9
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %35)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %37

37:                                               ; preds = %33
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = getelementptr inbounds i64, ptr %38, i32 1
  store ptr %39, ptr %5, align 8, !tbaa !9
  br label %28

40:                                               ; preds = %32
  %41 = load i64, ptr %1, align 8, !tbaa !5
  %42 = alloca i64, i64 %41, align 16
  store i64 %41, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store i64 0, ptr %9, align 8, !tbaa !5
  %43 = load i64, ptr %1, align 8, !tbaa !5
  %44 = and i64 %43, 1
  %45 = icmp ne i64 %44, 0
  br i1 %45, label %46, label %119

46:                                               ; preds = %40
  %47 = getelementptr inbounds i64, ptr %22, i64 0
  %48 = load i64, ptr %47, align 16, !tbaa !5
  %49 = getelementptr inbounds i64, ptr %22, i64 1
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = sub nsw i64 0, %50
  %52 = icmp eq i64 %48, %51
  br i1 %52, label %53, label %103

53:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store i64 0, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i64 0, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store i64 0, ptr %12, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %76, %53
  %55 = load i64, ptr %12, align 8, !tbaa !5
  %56 = icmp slt i64 %55, 3
  br i1 %56, label %58, label %57

57:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %79

58:                                               ; preds = %54
  %59 = load i64, ptr %12, align 8, !tbaa !5
  %60 = getelementptr inbounds i64, ptr %22, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !5
  %62 = icmp slt i64 %61, 0
  br i1 %62, label %63, label %69

63:                                               ; preds = %58
  %64 = load i64, ptr %12, align 8, !tbaa !5
  %65 = getelementptr inbounds i64, ptr %22, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !5
  %67 = load i64, ptr %10, align 8, !tbaa !5
  %68 = add nsw i64 %67, %66
  store i64 %68, ptr %10, align 8, !tbaa !5
  br label %75

69:                                               ; preds = %58
  %70 = load i64, ptr %12, align 8, !tbaa !5
  %71 = getelementptr inbounds i64, ptr %22, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !5
  %73 = load i64, ptr %11, align 8, !tbaa !5
  %74 = add nsw i64 %73, %72
  store i64 %74, ptr %11, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %69, %63
  br label %76

76:                                               ; preds = %75
  %77 = load i64, ptr %12, align 8, !tbaa !5
  %78 = add nsw i64 %77, 1
  store i64 %78, ptr %12, align 8, !tbaa !5
  br label %54, !llvm.loop !11

79:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store i64 0, ptr %13, align 8, !tbaa !5
  br label %80

80:                                               ; preds = %99, %79
  %81 = load i64, ptr %13, align 8, !tbaa !5
  %82 = icmp slt i64 %81, 3
  br i1 %82, label %84, label %83

83:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %102

84:                                               ; preds = %80
  %85 = load i64, ptr %13, align 8, !tbaa !5
  %86 = getelementptr inbounds i64, ptr %22, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !5
  %88 = icmp slt i64 %87, 0
  br i1 %88, label %89, label %93

89:                                               ; preds = %84
  %90 = load i64, ptr %11, align 8, !tbaa !5
  %91 = load i64, ptr %13, align 8, !tbaa !5
  %92 = getelementptr inbounds i64, ptr %42, i64 %91
  store i64 %90, ptr %92, align 8, !tbaa !5
  br label %98

93:                                               ; preds = %84
  %94 = load i64, ptr %10, align 8, !tbaa !5
  %95 = sub nsw i64 0, %94
  %96 = load i64, ptr %13, align 8, !tbaa !5
  %97 = getelementptr inbounds i64, ptr %42, i64 %96
  store i64 %95, ptr %97, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %93, %89
  br label %99

99:                                               ; preds = %98
  %100 = load i64, ptr %13, align 8, !tbaa !5
  %101 = add nsw i64 %100, 1
  store i64 %101, ptr %13, align 8, !tbaa !5
  br label %80, !llvm.loop !13

102:                                              ; preds = %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %118

103:                                              ; preds = %46
  %104 = getelementptr inbounds i64, ptr %22, i64 0
  %105 = load i64, ptr %104, align 16, !tbaa !5
  %106 = getelementptr inbounds i64, ptr %22, i64 1
  %107 = load i64, ptr %106, align 8, !tbaa !5
  %108 = add nsw i64 %105, %107
  %109 = getelementptr inbounds i64, ptr %42, i64 2
  store i64 %108, ptr %109, align 16, !tbaa !5
  %110 = getelementptr inbounds i64, ptr %22, i64 2
  %111 = load i64, ptr %110, align 16, !tbaa !5
  %112 = sub nsw i64 0, %111
  %113 = getelementptr inbounds i64, ptr %42, i64 0
  store i64 %112, ptr %113, align 16, !tbaa !5
  %114 = getelementptr inbounds i64, ptr %22, i64 2
  %115 = load i64, ptr %114, align 16, !tbaa !5
  %116 = sub nsw i64 0, %115
  %117 = getelementptr inbounds i64, ptr %42, i64 1
  store i64 %116, ptr %117, align 8, !tbaa !5
  br label %118

118:                                              ; preds = %103, %102
  store i64 3, ptr %9, align 8, !tbaa !5
  br label %119

119:                                              ; preds = %118, %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %120 = load i64, ptr %9, align 8, !tbaa !5
  store i64 %120, ptr %14, align 8, !tbaa !5
  br label %121

121:                                              ; preds = %140, %119
  %122 = load i64, ptr %14, align 8, !tbaa !5
  %123 = load i64, ptr %1, align 8, !tbaa !5
  %124 = icmp slt i64 %122, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %143

126:                                              ; preds = %121
  %127 = load i64, ptr %14, align 8, !tbaa !5
  %128 = add nsw i64 %127, 1
  %129 = getelementptr inbounds i64, ptr %22, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !5
  %131 = load i64, ptr %14, align 8, !tbaa !5
  %132 = getelementptr inbounds i64, ptr %42, i64 %131
  store i64 %130, ptr %132, align 8, !tbaa !5
  %133 = load i64, ptr %14, align 8, !tbaa !5
  %134 = getelementptr inbounds i64, ptr %22, i64 %133
  %135 = load i64, ptr %134, align 8, !tbaa !5
  %136 = sub nsw i64 0, %135
  %137 = load i64, ptr %14, align 8, !tbaa !5
  %138 = add nsw i64 %137, 1
  %139 = getelementptr inbounds i64, ptr %42, i64 %138
  store i64 %136, ptr %139, align 8, !tbaa !5
  br label %140

140:                                              ; preds = %126
  %141 = load i64, ptr %14, align 8, !tbaa !5
  %142 = add nsw i64 %141, 2
  store i64 %142, ptr %14, align 8, !tbaa !5
  br label %121, !llvm.loop !14

143:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store ptr %42, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %144 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %144, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %145 = load ptr, ptr %15, align 8, !tbaa !9
  %146 = mul nuw i64 8, %41
  %147 = udiv i64 %146, 8
  %148 = getelementptr inbounds i64, ptr %145, i64 %147
  store ptr %148, ptr %17, align 8, !tbaa !9
  br label %149

149:                                              ; preds = %160, %143
  %150 = load ptr, ptr %16, align 8, !tbaa !9
  %151 = load ptr, ptr %17, align 8, !tbaa !9
  %152 = icmp ne ptr %150, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %149
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %163

154:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %155 = load ptr, ptr %16, align 8, !tbaa !9
  %156 = load i64, ptr %155, align 8, !tbaa !5
  store i64 %156, ptr %18, align 8, !tbaa !5
  %157 = load i64, ptr %18, align 8, !tbaa !5
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %157)
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %158, ptr noundef @.str)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %160

160:                                              ; preds = %154
  %161 = load ptr, ptr %16, align 8, !tbaa !9
  %162 = getelementptr inbounds i64, ptr %161, i32 1
  store ptr %162, ptr %16, align 8, !tbaa !9
  br label %149

163:                                              ; preds = %153
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %165 = load ptr, ptr %2, align 8
  call void @llvm.stackrestore.p0(ptr %165)
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 align 2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %2 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %3 = load i64, ptr %1, align 8, !tbaa !5
  %4 = call ptr @llvm.stacksave.p0()
  %5 = alloca i64, i64 %3, align 16
  %6 = getelementptr inbounds i64, ptr %5, i64 %3
  %.not49 = icmp eq i64 %3, 0
  br i1 %.not49, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %7 = load i64, ptr %1, align 8, !tbaa !5
  %8 = alloca i64, i64 %7, align 16
  %9 = and i64 %7, 1
  %.not46 = icmp eq i64 %9, 0
  br i1 %.not46, label %.loopexit, label %12

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.050 = phi ptr [ %11, %.lr.ph ], [ %5, %0 ]
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %.050)
  %11 = getelementptr inbounds i8, ptr %.050, i64 8
  %.not = icmp eq ptr %11, %6
  br i1 %.not, label %._crit_edge, label %.lr.ph

12:                                               ; preds = %._crit_edge
  %13 = load i64, ptr %5, align 16, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %5, i64 8
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %16 = sub nsw i64 0, %15
  %17 = icmp eq i64 %13, %16
  br i1 %17, label %.preheader48.preheader, label %31

.preheader48.preheader:                           ; preds = %12
  %18 = call i64 @llvm.smax.i64(i64 %13, i64 0)
  %19 = call i64 @llvm.smin.i64(i64 %13, i64 0)
  %20 = call i64 @llvm.smax.i64(i64 %15, i64 0)
  %.142.1 = add nuw nsw i64 %20, %18
  %21 = call i64 @llvm.smin.i64(i64 %15, i64 0)
  %.1.1 = add nsw i64 %21, %19
  %22 = getelementptr inbounds i8, ptr %5, i64 16
  %23 = load i64, ptr %22, align 16, !tbaa !5
  %24 = call i64 @llvm.smax.i64(i64 %23, i64 0)
  %.142.2 = add nuw nsw i64 %24, %.142.1
  %25 = call i64 @llvm.smin.i64(i64 %23, i64 0)
  %.1.2 = add nsw i64 %25, %.1.1
  %26 = sub nsw i64 0, %.1.2
  %27 = icmp slt i64 %13, 0
  %spec.select = select i1 %27, i64 %.142.2, i64 %26
  store i64 %spec.select, ptr %8, align 16
  %28 = icmp slt i64 %15, 0
  %.sink64 = select i1 %28, i64 %.142.2, i64 %26
  %29 = getelementptr inbounds i8, ptr %8, i64 8
  store i64 %.sink64, ptr %29, align 8
  %30 = icmp slt i64 %23, 0
  %.sink65 = select i1 %30, i64 %.142.2, i64 %26
  br label %.loopexit.sink.split

31:                                               ; preds = %12
  %32 = add nsw i64 %15, %13
  %33 = getelementptr inbounds i8, ptr %8, i64 16
  store i64 %32, ptr %33, align 16, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %5, i64 16
  %35 = load i64, ptr %34, align 16, !tbaa !5
  %36 = sub nsw i64 0, %35
  store i64 %36, ptr %8, align 16, !tbaa !5
  br label %.loopexit.sink.split

.loopexit.sink.split:                             ; preds = %31, %.preheader48.preheader
  %.sink66 = phi i64 [ 16, %.preheader48.preheader ], [ 8, %31 ]
  %.sink65.sink = phi i64 [ %.sink65, %.preheader48.preheader ], [ %36, %31 ]
  %37 = getelementptr inbounds i8, ptr %8, i64 %.sink66
  store i64 %.sink65.sink, ptr %37, align 8
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.sink.split, %._crit_edge
  %.035 = phi i64 [ 0, %._crit_edge ], [ 3, %.loopexit.sink.split ]
  %38 = icmp slt i64 %.035, %7
  br i1 %38, label %.lr.ph57, label %._crit_edge58

._crit_edge58:                                    ; preds = %.lr.ph57, %.loopexit
  %39 = getelementptr inbounds i64, ptr %8, i64 %7
  %.not4759 = icmp eq i64 %7, 0
  br i1 %.not4759, label %._crit_edge63, label %.lr.ph62

.lr.ph57:                                         ; preds = %.loopexit, %.lr.ph57
  %.03855 = phi i64 [ %48, %.lr.ph57 ], [ %.035, %.loopexit ]
  %40 = add nuw nsw i64 %.03855, 1
  %41 = getelementptr inbounds i64, ptr %5, i64 %40
  %42 = load i64, ptr %41, align 8, !tbaa !5
  %43 = getelementptr inbounds i64, ptr %8, i64 %.03855
  store i64 %42, ptr %43, align 8, !tbaa !5
  %44 = getelementptr inbounds i64, ptr %5, i64 %.03855
  %45 = load i64, ptr %44, align 8, !tbaa !5
  %46 = sub nsw i64 0, %45
  %47 = getelementptr inbounds i64, ptr %8, i64 %40
  store i64 %46, ptr %47, align 8, !tbaa !5
  %48 = add nuw nsw i64 %.03855, 2
  %49 = icmp slt i64 %48, %7
  br i1 %49, label %.lr.ph57, label %._crit_edge58, !llvm.loop !9

._crit_edge63:                                    ; preds = %.lr.ph62, %._crit_edge58
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  call void @llvm.stackrestore.p0(ptr %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret void

.lr.ph62:                                         ; preds = %._crit_edge58, %.lr.ph62
  %.03660 = phi ptr [ %54, %.lr.ph62 ], [ %8, %._crit_edge58 ]
  %51 = load i64, ptr %.03660, align 8, !tbaa !5
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %51)
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull @.str)
  %54 = getelementptr inbounds i8, ptr %.03660, i64 8
  %.not47 = icmp eq ptr %54, %39
  br i1 %.not47, label %._crit_edge63, label %.lr.ph62
}

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #4

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,ReassociatePass,SROAPass,SimplifyCFGPass