; LLVM IR from DionysiosB/CodeForces :: 0100-0199 (152A-Marks)

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

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = 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 i8, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  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
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = call noalias noundef nonnull ptr @_Znam(i64 noundef %19) #7
  store ptr %20, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = mul nsw i32 %21, %22
  %24 = sext i32 %23 to i64
  %25 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %24, i64 4)
  %26 = extractvalue { i64, i1 } %25, 1
  %27 = extractvalue { i64, i1 } %25, 0
  %28 = select i1 %26, i64 -1, i64 %27
  %29 = call noalias noundef nonnull ptr @_Znam(i64 noundef %28) #7
  store ptr %29, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %59, %0
  %31 = load i32, ptr %8, align 4, !tbaa !5
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %62

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

36:                                               ; preds = %54, %35
  %37 = load i32, ptr %10, align 4, !tbaa !5
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %36
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %5)
  %43 = load i8, ptr %5, align 1, !tbaa !11
  %44 = sext i8 %43 to i32
  %45 = sub nsw i32 %44, 48
  %46 = load ptr, ptr %7, align 8, !tbaa !9
  %47 = load i32, ptr %8, align 4, !tbaa !5
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = mul nsw i32 %47, %48
  %50 = load i32, ptr %10, align 4, !tbaa !5
  %51 = add nsw i32 %49, %50
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i32, ptr %46, i64 %52
  store i32 %45, ptr %53, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %41
  %55 = load i32, ptr %10, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %10, align 4, !tbaa !5
  br label %36, !llvm.loop !12

57:                                               ; preds = %40
  %58 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2)
  br label %59

59:                                               ; preds = %57
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %8, align 4, !tbaa !5
  br label %30, !llvm.loop !14

62:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %73, %62
  %64 = load i32, ptr %11, align 4, !tbaa !5
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %76

68:                                               ; preds = %63
  %69 = load ptr, ptr %6, align 8, !tbaa !9
  %70 = load i32, ptr %11, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i8, ptr %69, i64 %71
  store i8 0, ptr %72, align 1, !tbaa !15
  br label %73

73:                                               ; preds = %68
  %74 = load i32, ptr %11, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %11, align 4, !tbaa !5
  br label %63, !llvm.loop !17

76:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %130, %76
  %78 = load i32, ptr %12, align 4, !tbaa !5
  %79 = load i32, ptr %3, align 4, !tbaa !5
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %133

82:                                               ; preds = %77
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %99, %82
  %84 = load i32, ptr %13, align 4, !tbaa !5
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %102

88:                                               ; preds = %83
  %89 = load ptr, ptr %7, align 8, !tbaa !9
  %90 = load i32, ptr %13, align 4, !tbaa !5
  %91 = load i32, ptr %3, align 4, !tbaa !5
  %92 = mul nsw i32 %90, %91
  %93 = load i32, ptr %12, align 4, !tbaa !5
  %94 = add nsw i32 %92, %93
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr %89, i64 %95
  %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) %96)
  %98 = load i32, ptr %97, align 4, !tbaa !5
  store i32 %98, ptr %4, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %88
  %100 = load i32, ptr %13, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %13, align 4, !tbaa !5
  br label %83, !llvm.loop !18

102:                                              ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %126, %102
  %104 = load i32, ptr %14, align 4, !tbaa !5
  %105 = load i32, ptr %2, align 4, !tbaa !5
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %103
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %129

108:                                              ; preds = %103
  %109 = load ptr, ptr %7, align 8, !tbaa !9
  %110 = load i32, ptr %14, align 4, !tbaa !5
  %111 = load i32, ptr %3, align 4, !tbaa !5
  %112 = mul nsw i32 %110, %111
  %113 = load i32, ptr %12, align 4, !tbaa !5
  %114 = add nsw i32 %112, %113
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i32, ptr %109, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = load i32, ptr %4, align 4, !tbaa !5
  %119 = icmp eq i32 %117, %118
  br i1 %119, label %120, label %125

120:                                              ; preds = %108
  %121 = load ptr, ptr %6, align 8, !tbaa !9
  %122 = load i32, ptr %14, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i8, ptr %121, i64 %123
  store i8 1, ptr %124, align 1, !tbaa !15
  br label %125

125:                                              ; preds = %120, %108
  br label %126

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

129:                                              ; preds = %107
  br label %130

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

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

134:                                              ; preds = %149, %133
  %135 = load i32, ptr %16, align 4, !tbaa !5
  %136 = load i32, ptr %2, align 4, !tbaa !5
  %137 = icmp slt i32 %135, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %134
  store i32 20, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %152

139:                                              ; preds = %134
  %140 = load ptr, ptr %6, align 8, !tbaa !9
  %141 = load i32, ptr %16, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i8, ptr %140, i64 %142
  %144 = load i8, ptr %143, align 1, !tbaa !15, !range !21, !noundef !22
  %145 = trunc i8 %144 to i1
  %146 = zext i1 %145 to i32
  %147 = load i32, ptr %15, align 4, !tbaa !5
  %148 = add nsw i32 %147, %146
  store i32 %148, ptr %15, align 4, !tbaa !5
  br label %149

149:                                              ; preds = %139
  %150 = load i32, ptr %16, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %16, align 4, !tbaa !5
  br label %134, !llvm.loop !23

152:                                              ; preds = %138
  %153 = load i32, ptr %15, align 4, !tbaa !5
  %154 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %153)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 1, 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
  %155 = load i32, ptr %1, align 4
  ret i32 %155
}

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #4

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

; 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, ...) #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 = { nobuiltin allocsize(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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 }
attributes #7 = { builtin allocsize(0) }

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

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


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

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = 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 i8, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = call noalias noundef nonnull ptr @_Znam(i64 noundef %7) #8
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = mul nsw i32 %9, %6
  %11 = sext i32 %10 to i64
  %12 = icmp slt i32 %10, 0
  %13 = shl nsw i64 %11, 2
  %14 = select i1 %12, i64 -1, i64 %13
  %15 = call noalias noundef nonnull ptr @_Znam(i64 noundef %14) #8
  %16 = icmp sgt i32 %6, 0
  br i1 %16, label %.preheader41, label %.preheader39

.preheader41:                                     ; preds = %0, %._crit_edge
  %.03744 = phi i32 [ %22, %._crit_edge ], [ 0, %0 ]
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

.preheader40:                                     ; preds = %._crit_edge
  %19 = icmp sgt i32 %23, 0
  br i1 %19, label %.lr.ph46.preheader, label %.preheader39

.lr.ph46.preheader:                               ; preds = %.preheader40
  %20 = zext nneg i32 %23 to i64
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %8, i8 0, i64 %20, i1 false), !tbaa !9
  br label %.preheader39

._crit_edge:                                      ; preds = %.lr.ph, %.preheader41
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2)
  %22 = add nuw nsw i32 %.03744, 1
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %.preheader41, label %.preheader40, !llvm.loop !11

.lr.ph:                                           ; preds = %.preheader41, %.lr.ph
  %.03643 = phi i32 [ %34, %.lr.ph ], [ 0, %.preheader41 ]
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %4)
  %26 = load i8, ptr %4, align 1, !tbaa !13
  %27 = sext i8 %26 to i32
  %28 = add nsw i32 %27, -48
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = mul nsw i32 %29, %.03744
  %31 = add nsw i32 %30, %.03643
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i32, ptr %15, i64 %32
  store i32 %28, ptr %33, align 4, !tbaa !5
  %34 = add nuw nsw i32 %.03643, 1
  %35 = icmp slt i32 %34, %29
  br i1 %35, label %.lr.ph, label %._crit_edge, !llvm.loop !14

.preheader39:                                     ; preds = %0, %.lr.ph46.preheader, %.preheader40
  %.lcssa4278 = phi i32 [ %23, %.lr.ph46.preheader ], [ %23, %.preheader40 ], [ %6, %0 ]
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = icmp sgt i32 %36, 0
  br i1 %37, label %.lr.ph55, label %.preheader

.preheader:                                       ; preds = %._crit_edge53, %.preheader39
  %38 = phi i32 [ %.lcssa4278, %.preheader39 ], [ %98, %._crit_edge53 ]
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.lr.ph58.preheader, label %._crit_edge59

.lr.ph58.preheader:                               ; preds = %.preheader
  %wide.trip.count72 = zext nneg i32 %38 to i64
  %min.iters.check107 = icmp ult i32 %38, 8
  br i1 %min.iters.check107, label %.lr.ph58.preheader119, label %vector.ph108

.lr.ph58.preheader119:                            ; preds = %middle.block105, %.lr.ph58.preheader
  %indvars.iv69.ph = phi i64 [ 0, %.lr.ph58.preheader ], [ %n.vec110, %middle.block105 ]
  %.03156.ph = phi i32 [ 0, %.lr.ph58.preheader ], [ %47, %middle.block105 ]
  br label %.lr.ph58

vector.ph108:                                     ; preds = %.lr.ph58.preheader
  %n.vec110 = and i64 %wide.trip.count72, 2147483640
  br label %vector.body112

vector.body112:                                   ; preds = %vector.body112, %vector.ph108
  %index113 = phi i64 [ 0, %vector.ph108 ], [ %index.next117, %vector.body112 ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph108 ], [ %44, %vector.body112 ]
  %vec.phi114 = phi <4 x i32> [ zeroinitializer, %vector.ph108 ], [ %45, %vector.body112 ]
  %40 = getelementptr inbounds i8, ptr %8, i64 %index113
  %41 = getelementptr inbounds i8, ptr %40, i64 4
  %wide.load115 = load <4 x i8>, ptr %40, align 1, !tbaa !9
  %wide.load116 = load <4 x i8>, ptr %41, align 1, !tbaa !9
  %42 = zext <4 x i8> %wide.load115 to <4 x i32>
  %43 = zext <4 x i8> %wide.load116 to <4 x i32>
  %44 = add <4 x i32> %vec.phi, %42
  %45 = add <4 x i32> %vec.phi114, %43
  %index.next117 = add nuw i64 %index113, 8
  %46 = icmp eq i64 %index.next117, %n.vec110
  br i1 %46, label %middle.block105, label %vector.body112, !llvm.loop !15

middle.block105:                                  ; preds = %vector.body112
  %bin.rdx = add <4 x i32> %45, %44
  %47 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n118 = icmp eq i64 %n.vec110, %wide.trip.count72
  br i1 %cmp.n118, label %._crit_edge59, label %.lr.ph58.preheader119

.lr.ph55:                                         ; preds = %.preheader39, %._crit_edge53
  %.pre74 = phi i32 [ %.pre80, %._crit_edge53 ], [ %36, %.preheader39 ]
  %48 = phi i32 [ %98, %._crit_edge53 ], [ %.lcssa4278, %.preheader39 ]
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %._crit_edge53 ], [ 0, %.preheader39 ]
  store i32 0, ptr %3, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %.lr.ph49.preheader, label %.preheader38.._crit_edge53_crit_edge

.lr.ph49.preheader:                               ; preds = %.lr.ph55
  %50 = getelementptr i32, ptr %15, i64 %indvars.iv66
  br label %.lr.ph49

.preheader38:                                     ; preds = %.lr.ph49
  %.pre.pre = load i32, ptr %2, align 4, !tbaa !5
  %51 = icmp sgt i32 %96, 0
  br i1 %51, label %.lr.ph52, label %.preheader38.._crit_edge53_crit_edge

.preheader38.._crit_edge53_crit_edge:             ; preds = %.lr.ph55, %.preheader38
  %52 = phi i32 [ %96, %.preheader38 ], [ %48, %.lr.ph55 ]
  %.pre81 = phi i32 [ %.pre.pre, %.preheader38 ], [ %.pre74, %.lr.ph55 ]
  %.pre76 = sext i32 %.pre81 to i64
  br label %._crit_edge53

.lr.ph52:                                         ; preds = %.preheader38
  %53 = sext i32 %.pre.pre to i64
  %wide.trip.count = zext nneg i32 %96 to i64
  %invariant.gep = getelementptr i32, ptr %15, i64 %indvars.iv66
  %min.iters.check = icmp ugt i32 %96, 7
  %ident.check.not = icmp eq i32 %.pre.pre, 1
  %or.cond = select i1 %min.iters.check, i1 %ident.check.not, i1 false
  br i1 %or.cond, label %vector.ph, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph52
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph52 ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %54 = mul nsw i64 %indvars.iv.ph, %53
  %gep.prol = getelementptr i32, ptr %invariant.gep, i64 %54
  %55 = load i32, ptr %gep.prol, align 4, !tbaa !5
  %56 = icmp eq i32 %55, %94
  br i1 %56, label %57, label %scalar.ph.prol.loopexit.unr-lcssa

57:                                               ; preds = %scalar.ph.prol
  %58 = getelementptr inbounds i8, ptr %8, i64 %indvars.iv.ph
  store i8 1, ptr %58, align 1, !tbaa !9
  br label %scalar.ph.prol.loopexit.unr-lcssa

scalar.ph.prol.loopexit.unr-lcssa:                ; preds = %57, %scalar.ph.prol
  %indvars.iv.next.prol = or disjoint i64 %indvars.iv.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol.loopexit.unr-lcssa, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol.loopexit.unr-lcssa ]
  %59 = add nsw i64 %wide.trip.count, -1
  %60 = icmp eq i64 %indvars.iv.ph, %59
  br i1 %60, label %._crit_edge53, label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph52
  %n.vec = and i64 %wide.trip.count, 2147483640
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %94, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %pred.store.continue104, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue104 ]
  %61 = or disjoint i64 %index, 4
  %62 = getelementptr i32, ptr %invariant.gep, i64 %index
  %63 = getelementptr i8, ptr %62, i64 16
  %wide.load = load <4 x i32>, ptr %62, align 4, !tbaa !5
  %wide.load90 = load <4 x i32>, ptr %63, align 4, !tbaa !5
  %64 = icmp eq <4 x i32> %wide.load, %broadcast.splat
  %65 = icmp eq <4 x i32> %wide.load90, %broadcast.splat
  %66 = extractelement <4 x i1> %64, i64 0
  br i1 %66, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body
  %67 = getelementptr inbounds i8, ptr %8, i64 %index
  store i8 1, ptr %67, align 1, !tbaa !9
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body
  %68 = extractelement <4 x i1> %64, i64 1
  br i1 %68, label %pred.store.if91, label %pred.store.continue92

pred.store.if91:                                  ; preds = %pred.store.continue
  %69 = or disjoint i64 %index, 1
  %70 = getelementptr inbounds i8, ptr %8, i64 %69
  store i8 1, ptr %70, align 1, !tbaa !9
  br label %pred.store.continue92

pred.store.continue92:                            ; preds = %pred.store.if91, %pred.store.continue
  %71 = extractelement <4 x i1> %64, i64 2
  br i1 %71, label %pred.store.if93, label %pred.store.continue94

pred.store.if93:                                  ; preds = %pred.store.continue92
  %72 = or disjoint i64 %index, 2
  %73 = getelementptr inbounds i8, ptr %8, i64 %72
  store i8 1, ptr %73, align 1, !tbaa !9
  br label %pred.store.continue94

pred.store.continue94:                            ; preds = %pred.store.if93, %pred.store.continue92
  %74 = extractelement <4 x i1> %64, i64 3
  br i1 %74, label %pred.store.if95, label %pred.store.continue96

pred.store.if95:                                  ; preds = %pred.store.continue94
  %75 = or disjoint i64 %index, 3
  %76 = getelementptr inbounds i8, ptr %8, i64 %75
  store i8 1, ptr %76, align 1, !tbaa !9
  br label %pred.store.continue96

pred.store.continue96:                            ; preds = %pred.store.if95, %pred.store.continue94
  %77 = extractelement <4 x i1> %65, i64 0
  br i1 %77, label %pred.store.if97, label %pred.store.continue98

pred.store.if97:                                  ; preds = %pred.store.continue96
  %78 = getelementptr inbounds i8, ptr %8, i64 %61
  store i8 1, ptr %78, align 1, !tbaa !9
  br label %pred.store.continue98

pred.store.continue98:                            ; preds = %pred.store.if97, %pred.store.continue96
  %79 = extractelement <4 x i1> %65, i64 1
  br i1 %79, label %pred.store.if99, label %pred.store.continue100

pred.store.if99:                                  ; preds = %pred.store.continue98
  %80 = or disjoint i64 %index, 5
  %81 = getelementptr inbounds i8, ptr %8, i64 %80
  store i8 1, ptr %81, align 1, !tbaa !9
  br label %pred.store.continue100

pred.store.continue100:                           ; preds = %pred.store.if99, %pred.store.continue98
  %82 = extractelement <4 x i1> %65, i64 2
  br i1 %82, label %pred.store.if101, label %pred.store.continue102

pred.store.if101:                                 ; preds = %pred.store.continue100
  %83 = or disjoint i64 %index, 6
  %84 = getelementptr inbounds i8, ptr %8, i64 %83
  store i8 1, ptr %84, align 1, !tbaa !9
  br label %pred.store.continue102

pred.store.continue102:                           ; preds = %pred.store.if101, %pred.store.continue100
  %85 = extractelement <4 x i1> %65, i64 3
  br i1 %85, label %pred.store.if103, label %pred.store.continue104

pred.store.if103:                                 ; preds = %pred.store.continue102
  %86 = or disjoint i64 %index, 7
  %87 = getelementptr inbounds i8, ptr %8, i64 %86
  store i8 1, ptr %87, align 1, !tbaa !9
  br label %pred.store.continue104

pred.store.continue104:                           ; preds = %pred.store.if103, %pred.store.continue102
  %index.next = add nuw i64 %index, 8
  %88 = icmp eq i64 %index.next, %n.vec
  br i1 %88, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %pred.store.continue104
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge53, label %scalar.ph.preheader

.lr.ph49:                                         ; preds = %.lr.ph49.preheader, %.lr.ph49
  %.03347 = phi i32 [ %95, %.lr.ph49 ], [ 0, %.lr.ph49.preheader ]
  %89 = load i32, ptr %2, align 4, !tbaa !5
  %90 = mul nsw i32 %89, %.03347
  %91 = sext i32 %90 to i64
  %92 = getelementptr i32, ptr %50, i64 %91
  %93 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %92)
  %94 = load i32, ptr %93, align 4, !tbaa !5
  store i32 %94, ptr %3, align 4, !tbaa !5
  %95 = add nuw nsw i32 %.03347, 1
  %96 = load i32, ptr %1, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %.lr.ph49, label %.preheader38, !llvm.loop !19

._crit_edge53:                                    ; preds = %scalar.ph.prol.loopexit, %110, %middle.block, %.preheader38.._crit_edge53_crit_edge
  %98 = phi i32 [ %52, %.preheader38.._crit_edge53_crit_edge ], [ %96, %middle.block ], [ %96, %110 ], [ %96, %scalar.ph.prol.loopexit ]
  %.pre80 = phi i32 [ %.pre81, %.preheader38.._crit_edge53_crit_edge ], [ %.pre.pre, %middle.block ], [ %.pre.pre, %110 ], [ %.pre.pre, %scalar.ph.prol.loopexit ]
  %.pre-phi = phi i64 [ %.pre76, %.preheader38.._crit_edge53_crit_edge ], [ %53, %middle.block ], [ %53, %110 ], [ %53, %scalar.ph.prol.loopexit ]
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %99 = icmp slt i64 %indvars.iv.next67, %.pre-phi
  br i1 %99, label %.lr.ph55, label %.preheader, !llvm.loop !20

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %110
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %110 ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %100 = mul nsw i64 %indvars.iv, %53
  %gep = getelementptr i32, ptr %invariant.gep, i64 %100
  %101 = load i32, ptr %gep, align 4, !tbaa !5
  %102 = icmp eq i32 %101, %94
  br i1 %102, label %103, label %scalar.ph.1

103:                                              ; preds = %scalar.ph
  %104 = getelementptr inbounds i8, ptr %8, i64 %indvars.iv
  store i8 1, ptr %104, align 1, !tbaa !9
  br label %scalar.ph.1

scalar.ph.1:                                      ; preds = %scalar.ph, %103
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %105 = mul nsw i64 %indvars.iv.next, %53
  %gep.1 = getelementptr i32, ptr %invariant.gep, i64 %105
  %106 = load i32, ptr %gep.1, align 4, !tbaa !5
  %107 = icmp eq i32 %106, %94
  br i1 %107, label %108, label %110

108:                                              ; preds = %scalar.ph.1
  %109 = getelementptr inbounds i8, ptr %8, i64 %indvars.iv.next
  store i8 1, ptr %109, align 1, !tbaa !9
  br label %110

110:                                              ; preds = %108, %scalar.ph.1
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
  br i1 %exitcond.not.1, label %._crit_edge53, label %scalar.ph, !llvm.loop !21

._crit_edge59:                                    ; preds = %.lr.ph58, %middle.block105, %.preheader
  %.031.lcssa = phi i32 [ 0, %.preheader ], [ %47, %middle.block105 ], [ %115, %.lr.ph58 ]
  %111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.031.lcssa)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.lr.ph58:                                         ; preds = %.lr.ph58.preheader119, %.lr.ph58
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %.lr.ph58 ], [ %indvars.iv69.ph, %.lr.ph58.preheader119 ]
  %.03156 = phi i32 [ %115, %.lr.ph58 ], [ %.03156.ph, %.lr.ph58.preheader119 ]
  %112 = getelementptr inbounds i8, ptr %8, i64 %indvars.iv69
  %113 = load i8, ptr %112, align 1, !tbaa !9, !range !22, !noundef !23
  %114 = zext nneg i8 %113 to i32
  %115 = add nuw nsw i32 %.03156, %114
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond73.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count72
  br i1 %exitcond73.not, label %._crit_edge59, label %.lr.ph58, !llvm.loop !24
}

; 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #3

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

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6

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 = { 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 = { nobuiltin allocsize(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 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass