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

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

@r = external dso_local global i32, align 4
@g = external dso_local global i32, align 4
@dp = external dso_local global [200001 x i32], align 16
@MOD = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @r, ptr noundef @g)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %10 = load i32, ptr @r, align 4, !tbaa !5
  %11 = load i32, ptr @g, align 4, !tbaa !5
  %12 = add nsw i32 %10, %11
  %13 = mul nsw i32 8, %12
  %14 = add nsw i32 %13, 1
  %15 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %14)
  %16 = fsub double %15, 1.000000e+00
  %17 = fdiv double %16, 2.000000e+00
  %18 = fptosi double %17 to i32
  store i32 %18, ptr %2, align 4, !tbaa !5
  store i32 1, ptr @dp, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %66, %0
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = icmp sle i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %69

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %25 = load i32, ptr @r, align 4, !tbaa !5
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sub nsw i32 %25, %26
  store i32 %27, ptr %5, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %62, %24
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = icmp sge i32 %29, 0
  br i1 %30, label %32, label %31

31:                                               ; preds = %28
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %65

32:                                               ; preds = %28
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr %5, align 4, !tbaa !5
  %39 = add nsw i32 %37, %38
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = add nsw i32 %42, %36
  store i32 %43, ptr %41, align 4, !tbaa !5
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = add nsw i32 %44, %45
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = load i32, ptr @MOD, align 4, !tbaa !5
  %51 = icmp sge i32 %49, %50
  br i1 %51, label %52, label %61

52:                                               ; preds = %32
  %53 = load i32, ptr @MOD, align 4, !tbaa !5
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = add nsw i32 %54, %55
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = sub nsw i32 %59, %53
  store i32 %60, ptr %58, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %52, %32
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = add nsw i32 %63, -1
  store i32 %64, ptr %5, align 4, !tbaa !5
  br label %28, !llvm.loop !9

65:                                               ; preds = %31
  br label %66

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

69:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = load i32, ptr %2, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  %73 = mul nsw i32 %70, %72
  %74 = sdiv i32 %73, 2
  %75 = load i32, ptr @g, align 4, !tbaa !5
  %76 = sub nsw i32 %74, %75
  store i32 %76, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %78 = load i32, ptr %77, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  store i32 %78, ptr %6, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %99, %69
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = load i32, ptr @r, align 4, !tbaa !5
  %82 = icmp sle i32 %80, %81
  br i1 %82, label %84, label %83

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

84:                                               ; preds = %79
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = load i32, ptr @ans, align 4, !tbaa !5
  %90 = add nsw i32 %89, %88
  store i32 %90, ptr @ans, align 4, !tbaa !5
  %91 = load i32, ptr @ans, align 4, !tbaa !5
  %92 = load i32, ptr @MOD, align 4, !tbaa !5
  %93 = icmp sge i32 %91, %92
  br i1 %93, label %94, label %98

94:                                               ; preds = %84
  %95 = load i32, ptr @MOD, align 4, !tbaa !5
  %96 = load i32, ptr @ans, align 4, !tbaa !5
  %97 = sub nsw i32 %96, %95
  store i32 %97, ptr @ans, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %94, %84
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %6, align 4, !tbaa !5
  br label %79, !llvm.loop !12

102:                                              ; preds = %83
  %103 = load i32, ptr @ans, align 4, !tbaa !5
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %103)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %105 = load i32, ptr %1, align 4
  ret i32 %105
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #3

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

; 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)) #3

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

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

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

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


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

@r = external dso_local global i32, align 4
@g = external dso_local global i32, align 4
@dp = external dso_local local_unnamed_addr global [200001 x i32], align 16
@MOD = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @r, ptr noundef nonnull @g)
  %4 = load i32, ptr @r, align 4, !tbaa !5
  %5 = load i32, ptr @g, align 4, !tbaa !5
  %6 = add nsw i32 %5, %4
  %7 = shl nsw i32 %6, 3
  %8 = or disjoint i32 %7, 1
  %9 = tail call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %8)
  %10 = fadd double %9, -1.000000e+00
  %11 = fmul double %10, 5.000000e-01
  %12 = fptosi double %11 to i32
  store i32 1, ptr @dp, align 16, !tbaa !5
  %.not30 = icmp slt i32 %12, 1
  br i1 %.not30, label %.._crit_edge34_crit_edge, label %.lr.ph33

.._crit_edge34_crit_edge:                         ; preds = %0
  %.pre50 = add nsw i32 %12, 1
  br label %._crit_edge34

.lr.ph33:                                         ; preds = %0
  %13 = load i32, ptr @r, align 4, !tbaa !5
  %14 = load i32, ptr @MOD, align 4
  %15 = sext i32 %13 to i64
  %16 = add nuw i32 %12, 1
  %wide.trip.count = zext i32 %16 to i64
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %14, i64 0
  %17 = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %18 = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %19 = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %20 = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %39

._crit_edge34:                                    ; preds = %._crit_edge, %.._crit_edge34_crit_edge
  %.pre-phi = phi i32 [ %.pre50, %.._crit_edge34_crit_edge ], [ %16, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %21 = mul nsw i32 %.pre-phi, %12
  %22 = sdiv i32 %21, 2
  %23 = load i32, ptr @g, align 4, !tbaa !5
  %24 = sub nsw i32 %22, %23
  store i32 %24, 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
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %26 = load i32, ptr %25, align 4, !tbaa !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
  %27 = load i32, ptr @r, align 4, !tbaa !5
  %.not2635 = icmp sgt i32 %26, %27
  %.pre = load i32, ptr @ans, align 4, !tbaa !5
  br i1 %.not2635, label %._crit_edge34._crit_edge, label %.lr.ph38

.lr.ph38:                                         ; preds = %._crit_edge34
  %28 = load i32, ptr @MOD, align 4, !tbaa !5
  %29 = sext i32 %26 to i64
  %30 = add i32 %27, 1
  %31 = sub i32 %30, %26
  %32 = sub i32 %27, %26
  %xtraiter = and i32 %31, 3
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.prol.loopexit, label %.prol.preheader

.prol.preheader:                                  ; preds = %.lr.ph38, %.prol.preheader
  %indvars.iv46.prol = phi i64 [ %indvars.iv.next47.prol, %.prol.preheader ], [ %29, %.lr.ph38 ]
  %33 = phi i32 [ %spec.select.prol, %.prol.preheader ], [ %.pre, %.lr.ph38 ]
  %prol.iter = phi i32 [ %prol.iter.next, %.prol.preheader ], [ 0, %.lr.ph38 ]
  %34 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %indvars.iv46.prol
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = add nsw i32 %33, %35
  %.not27.prol = icmp slt i32 %36, %28
  %37 = select i1 %.not27.prol, i32 0, i32 %28
  %spec.select.prol = sub nsw i32 %36, %37
  %indvars.iv.next47.prol = add nsw i64 %indvars.iv46.prol, 1
  %prol.iter.next = add i32 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.prol.loopexit, label %.prol.preheader, !llvm.loop !9

.prol.loopexit:                                   ; preds = %.prol.preheader, %.lr.ph38
  %spec.select.lcssa.unr = phi i32 [ poison, %.lr.ph38 ], [ %spec.select.prol, %.prol.preheader ]
  %indvars.iv46.unr = phi i64 [ %29, %.lr.ph38 ], [ %indvars.iv.next47.prol, %.prol.preheader ]
  %.unr = phi i32 [ %.pre, %.lr.ph38 ], [ %spec.select.prol, %.prol.preheader ]
  %38 = icmp ult i32 %32, 3
  br i1 %38, label %._crit_edge39, label %.lr.ph38.new

39:                                               ; preds = %.lr.ph33, %._crit_edge
  %indvar = phi i32 [ 0, %.lr.ph33 ], [ %indvar.next, %._crit_edge ]
  %indvars.iv43 = phi i64 [ 1, %.lr.ph33 ], [ %indvars.iv.next44, %._crit_edge ]
  %indvars.iv.in = phi i32 [ %13, %.lr.ph33 ], [ %indvars.iv, %._crit_edge ]
  %40 = xor i32 %indvar, -1
  %41 = add i32 %13, %40
  %smin = tail call i32 @llvm.smin.i32(i32 %41, i32 0)
  %42 = sub i32 %41, %smin
  %43 = zext i32 %42 to i64
  %44 = add nuw nsw i64 %43, 1
  %indvars.iv = add i32 %indvars.iv.in, -1
  %.not = icmp sgt i64 %indvars.iv43, %15
  br i1 %.not, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %39
  %45 = zext i32 %indvars.iv to i64
  %min.iters.check = icmp ult i32 %42, 7
  br i1 %min.iters.check, label %.lr.ph.preheader60, label %vector.ph

.lr.ph.preheader60:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv40.ph = phi i64 [ %45, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %44, 8589934584
  %ind.end = sub nsw i64 %45, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = sub i64 %45, %index
  %46 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %offset.idx
  %47 = getelementptr inbounds i8, ptr %46, i64 -12
  %48 = getelementptr inbounds i8, ptr %46, i64 -28
  %wide.load = load <4 x i32>, ptr %47, align 4, !tbaa !5
  %wide.load52 = load <4 x i32>, ptr %48, align 4, !tbaa !5
  %49 = add nuw nsw i64 %offset.idx, %indvars.iv43
  %50 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %49
  %51 = getelementptr inbounds i8, ptr %50, i64 -12
  %52 = getelementptr inbounds i8, ptr %50, i64 -28
  %wide.load54 = load <4 x i32>, ptr %51, align 4, !tbaa !5
  %wide.load56 = load <4 x i32>, ptr %52, align 4, !tbaa !5
  %53 = add nsw <4 x i32> %wide.load54, %wide.load
  %54 = add nsw <4 x i32> %wide.load56, %wide.load52
  %55 = icmp slt <4 x i32> %53, %17
  %56 = select <4 x i1> %55, <4 x i32> zeroinitializer, <4 x i32> %18
  %reverse58 = sub nsw <4 x i32> %53, %56
  store <4 x i32> %reverse58, ptr %51, align 4, !tbaa !5
  %57 = icmp slt <4 x i32> %54, %19
  %58 = select <4 x i1> %57, <4 x i32> zeroinitializer, <4 x i32> %20
  %reverse59 = sub nsw <4 x i32> %54, %58
  store <4 x i32> %reverse59, ptr %52, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %59 = icmp eq i64 %index.next, %n.vec
  br i1 %59, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %44, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader60

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %39
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next44, %wide.trip.count
  %indvar.next = add i32 %indvar, 1
  br i1 %exitcond.not, label %._crit_edge34, label %39, !llvm.loop !15

.lr.ph:                                           ; preds = %.lr.ph.preheader60, %.lr.ph
  %indvars.iv40 = phi i64 [ %indvars.iv.next41, %.lr.ph ], [ %indvars.iv40.ph, %.lr.ph.preheader60 ]
  %60 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %indvars.iv40
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = add nuw nsw i64 %indvars.iv40, %indvars.iv43
  %63 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = add nsw i32 %64, %61
  %.not28 = icmp slt i32 %65, %14
  %66 = select i1 %.not28, i32 0, i32 %14
  %spec.select51 = sub nsw i32 %65, %66
  store i32 %spec.select51, ptr %63, align 4, !tbaa !5
  %indvars.iv.next41 = add nsw i64 %indvars.iv40, -1
  %67 = trunc nuw i64 %indvars.iv40 to i32
  %68 = icmp sgt i32 %67, 0
  br i1 %68, label %.lr.ph, label %._crit_edge, !llvm.loop !16

._crit_edge39:                                    ; preds = %.lr.ph38.new, %.prol.loopexit
  %spec.select.lcssa = phi i32 [ %spec.select.lcssa.unr, %.prol.loopexit ], [ %spec.select.3, %.lr.ph38.new ]
  store i32 %spec.select.lcssa, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge34._crit_edge

._crit_edge34._crit_edge:                         ; preds = %._crit_edge34, %._crit_edge39
  %69 = phi i32 [ %spec.select.lcssa, %._crit_edge39 ], [ %.pre, %._crit_edge34 ]
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %69)
  ret i32 0

.lr.ph38.new:                                     ; preds = %.prol.loopexit, %.lr.ph38.new
  %indvars.iv46 = phi i64 [ %indvars.iv.next47.3, %.lr.ph38.new ], [ %indvars.iv46.unr, %.prol.loopexit ]
  %71 = phi i32 [ %spec.select.3, %.lr.ph38.new ], [ %.unr, %.prol.loopexit ]
  %72 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %indvars.iv46
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %71, %73
  %.not27 = icmp slt i32 %74, %28
  %75 = select i1 %.not27, i32 0, i32 %28
  %spec.select = sub nsw i32 %74, %75
  %indvars.iv.next47 = add nsw i64 %indvars.iv46, 1
  %76 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %indvars.iv.next47
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = add nsw i32 %spec.select, %77
  %.not27.1 = icmp slt i32 %78, %28
  %79 = select i1 %.not27.1, i32 0, i32 %28
  %spec.select.1 = sub nsw i32 %78, %79
  %indvars.iv.next47.1 = add nsw i64 %indvars.iv46, 2
  %80 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %indvars.iv.next47.1
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = add nsw i32 %spec.select.1, %81
  %.not27.2 = icmp slt i32 %82, %28
  %83 = select i1 %.not27.2, i32 0, i32 %28
  %spec.select.2 = sub nsw i32 %82, %83
  %indvars.iv.next47.2 = add nsw i64 %indvars.iv46, 3
  %84 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %indvars.iv.next47.2
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = add nsw i32 %spec.select.2, %85
  %.not27.3 = icmp slt i32 %86, %28
  %87 = select i1 %.not27.3, i32 0, i32 %28
  %spec.select.3 = sub nsw i32 %86, %87
  %indvars.iv.next47.3 = add nsw i64 %indvars.iv46, 4
  %lftr.wideiv.3 = trunc i64 %indvars.iv.next47.3 to i32
  %exitcond49.not.3 = icmp eq i32 %30, %lftr.wideiv.3
  br i1 %exitcond49.not.3, label %._crit_edge39, label %.lr.ph38.new, !llvm.loop !17
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 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) #2

; 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 #3

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

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

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

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

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


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