; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ (2079)

; 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_istream" = type { ptr, i64, %"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 }

@c1 = external dso_local global [1000 x i32], align 16
@c2 = external dso_local global [1000 x i32], align 16
@g = external dso_local global [1000 x i32], align 16
@n = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  br label %11

11:                                               ; preds = %116, %0
  %12 = load i32, ptr %4, align 4, !tbaa !5
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr %4, align 4, !tbaa !5
  %14 = icmp ne i32 %12, 0
  br i1 %14, label %15, label %122

15:                                               ; preds = %11
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.memset.p0.i64(ptr align 16 @g, i8 0, i64 4000, i1 false)
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %28, %15
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = icmp sle i32 %19, %20
  br i1 %21, label %22, label %31

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

28:                                               ; preds = %22
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %2, align 4, !tbaa !5
  br label %18, !llvm.loop !9

31:                                               ; preds = %18
  call void @llvm.memset.p0.i64(ptr align 16 @c1, i8 0, i64 4000, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @c2, i8 0, i64 4000, i1 false)
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %45, %31
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = icmp sle i32 %33, 41
  br i1 %34, label %35, label %39

35:                                               ; preds = %32
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = load i32, ptr getelementptr inbounds ([1000 x i32], ptr @g, i64 0, i64 1), align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br label %39

39:                                               ; preds = %35, %32
  %40 = phi i1 [ false, %32 ], [ %38, %35 ]
  br i1 %40, label %41, label %48

41:                                               ; preds = %39
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [1000 x i32], ptr @c1, i64 0, i64 %43
  store i32 1, ptr %44, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %41
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %2, align 4, !tbaa !5
  br label %32, !llvm.loop !11

48:                                               ; preds = %39
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %113, %48
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = icmp sle i32 %50, 8
  br i1 %51, label %52, label %116

52:                                               ; preds = %49
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %91, %52
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = icmp sle i32 %54, 40
  br i1 %55, label %56, label %94

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

57:                                               ; preds = %84, %56
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = add nsw i32 %58, %59
  %61 = icmp sle i32 %60, 40
  br i1 %61, label %62, label %69

62:                                               ; preds = %57
  %63 = load i32, ptr %9, align 4, !tbaa !5
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [1000 x i32], ptr @g, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp sle i32 %63, %67
  br label %69

69:                                               ; preds = %62, %57
  %70 = phi i1 [ false, %57 ], [ %68, %62 ]
  br i1 %70, label %72, label %71

71:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %90

72:                                               ; preds = %69
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [1000 x i32], ptr @c1, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = load i32, ptr %3, align 4, !tbaa !5
  %78 = load i32, ptr %8, align 4, !tbaa !5
  %79 = add nsw i32 %77, %78
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [1000 x i32], ptr @c2, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = add nsw i32 %82, %76
  store i32 %83, ptr %81, align 4, !tbaa !5
  br label %84

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

90:                                               ; preds = %71
  br label %91

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

94:                                               ; preds = %53
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %109, %94
  %96 = load i32, ptr %3, align 4, !tbaa !5
  %97 = icmp sle i32 %96, 40
  br i1 %97, label %98, label %112

98:                                               ; preds = %95
  %99 = load i32, ptr %3, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [1000 x i32], ptr @c2, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = load i32, ptr %3, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1000 x i32], ptr @c1, i64 0, i64 %104
  store i32 %102, ptr %105, align 4, !tbaa !5
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [1000 x i32], ptr @c2, i64 0, i64 %107
  store i32 0, ptr %108, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %98
  %110 = load i32, ptr %3, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %3, align 4, !tbaa !5
  br label %95, !llvm.loop !14

112:                                              ; preds = %95
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %2, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %2, align 4, !tbaa !5
  br label %49, !llvm.loop !15

116:                                              ; preds = %49
  %117 = load i32, ptr @n, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [1000 x i32], ptr @c1, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %120)
  br label %11, !llvm.loop !16

122:                                              ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  ret i32 0
}

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

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

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

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

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

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

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

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

@c1 = external dso_local local_unnamed_addr global [1000 x i32], align 16
@c2 = external dso_local local_unnamed_addr global [1000 x i32], align 16
@g = external dso_local local_unnamed_addr global [1000 x i32], align 16
@n = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %7 = add nsw i32 %6, -1
  store i32 %7, ptr %1, align 4, !tbaa !5
  %.not45 = icmp eq i32 %6, 0
  br i1 %.not45, label %._crit_edge48, label %.lr.ph47

.lr.ph47:                                         ; preds = %0, %51
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) @g, i8 0, i64 4000, i1 false)
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %.not3035 = icmp slt i32 %10, 1
  br i1 %.not3035, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %.lr.ph47
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) @c1, i8 0, i64 4000, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) @c2, i8 0, i64 4000, i1 false)
  br label %.lr.ph39.preheader

.lr.ph:                                           ; preds = %.lr.ph47, %.lr.ph
  %.02736 = phi i32 [ %16, %.lr.ph ], [ 1, %.lr.ph47 ]
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %12 = load i32, ptr %4, align 4, !tbaa !5
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [1000 x i32], ptr @g, i64 0, i64 %14
  store i32 %12, ptr %15, align 4, !tbaa !5
  %16 = add nuw nsw i32 %.02736, 1
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %.not30.not = icmp slt i32 %.02736, %17
  br i1 %.not30.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @g, i64 4), align 4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) @c1, i8 0, i64 4000, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) @c2, i8 0, i64 4000, i1 false)
  %18 = icmp sgt i32 %.pre, -1
  br i1 %18, label %.lr.ph39.preheader, label %.preheader33.preheader

.lr.ph39.preheader:                               ; preds = %._crit_edge.thread, %._crit_edge
  %19 = phi i32 [ 0, %._crit_edge.thread ], [ %.pre, %._crit_edge ]
  %umin = call i32 @llvm.umin.i32(i32 %19, i32 41)
  %20 = add nuw nsw i32 %umin, 1
  %wide.trip.count = zext nneg i32 %20 to i64
  %min.iters.check = icmp ult i32 %19, 7
  br i1 %min.iters.check, label %.lr.ph39.preheader66, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph39.preheader
  %n.vec = and i64 %wide.trip.count, 120
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr @c1, align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds (i8, ptr @c1, i64 16), align 16, !tbaa !5
  %21 = icmp eq i64 %n.vec, 8
  br i1 %21, label %middle.block, label %vector.body.1, !llvm.loop !11

vector.body.1:                                    ; preds = %vector.ph
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds (i8, ptr @c1, i64 32), align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds (i8, ptr @c1, i64 48), align 16, !tbaa !5
  %22 = icmp eq i64 %n.vec, 16
  br i1 %22, label %middle.block, label %vector.body.2, !llvm.loop !11

vector.body.2:                                    ; preds = %vector.body.1
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds (i8, ptr @c1, i64 64), align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds (i8, ptr @c1, i64 80), align 16, !tbaa !5
  %23 = icmp eq i64 %n.vec, 24
  br i1 %23, label %middle.block, label %vector.body.3, !llvm.loop !11

vector.body.3:                                    ; preds = %vector.body.2
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds (i8, ptr @c1, i64 96), align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds (i8, ptr @c1, i64 112), align 16, !tbaa !5
  %24 = icmp eq i64 %n.vec, 32
  br i1 %24, label %middle.block, label %vector.body.4, !llvm.loop !11

vector.body.4:                                    ; preds = %vector.body.3
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds (i8, ptr @c1, i64 128), align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds (i8, ptr @c1, i64 144), align 16, !tbaa !5
  br label %middle.block

middle.block:                                     ; preds = %vector.body.4, %vector.body.3, %vector.body.2, %vector.body.1, %vector.ph
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader33.preheader, label %.lr.ph39.preheader66

.lr.ph39.preheader66:                             ; preds = %middle.block, %.lr.ph39.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph39.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph39

.lr.ph39:                                         ; preds = %.lr.ph39.preheader66, %.lr.ph39
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph39 ], [ %indvars.iv.ph, %.lr.ph39.preheader66 ]
  %25 = getelementptr inbounds [1000 x i32], ptr @c1, i64 0, i64 %indvars.iv
  store i32 1, ptr %25, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader33.preheader, label %.lr.ph39, !llvm.loop !14

.preheader33.preheader:                           ; preds = %.lr.ph39, %middle.block, %._crit_edge
  br label %.preheader33

.preheader33:                                     ; preds = %.preheader33.preheader, %.preheader32.preheader
  %indvars.iv50 = phi i64 [ %indvars.iv.next51, %.preheader32.preheader ], [ 2, %.preheader33.preheader ]
  %26 = getelementptr inbounds [1000 x i32], ptr @g, i64 0, i64 %indvars.iv50
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %smax = call i32 @llvm.smax.i32(i32 %27, i32 -1)
  %28 = add i32 %smax, 1
  br label %.preheader

.preheader:                                       ; preds = %.preheader33, %.critedge
  %indvars.iv56 = phi i64 [ 0, %.preheader33 ], [ %indvars.iv.next57, %.critedge ]
  %29 = getelementptr inbounds [1000 x i32], ptr @c1, i64 0, i64 %indvars.iv56
  br label %30

30:                                               ; preds = %.preheader, %42
  %indvars.iv52 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next53, %42 ]
  %.041 = phi i32 [ 0, %.preheader ], [ %48, %42 ]
  %exitcond55 = icmp eq i32 %.041, %28
  br i1 %exitcond55, label %.critedge, label %42

.critedge:                                        ; preds = %42, %30
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %exitcond59.not = icmp eq i64 %indvars.iv.next57, 41
  br i1 %exitcond59.not, label %.preheader32.preheader, label %.preheader, !llvm.loop !15

.preheader32.preheader:                           ; preds = %.critedge
  %31 = load <4 x i32>, ptr @c2, align 16, !tbaa !5
  store <4 x i32> %31, ptr @c1, align 16, !tbaa !5
  store <4 x i32> zeroinitializer, ptr @c2, align 16, !tbaa !5
  %32 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @c2, i64 16), align 16, !tbaa !5
  store <4 x i32> %32, ptr getelementptr inbounds (i8, ptr @c1, i64 16), align 16, !tbaa !5
  store <4 x i32> zeroinitializer, ptr getelementptr inbounds (i8, ptr @c2, i64 16), align 16, !tbaa !5
  %33 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @c2, i64 32), align 16, !tbaa !5
  store <4 x i32> %33, ptr getelementptr inbounds (i8, ptr @c1, i64 32), align 16, !tbaa !5
  store <4 x i32> zeroinitializer, ptr getelementptr inbounds (i8, ptr @c2, i64 32), align 16, !tbaa !5
  %34 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @c2, i64 48), align 16, !tbaa !5
  store <4 x i32> %34, ptr getelementptr inbounds (i8, ptr @c1, i64 48), align 16, !tbaa !5
  store <4 x i32> zeroinitializer, ptr getelementptr inbounds (i8, ptr @c2, i64 48), align 16, !tbaa !5
  %35 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @c2, i64 64), align 16, !tbaa !5
  store <4 x i32> %35, ptr getelementptr inbounds (i8, ptr @c1, i64 64), align 16, !tbaa !5
  store <4 x i32> zeroinitializer, ptr getelementptr inbounds (i8, ptr @c2, i64 64), align 16, !tbaa !5
  %36 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @c2, i64 80), align 16, !tbaa !5
  store <4 x i32> %36, ptr getelementptr inbounds (i8, ptr @c1, i64 80), align 16, !tbaa !5
  store <4 x i32> zeroinitializer, ptr getelementptr inbounds (i8, ptr @c2, i64 80), align 16, !tbaa !5
  %37 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @c2, i64 96), align 16, !tbaa !5
  store <4 x i32> %37, ptr getelementptr inbounds (i8, ptr @c1, i64 96), align 16, !tbaa !5
  store <4 x i32> zeroinitializer, ptr getelementptr inbounds (i8, ptr @c2, i64 96), align 16, !tbaa !5
  %38 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @c2, i64 112), align 16, !tbaa !5
  store <4 x i32> %38, ptr getelementptr inbounds (i8, ptr @c1, i64 112), align 16, !tbaa !5
  store <4 x i32> zeroinitializer, ptr getelementptr inbounds (i8, ptr @c2, i64 112), align 16, !tbaa !5
  %39 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @c2, i64 128), align 16, !tbaa !5
  store <4 x i32> %39, ptr getelementptr inbounds (i8, ptr @c1, i64 128), align 16, !tbaa !5
  store <4 x i32> zeroinitializer, ptr getelementptr inbounds (i8, ptr @c2, i64 128), align 16, !tbaa !5
  %40 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @c2, i64 144), align 16, !tbaa !5
  store <4 x i32> %40, ptr getelementptr inbounds (i8, ptr @c1, i64 144), align 16, !tbaa !5
  store <4 x i32> zeroinitializer, ptr getelementptr inbounds (i8, ptr @c2, i64 144), align 16, !tbaa !5
  %41 = load i32, ptr getelementptr inbounds (i8, ptr @c2, i64 160), align 16, !tbaa !5
  store i32 %41, ptr getelementptr inbounds (i8, ptr @c1, i64 160), align 16, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @c2, i64 160), align 16, !tbaa !5
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %exitcond65.not = icmp eq i64 %indvars.iv.next51, 9
  br i1 %exitcond65.not, label %51, label %.preheader33, !llvm.loop !16

42:                                               ; preds = %30
  %43 = add nuw nsw i64 %indvars.iv52, %indvars.iv56
  %44 = load i32, ptr %29, align 4, !tbaa !5
  %45 = getelementptr inbounds [1000 x i32], ptr @c2, i64 0, i64 %43
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = add nsw i32 %46, %44
  store i32 %47, ptr %45, align 4, !tbaa !5
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, %indvars.iv50
  %48 = add nuw nsw i32 %.041, 1
  %49 = add nuw nsw i64 %indvars.iv.next53, %indvars.iv56
  %50 = icmp ult i64 %49, 41
  br i1 %50, label %30, label %.critedge, !llvm.loop !17

51:                                               ; preds = %.preheader32.preheader
  %52 = load i32, ptr @n, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [1000 x i32], ptr @c1, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %55)
  %57 = load i32, ptr %1, align 4, !tbaa !5
  %58 = add nsw i32 %57, -1
  store i32 %58, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %57, 0
  br i1 %.not, label %._crit_edge48, label %.lr.ph47, !llvm.loop !18

._crit_edge48:                                    ; preds = %51, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

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

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

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass