; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/306 Division 2/Problem E (E)

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

@n = external dso_local global i32, align 4
@a = external dso_local global [100100 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 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
  store i32 0, ptr %1, align 4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %20, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %15, label %14

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

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %17
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %18)
  br label %20

20:                                               ; preds = %15
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !9

23:                                               ; preds = %14
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = sub nsw i32 %24, 1
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = icmp eq i32 %28, 1
  br i1 %29, label %30, label %32

30:                                               ; preds = %23
  %31 = call i32 @puts(ptr noundef @.str.1)
  store i32 0, ptr %1, align 4
  br label %167

32:                                               ; preds = %23
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = icmp eq i32 %33, 1
  br i1 %34, label %35, label %45

35:                                               ; preds = %32
  %36 = load i32, ptr @a, align 16, !tbaa !5
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %42

38:                                               ; preds = %35
  %39 = call i32 @puts(ptr noundef @.str.2)
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %44

42:                                               ; preds = %35
  %43 = call i32 @puts(ptr noundef @.str.1)
  br label %44

44:                                               ; preds = %42, %38
  store i32 0, ptr %1, align 4
  br label %167

45:                                               ; preds = %32
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = sub nsw i32 %46, 2
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = icmp eq i32 %50, 1
  br i1 %51, label %52, label %76

52:                                               ; preds = %45
  %53 = call i32 @puts(ptr noundef @.str.2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %66, %52
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = sub nsw i32 %56, 1
  %58 = icmp slt i32 %55, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %69

60:                                               ; preds = %54
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %64)
  br label %66

66:                                               ; preds = %60
  %67 = load i32, ptr %3, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %3, align 4, !tbaa !5
  br label %54, !llvm.loop !11

69:                                               ; preds = %59
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %71 = sub nsw i32 %70, 1
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %74)
  store i32 0, ptr %1, align 4
  br label %167

76:                                               ; preds = %45
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = icmp eq i32 %77, 2
  br i1 %78, label %79, label %81

79:                                               ; preds = %76
  %80 = call i32 @puts(ptr noundef @.str.1)
  store i32 0, ptr %1, align 4
  br label %167

81:                                               ; preds = %76
  %82 = load i32, ptr @n, align 4, !tbaa !5
  %83 = sub nsw i32 %82, 3
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = icmp eq i32 %86, 1
  br i1 %87, label %88, label %148

88:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %89 = load i32, ptr @n, align 4, !tbaa !5
  %90 = sub nsw i32 %89, 4
  store i32 %90, ptr %4, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %102, %88
  %92 = load i32, ptr %4, align 4, !tbaa !5
  %93 = icmp sge i32 %92, 0
  br i1 %93, label %94, label %100

94:                                               ; preds = %91
  %95 = load i32, ptr %4, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = icmp eq i32 %98, 1
  br label %100

100:                                              ; preds = %94, %91
  %101 = phi i1 [ false, %91 ], [ %99, %94 ]
  br i1 %101, label %102, label %105

102:                                              ; preds = %100
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = add nsw i32 %103, -1
  store i32 %104, ptr %4, align 4, !tbaa !5
  br label %91, !llvm.loop !12

105:                                              ; preds = %100
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = icmp slt i32 %106, 0
  br i1 %107, label %108, label %110

108:                                              ; preds = %105
  %109 = call i32 @puts(ptr noundef @.str.1)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %147

110:                                              ; preds = %105
  %111 = call i32 @puts(ptr noundef @.str.2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %123, %110
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = load i32, ptr %4, align 4, !tbaa !5
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %117, label %116

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

117:                                              ; preds = %112
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %121)
  br label %123

123:                                              ; preds = %117
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %6, align 4, !tbaa !5
  br label %112, !llvm.loop !13

126:                                              ; preds = %116
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %128 = load i32, ptr %4, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %7, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %142, %126
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = load i32, ptr @n, align 4, !tbaa !5
  %133 = sub nsw i32 %132, 2
  %134 = icmp slt i32 %131, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %130
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %145

136:                                              ; preds = %130
  %137 = load i32, ptr %7, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %140)
  br label %142

142:                                              ; preds = %136
  %143 = load i32, ptr %7, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %7, align 4, !tbaa !5
  br label %130, !llvm.loop !14

145:                                              ; preds = %135
  %146 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %147

147:                                              ; preds = %145, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %167

148:                                              ; preds = %81
  %149 = call i32 @puts(ptr noundef @.str.2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %162, %148
  %151 = load i32, ptr %8, align 4, !tbaa !5
  %152 = load i32, ptr @n, align 4, !tbaa !5
  %153 = sub nsw i32 %152, 3
  %154 = icmp slt i32 %151, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %150
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %165

156:                                              ; preds = %150
  %157 = load i32, ptr %8, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %160)
  br label %162

162:                                              ; preds = %156
  %163 = load i32, ptr %8, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %8, align 4, !tbaa !5
  br label %150, !llvm.loop !15

165:                                              ; preds = %155
  %166 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  store i32 0, ptr %1, align 4
  br label %167

167:                                              ; preds = %165, %147, %79, %69, %44, %30
  %168 = load i32, ptr %1, align 4
  ret i32 %168
}

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

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

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

declare i32 @puts(ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 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)) #4

declare i32 @printf(ptr noundef, ...) #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 = { "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 = { 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 = { 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 #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}


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

@n = external dso_local global i32, align 4
@a = external dso_local global [100100 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1

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

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa31 = phi i32 [ %2, %0 ], [ %11, %.lr.ph ]
  %4 = add nsw i32 %.lcssa31, -1
  %5 = sext i32 %4 to i64
  %6 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %5
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = icmp eq i32 %7, 1
  br i1 %8, label %14, label %16

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

14:                                               ; preds = %._crit_edge
  %15 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %98

16:                                               ; preds = %._crit_edge
  %17 = icmp eq i32 %.lcssa31, 1
  br i1 %17, label %18, label %27

18:                                               ; preds = %16
  %19 = load i32, ptr @a, align 16, !tbaa !5
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %25

21:                                               ; preds = %18
  %22 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  %23 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %98

25:                                               ; preds = %18
  %26 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %98

27:                                               ; preds = %16
  %28 = add nsw i32 %.lcssa31, -2
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = icmp eq i32 %31, 1
  br i1 %32, label %33, label %48

33:                                               ; preds = %27
  %34 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = icmp sgt i32 %35, 1
  br i1 %36, label %.lr.ph51, label %.._crit_edge52_crit_edge

.._crit_edge52_crit_edge:                         ; preds = %33
  %37 = add nsw i32 %35, -1
  %.pre = sext i32 %37 to i64
  br label %._crit_edge52

._crit_edge52:                                    ; preds = %.lr.ph51, %.._crit_edge52_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge52_crit_edge ], [ %46, %.lr.ph51 ]
  %38 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %.pre-phi
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %39)
  br label %98

.lr.ph51:                                         ; preds = %33, %.lr.ph51
  %indvars.iv72 = phi i64 [ %indvars.iv.next73, %.lr.ph51 ], [ 0, %33 ]
  %41 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv72
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %42)
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = add nsw i32 %44, -1
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next73, %46
  br i1 %47, label %.lr.ph51, label %._crit_edge52, !llvm.loop !11

48:                                               ; preds = %27
  %49 = icmp eq i32 %.lcssa31, 2
  br i1 %49, label %50, label %52

50:                                               ; preds = %48
  %51 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %98

52:                                               ; preds = %48
  %53 = add i32 %.lcssa31, -3
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = icmp eq i32 %56, 1
  br i1 %57, label %58, label %86

58:                                               ; preds = %52
  %59 = icmp sgt i32 %.lcssa31, 3
  br i1 %59, label %.lr.ph39.preheader, label %._crit_edge40

.lr.ph39.preheader:                               ; preds = %58
  %60 = add nsw i32 %.lcssa31, -4
  %61 = zext nneg i32 %53 to i64
  br label %.lr.ph39

.lr.ph39:                                         ; preds = %.lr.ph39.preheader, %66
  %indvars.iv66 = phi i64 [ %61, %.lr.ph39.preheader ], [ %indvars.iv.next67, %66 ]
  %.02437 = phi i32 [ %60, %.lr.ph39.preheader ], [ %67, %66 ]
  %62 = zext nneg i32 %.02437 to i64
  %63 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = icmp eq i32 %64, 1
  br i1 %65, label %66, label %.critedge

66:                                               ; preds = %.lr.ph39
  %67 = add nsw i32 %.02437, -1
  %68 = icmp sgt i32 %.02437, 0
  %indvars.iv.next67 = add nsw i64 %indvars.iv66, -1
  br i1 %68, label %.lr.ph39, label %._crit_edge40, !llvm.loop !12

._crit_edge40:                                    ; preds = %66, %58
  %69 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %98

.critedge:                                        ; preds = %.lr.ph39
  %70 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  %.not = icmp eq i32 %.02437, 0
  br i1 %.not, label %._crit_edge43, label %.lr.ph42

._crit_edge43:                                    ; preds = %.lr.ph42, %.critedge
  %71 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %.02244 = add nuw nsw i32 %.02437, 1
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = add nsw i32 %72, -2
  %74 = icmp slt i32 %.02244, %73
  br i1 %74, label %.lr.ph47, label %._crit_edge48

.lr.ph42:                                         ; preds = %.critedge, %.lr.ph42
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %.lr.ph42 ], [ 0, %.critedge ]
  %75 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv61
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %76)
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next62, %62
  br i1 %exitcond.not, label %._crit_edge43, label %.lr.ph42, !llvm.loop !13

._crit_edge48:                                    ; preds = %.lr.ph47, %._crit_edge43
  %78 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  br label %98

.lr.ph47:                                         ; preds = %._crit_edge43, %.lr.ph47
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %.lr.ph47 ], [ %indvars.iv66, %._crit_edge43 ]
  %79 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv69
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %80)
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %82 = load i32, ptr @n, align 4, !tbaa !5
  %83 = add nsw i32 %82, -2
  %84 = trunc nuw i64 %indvars.iv.next70 to i32
  %85 = icmp sgt i32 %83, %84
  br i1 %85, label %.lr.ph47, label %._crit_edge48, !llvm.loop !14

86:                                               ; preds = %52
  %87 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  %88 = load i32, ptr @n, align 4, !tbaa !5
  %89 = icmp sgt i32 %88, 3
  br i1 %89, label %.lr.ph35, label %._crit_edge36

._crit_edge36:                                    ; preds = %.lr.ph35, %86
  %90 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  br label %98

.lr.ph35:                                         ; preds = %86, %.lr.ph35
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %.lr.ph35 ], [ 0, %86 ]
  %91 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv58
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %92)
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %94 = load i32, ptr @n, align 4, !tbaa !5
  %95 = add nsw i32 %94, -3
  %96 = sext i32 %95 to i64
  %97 = icmp slt i64 %indvars.iv.next59, %96
  br i1 %97, label %.lr.ph35, label %._crit_edge36, !llvm.loop !15

98:                                               ; preds = %._crit_edge40, %._crit_edge48, %21, %25, %._crit_edge36, %50, %._crit_edge52, %14
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) 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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 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)) #4

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { 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 #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 = { 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 = { 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" }

!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: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass