; LLVM IR from Shah-Shishir/Codeforces-Solutions :: 1334C. Circle of Monsters (main)

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

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

10:                                               ; preds = %112, %0
  %11 = load i32, ptr %4, align 4, !tbaa !5
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = icmp sle i32 %11, %12
  br i1 %13, label %14, label %115

14:                                               ; preds = %10
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %28, %14
  %17 = load i32, ptr %5, align 4, !tbaa !5
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %20, label %31

20:                                               ; preds = %16
  %21 = load i32, ptr %5, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %22
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [300005 x i64], ptr @b, i64 0, i64 %25
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %23, ptr noundef %26)
  br label %28

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

31:                                               ; preds = %16
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %33
  %35 = load i64, ptr %34, align 8, !tbaa !11
  store i64 %35, ptr @a, align 16, !tbaa !11
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [300005 x i64], ptr @b, i64 0, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !11
  store i64 %39, ptr @b, align 16, !tbaa !11
  store i64 0, ptr %6, align 8, !tbaa !11
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %80, %31
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = icmp sle i32 %41, %42
  br i1 %43, label %44, label %83

44:                                               ; preds = %40
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = sub nsw i32 %45, 1
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [300005 x i64], ptr @b, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !11
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !11
  %54 = icmp sge i64 %49, %53
  br i1 %54, label %55, label %59

55:                                               ; preds = %44
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [300005 x i64], ptr @q, i64 0, i64 %57
  store i64 0, ptr %58, align 8, !tbaa !11
  br label %73

59:                                               ; preds = %44
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !11
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = sub nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [300005 x i64], ptr @b, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !11
  %69 = sub nsw i64 %63, %68
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [300005 x i64], ptr @q, i64 0, i64 %71
  store i64 %69, ptr %72, align 8, !tbaa !11
  br label %73

73:                                               ; preds = %59, %55
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [300005 x i64], ptr @q, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !11
  %78 = load i64, ptr %6, align 8, !tbaa !11
  %79 = add nsw i64 %78, %77
  store i64 %79, ptr %6, align 8, !tbaa !11
  br label %80

80:                                               ; preds = %73
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %5, align 4, !tbaa !5
  br label %40, !llvm.loop !13

83:                                               ; preds = %40
  store i64 1000000000000000000, ptr %7, align 8, !tbaa !11
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %106, %83
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = load i32, ptr %3, align 4, !tbaa !5
  %87 = icmp sle i32 %85, %86
  br i1 %87, label %88, label %109

88:                                               ; preds = %84
  %89 = load i64, ptr %6, align 8, !tbaa !11
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [300005 x i64], ptr @q, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !11
  %94 = sub nsw i64 %89, %93
  %95 = load i32, ptr %5, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !11
  %99 = add nsw i64 %94, %98
  store i64 %99, ptr %8, align 8, !tbaa !11
  %100 = load i64, ptr %8, align 8, !tbaa !11
  %101 = load i64, ptr %7, align 8, !tbaa !11
  %102 = icmp slt i64 %100, %101
  br i1 %102, label %103, label %105

103:                                              ; preds = %88
  %104 = load i64, ptr %8, align 8, !tbaa !11
  store i64 %104, ptr %7, align 8, !tbaa !11
  br label %105

105:                                              ; preds = %103, %88
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %5, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %5, align 4, !tbaa !5
  br label %84, !llvm.loop !14

109:                                              ; preds = %84
  %110 = load i64, ptr %7, align 8, !tbaa !11
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %110)
  br label %112

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

115:                                              ; preds = %10
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@a = external dso_local global [300005 x i64], align 16
@b = external dso_local global [300005 x i64], align 16
@q = external dso_local local_unnamed_addr global [300005 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %.not51 = icmp slt i32 %4, 1
  br i1 %.not51, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %0, %._crit_edge49
  %.052 = phi i32 [ %67, %._crit_edge49 ], [ 1, %0 ]
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %6 = load i32, ptr %2, align 4, !tbaa !5
  %.not3337 = icmp slt i32 %6, 1
  br i1 %.not3337, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %.lr.ph54
  %.pre = sext i32 %6 to i64
  %7 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %.pre
  %8 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %8, ptr @a, align 16, !tbaa !9
  %9 = getelementptr inbounds [300005 x i64], ptr @b, i64 0, i64 %.pre
  %10 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %10, ptr @b, align 16, !tbaa !9
  br label %._crit_edge49

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

._crit_edge:                                      ; preds = %.lr.ph
  %16 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %15
  %17 = load i64, ptr %16, align 8, !tbaa !9
  store i64 %17, ptr @a, align 16, !tbaa !9
  %18 = getelementptr inbounds [300005 x i64], ptr @b, i64 0, i64 %15
  %19 = load i64, ptr %18, align 8, !tbaa !9
  store i64 %19, ptr @b, align 16, !tbaa !9
  %.not3439 = icmp slt i32 %14, 1
  br i1 %.not3439, label %._crit_edge49, label %.lr.ph43.preheader

.lr.ph43.preheader:                               ; preds = %._crit_edge
  %20 = add nuw i32 %14, 1
  %wide.trip.count = zext i32 %20 to i64
  %21 = zext nneg i32 %14 to i64
  %min.iters.check88 = icmp ult i32 %14, 4
  br i1 %min.iters.check88, label %.lr.ph43.preheader107, label %vector.ph89

.lr.ph43.preheader107:                            ; preds = %middle.block86, %.lr.ph43.preheader
  %indvars.iv59.ph = phi i64 [ 1, %.lr.ph43.preheader ], [ %ind.end92, %middle.block86 ]
  %.02641.ph = phi i64 [ 0, %.lr.ph43.preheader ], [ %37, %middle.block86 ]
  br label %.lr.ph43

vector.ph89:                                      ; preds = %.lr.ph43.preheader
  %n.vec91 = and i64 %21, 2147483644
  %ind.end92 = or disjoint i64 %n.vec91, 1
  br label %vector.body94

vector.body94:                                    ; preds = %vector.body94, %vector.ph89
  %index95 = phi i64 [ 0, %vector.ph89 ], [ %index.next103, %vector.body94 ]
  %vec.phi96 = phi <2 x i64> [ zeroinitializer, %vector.ph89 ], [ %34, %vector.body94 ]
  %vec.phi97 = phi <2 x i64> [ zeroinitializer, %vector.ph89 ], [ %35, %vector.body94 ]
  %offset.idx98 = or disjoint i64 %index95, 1
  %22 = getelementptr inbounds [300005 x i64], ptr @b, i64 0, i64 %index95
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  %wide.load99 = load <2 x i64>, ptr %22, align 16, !tbaa !9
  %wide.load100 = load <2 x i64>, ptr %23, align 16, !tbaa !9
  %24 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %offset.idx98
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  %wide.load101 = load <2 x i64>, ptr %24, align 8, !tbaa !9
  %wide.load102 = load <2 x i64>, ptr %25, align 8, !tbaa !9
  %26 = icmp slt <2 x i64> %wide.load99, %wide.load101
  %27 = icmp slt <2 x i64> %wide.load100, %wide.load102
  %28 = sub nsw <2 x i64> %wide.load101, %wide.load99
  %29 = sub nsw <2 x i64> %wide.load102, %wide.load100
  %30 = select <2 x i1> %26, <2 x i64> %28, <2 x i64> zeroinitializer
  %31 = select <2 x i1> %27, <2 x i64> %29, <2 x i64> zeroinitializer
  %32 = getelementptr inbounds [300005 x i64], ptr @q, i64 0, i64 %offset.idx98
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  store <2 x i64> %30, ptr %32, align 8
  store <2 x i64> %31, ptr %33, align 8
  %34 = add <2 x i64> %30, %vec.phi96
  %35 = add <2 x i64> %31, %vec.phi97
  %index.next103 = add nuw i64 %index95, 4
  %36 = icmp eq i64 %index.next103, %n.vec91
  br i1 %36, label %middle.block86, label %vector.body94, !llvm.loop !13

middle.block86:                                   ; preds = %vector.body94
  %bin.rdx = add <2 x i64> %35, %34
  %37 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n104 = icmp eq i64 %n.vec91, %21
  br i1 %cmp.n104, label %.preheader, label %.lr.ph43.preheader107

.preheader:                                       ; preds = %.lr.ph43, %middle.block86
  %.lcssa81 = phi i64 [ %37, %middle.block86 ], [ %59, %.lr.ph43 ]
  br i1 %.not3439, label %._crit_edge49, label %.lr.ph48.preheader

.lr.ph48.preheader:                               ; preds = %.preheader
  %38 = add nuw i32 %14, 1
  %wide.trip.count65 = zext i32 %38 to i64
  %39 = zext nneg i32 %14 to i64
  %min.iters.check = icmp ult i32 %14, 4
  br i1 %min.iters.check, label %.lr.ph48.preheader106, label %vector.ph

.lr.ph48.preheader106:                            ; preds = %middle.block, %.lr.ph48.preheader
  %indvars.iv62.ph = phi i64 [ 1, %.lr.ph48.preheader ], [ %ind.end, %middle.block ]
  %.02547.ph = phi i64 [ 1000000000000000000, %.lr.ph48.preheader ], [ %51, %middle.block ]
  br label %.lr.ph48

vector.ph:                                        ; preds = %.lr.ph48.preheader
  %n.vec = and i64 %39, 2147483644
  %ind.end = or disjoint i64 %n.vec, 1
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %.lcssa81, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ <i64 1000000000000000000, i64 1000000000000000000>, %vector.ph ], [ %48, %vector.body ]
  %vec.phi82 = phi <2 x i64> [ <i64 1000000000000000000, i64 1000000000000000000>, %vector.ph ], [ %49, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %40 = getelementptr inbounds [300005 x i64], ptr @q, i64 0, i64 %offset.idx
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  %wide.load = load <2 x i64>, ptr %40, align 8, !tbaa !9
  %wide.load83 = load <2 x i64>, ptr %41, align 8, !tbaa !9
  %42 = sub <2 x i64> %broadcast.splat, %wide.load
  %43 = sub <2 x i64> %broadcast.splat, %wide.load83
  %44 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %offset.idx
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  %wide.load84 = load <2 x i64>, ptr %44, align 8, !tbaa !9
  %wide.load85 = load <2 x i64>, ptr %45, align 8, !tbaa !9
  %46 = add nsw <2 x i64> %42, %wide.load84
  %47 = add nsw <2 x i64> %43, %wide.load85
  %48 = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %46, <2 x i64> %vec.phi)
  %49 = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %47, <2 x i64> %vec.phi82)
  %index.next = add nuw i64 %index, 4
  %50 = icmp eq i64 %index.next, %n.vec
  br i1 %50, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %rdx.minmax = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %48, <2 x i64> %49)
  %51 = call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
  %cmp.n = icmp eq i64 %n.vec, %39
  br i1 %cmp.n, label %._crit_edge49, label %.lr.ph48.preheader106

.lr.ph43:                                         ; preds = %.lr.ph43.preheader107, %.lr.ph43
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %.lr.ph43 ], [ %indvars.iv59.ph, %.lr.ph43.preheader107 ]
  %.02641 = phi i64 [ %59, %.lr.ph43 ], [ %.02641.ph, %.lr.ph43.preheader107 ]
  %52 = add nsw i64 %indvars.iv59, -1
  %53 = getelementptr inbounds [300005 x i64], ptr @b, i64 0, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !9
  %55 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %indvars.iv59
  %56 = load i64, ptr %55, align 8, !tbaa !9
  %.not36 = icmp slt i64 %54, %56
  %57 = sub nsw i64 %56, %54
  %spec.select79 = select i1 %.not36, i64 %57, i64 0
  %58 = getelementptr inbounds [300005 x i64], ptr @q, i64 0, i64 %indvars.iv59
  store i64 %spec.select79, ptr %58, align 8
  %59 = add nsw i64 %spec.select79, %.02641
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph43, !llvm.loop !17

.lr.ph48:                                         ; preds = %.lr.ph48.preheader106, %.lr.ph48
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %.lr.ph48 ], [ %indvars.iv62.ph, %.lr.ph48.preheader106 ]
  %.02547 = phi i64 [ %spec.select, %.lr.ph48 ], [ %.02547.ph, %.lr.ph48.preheader106 ]
  %60 = getelementptr inbounds [300005 x i64], ptr @q, i64 0, i64 %indvars.iv62
  %61 = load i64, ptr %60, align 8, !tbaa !9
  %62 = sub i64 %.lcssa81, %61
  %63 = getelementptr inbounds [300005 x i64], ptr @a, i64 0, i64 %indvars.iv62
  %64 = load i64, ptr %63, align 8, !tbaa !9
  %65 = add nsw i64 %62, %64
  %spec.select = call i64 @llvm.smin.i64(i64 %65, i64 %.02547)
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count65
  br i1 %exitcond66.not, label %._crit_edge49, label %.lr.ph48, !llvm.loop !18

._crit_edge49:                                    ; preds = %.lr.ph48, %middle.block, %._crit_edge, %._crit_edge.thread, %.preheader
  %.025.lcssa = phi i64 [ 1000000000000000000, %.preheader ], [ 1000000000000000000, %._crit_edge.thread ], [ 1000000000000000000, %._crit_edge ], [ %51, %middle.block ], [ %spec.select, %.lr.ph48 ]
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %.025.lcssa)
  %67 = add nuw nsw i32 %.052, 1
  %68 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.052, %68
  br i1 %.not.not, label %.lr.ph54, label %._crit_edge55, !llvm.loop !19

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #3

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

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

attributes #0 = { mustprogress nofree norecurse nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12, !14, !15}
!17 = distinct !{!17, !12, !15, !14}
!18 = distinct !{!18, !12, !15, !14}
!19 = distinct !{!19, !12}


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