; LLVM IR from bhrigukansra/algorithms-in-C-Cplusplus-Java-Python-JavaScript :: Algorithms/Implementation/Pattern-Problems/cpp (pattern30)

; 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 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %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
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %19 = 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 %2) #5
  %20 = 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)
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = srem i32 %21, 2
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %27

24:                                               ; preds = %0
  %25 = 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)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %161

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

28:                                               ; preds = %35, %27
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = icmp sle i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %38

33:                                               ; preds = %28
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  br label %35

35:                                               ; preds = %33
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %4, align 4, !tbaa !5
  br label %28, !llvm.loop !9

38:                                               ; preds = %32
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sub nsw i32 %40, 2
  %42 = sdiv i32 %41, 2
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %92, %38
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = icmp sle i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %95

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = mul nsw i32 2, %50
  %52 = sub nsw i32 %51, 1
  store i32 %52, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sdiv i32 %53, 2
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = sub nsw i32 %54, %55
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %65, %49
  %59 = load i32, ptr %9, align 4, !tbaa !5
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = icmp sle i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %68

63:                                               ; preds = %58
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  br label %65

65:                                               ; preds = %63
  %66 = load i32, ptr %9, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %9, align 4, !tbaa !5
  br label %58, !llvm.loop !11

68:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %76, %68
  %70 = load i32, ptr %10, align 4, !tbaa !5
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = icmp sle i32 %70, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %79

74:                                               ; preds = %69
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  br label %76

76:                                               ; preds = %74
  %77 = load i32, ptr %10, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %10, align 4, !tbaa !5
  br label %69, !llvm.loop !12

79:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %87, %79
  %81 = load i32, ptr %11, align 4, !tbaa !5
  %82 = load i32, ptr %8, align 4, !tbaa !5
  %83 = icmp sle i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %90

85:                                               ; preds = %80
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  br label %87

87:                                               ; preds = %85
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %11, align 4, !tbaa !5
  br label %80, !llvm.loop !13

90:                                               ; preds = %84
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %92

92:                                               ; preds = %90
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %6, align 4, !tbaa !5
  br label %44, !llvm.loop !14

95:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %96 = load i32, ptr %5, align 4, !tbaa !5
  %97 = sub nsw i32 %96, 1
  store i32 %97, ptr %12, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %145, %95
  %99 = load i32, ptr %12, align 4, !tbaa !5
  %100 = icmp sge i32 %99, 1
  br i1 %100, label %102, label %101

101:                                              ; preds = %98
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %148

102:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %103 = load i32, ptr %12, align 4, !tbaa !5
  %104 = mul nsw i32 2, %103
  %105 = sub nsw i32 %104, 1
  store i32 %105, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %106 = load i32, ptr %2, align 4, !tbaa !5
  %107 = sdiv i32 %106, 2
  %108 = load i32, ptr %12, align 4, !tbaa !5
  %109 = sub nsw i32 %107, %108
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %118, %102
  %112 = load i32, ptr %15, align 4, !tbaa !5
  %113 = load i32, ptr %14, align 4, !tbaa !5
  %114 = icmp sle i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %121

116:                                              ; preds = %111
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  br label %118

118:                                              ; preds = %116
  %119 = load i32, ptr %15, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %15, align 4, !tbaa !5
  br label %111, !llvm.loop !15

121:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 1, ptr %16, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %129, %121
  %123 = load i32, ptr %16, align 4, !tbaa !5
  %124 = load i32, ptr %13, align 4, !tbaa !5
  %125 = icmp sle i32 %123, %124
  br i1 %125, label %127, label %126

126:                                              ; preds = %122
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %132

127:                                              ; preds = %122
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  br label %129

129:                                              ; preds = %127
  %130 = load i32, ptr %16, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %16, align 4, !tbaa !5
  br label %122, !llvm.loop !16

132:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %140, %132
  %134 = load i32, ptr %17, align 4, !tbaa !5
  %135 = load i32, ptr %14, align 4, !tbaa !5
  %136 = icmp sle i32 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 26, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %143

138:                                              ; preds = %133
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  br label %140

140:                                              ; preds = %138
  %141 = load i32, ptr %17, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %17, align 4, !tbaa !5
  br label %133, !llvm.loop !17

143:                                              ; preds = %137
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %145

145:                                              ; preds = %143
  %146 = load i32, ptr %12, align 4, !tbaa !5
  %147 = add nsw i32 %146, -1
  store i32 %147, ptr %12, align 4, !tbaa !5
  br label %98, !llvm.loop !18

148:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 1, ptr %18, align 4, !tbaa !5
  br label %149

149:                                              ; preds = %156, %148
  %150 = load i32, ptr %18, align 4, !tbaa !5
  %151 = load i32, ptr %2, align 4, !tbaa !5
  %152 = icmp sle i32 %150, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %149
  store i32 29, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %159

154:                                              ; preds = %149
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  br label %156

156:                                              ; preds = %154
  %157 = load i32, ptr %18, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %18, align 4, !tbaa !5
  br label %149, !llvm.loop !19

159:                                              ; preds = %153
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  store i32 0, ptr %3, align 4
  br label %161

161:                                              ; preds = %159, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %162 = load i32, ptr %3, align 4
  switch i32 %162, label %165 [
    i32 0, label %163
    i32 1, label %163
  ]

163:                                              ; preds = %161, %161
  %164 = load i32, ptr %1, align 4
  ret i32 %164

165:                                              ; preds = %161
  unreachable
}

; 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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !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 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %3 = 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)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %5 = and i32 %4, 1
  %6 = icmp eq i32 %5, 0
  br i1 %6, label %7, label %.preheader58

.preheader58:                                     ; preds = %0
  %.not59 = icmp slt i32 %4, 1
  br i1 %.not59, label %._crit_edge, label %.lr.ph

7:                                                ; preds = %0
  %8 = 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)
  br label %._crit_edge92

._crit_edge:                                      ; preds = %.lr.ph, %.preheader58
  %9 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = add nsw i32 %10, -2
  %12 = sdiv i32 %11, 2
  %.not4572 = icmp slt i32 %10, 1
  br i1 %.not4572, label %._crit_edge92, label %.lr.ph75.preheader

.lr.ph75.preheader:                               ; preds = %._crit_edge
  %13 = call i32 @llvm.smax.i32(i32 %12, i32 0)
  %14 = add nuw nsw i32 %13, 1
  br label %.lr.ph75

.lr.ph:                                           ; preds = %.preheader58, %.lr.ph
  %.04160 = phi i32 [ %16, %.lr.ph ], [ 1, %.preheader58 ]
  %15 = 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.2)
  %16 = add nuw nsw i32 %.04160, 1
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.04160, %17
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader55:                                     ; preds = %._crit_edge71
  %18 = icmp sgt i32 %10, 3
  br i1 %18, label %.lr.ph88.preheader, label %.preheader

.lr.ph88.preheader:                               ; preds = %.preheader55
  %19 = sub nsw i32 2, %12
  %20 = shl nsw i32 %12, 1
  br label %.lr.ph88

.lr.ph75:                                         ; preds = %.lr.ph75.preheader, %._crit_edge71
  %indvars.iv = phi i32 [ 2, %.lr.ph75.preheader ], [ %indvars.iv.next, %._crit_edge71 ]
  %.04273 = phi i32 [ 1, %.lr.ph75.preheader ], [ %29, %._crit_edge71 ]
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = sdiv i32 %21, 2
  %23 = sub nsw i32 %22, %.04273
  %.not5061 = icmp slt i32 %23, 0
  br i1 %.not5061, label %.lr.ph67.preheader, label %.lr.ph64

.lr.ph67.preheader:                               ; preds = %.lr.ph64, %.lr.ph75
  br label %.lr.ph67

.lr.ph64:                                         ; preds = %.lr.ph75, %.lr.ph64
  %.04062 = phi i32 [ %25, %.lr.ph64 ], [ 1, %.lr.ph75 ]
  %24 = 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.2)
  %25 = add nuw nsw i32 %.04062, 1
  %.not50 = icmp sgt i32 %.04062, %23
  br i1 %.not50, label %.lr.ph67.preheader, label %.lr.ph64, !llvm.loop !11

.preheader56:                                     ; preds = %.lr.ph67
  br i1 %.not5061, label %._crit_edge71, label %.lr.ph70

.lr.ph67:                                         ; preds = %.lr.ph67.preheader, %.lr.ph67
  %.03966 = phi i32 [ %27, %.lr.ph67 ], [ 1, %.lr.ph67.preheader ]
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  %27 = add nuw i32 %.03966, 1
  %exitcond.not = icmp eq i32 %27, %indvars.iv
  br i1 %exitcond.not, label %.preheader56, label %.lr.ph67, !llvm.loop !12

._crit_edge71:                                    ; preds = %.lr.ph70, %.preheader56
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %29 = add nuw nsw i32 %.04273, 1
  %indvars.iv.next = add nuw i32 %indvars.iv, 2
  %exitcond93 = icmp eq i32 %.04273, %14
  br i1 %exitcond93, label %.preheader55, label %.lr.ph75, !llvm.loop !13

.lr.ph70:                                         ; preds = %.preheader56, %.lr.ph70
  %.03869 = phi i32 [ %31, %.lr.ph70 ], [ 1, %.preheader56 ]
  %30 = 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.2)
  %31 = add nuw nsw i32 %.03869, 1
  %.not52 = icmp sgt i32 %.03869, %23
  br i1 %.not52, label %._crit_edge71, label %.lr.ph70, !llvm.loop !14

.preheader:                                       ; preds = %._crit_edge86, %.preheader55
  %.pr = load i32, ptr %1, align 4, !tbaa !5
  %.not4689 = icmp slt i32 %.pr, 1
  br i1 %.not4689, label %._crit_edge92, label %.lr.ph91

.lr.ph88:                                         ; preds = %.lr.ph88.preheader, %._crit_edge86
  %indvars.iv97 = phi i32 [ %20, %.lr.ph88.preheader ], [ %indvars.iv.next98, %._crit_edge86 ]
  %indvars.iv94 = phi i32 [ %19, %.lr.ph88.preheader ], [ %indvars.iv.next95, %._crit_edge86 ]
  %.03787 = phi i32 [ %12, %.lr.ph88.preheader ], [ %41, %._crit_edge86 ]
  %umax = call i32 @llvm.umax.i32(i32 %indvars.iv97, i32 2)
  %32 = load i32, ptr %1, align 4, !tbaa !5
  %33 = sdiv i32 %32, 2
  %.not4776 = icmp slt i32 %33, %.03787
  br i1 %.not4776, label %.preheader54, label %.lr.ph79.preheader

.lr.ph79.preheader:                               ; preds = %.lr.ph88
  %34 = add i32 %33, %indvars.iv94
  br label %.lr.ph79

.preheader54:                                     ; preds = %.lr.ph79, %.lr.ph88
  %.not48.not80.not = icmp eq i32 %.03787, 0
  br i1 %.not48.not80.not, label %.preheader53, label %.lr.ph82

.lr.ph79:                                         ; preds = %.lr.ph79.preheader, %.lr.ph79
  %.03577 = phi i32 [ %36, %.lr.ph79 ], [ 1, %.lr.ph79.preheader ]
  %35 = 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.2)
  %36 = add nuw i32 %.03577, 1
  %exitcond96 = icmp eq i32 %36, %34
  br i1 %exitcond96, label %.preheader54, label %.lr.ph79, !llvm.loop !15

.preheader53:                                     ; preds = %.lr.ph82, %.preheader54
  br i1 %.not4776, label %._crit_edge86, label %.lr.ph85.preheader

.lr.ph85.preheader:                               ; preds = %.preheader53
  %37 = add i32 %33, %indvars.iv94
  br label %.lr.ph85

.lr.ph82:                                         ; preds = %.preheader54, %.lr.ph82
  %.03481 = phi i32 [ %39, %.lr.ph82 ], [ 1, %.preheader54 ]
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  %39 = add nuw i32 %.03481, 1
  %exitcond99.not = icmp eq i32 %39, %umax
  br i1 %exitcond99.not, label %.preheader53, label %.lr.ph82, !llvm.loop !16

._crit_edge86:                                    ; preds = %.lr.ph85, %.preheader53
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %41 = add nsw i32 %.03787, -1
  %42 = icmp sgt i32 %.03787, 1
  %indvars.iv.next95 = add i32 %indvars.iv94, 1
  %indvars.iv.next98 = add i32 %indvars.iv97, -2
  br i1 %42, label %.lr.ph88, label %.preheader, !llvm.loop !17

.lr.ph85:                                         ; preds = %.lr.ph85.preheader, %.lr.ph85
  %.03384 = phi i32 [ %44, %.lr.ph85 ], [ 1, %.lr.ph85.preheader ]
  %43 = 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.2)
  %44 = add nuw i32 %.03384, 1
  %exitcond100 = icmp eq i32 %44, %37
  br i1 %exitcond100, label %._crit_edge86, label %.lr.ph85, !llvm.loop !18

.lr.ph91:                                         ; preds = %.preheader, %.lr.ph91
  %.090 = phi i32 [ %46, %.lr.ph91 ], [ 1, %.preheader ]
  %45 = 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.2)
  %46 = add nuw nsw i32 %.090, 1
  %47 = load i32, ptr %1, align 4, !tbaa !5
  %.not46.not = icmp slt i32 %.090, %47
  br i1 %.not46.not, label %.lr.ph91, label %._crit_edge92, !llvm.loop !19

._crit_edge92:                                    ; preds = %.lr.ph91, %.preheader, %._crit_edge, %7
  %_ZSt4cout.sink = phi ptr [ %8, %7 ], [ @_ZSt4cout, %._crit_edge ], [ @_ZSt4cout, %.preheader ], [ @_ZSt4cout, %.lr.ph91 ]
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %_ZSt4cout.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 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) local_unnamed_addr #1

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


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