; LLVM IR from tangjz/acm-icpc :: codeforces/complete (510E)

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

@n = external dso_local global i32, align 4
@a = external dso_local global [202 x i32], align 16
@s = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@pre = external dso_local global [202 x i32], align 16
@level = external dso_local global [202 x i32], align 16
@flow = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@out = external dso_local global [202 x [202 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7isprimei(i32 noundef) #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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z7addedgeiii(i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3bfsv() #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3dfsii(i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5printii(i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %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
  store i32 0, ptr %1, align 4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  store i32 0, ptr @s, align 4, !tbaa !5
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = add nsw i32 %12, 1
  store i32 %13, ptr @t, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %24, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp sle i32 %15, %16
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %14
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds i32, ptr @a, i64 %21
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %22)
  br label %24

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !9

27:                                               ; preds = %18
  call void @llvm.memset.p0.i64(ptr align 16 @pre, i8 -1, i64 808, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %28

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

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

33:                                               ; preds = %28
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [202 x i32], ptr @a, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = and i32 %37, 1
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %43

40:                                               ; preds = %33
  %41 = load i32, ptr @s, align 4, !tbaa !5
  %42 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z7addedgeiii(i32 noundef %41, i32 noundef %42, i32 noundef 2)
  br label %46

43:                                               ; preds = %33
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = load i32, ptr @t, align 4, !tbaa !5
  call void @_Z7addedgeiii(i32 noundef %44, i32 noundef %45, i32 noundef 2)
  br label %46

46:                                               ; preds = %43, %40
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %3, align 4, !tbaa !5
  br label %28, !llvm.loop !11

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

51:                                               ; preds = %95, %50
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = icmp sle i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %98

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

57:                                               ; preds = %91, %56
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = load i32, ptr @n, align 4, !tbaa !5
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %94

62:                                               ; preds = %57
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [202 x i32], ptr @a, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = and i32 %66, 1
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %90

69:                                               ; preds = %62
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [202 x i32], ptr @a, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = and i32 %73, 1
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %90, label %76

76:                                               ; preds = %69
  %77 = load i32, ptr %4, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [202 x i32], ptr @a, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [202 x i32], ptr @a, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = add nsw i32 %80, %84
  %86 = call noundef zeroext i1 @_Z7isprimei(i32 noundef %85)
  br i1 %86, label %87, label %90

87:                                               ; preds = %76
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z7addedgeiii(i32 noundef %88, i32 noundef %89, i32 noundef 1)
  br label %90

90:                                               ; preds = %87, %76, %69, %62
  br label %91

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

94:                                               ; preds = %61
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %4, align 4, !tbaa !5
  br label %51, !llvm.loop !13

98:                                               ; preds = %55
  br label %99

99:                                               ; preds = %110, %98
  %100 = call noundef zeroext i1 @_Z3bfsv()
  br i1 %100, label %101, label %111

101:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  br label %102

102:                                              ; preds = %106, %101
  %103 = load i32, ptr @s, align 4, !tbaa !5
  %104 = call noundef i32 @_Z3dfsii(i32 noundef %103, i32 noundef 1061109567)
  store i32 %104, ptr %7, align 4, !tbaa !5
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %110

106:                                              ; preds = %102
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = load i32, ptr @flow, align 4, !tbaa !5
  %109 = add nsw i32 %108, %107
  store i32 %109, ptr @flow, align 4, !tbaa !5
  br label %102, !llvm.loop !14

110:                                              ; preds = %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %99, !llvm.loop !15

111:                                              ; preds = %99
  %112 = load i32, ptr @flow, align 4, !tbaa !5
  %113 = load i32, ptr @n, align 4, !tbaa !5
  %114 = icmp ne i32 %112, %113
  br i1 %114, label %115, label %117

115:                                              ; preds = %111
  %116 = call i32 @puts(ptr noundef @.str.1)
  store i32 0, ptr %1, align 4
  br label %190

117:                                              ; preds = %111
  call void @llvm.memset.p0.i64(ptr align 16 @level, i8 0, i64 808, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %141, %117
  %119 = load i32, ptr %8, align 4, !tbaa !5
  %120 = load i32, ptr @n, align 4, !tbaa !5
  %121 = icmp sle i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 18, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %144

123:                                              ; preds = %118
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [202 x i32], ptr @a, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = and i32 %127, 1
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %140

130:                                              ; preds = %123
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [202 x i32], ptr @level, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %140, label %136

136:                                              ; preds = %130
  %137 = load i32, ptr %8, align 4, !tbaa !5
  call void @_Z5printii(i32 noundef %137, i32 noundef 0)
  %138 = load i32, ptr @ans, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr @ans, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %136, %130, %123
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %8, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %8, align 4, !tbaa !5
  br label %118, !llvm.loop !16

144:                                              ; preds = %122
  %145 = load i32, ptr @ans, align 4, !tbaa !5
  %146 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %145)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %186, %144
  %148 = load i32, ptr %9, align 4, !tbaa !5
  %149 = load i32, ptr @ans, align 4, !tbaa !5
  %150 = icmp slt i32 %148, %149
  br i1 %150, label %152, label %151

151:                                              ; preds = %147
  store i32 21, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %189

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

153:                                              ; preds = %182, %152
  %154 = load i32, ptr %10, align 4, !tbaa !5
  %155 = load i32, ptr %9, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [202 x [202 x i32]], ptr @out, i64 0, i64 %156
  %158 = getelementptr inbounds [202 x i32], ptr %157, i64 0, i64 0
  %159 = load i32, ptr %158, align 8, !tbaa !5
  %160 = icmp sle i32 %154, %159
  br i1 %160, label %162, label %161

161:                                              ; preds = %153
  store i32 24, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %185

162:                                              ; preds = %153
  %163 = load i32, ptr %9, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [202 x [202 x i32]], ptr @out, i64 0, i64 %164
  %166 = load i32, ptr %10, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [202 x i32], ptr %165, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = load i32, ptr %10, align 4, !tbaa !5
  %171 = load i32, ptr %9, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [202 x [202 x i32]], ptr @out, i64 0, i64 %172
  %174 = getelementptr inbounds [202 x i32], ptr %173, i64 0, i64 0
  %175 = load i32, ptr %174, align 8, !tbaa !5
  %176 = icmp eq i32 %170, %175
  %177 = zext i1 %176 to i64
  %178 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %177
  %179 = load i8, ptr %178, align 1, !tbaa !17
  %180 = sext i8 %179 to i32
  %181 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %169, i32 noundef %180)
  br label %182

182:                                              ; preds = %162
  %183 = load i32, ptr %10, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %10, align 4, !tbaa !5
  br label %153, !llvm.loop !18

185:                                              ; preds = %161
  br label %186

186:                                              ; preds = %185
  %187 = load i32, ptr %9, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %9, align 4, !tbaa !5
  br label %147, !llvm.loop !19

189:                                              ; preds = %151
  store i32 0, ptr %1, align 4
  br label %190

190:                                              ; preds = %189, %115
  %191 = load i32, ptr %1, align 4
  ret i32 %191
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #5

declare i32 @puts(ptr noundef) #5

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{!7, !7, i64 0}
!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"

@n = external dso_local global i32, align 4
@a = external dso_local global [202 x i32], align 16
@s = external dso_local local_unnamed_addr global i32, align 4
@t = external dso_local local_unnamed_addr global i32, align 4
@pre = external dso_local local_unnamed_addr global [202 x i32], align 16
@level = external dso_local local_unnamed_addr global [202 x i32], align 16
@flow = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@out = external dso_local local_unnamed_addr global [202 x [202 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7isprimei(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z7addedgeiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3bfsv() local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3dfsii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5printii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  store i32 0, ptr @s, align 4, !tbaa !5
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = add nsw i32 %2, 1
  store i32 %3, ptr @t, align 4, !tbaa !5
  %.not60 = icmp slt i32 %2, 1
  br i1 %.not60, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %0
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(808) @pre, i8 -1, i64 808, i1 false)
  br label %.preheader57

._crit_edge:                                      ; preds = %.lr.ph
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(808) @pre, i8 -1, i64 808, i1 false)
  %.not4362 = icmp slt i32 %6, 1
  br i1 %.not4362, label %.preheader57, label %.lr.ph65

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %4 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %4)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %.not.not = icmp slt i64 %indvars.iv, %7
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader59:                                     ; preds = %16
  %.not4470 = icmp slt i32 %17, 1
  br i1 %.not4470, label %.preheader57, label %.preheader58

.lr.ph65:                                         ; preds = %._crit_edge, %16
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %16 ], [ 1, %._crit_edge ]
  %8 = getelementptr inbounds [202 x i32], ptr @a, i64 0, i64 %indvars.iv87
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = and i32 %9, 1
  %.not54 = icmp eq i32 %10, 0
  %11 = trunc nuw nsw i64 %indvars.iv87 to i32
  br i1 %.not54, label %14, label %12

12:                                               ; preds = %.lr.ph65
  %13 = load i32, ptr @s, align 4, !tbaa !5
  tail call void @_Z7addedgeiii(i32 noundef %13, i32 noundef %11, i32 noundef 2)
  br label %16

14:                                               ; preds = %.lr.ph65
  %15 = load i32, ptr @t, align 4, !tbaa !5
  tail call void @_Z7addedgeiii(i32 noundef %11, i32 noundef %15, i32 noundef 2)
  br label %16

16:                                               ; preds = %12, %14
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %.not43.not = icmp slt i64 %indvars.iv87, %18
  br i1 %.not43.not, label %.lr.ph65, label %.preheader59, !llvm.loop !11

.preheader58:                                     ; preds = %.preheader59, %._crit_edge69
  %19 = phi i32 [ %23, %._crit_edge69 ], [ %17, %.preheader59 ]
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %._crit_edge69 ], [ 1, %.preheader59 ]
  %.not5166 = icmp slt i32 %19, 1
  br i1 %.not5166, label %.preheader58.._crit_edge69_crit_edge, label %.lr.ph68

.preheader58.._crit_edge69_crit_edge:             ; preds = %.preheader58
  %.pre106 = sext i32 %19 to i64
  br label %._crit_edge69

.lr.ph68:                                         ; preds = %.preheader58
  %20 = getelementptr inbounds [202 x i32], ptr @a, i64 0, i64 %indvars.iv93
  %21 = trunc nuw nsw i64 %indvars.iv93 to i32
  br label %24

.preheader57:                                     ; preds = %._crit_edge69, %._crit_edge.thread, %._crit_edge, %.preheader59
  %22 = tail call noundef zeroext i1 @_Z3bfsv()
  br i1 %22, label %.preheader55, label %._crit_edge74

._crit_edge69:                                    ; preds = %36, %.preheader58.._crit_edge69_crit_edge
  %.pre-phi = phi i64 [ %.pre106, %.preheader58.._crit_edge69_crit_edge ], [ %38, %36 ]
  %23 = phi i32 [ %19, %.preheader58.._crit_edge69_crit_edge ], [ %37, %36 ]
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %.not44.not = icmp slt i64 %indvars.iv93, %.pre-phi
  br i1 %.not44.not, label %.preheader58, label %.preheader57, !llvm.loop !12

24:                                               ; preds = %.lr.ph68, %36
  %indvars.iv90 = phi i64 [ 1, %.lr.ph68 ], [ %indvars.iv.next91, %36 ]
  %25 = load i32, ptr %20, align 4, !tbaa !5
  %26 = and i32 %25, 1
  %.not52 = icmp eq i32 %26, 0
  br i1 %.not52, label %36, label %27

27:                                               ; preds = %24
  %28 = getelementptr inbounds [202 x i32], ptr @a, i64 0, i64 %indvars.iv90
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = and i32 %29, 1
  %.not53 = icmp eq i32 %30, 0
  br i1 %.not53, label %31, label %36

31:                                               ; preds = %27
  %32 = add nsw i32 %29, %25
  %33 = tail call noundef zeroext i1 @_Z7isprimei(i32 noundef %32)
  br i1 %33, label %34, label %36

34:                                               ; preds = %31
  %35 = trunc nuw nsw i64 %indvars.iv90 to i32
  tail call void @_Z7addedgeiii(i32 noundef %21, i32 noundef %35, i32 noundef 1)
  br label %36

36:                                               ; preds = %24, %27, %31, %34
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %.not51.not = icmp slt i64 %indvars.iv90, %38
  br i1 %.not51.not, label %24, label %._crit_edge69, !llvm.loop !14

.loopexit56:                                      ; preds = %.lr.ph73, %.preheader55
  %39 = tail call noundef zeroext i1 @_Z3bfsv()
  br i1 %39, label %.preheader55, label %._crit_edge74, !llvm.loop !15

.preheader55:                                     ; preds = %.preheader57, %.loopexit56
  %40 = load i32, ptr @s, align 4, !tbaa !5
  %41 = tail call noundef i32 @_Z3dfsii(i32 noundef %40, i32 noundef 1061109567)
  %.not5072 = icmp eq i32 %41, 0
  br i1 %.not5072, label %.loopexit56, label %.lr.ph73

.lr.ph73:                                         ; preds = %.preheader55, %.lr.ph73
  %42 = phi i32 [ %46, %.lr.ph73 ], [ %41, %.preheader55 ]
  %43 = load i32, ptr @flow, align 4, !tbaa !5
  %44 = add nsw i32 %43, %42
  store i32 %44, ptr @flow, align 4, !tbaa !5
  %45 = load i32, ptr @s, align 4, !tbaa !5
  %46 = tail call noundef i32 @_Z3dfsii(i32 noundef %45, i32 noundef 1061109567)
  %.not50 = icmp eq i32 %46, 0
  br i1 %.not50, label %.loopexit56, label %.lr.ph73, !llvm.loop !16

._crit_edge74:                                    ; preds = %.loopexit56, %.preheader57
  %47 = load i32, ptr @flow, align 4, !tbaa !5
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %.not45 = icmp eq i32 %47, %48
  br i1 %.not45, label %51, label %49

49:                                               ; preds = %._crit_edge74
  %50 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %.loopexit

51:                                               ; preds = %._crit_edge74
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(808) @level, i8 0, i64 808, i1 false)
  %.not4675 = icmp slt i32 %47, 1
  br i1 %.not4675, label %._crit_edge79, label %.lr.ph78

._crit_edge79:                                    ; preds = %67, %51
  %52 = load i32, ptr @ans, align 4, !tbaa !5
  %53 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %52)
  %54 = load i32, ptr @ans, align 4, !tbaa !5
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %.preheader, label %.loopexit

.lr.ph78:                                         ; preds = %51, %67
  %56 = phi i32 [ %68, %67 ], [ %47, %51 ]
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %67 ], [ 1, %51 ]
  %57 = getelementptr inbounds [202 x i32], ptr @a, i64 0, i64 %indvars.iv96
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = and i32 %58, 1
  %.not48 = icmp eq i32 %59, 0
  br i1 %.not48, label %67, label %60

60:                                               ; preds = %.lr.ph78
  %61 = getelementptr inbounds [202 x i32], ptr @level, i64 0, i64 %indvars.iv96
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %.not49 = icmp eq i32 %62, 0
  br i1 %.not49, label %63, label %67

63:                                               ; preds = %60
  %64 = trunc nuw nsw i64 %indvars.iv96 to i32
  tail call void @_Z5printii(i32 noundef %64, i32 noundef 0)
  %65 = load i32, ptr @ans, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr @ans, align 4, !tbaa !5
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %.lr.ph78, %60, %63
  %68 = phi i32 [ %56, %.lr.ph78 ], [ %56, %60 ], [ %.pre, %63 ]
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %69 = sext i32 %68 to i64
  %.not46.not = icmp slt i64 %indvars.iv96, %69
  br i1 %.not46.not, label %.lr.ph78, label %._crit_edge79, !llvm.loop !17

.preheader:                                       ; preds = %._crit_edge79, %._crit_edge83
  %70 = phi i32 [ %73, %._crit_edge83 ], [ %54, %._crit_edge79 ]
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %._crit_edge83 ], [ 0, %._crit_edge79 ]
  %71 = getelementptr inbounds [202 x [202 x i32]], ptr @out, i64 0, i64 %indvars.iv102
  %72 = load i32, ptr %71, align 8, !tbaa !5
  %.not4780 = icmp slt i32 %72, 0
  br i1 %.not4780, label %._crit_edge83, label %.lr.ph82

._crit_edge83.loopexit:                           ; preds = %.lr.ph82
  %.pre105 = load i32, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge83

._crit_edge83:                                    ; preds = %._crit_edge83.loopexit, %.preheader
  %73 = phi i32 [ %.pre105, %._crit_edge83.loopexit ], [ %70, %.preheader ]
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv.next103, %74
  br i1 %75, label %.preheader, label %.loopexit, !llvm.loop !18

.lr.ph82:                                         ; preds = %.preheader, %.lr.ph82
  %indvars.iv99 = phi i64 [ %indvars.iv.next100, %.lr.ph82 ], [ 0, %.preheader ]
  %76 = phi i32 [ %86, %.lr.ph82 ], [ %72, %.preheader ]
  %77 = getelementptr inbounds [202 x [202 x i32]], ptr @out, i64 0, i64 %indvars.iv102, i64 %indvars.iv99
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = zext i32 %76 to i64
  %80 = icmp eq i64 %indvars.iv99, %79
  %81 = zext i1 %80 to i64
  %82 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %81
  %83 = load i8, ptr %82, align 1, !tbaa !19
  %84 = sext i8 %83 to i32
  %85 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %78, i32 noundef %84)
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %86 = load i32, ptr %71, align 8, !tbaa !5
  %87 = sext i32 %86 to i64
  %.not47.not = icmp slt i64 %indvars.iv99, %87
  br i1 %.not47.not, label %.lr.ph82, label %._crit_edge83.loopexit, !llvm.loop !20

.loopexit:                                        ; preds = %._crit_edge83, %._crit_edge79, %49
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4

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

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

!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}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass