; LLVM IR from HarshCasper/NeoAlgo :: C-Plus-Plus/math/Sieve_Of_Atkins.ll (Z14Sieve_Of_Atkini)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z14Sieve_Of_Atkini(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 2
  br i1 %14, label %15, label %18

15:                                               ; preds = %1
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 2)
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef @.str)
  br label %18

18:                                               ; preds = %15, %1
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 3
  br i1 %20, label %21, label %24

21:                                               ; preds = %18
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 3)
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef @.str)
  br label %24

24:                                               ; preds = %21, %18
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = zext i32 %25 to i64
  %27 = call ptr @llvm.stacksave.p0()
  store ptr %27, ptr %3, align 8
  %28 = alloca i8, i64 %26, align 16
  store i64 %26, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %38, %24
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %41

34:                                               ; preds = %29
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds i8, ptr %28, i64 %36
  store i8 0, ptr %37, align 1, !tbaa !9
  br label %38

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

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

42:                                               ; preds = %130, %41
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = mul nsw i32 %43, %44
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

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

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

50:                                               ; preds = %126, %49
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = load i32, ptr %8, align 4, !tbaa !5
  %53 = mul nsw i32 %51, %52
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = mul nsw i32 4, %58
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = mul nsw i32 %59, %60
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = mul nsw i32 %62, %63
  %65 = add nsw i32 %61, %64
  store i32 %65, ptr %9, align 4, !tbaa !5
  %66 = load i32, ptr %9, align 4, !tbaa !5
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = icmp sle i32 %66, %67
  br i1 %68, label %69, label %81

69:                                               ; preds = %57
  %70 = load i32, ptr %9, align 4, !tbaa !5
  %71 = srem i32 %70, 12
  %72 = icmp eq i32 %71, 1
  br i1 %72, label %77, label %73

73:                                               ; preds = %69
  %74 = load i32, ptr %9, align 4, !tbaa !5
  %75 = srem i32 %74, 12
  %76 = icmp eq i32 %75, 5
  br i1 %76, label %77, label %81

77:                                               ; preds = %73, %69
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i8, ptr %28, i64 %79
  store i8 1, ptr %80, align 1, !tbaa !9
  br label %81

81:                                               ; preds = %77, %73, %57
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = mul nsw i32 3, %82
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = mul nsw i32 %83, %84
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = mul nsw i32 %86, %87
  %89 = add nsw i32 %85, %88
  store i32 %89, ptr %9, align 4, !tbaa !5
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = load i32, ptr %2, align 4, !tbaa !5
  %92 = icmp sle i32 %90, %91
  br i1 %92, label %93, label %101

93:                                               ; preds = %81
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = srem i32 %94, 12
  %96 = icmp eq i32 %95, 7
  br i1 %96, label %97, label %101

97:                                               ; preds = %93
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i8, ptr %28, i64 %99
  store i8 1, ptr %100, align 1, !tbaa !9
  br label %101

101:                                              ; preds = %97, %93, %81
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = mul nsw i32 3, %102
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = mul nsw i32 %103, %104
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = mul nsw i32 %106, %107
  %109 = sub nsw i32 %105, %108
  store i32 %109, ptr %9, align 4, !tbaa !5
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = icmp sgt i32 %110, %111
  br i1 %112, label %113, label %125

113:                                              ; preds = %101
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = load i32, ptr %2, align 4, !tbaa !5
  %116 = icmp sle i32 %114, %115
  br i1 %116, label %117, label %125

117:                                              ; preds = %113
  %118 = load i32, ptr %9, align 4, !tbaa !5
  %119 = srem i32 %118, 12
  %120 = icmp eq i32 %119, 11
  br i1 %120, label %121, label %125

121:                                              ; preds = %117
  %122 = load i32, ptr %9, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i8, ptr %28, i64 %123
  store i8 1, ptr %124, align 1, !tbaa !9
  br label %125

125:                                              ; preds = %121, %117, %113, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %8, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %8, align 4, !tbaa !5
  br label %50, !llvm.loop !13

129:                                              ; preds = %56
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %6, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %6, align 4, !tbaa !5
  br label %42, !llvm.loop !14

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

134:                                              ; preds = %168, %133
  %135 = load i32, ptr %10, align 4, !tbaa !5
  %136 = load i32, ptr %10, align 4, !tbaa !5
  %137 = mul nsw i32 %135, %136
  %138 = load i32, ptr %2, align 4, !tbaa !5
  %139 = icmp slt i32 %137, %138
  br i1 %139, label %141, label %140

140:                                              ; preds = %134
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %171

141:                                              ; preds = %134
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds i8, ptr %28, i64 %143
  %145 = load i8, ptr %144, align 1, !tbaa !9, !range !15, !noundef !16
  %146 = trunc i8 %145 to i1
  br i1 %146, label %147, label %167

147:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %148 = load i32, ptr %10, align 4, !tbaa !5
  %149 = load i32, ptr %10, align 4, !tbaa !5
  %150 = mul nsw i32 %148, %149
  store i32 %150, ptr %11, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %160, %147
  %152 = load i32, ptr %11, align 4, !tbaa !5
  %153 = load i32, ptr %2, align 4, !tbaa !5
  %154 = icmp slt i32 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %166

156:                                              ; preds = %151
  %157 = load i32, ptr %11, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds i8, ptr %28, i64 %158
  store i8 0, ptr %159, align 1, !tbaa !9
  br label %160

160:                                              ; preds = %156
  %161 = load i32, ptr %10, align 4, !tbaa !5
  %162 = load i32, ptr %10, align 4, !tbaa !5
  %163 = mul nsw i32 %161, %162
  %164 = load i32, ptr %11, align 4, !tbaa !5
  %165 = add nsw i32 %164, %163
  store i32 %165, ptr %11, align 4, !tbaa !5
  br label %151, !llvm.loop !17

166:                                              ; preds = %155
  br label %167

167:                                              ; preds = %166, %141
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %10, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %10, align 4, !tbaa !5
  br label %134, !llvm.loop !18

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

172:                                              ; preds = %188, %171
  %173 = load i32, ptr %12, align 4, !tbaa !5
  %174 = load i32, ptr %2, align 4, !tbaa !5
  %175 = icmp slt i32 %173, %174
  br i1 %175, label %177, label %176

176:                                              ; preds = %172
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %191

177:                                              ; preds = %172
  %178 = load i32, ptr %12, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds i8, ptr %28, i64 %179
  %181 = load i8, ptr %180, align 1, !tbaa !9, !range !15, !noundef !16
  %182 = trunc i8 %181 to i1
  br i1 %182, label %183, label %187

183:                                              ; preds = %177
  %184 = load i32, ptr %12, align 4, !tbaa !5
  %185 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %184)
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %185, ptr noundef @.str)
  br label %187

187:                                              ; preds = %183, %177
  br label %188

188:                                              ; preds = %187
  %189 = load i32, ptr %12, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %12, align 4, !tbaa !5
  br label %172, !llvm.loop !19

191:                                              ; preds = %176
  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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

; Function Attrs: mustprogress noreturn uwtable
define dso_local noundef i32 @_Z14Sieve_Of_Atkini(i32 noundef %0) local_unnamed_addr #0 {
  %2 = icmp sgt i32 %0, 2
  br i1 %2, label %3, label %.thread

3:                                                ; preds = %1
  %4 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 2)
  %5 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull @.str)
  %.not78 = icmp eq i32 %0, 3
  br i1 %.not78, label %.preheader84.thread103, label %6

6:                                                ; preds = %3
  %7 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 3)
  %8 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull @.str)
  br label %.preheader84.thread103

.preheader84.thread103:                           ; preds = %3, %6
  %9 = zext nneg i32 %0 to i64
  %10 = alloca i8, i64 %9, align 16
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %10, i8 0, i64 %9, i1 false), !tbaa !5
  br label %.preheader83.us.preheader

.thread:                                          ; preds = %1
  %11 = zext i32 %0 to i64
  %12 = alloca i8, i64 %11, align 16
  %13 = icmp sgt i32 %0, 0
  br i1 %13, label %.preheader84, label %.preheader

.preheader84:                                     ; preds = %.thread
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %12, i8 0, i64 %11, i1 false), !tbaa !5
  %.not = icmp eq i32 %0, 1
  br i1 %.not, label %.preheader, label %.preheader83.us.preheader

.preheader83.us.preheader:                        ; preds = %.preheader84.thread103, %.preheader84
  %14 = phi ptr [ %10, %.preheader84.thread103 ], [ %12, %.preheader84 ]
  br label %.preheader83.us

.preheader83.us:                                  ; preds = %.preheader83.us.preheader, %._crit_edge.us
  %.06390.us = phi i32 [ %43, %._crit_edge.us ], [ 1, %.preheader83.us.preheader ]
  %factor.op.mul.us = shl i32 %.06390.us, 2
  %factor.op.mul86.us = mul i32 %.06390.us, 3
  %.reass.us = mul i32 %factor.op.mul.us, %.06390.us
  %.reass87.us = mul i32 %factor.op.mul86.us, %.06390.us
  br label %15

15:                                               ; preds = %.preheader83.us, %39
  %16 = phi i32 [ 1, %.preheader83.us ], [ %41, %39 ]
  %.06288.us = phi i32 [ 1, %.preheader83.us ], [ %40, %39 ]
  %17 = add nuw nsw i32 %16, %.reass.us
  %.not.us = icmp sgt i32 %17, %0
  br i1 %.not.us, label %23, label %18

18:                                               ; preds = %15
  %19 = urem i32 %17, 12
  switch i32 %19, label %23 [
    i32 1, label %20
    i32 5, label %20
  ]

20:                                               ; preds = %18, %18
  %21 = zext nneg i32 %17 to i64
  %22 = getelementptr inbounds i8, ptr %14, i64 %21
  store i8 1, ptr %22, align 1, !tbaa !5
  br label %23

23:                                               ; preds = %20, %18, %15
  %24 = add nuw nsw i32 %16, %.reass87.us
  %.not72.us = icmp sle i32 %24, %0
  %25 = urem i32 %24, 12
  %26 = icmp eq i32 %25, 7
  %or.cond.us = and i1 %.not72.us, %26
  br i1 %or.cond.us, label %27, label %30

27:                                               ; preds = %23
  %28 = zext nneg i32 %24 to i64
  %29 = getelementptr inbounds i8, ptr %14, i64 %28
  store i8 1, ptr %29, align 1, !tbaa !5
  br label %30

30:                                               ; preds = %27, %23
  %31 = sub nsw i32 %.reass87.us, %16
  %32 = icmp ugt i32 %.06390.us, %.06288.us
  %.not73.us = icmp sle i32 %31, %0
  %33 = srem i32 %31, 12
  %34 = icmp eq i32 %33, 11
  %35 = and i1 %.not73.us, %34
  %or.cond77.us = select i1 %32, i1 %35, i1 false
  br i1 %or.cond77.us, label %36, label %39

36:                                               ; preds = %30
  %37 = sext i32 %31 to i64
  %38 = getelementptr inbounds i8, ptr %14, i64 %37
  store i8 1, ptr %38, align 1, !tbaa !5
  br label %39

39:                                               ; preds = %36, %30
  %40 = add nuw nsw i32 %.06288.us, 1
  %41 = mul nuw nsw i32 %40, %40
  %42 = icmp slt i32 %41, %0
  br i1 %42, label %15, label %._crit_edge.us, !llvm.loop !9

._crit_edge.us:                                   ; preds = %39
  %43 = add nuw nsw i32 %.06390.us, 1
  %44 = mul nuw nsw i32 %43, %43
  %45 = icmp slt i32 %44, %0
  br i1 %45, label %.preheader83.us, label %.preheader82, !llvm.loop !11

.preheader82:                                     ; preds = %._crit_edge.us
  %46 = icmp sgt i32 %0, 25
  br i1 %46, label %.lr.ph94, label %.preheader

.preheader:                                       ; preds = %.loopexit, %.thread, %.preheader84, %.preheader82
  %47 = phi ptr [ %14, %.preheader82 ], [ %12, %.preheader84 ], [ %12, %.thread ], [ %14, %.loopexit ]
  %48 = sext i32 %0 to i64
  br label %61

.lr.ph94:                                         ; preds = %.preheader82, %.loopexit
  %indvars.iv97 = phi i64 [ %indvars.iv.next98, %.loopexit ], [ 5, %.preheader82 ]
  %49 = phi i32 [ %59, %.loopexit ], [ 25, %.preheader82 ]
  %50 = getelementptr inbounds i8, ptr %14, i64 %indvars.iv97
  %51 = load i8, ptr %50, align 1, !tbaa !5, !range !12, !noundef !13
  %52 = trunc nuw i8 %51 to i1
  %53 = icmp slt i32 %49, %0
  %or.cond = and i1 %53, %52
  br i1 %or.cond, label %.lr.ph92.preheader, label %.loopexit

.lr.ph92.preheader:                               ; preds = %.lr.ph94
  %54 = zext nneg i32 %49 to i64
  br label %.lr.ph92

.lr.ph92:                                         ; preds = %.lr.ph92.preheader, %.lr.ph92
  %indvars.iv = phi i64 [ %54, %.lr.ph92.preheader ], [ %indvars.iv.next, %.lr.ph92 ]
  %55 = getelementptr inbounds i8, ptr %14, i64 %indvars.iv
  store i8 0, ptr %55, align 1, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, %54
  %56 = trunc nuw i64 %indvars.iv.next to i32
  %57 = icmp slt i32 %56, %0
  br i1 %57, label %.lr.ph92, label %.loopexit, !llvm.loop !14

.loopexit:                                        ; preds = %.lr.ph92, %.lr.ph94
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %58 = mul nuw nsw i64 %indvars.iv.next98, %indvars.iv.next98
  %59 = trunc nuw i64 %58 to i32
  %60 = icmp slt i32 %59, %0
  br i1 %60, label %.lr.ph94, label %.preheader, !llvm.loop !15

61:                                               ; preds = %.preheader, %70
  %indvars.iv100 = phi i64 [ 5, %.preheader ], [ %indvars.iv.next101, %70 ]
  %62 = icmp slt i64 %indvars.iv100, %48
  tail call void @llvm.assume(i1 %62)
  %63 = getelementptr inbounds i8, ptr %47, i64 %indvars.iv100
  %64 = load i8, ptr %63, align 1, !tbaa !5, !range !12, !noundef !13
  %65 = trunc nuw i8 %64 to i1
  br i1 %65, label %66, label %70

66:                                               ; preds = %61
  %67 = trunc nuw nsw i64 %indvars.iv100 to i32
  %68 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %67)
  %69 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef nonnull @.str)
  br label %70

70:                                               ; preds = %61, %66
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  br label %61, !llvm.loop !16
}

; 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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

attributes #0 = { mustprogress noreturn 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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 = !{!"bool", !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 = !{i8 0, i8 2}
!13 = !{}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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