; LLVM IR from Shah-Shishir/Codeforces-Solutions :: 1332B. Composite Coloring (main)

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

@arr = external dso_local global [1005 x i32], align 16
@__const.main.primes = external hidden unnamed_addr constant [11 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = 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 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 [11 x i32], align 16
  %10 = alloca [12 x i32], align 16
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 44, ptr %9) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 @__const.main.primes, i64 44, i1 false)
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %156, %0
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp sle i32 %13, %14
  br i1 %15, label %16, label %159

16:                                               ; preds = %12
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 48, ptr %10) #6
  call void @llvm.memset.p0.i64(ptr align 16 %10, i8 0, i64 48, i1 false)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %56, %16
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %22, label %59

22:                                               ; preds = %18
  %23 = load i32, ptr %5, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [1005 x i32], ptr @arr, i64 0, i64 %24
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %25)
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %52, %22
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = icmp slt i32 %28, 11
  br i1 %29, label %30, label %55

30:                                               ; preds = %27
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [1005 x i32], ptr @arr, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [11 x i32], ptr %9, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = srem i32 %34, %38
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %51

41:                                               ; preds = %30
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [1005 x i32], ptr @arr, i64 0, i64 %45
  store i32 %43, ptr %46, align 4, !tbaa !5
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [12 x i32], ptr %10, i64 0, i64 %49
  store i32 1, ptr %50, align 4, !tbaa !5
  br label %55

51:                                               ; preds = %30
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %6, align 4, !tbaa !5
  br label %27, !llvm.loop !9

55:                                               ; preds = %41, %27
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %5, align 4, !tbaa !5
  br label %18, !llvm.loop !11

59:                                               ; preds = %18
  store i32 0, ptr %8, align 4, !tbaa !5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %127, %59
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = icmp sle i32 %61, 11
  br i1 %62, label %63, label %130

63:                                               ; preds = %60
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [12 x i32], ptr %10, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %123, label %69

69:                                               ; preds = %63
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %6, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %86, %69
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = icmp sle i32 %73, 11
  br i1 %74, label %75, label %89

75:                                               ; preds = %72
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [12 x i32], ptr %10, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %85

81:                                               ; preds = %75
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [12 x i32], ptr %10, i64 0, i64 %83
  store i32 0, ptr %84, align 4, !tbaa !5
  br label %89

85:                                               ; preds = %75
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %6, align 4, !tbaa !5
  br label %72, !llvm.loop !12

89:                                               ; preds = %81, %72
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %110, %89
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = load i32, ptr %4, align 4, !tbaa !5
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %94, label %113

94:                                               ; preds = %90
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [1005 x i32], ptr @arr, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = icmp eq i32 %98, %99
  br i1 %100, label %101, label %109

101:                                              ; preds = %94
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1005 x i32], ptr @arr, i64 0, i64 %104
  store i32 %102, ptr %105, align 4, !tbaa !5
  %106 = load i32, ptr %5, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [12 x i32], ptr %10, i64 0, i64 %107
  store i32 1, ptr %108, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %101, %94
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %7, align 4, !tbaa !5
  br label %90, !llvm.loop !13

113:                                              ; preds = %90
  %114 = load i32, ptr %5, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [12 x i32], ptr %10, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %119, label %122

119:                                              ; preds = %113
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %121 = load i32, ptr %120, align 4, !tbaa !5
  store i32 %121, ptr %8, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %119, %113
  br label %126

123:                                              ; preds = %63
  %124 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %125 = load i32, ptr %124, align 4, !tbaa !5
  store i32 %125, ptr %8, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %123, %122
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %5, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %5, align 4, !tbaa !5
  br label %60, !llvm.loop !14

130:                                              ; preds = %60
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %131)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %152, %130
  %134 = load i32, ptr %5, align 4, !tbaa !5
  %135 = load i32, ptr %4, align 4, !tbaa !5
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %137, label %155

137:                                              ; preds = %133
  %138 = load i32, ptr %5, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [1005 x i32], ptr @arr, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %141)
  %143 = load i32, ptr %5, align 4, !tbaa !5
  %144 = load i32, ptr %4, align 4, !tbaa !5
  %145 = sub nsw i32 %144, 1
  %146 = icmp eq i32 %143, %145
  br i1 %146, label %147, label %149

147:                                              ; preds = %137
  %148 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %151

149:                                              ; preds = %137
  %150 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %151

151:                                              ; preds = %149, %147
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %5, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %5, align 4, !tbaa !5
  br label %133, !llvm.loop !15

155:                                              ; preds = %133
  call void @llvm.lifetime.end.p0(i64 48, ptr %10) #6
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %3, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %3, align 4, !tbaa !5
  br label %12, !llvm.loop !16

159:                                              ; preds = %12
  call void @llvm.lifetime.end.p0(i64 44, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  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 4, ptr %2) #6
  ret i32 0
}

; 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

declare i32 @__isoc99_scanf(ptr 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

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

declare i32 @printf(ptr noundef, ...) #3

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

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 = { "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 nounwind willreturn memory(argmem: write) }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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}


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

@arr = external dso_local global [1005 x i32], align 16
@__const.main.primes = external hidden unnamed_addr constant [11 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [12 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %.not43 = icmp slt i32 %7, 1
  br i1 %.not43, label %._crit_edge47, label %.lr.ph46.preheader

.lr.ph46.preheader:                               ; preds = %0
  %.pre = load i32, ptr @__const.main.primes, align 16
  %8 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.primes, i64 4), align 4
  %9 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.primes, i64 8), align 8
  %10 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.primes, i64 12), align 4
  %11 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.primes, i64 16), align 16
  %12 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.primes, i64 20), align 4
  %13 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.primes, i64 24), align 8
  %14 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.primes, i64 28), align 4
  %15 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.primes, i64 32), align 16
  %16 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.primes, i64 36), align 4
  %17 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.primes, i64 40), align 8
  br label %.lr.ph46

.lr.ph46:                                         ; preds = %.lr.ph46.preheader, %._crit_edge42
  %.01744 = phi i32 [ %121, %._crit_edge42 ], [ 1, %.lr.ph46.preheader ]
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(48) %5, i8 0, i64 48, i1 false)
  store i32 0, ptr %3, align 4, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph46, %.loopexit26
  %storemerge33 = phi i32 [ %63, %.loopexit26 ], [ 0, %.lr.ph46 ]
  %21 = sext i32 %storemerge33 to i64
  %22 = getelementptr inbounds [1005 x i32], ptr @arr, i64 0, i64 %21
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %22)
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [1005 x i32], ptr @arr, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = srem i32 %27, %.pre
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %60, %57, %54, %51, %48, %45, %42, %39, %36, %33, %.lr.ph
  %.01632.lcssa.wide = phi i32 [ 1, %.lr.ph ], [ 2, %33 ], [ 3, %36 ], [ 4, %39 ], [ 5, %42 ], [ 6, %45 ], [ 7, %48 ], [ 8, %51 ], [ 9, %54 ], [ 10, %57 ], [ 11, %60 ]
  store i32 %.01632.lcssa.wide, ptr %26, align 4, !tbaa !5
  %31 = zext nneg i32 %.01632.lcssa.wide to i64
  %32 = getelementptr inbounds [12 x i32], ptr %5, i64 0, i64 %31
  store i32 1, ptr %32, align 4, !tbaa !5
  br label %.loopexit26

33:                                               ; preds = %.lr.ph
  %34 = srem i32 %27, %8
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %30, label %36

36:                                               ; preds = %33
  %37 = srem i32 %27, %9
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %30, label %39

39:                                               ; preds = %36
  %40 = srem i32 %27, %10
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %30, label %42

42:                                               ; preds = %39
  %43 = srem i32 %27, %11
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %30, label %45

45:                                               ; preds = %42
  %46 = srem i32 %27, %12
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %30, label %48

48:                                               ; preds = %45
  %49 = srem i32 %27, %13
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %30, label %51

51:                                               ; preds = %48
  %52 = srem i32 %27, %14
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %30, label %54

54:                                               ; preds = %51
  %55 = srem i32 %27, %15
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %30, label %57

57:                                               ; preds = %54
  %58 = srem i32 %27, %16
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %30, label %60

60:                                               ; preds = %57
  %61 = srem i32 %27, %17
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %30, label %.loopexit26

.loopexit26:                                      ; preds = %60, %30
  %63 = add nsw i32 %24, 1
  store i32 %63, ptr %3, align 4, !tbaa !5
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.loopexit26, %.lr.ph46
  store i32 0, ptr %4, align 4, !tbaa !5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %._crit_edge, %99
  %67 = phi i32 [ 0, %._crit_edge ], [ %100, %99 ]
  %storemerge2138 = phi i32 [ 1, %._crit_edge ], [ %102, %99 ]
  %68 = sext i32 %storemerge2138 to i64
  %69 = getelementptr inbounds [12 x i32], ptr %5, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %.not23 = icmp eq i32 %70, 0
  br i1 %.not23, label %.preheader, label %96

.preheader:                                       ; preds = %66, %71
  %indvars.iv = phi i64 [ %indvars.iv.next, %71 ], [ %68, %66 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, 11
  br i1 %exitcond.not, label %.loopexit, label %71

71:                                               ; preds = %.preheader
  %72 = getelementptr inbounds [12 x i32], ptr %5, i64 0, i64 %indvars.iv.next
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %.not24 = icmp eq i32 %73, 0
  br i1 %.not24, label %.preheader, label %74, !llvm.loop !11

74:                                               ; preds = %71
  %75 = getelementptr inbounds [12 x i32], ptr %5, i64 0, i64 %indvars.iv.next
  store i32 0, ptr %75, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader, %74
  %.150 = trunc i64 %indvars.iv.next to i32
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = icmp sgt i32 %76, 0
  br i1 %77, label %.lr.ph36.preheader, label %._crit_edge37

.lr.ph36.preheader:                               ; preds = %.loopexit
  %wide.trip.count56 = zext nneg i32 %76 to i64
  %xtraiter = and i64 %wide.trip.count56, 1
  %78 = icmp eq i32 %76, 1
  br i1 %78, label %._crit_edge37.loopexit.unr-lcssa, label %.lr.ph36.preheader.new

.lr.ph36.preheader.new:                           ; preds = %.lr.ph36.preheader
  %unroll_iter = and i64 %wide.trip.count56, 2147483646
  br label %.lr.ph36

.lr.ph36:                                         ; preds = %87, %.lr.ph36.preheader.new
  %indvars.iv53 = phi i64 [ 0, %.lr.ph36.preheader.new ], [ %indvars.iv.next54.1, %87 ]
  %niter = phi i64 [ 0, %.lr.ph36.preheader.new ], [ %niter.next.1, %87 ]
  %79 = getelementptr inbounds [1005 x i32], ptr @arr, i64 0, i64 %indvars.iv53
  %80 = load i32, ptr %79, align 8, !tbaa !5
  %81 = icmp eq i32 %80, %.150
  br i1 %81, label %82, label %.lr.ph36.1

82:                                               ; preds = %.lr.ph36
  store i32 %storemerge2138, ptr %79, align 8, !tbaa !5
  store i32 1, ptr %69, align 4, !tbaa !5
  br label %.lr.ph36.1

.lr.ph36.1:                                       ; preds = %.lr.ph36, %82
  %indvars.iv.next54 = or disjoint i64 %indvars.iv53, 1
  %83 = getelementptr inbounds [1005 x i32], ptr @arr, i64 0, i64 %indvars.iv.next54
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = icmp eq i32 %84, %.150
  br i1 %85, label %86, label %87

86:                                               ; preds = %.lr.ph36.1
  store i32 %storemerge2138, ptr %83, align 4, !tbaa !5
  store i32 1, ptr %69, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %86, %.lr.ph36.1
  %indvars.iv.next54.1 = add nuw nsw i64 %indvars.iv53, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge37.loopexit.unr-lcssa, label %.lr.ph36, !llvm.loop !12

._crit_edge37.loopexit.unr-lcssa:                 ; preds = %87, %.lr.ph36.preheader
  %indvars.iv53.unr = phi i64 [ 0, %.lr.ph36.preheader ], [ %indvars.iv.next54.1, %87 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge37, label %.lr.ph36.epil

.lr.ph36.epil:                                    ; preds = %._crit_edge37.loopexit.unr-lcssa
  %88 = getelementptr inbounds [1005 x i32], ptr @arr, i64 0, i64 %indvars.iv53.unr
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = icmp eq i32 %89, %.150
  br i1 %90, label %91, label %._crit_edge37

91:                                               ; preds = %.lr.ph36.epil
  store i32 %storemerge2138, ptr %88, align 4, !tbaa !5
  store i32 1, ptr %69, align 4, !tbaa !5
  br label %._crit_edge37

._crit_edge37:                                    ; preds = %._crit_edge37.loopexit.unr-lcssa, %91, %.lr.ph36.epil, %.loopexit
  %92 = load i32, ptr %69, align 4, !tbaa !5
  %.not25 = icmp eq i32 %92, 0
  br i1 %.not25, label %99, label %93

93:                                               ; preds = %._crit_edge37
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %95 = load i32, ptr %94, align 4, !tbaa !5
  store i32 %95, ptr %4, align 4, !tbaa !5
  br label %99

96:                                               ; preds = %66
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %98 = load i32, ptr %97, align 4, !tbaa !5
  store i32 %98, ptr %4, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %96, %93, %._crit_edge37
  %100 = phi i32 [ %98, %96 ], [ %95, %93 ], [ %67, %._crit_edge37 ]
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %3, align 4, !tbaa !5
  %103 = icmp slt i32 %101, 11
  br i1 %103, label %66, label %104, !llvm.loop !13

104:                                              ; preds = %99
  %105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %100)
  store i32 0, ptr %3, align 4, !tbaa !5
  %106 = load i32, ptr %2, align 4, !tbaa !5
  %107 = icmp sgt i32 %106, 0
  br i1 %107, label %.lr.ph41, label %._crit_edge42

.lr.ph41:                                         ; preds = %104, %.lr.ph41
  %storemerge2239 = phi i32 [ %118, %.lr.ph41 ], [ 0, %104 ]
  %108 = sext i32 %storemerge2239 to i64
  %109 = getelementptr inbounds [1005 x i32], ptr @arr, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %110)
  %112 = load i32, ptr %3, align 4, !tbaa !5
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = add nsw i32 %113, -1
  %115 = icmp eq i32 %112, %114
  %.str.3..str.4 = select i1 %115, ptr @.str.3, ptr @.str.4
  %116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.4)
  %117 = load i32, ptr %3, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %3, align 4, !tbaa !5
  %119 = load i32, ptr %2, align 4, !tbaa !5
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %.lr.ph41, label %._crit_edge42, !llvm.loop !14

._crit_edge42:                                    ; preds = %.lr.ph41, %104
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #5
  %121 = add nuw nsw i32 %.01744, 1
  %122 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.01744, %122
  br i1 %.not.not, label %.lr.ph46, label %._crit_edge47, !llvm.loop !15

._crit_edge47:                                    ; preds = %._crit_edge42, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass