; LLVM IR from DionysiosB/CodeForces :: 0300-0399 (355B-VasyaAndPublicTransport)

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

38:                                               ; preds = %49, %0
  %39 = load i32, ptr %10, align 4, !tbaa !5
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %38
  %44 = load ptr, ptr %8, align 8, !tbaa !9
  %45 = load i32, ptr %10, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %44, i64 %46
  %48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %47)
  br label %49

49:                                               ; preds = %43
  %50 = load i32, ptr %10, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %10, align 4, !tbaa !5
  br label %38, !llvm.loop !11

52:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %64, %52
  %54 = load i32, ptr %11, align 4, !tbaa !5
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = icmp sle i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %67

58:                                               ; preds = %53
  %59 = load ptr, ptr %9, align 8, !tbaa !9
  %60 = load i32, ptr %11, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i32, ptr %59, i64 %61
  %63 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %62)
  br label %64

64:                                               ; preds = %58
  %65 = load i32, ptr %11, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %11, align 4, !tbaa !5
  br label %53, !llvm.loop !13

67:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %98, %67
  %69 = load i32, ptr %13, align 4, !tbaa !5
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = icmp sle i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %101

73:                                               ; preds = %68
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = load ptr, ptr %8, align 8, !tbaa !9
  %76 = load i32, ptr %13, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds i32, ptr %75, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = mul nsw i32 %74, %79
  %81 = sext i32 %80 to i64
  store i64 %81, ptr %12, align 8, !tbaa !14
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = load i64, ptr %12, align 8, !tbaa !14
  %85 = icmp slt i64 %83, %84
  br i1 %85, label %86, label %89

86:                                               ; preds = %73
  %87 = load i32, ptr %3, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  br label %91

89:                                               ; preds = %73
  %90 = load i64, ptr %12, align 8, !tbaa !14
  br label %91

91:                                               ; preds = %89, %86
  %92 = phi i64 [ %88, %86 ], [ %90, %89 ]
  %93 = trunc i64 %92 to i32
  %94 = load ptr, ptr %8, align 8, !tbaa !9
  %95 = load i32, ptr %13, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i32, ptr %94, i64 %96
  store i32 %93, ptr %97, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %91
  %99 = load i32, ptr %13, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %13, align 4, !tbaa !5
  br label %68, !llvm.loop !16

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

102:                                              ; preds = %132, %101
  %103 = load i32, ptr %14, align 4, !tbaa !5
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = icmp sle i32 %103, %104
  br i1 %105, label %107, label %106

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

107:                                              ; preds = %102
  %108 = load i32, ptr %2, align 4, !tbaa !5
  %109 = load ptr, ptr %9, align 8, !tbaa !9
  %110 = load i32, ptr %14, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds i32, ptr %109, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = mul nsw i32 %108, %113
  %115 = sext i32 %114 to i64
  store i64 %115, ptr %12, align 8, !tbaa !14
  %116 = load i32, ptr %3, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = load i64, ptr %12, align 8, !tbaa !14
  %119 = icmp slt i64 %117, %118
  br i1 %119, label %120, label %123

120:                                              ; preds = %107
  %121 = load i32, ptr %3, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  br label %125

123:                                              ; preds = %107
  %124 = load i64, ptr %12, align 8, !tbaa !14
  br label %125

125:                                              ; preds = %123, %120
  %126 = phi i64 [ %122, %120 ], [ %124, %123 ]
  %127 = trunc i64 %126 to i32
  %128 = load ptr, ptr %9, align 8, !tbaa !9
  %129 = load i32, ptr %14, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i32, ptr %128, i64 %130
  store i32 %127, ptr %131, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %125
  %133 = load i32, ptr %14, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %14, align 4, !tbaa !5
  br label %102, !llvm.loop !17

135:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 1, ptr %16, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %150, %135
  %137 = load i32, ptr %16, align 4, !tbaa !5
  %138 = load i32, ptr %6, align 4, !tbaa !5
  %139 = icmp sle i32 %137, %138
  br i1 %139, label %141, label %140

140:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %153

141:                                              ; preds = %136
  %142 = load ptr, ptr %8, align 8, !tbaa !9
  %143 = load i32, ptr %16, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr %142, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = load i64, ptr %15, align 8, !tbaa !14
  %149 = add nsw i64 %148, %147
  store i64 %149, ptr %15, align 8, !tbaa !14
  br label %150

150:                                              ; preds = %141
  %151 = load i32, ptr %16, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %16, align 4, !tbaa !5
  br label %136, !llvm.loop !18

153:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store i64 0, ptr %17, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 1, ptr %18, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %168, %153
  %155 = load i32, ptr %18, align 4, !tbaa !5
  %156 = load i32, ptr %7, align 4, !tbaa !5
  %157 = icmp sle i32 %155, %156
  br i1 %157, label %159, label %158

158:                                              ; preds = %154
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %171

159:                                              ; preds = %154
  %160 = load ptr, ptr %9, align 8, !tbaa !9
  %161 = load i32, ptr %18, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds i32, ptr %160, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = load i64, ptr %17, align 8, !tbaa !14
  %167 = add nsw i64 %166, %165
  store i64 %167, ptr %17, align 8, !tbaa !14
  br label %168

168:                                              ; preds = %159
  %169 = load i32, ptr %18, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %18, align 4, !tbaa !5
  br label %154, !llvm.loop !19

171:                                              ; preds = %158
  %172 = load i64, ptr %15, align 8, !tbaa !14
  %173 = load i32, ptr %4, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = icmp sgt i64 %172, %174
  br i1 %175, label %176, label %179

176:                                              ; preds = %171
  %177 = load i32, ptr %4, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  store i64 %178, ptr %15, align 8, !tbaa !14
  br label %179

179:                                              ; preds = %176, %171
  %180 = load i64, ptr %17, align 8, !tbaa !14
  %181 = load i32, ptr %4, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = icmp sgt i64 %180, %182
  br i1 %183, label %184, label %187

184:                                              ; preds = %179
  %185 = load i32, ptr %4, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  store i64 %186, ptr %17, align 8, !tbaa !14
  br label %187

187:                                              ; preds = %184, %179
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %188 = load i64, ptr %15, align 8, !tbaa !14
  %189 = load i64, ptr %17, align 8, !tbaa !14
  %190 = add nsw i64 %188, %189
  store i64 %190, ptr %19, align 8, !tbaa !14
  %191 = load i64, ptr %19, align 8, !tbaa !14
  %192 = load i32, ptr %5, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = icmp sgt i64 %191, %193
  br i1 %194, label %195, label %198

195:                                              ; preds = %187
  %196 = load i32, ptr %5, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  store i64 %197, ptr %19, align 8, !tbaa !14
  br label %198

198:                                              ; preds = %195, %187
  %199 = load i64, ptr %19, align 8, !tbaa !14
  %200 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %199)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  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 i32 @__isoc99_scanf(ptr noundef, ...) #2

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

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

; 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 nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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

.preheader60.loopexit:                            ; preds = %.lr.ph
  %.pre = load i32, ptr %6, align 4, !tbaa !5
  br label %.preheader60

.preheader60:                                     ; preds = %.preheader60.loopexit, %0
  %23 = phi i32 [ %27, %.preheader60.loopexit ], [ %9, %0 ]
  %24 = phi i32 [ %.pre, %.preheader60.loopexit ], [ %16, %0 ]
  %.not5264 = icmp slt i32 %24, 1
  br i1 %.not5264, label %.preheader59, label %.lr.ph66

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %25 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %25)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %.not.not = icmp slt i64 %indvars.iv, %28
  br i1 %.not.not, label %.lr.ph, label %.preheader60.loopexit, !llvm.loop !9

.preheader59.loopexit:                            ; preds = %.lr.ph66
  %.pre108 = load i32, ptr %5, align 4, !tbaa !5
  br label %.preheader59

.preheader59:                                     ; preds = %.preheader59.loopexit, %.preheader60
  %29 = phi i32 [ %23, %.preheader60 ], [ %.pre108, %.preheader59.loopexit ]
  %.lcssa61 = phi i32 [ %24, %.preheader60 ], [ %43, %.preheader59.loopexit ]
  %.not5367 = icmp slt i32 %29, 1
  br i1 %.not5367, label %.preheader58, label %.lr.ph69

.lr.ph69:                                         ; preds = %.preheader59
  %30 = load i32, ptr %1, align 4, !tbaa !5
  %31 = load i32, ptr %2, align 4
  %32 = add nuw i32 %29, 1
  %wide.trip.count = zext i32 %32 to i64
  %33 = zext nneg i32 %29 to i64
  %min.iters.check = icmp ult i32 %29, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph69
  %indvars.iv90.ph = phi i64 [ 1, %.lr.ph69 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph69
  %n.vec = and i64 %33, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %30, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert116 = insertelement <4 x i32> poison, i32 %31, i64 0
  %broadcast.splat117 = shufflevector <4 x i32> %broadcast.splatinsert116, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %34 = getelementptr inbounds i32, ptr %15, i64 %offset.idx
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  %wide.load = load <4 x i32>, ptr %34, align 4, !tbaa !5
  %wide.load115 = load <4 x i32>, ptr %35, align 4, !tbaa !5
  %36 = mul nsw <4 x i32> %wide.load, %broadcast.splat
  %37 = mul nsw <4 x i32> %wide.load115, %broadcast.splat
  %38 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %broadcast.splat117, <4 x i32> %36)
  %39 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %broadcast.splat117, <4 x i32> %37)
  store <4 x i32> %38, ptr %34, align 4, !tbaa !5
  store <4 x i32> %39, ptr %35, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %40 = icmp eq i64 %index.next, %n.vec
  br i1 %40, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %33
  br i1 %cmp.n, label %.preheader58, label %scalar.ph.preheader

.lr.ph66:                                         ; preds = %.preheader60, %.lr.ph66
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %.lr.ph66 ], [ 1, %.preheader60 ]
  %41 = getelementptr inbounds i32, ptr %22, i64 %indvars.iv87
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %41)
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %.not52.not = icmp slt i64 %indvars.iv87, %44
  br i1 %.not52.not, label %.lr.ph66, label %.preheader59.loopexit, !llvm.loop !14

.preheader58:                                     ; preds = %scalar.ph, %middle.block, %.preheader59
  %.not5471 = icmp slt i32 %.lcssa61, 1
  br i1 %.not5471, label %.preheader57, label %.lr.ph73

.lr.ph73:                                         ; preds = %.preheader58
  %45 = load i32, ptr %1, align 4, !tbaa !5
  %46 = load i32, ptr %2, align 4
  %47 = add nuw i32 %.lcssa61, 1
  %wide.trip.count96 = zext i32 %47 to i64
  %48 = zext nneg i32 %.lcssa61 to i64
  %min.iters.check120 = icmp ult i32 %.lcssa61, 8
  br i1 %min.iters.check120, label %scalar.ph119.preheader, label %vector.ph121

scalar.ph119.preheader:                           ; preds = %middle.block118, %.lr.ph73
  %indvars.iv93.ph = phi i64 [ 1, %.lr.ph73 ], [ %ind.end124, %middle.block118 ]
  br label %scalar.ph119

vector.ph121:                                     ; preds = %.lr.ph73
  %n.vec123 = and i64 %48, 2147483640
  %ind.end124 = or disjoint i64 %n.vec123, 1
  %broadcast.splatinsert131 = insertelement <4 x i32> poison, i32 %45, i64 0
  %broadcast.splat132 = shufflevector <4 x i32> %broadcast.splatinsert131, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert133 = insertelement <4 x i32> poison, i32 %46, i64 0
  %broadcast.splat134 = shufflevector <4 x i32> %broadcast.splatinsert133, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body126

vector.body126:                                   ; preds = %vector.body126, %vector.ph121
  %index127 = phi i64 [ 0, %vector.ph121 ], [ %index.next135, %vector.body126 ]
  %offset.idx128 = or disjoint i64 %index127, 1
  %49 = getelementptr inbounds i32, ptr %22, i64 %offset.idx128
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  %wide.load129 = load <4 x i32>, ptr %49, align 4, !tbaa !5
  %wide.load130 = load <4 x i32>, ptr %50, align 4, !tbaa !5
  %51 = mul nsw <4 x i32> %wide.load129, %broadcast.splat132
  %52 = mul nsw <4 x i32> %wide.load130, %broadcast.splat132
  %53 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %broadcast.splat134, <4 x i32> %51)
  %54 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %broadcast.splat134, <4 x i32> %52)
  store <4 x i32> %53, ptr %49, align 4, !tbaa !5
  store <4 x i32> %54, ptr %50, align 4, !tbaa !5
  %index.next135 = add nuw i64 %index127, 8
  %55 = icmp eq i64 %index.next135, %n.vec123
  br i1 %55, label %middle.block118, label %vector.body126, !llvm.loop !15

middle.block118:                                  ; preds = %vector.body126
  %cmp.n136 = icmp eq i64 %n.vec123, %48
  br i1 %cmp.n136, label %.preheader57, label %scalar.ph119.preheader

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv90 = phi i64 [ %indvars.iv.next91, %scalar.ph ], [ %indvars.iv90.ph, %scalar.ph.preheader ]
  %56 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv90
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = mul nsw i32 %57, %30
  %59 = call i32 @llvm.smin.i32(i32 %31, i32 %58)
  store i32 %59, ptr %56, align 4, !tbaa !5
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next91, %wide.trip.count
  br i1 %exitcond.not, label %.preheader58, label %scalar.ph, !llvm.loop !16

.preheader57:                                     ; preds = %scalar.ph119, %middle.block118, %.preheader58
  br i1 %.not5367, label %.preheader, label %.lr.ph77.preheader

.lr.ph77.preheader:                               ; preds = %.preheader57
  %60 = add nuw i32 %29, 1
  %wide.trip.count101 = zext i32 %60 to i64
  %61 = zext nneg i32 %29 to i64
  %min.iters.check139 = icmp ult i32 %29, 4
  br i1 %min.iters.check139, label %.lr.ph77.preheader175, label %vector.ph140

.lr.ph77.preheader175:                            ; preds = %middle.block137, %.lr.ph77.preheader
  %indvars.iv98.ph = phi i64 [ 1, %.lr.ph77.preheader ], [ %ind.end143, %middle.block137 ]
  %.04275.ph = phi i64 [ 0, %.lr.ph77.preheader ], [ %69, %middle.block137 ]
  br label %.lr.ph77

vector.ph140:                                     ; preds = %.lr.ph77.preheader
  %n.vec142 = and i64 %61, 2147483644
  %ind.end143 = or disjoint i64 %n.vec142, 1
  br label %vector.body145

vector.body145:                                   ; preds = %vector.body145, %vector.ph140
  %index146 = phi i64 [ 0, %vector.ph140 ], [ %index.next151, %vector.body145 ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph140 ], [ %66, %vector.body145 ]
  %vec.phi147 = phi <2 x i64> [ zeroinitializer, %vector.ph140 ], [ %67, %vector.body145 ]
  %offset.idx148 = or disjoint i64 %index146, 1
  %62 = getelementptr inbounds i32, ptr %15, i64 %offset.idx148
  %63 = getelementptr inbounds i8, ptr %62, i64 8
  %wide.load149 = load <2 x i32>, ptr %62, align 4, !tbaa !5
  %wide.load150 = load <2 x i32>, ptr %63, align 4, !tbaa !5
  %64 = sext <2 x i32> %wide.load149 to <2 x i64>
  %65 = sext <2 x i32> %wide.load150 to <2 x i64>
  %66 = add <2 x i64> %vec.phi, %64
  %67 = add <2 x i64> %vec.phi147, %65
  %index.next151 = add nuw i64 %index146, 4
  %68 = icmp eq i64 %index.next151, %n.vec142
  br i1 %68, label %middle.block137, label %vector.body145, !llvm.loop !17

middle.block137:                                  ; preds = %vector.body145
  %bin.rdx = add <2 x i64> %67, %66
  %69 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n152 = icmp eq i64 %n.vec142, %61
  br i1 %cmp.n152, label %.preheader, label %.lr.ph77.preheader175

scalar.ph119:                                     ; preds = %scalar.ph119.preheader, %scalar.ph119
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %scalar.ph119 ], [ %indvars.iv93.ph, %scalar.ph119.preheader ]
  %70 = getelementptr inbounds i32, ptr %22, i64 %indvars.iv93
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = mul nsw i32 %71, %45
  %73 = call i32 @llvm.smin.i32(i32 %46, i32 %72)
  store i32 %73, ptr %70, align 4, !tbaa !5
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count96
  br i1 %exitcond97.not, label %.preheader57, label %scalar.ph119, !llvm.loop !18

.preheader:                                       ; preds = %.lr.ph77, %middle.block137, %.preheader57
  %.042.lcssa = phi i64 [ 0, %.preheader57 ], [ %69, %middle.block137 ], [ %87, %.lr.ph77 ]
  br i1 %.not5471, label %._crit_edge, label %.lr.ph82.preheader

.lr.ph82.preheader:                               ; preds = %.preheader
  %74 = add nuw i32 %.lcssa61, 1
  %wide.trip.count106 = zext i32 %74 to i64
  %75 = zext nneg i32 %.lcssa61 to i64
  %min.iters.check155 = icmp ult i32 %.lcssa61, 4
  br i1 %min.iters.check155, label %.lr.ph82.preheader172, label %vector.ph156

.lr.ph82.preheader172:                            ; preds = %middle.block153, %.lr.ph82.preheader
  %indvars.iv103.ph = phi i64 [ 1, %.lr.ph82.preheader ], [ %ind.end159, %middle.block153 ]
  %.04080.ph = phi i64 [ 0, %.lr.ph82.preheader ], [ %83, %middle.block153 ]
  br label %.lr.ph82

vector.ph156:                                     ; preds = %.lr.ph82.preheader
  %n.vec158 = and i64 %75, 2147483644
  %ind.end159 = or disjoint i64 %n.vec158, 1
  br label %vector.body161

vector.body161:                                   ; preds = %vector.body161, %vector.ph156
  %index162 = phi i64 [ 0, %vector.ph156 ], [ %index.next168, %vector.body161 ]
  %vec.phi163 = phi <2 x i64> [ zeroinitializer, %vector.ph156 ], [ %80, %vector.body161 ]
  %vec.phi164 = phi <2 x i64> [ zeroinitializer, %vector.ph156 ], [ %81, %vector.body161 ]
  %offset.idx165 = or disjoint i64 %index162, 1
  %76 = getelementptr inbounds i32, ptr %22, i64 %offset.idx165
  %77 = getelementptr inbounds i8, ptr %76, i64 8
  %wide.load166 = load <2 x i32>, ptr %76, align 4, !tbaa !5
  %wide.load167 = load <2 x i32>, ptr %77, align 4, !tbaa !5
  %78 = sext <2 x i32> %wide.load166 to <2 x i64>
  %79 = sext <2 x i32> %wide.load167 to <2 x i64>
  %80 = add <2 x i64> %vec.phi163, %78
  %81 = add <2 x i64> %vec.phi164, %79
  %index.next168 = add nuw i64 %index162, 4
  %82 = icmp eq i64 %index.next168, %n.vec158
  br i1 %82, label %middle.block153, label %vector.body161, !llvm.loop !19

middle.block153:                                  ; preds = %vector.body161
  %bin.rdx169 = add <2 x i64> %81, %80
  %83 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx169)
  %cmp.n170 = icmp eq i64 %n.vec158, %75
  br i1 %cmp.n170, label %._crit_edge, label %.lr.ph82.preheader172

.lr.ph77:                                         ; preds = %.lr.ph77.preheader175, %.lr.ph77
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %.lr.ph77 ], [ %indvars.iv98.ph, %.lr.ph77.preheader175 ]
  %.04275 = phi i64 [ %87, %.lr.ph77 ], [ %.04275.ph, %.lr.ph77.preheader175 ]
  %84 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv98
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = add nsw i64 %.04275, %86
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %exitcond102.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count101
  br i1 %exitcond102.not, label %.preheader, label %.lr.ph77, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph82, %middle.block153, %.preheader
  %.040.lcssa = phi i64 [ 0, %.preheader ], [ %83, %middle.block153 ], [ %97, %.lr.ph82 ]
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %spec.select = call i64 @llvm.smin.i64(i64 %.042.lcssa, i64 %89)
  %.1 = call i64 @llvm.smin.i64(i64 %.040.lcssa, i64 %89)
  %90 = add nsw i64 %spec.select, %.1
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %.0 = call i64 @llvm.smin.i64(i64 %90, i64 %92)
  %93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %.0)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

.lr.ph82:                                         ; preds = %.lr.ph82.preheader172, %.lr.ph82
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %.lr.ph82 ], [ %indvars.iv103.ph, %.lr.ph82.preheader172 ]
  %.04080 = phi i64 [ %97, %.lr.ph82 ], [ %.04080.ph, %.lr.ph82.preheader172 ]
  %94 = getelementptr inbounds i32, ptr %22, i64 %indvars.iv103
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = add nsw i64 %.04080, %96
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %exitcond107.not = icmp eq i64 %indvars.iv.next104, %wide.trip.count106
  br i1 %exitcond107.not, label %._crit_edge, label %.lr.ph82, !llvm.loop !21
}

; 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #4

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

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

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { 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 = 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}
!15 = distinct !{!15, !10, !12, !13}
!16 = distinct !{!16, !10, !13, !12}
!17 = distinct !{!17, !10, !12, !13}
!18 = distinct !{!18, !10, !13, !12}
!19 = distinct !{!19, !10, !12, !13}
!20 = distinct !{!20, !10, !13, !12}
!21 = distinct !{!21, !10, !13, !12}


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