; LLVM IR from tangjz/acm-icpc :: self_training/2015-02-15 (H)

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

@n = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@f = external dso_local global [100001 x i32], align 16
@g = external dso_local global [100001 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @v)
  br label %10

10:                                               ; preds = %110, %0
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr @n, align 4, !tbaa !5
  %13 = icmp ne i32 %11, 0
  br i1 %13, label %14, label %111

14:                                               ; preds = %10
  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
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %16 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %16, ptr %6, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %32, %14
  %18 = load i32, ptr %6, align 4, !tbaa !5
  %19 = load i32, ptr @v, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %35

22:                                               ; preds = %17
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = sub nsw i32 %23, %24
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %30
  store i32 %28, ptr %31, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %22
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %6, align 4, !tbaa !5
  br label %17, !llvm.loop !9

35:                                               ; preds = %21
  br label %36

36:                                               ; preds = %80, %35
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr %2, align 4, !tbaa !5
  %39 = icmp ne i32 %37, 0
  br i1 %39, label %40, label %81

40:                                               ; preds = %36
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %42 = load i32, ptr @v, align 4, !tbaa !5
  store i32 %42, ptr %7, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %77, %40
  %44 = load i32, ptr %7, align 4, !tbaa !5
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = add nsw i32 %45, %46
  %48 = icmp sge i32 %44, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %80

50:                                               ; preds = %43
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = sub nsw i32 %55, %56
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = add nsw i32 %60, %61
  %63 = icmp slt i32 %54, %62
  br i1 %63, label %64, label %76

64:                                               ; preds = %50
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = sub nsw i32 %65, %66
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = add nsw i32 %70, %71
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %74
  store i32 %72, ptr %75, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %64, %50
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = add nsw i32 %78, -1
  store i32 %79, ptr %7, align 4, !tbaa !5
  br label %43, !llvm.loop !11

80:                                               ; preds = %49
  br label %36, !llvm.loop !12

81:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %82 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %82, ptr %8, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %107, %81
  %84 = load i32, ptr %8, align 4, !tbaa !5
  %85 = load i32, ptr @v, align 4, !tbaa !5
  %86 = icmp sle i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %110

88:                                               ; preds = %83
  %89 = load i32, ptr %8, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = icmp slt i32 %92, %96
  br i1 %97, label %98, label %106

98:                                               ; preds = %88
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %104
  store i32 %102, ptr %105, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %98, %88
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %8, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %8, align 4, !tbaa !5
  br label %83, !llvm.loop !13

110:                                              ; preds = %87
  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
  br label %10, !llvm.loop !14

111:                                              ; preds = %10
  %112 = load i32, ptr @v, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %115)
  ret i32 0
}

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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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 = { nounwind }

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

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


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

@n = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [100001 x i32], align 16
@g = external dso_local local_unnamed_addr global [100001 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind 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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @v)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = add nsw i32 %6, -1
  store i32 %7, ptr @n, align 4, !tbaa !5
  %.not36 = icmp eq i32 %6, 0
  br i1 %.not36, label %.._crit_edge39_crit_edge, label %.lr.ph38

.._crit_edge39_crit_edge:                         ; preds = %0
  %.pre = load i32, ptr @v, align 4, !tbaa !5
  br label %._crit_edge39

.lr.ph38:                                         ; preds = %0, %._crit_edge35
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2, ptr noundef nonnull %1)
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = load i32, ptr @v, align 4, !tbaa !5
  %.not2024 = icmp sgt i32 %9, %10
  br i1 %.not2024, label %.preheader, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph38
  %11 = sext i32 %9 to i64
  %12 = shl nsw i64 %11, 2
  %scevgep = getelementptr i8, ptr @g, i64 %12
  %13 = sub i32 %10, %9
  %14 = zext i32 %13 to i64
  %15 = shl nuw nsw i64 %14, 2
  %16 = add nuw nsw i64 %15, 4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep, ptr noundef nonnull align 16 dereferenceable(1) @f, i64 %16, i1 false), !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph.preheader, %.lr.ph38
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = add nsw i32 %17, -1
  store i32 %18, ptr %1, align 4, !tbaa !5
  %.not2129 = icmp eq i32 %17, 0
  br i1 %.not2129, label %._crit_edge, label %.lr.ph30

.loopexit:                                        ; preds = %99, %middle.block75, %.lr.ph30
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = add nsw i32 %19, -1
  store i32 %20, ptr %1, align 4, !tbaa !5
  %.not21 = icmp eq i32 %19, 0
  br i1 %.not21, label %._crit_edge, label %.lr.ph30, !llvm.loop !9

.lr.ph30:                                         ; preds = %.preheader, %.loopexit
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %22 = load i32, ptr @v, align 4, !tbaa !5
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = add nsw i32 %24, %23
  %.not2326 = icmp slt i32 %22, %25
  br i1 %.not2326, label %.loopexit, label %.lr.ph28

.lr.ph28:                                         ; preds = %.lr.ph30
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = sext i32 %22 to i64
  %28 = sext i32 %23 to i64
  %29 = sext i32 %25 to i64
  %30 = add nsw i64 %27, 1
  %31 = sub nsw i64 %30, %29
  %min.iters.check77 = icmp ult i64 %31, 28
  br i1 %min.iters.check77, label %scalar.ph76.preheader, label %vector.scevcheck

vector.scevcheck:                                 ; preds = %.lr.ph28
  %32 = sub nsw i64 %27, %29
  %33 = shl nsw i64 %27, 2
  %scevgep66 = getelementptr i8, ptr @g, i64 %33
  %mul.result.neg = mul nsw i64 %32, -4
  %34 = getelementptr i8, ptr %scevgep66, i64 %mul.result.neg
  %35 = icmp ugt ptr %34, %scevgep66
  %36 = sub nsw i64 %27, %28
  %37 = shl nsw i64 %36, 2
  %scevgep67 = getelementptr i8, ptr @g, i64 %37
  %mul.result69.neg = mul nsw i64 %32, -4
  %mul.overflow70 = icmp ugt i64 %32, 4611686018427387903
  %38 = getelementptr i8, ptr %scevgep67, i64 %mul.result69.neg
  %39 = icmp ugt ptr %38, %scevgep67
  %40 = or i1 %39, %mul.overflow70
  %41 = or i1 %35, %40
  br i1 %41, label %scalar.ph76.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %vector.scevcheck
  %42 = shl nsw i64 %29, 2
  %scevgep71 = getelementptr i8, ptr @g, i64 %42
  %43 = shl nsw i64 %27, 2
  %scevgep72 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @g, i64 4), i64 %43
  %44 = sext i32 %24 to i64
  %45 = shl nsw i64 %44, 2
  %scevgep73 = getelementptr i8, ptr @g, i64 %45
  %46 = sub nsw i64 %27, %28
  %47 = shl nsw i64 %46, 2
  %scevgep74 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @g, i64 4), i64 %47
  %bound0 = icmp ult ptr %scevgep71, %scevgep74
  %bound1 = icmp ult ptr %scevgep73, %scevgep72
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %scalar.ph76.preheader, label %vector.ph78

vector.ph78:                                      ; preds = %vector.memcheck
  %n.vec80 = and i64 %31, -8
  %ind.end81 = sub nsw i64 %27, %n.vec80
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %26, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body83

vector.body83:                                    ; preds = %pred.store.continue108, %vector.ph78
  %index84 = phi i64 [ 0, %vector.ph78 ], [ %index.next109, %pred.store.continue108 ]
  %offset.idx85 = sub i64 %27, %index84
  %48 = add i64 %offset.idx85, -4
  %49 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %offset.idx85
  %50 = getelementptr inbounds i8, ptr %49, i64 -12
  %51 = getelementptr inbounds i8, ptr %49, i64 -28
  %wide.load86 = load <4 x i32>, ptr %50, align 4, !tbaa !5, !alias.scope !11, !noalias !14
  %reverse = shufflevector <4 x i32> %wide.load86, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load87 = load <4 x i32>, ptr %51, align 4, !tbaa !5, !alias.scope !11, !noalias !14
  %reverse88 = shufflevector <4 x i32> %wide.load87, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %52 = sub nsw i64 %offset.idx85, %28
  %53 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %52
  %54 = getelementptr inbounds i8, ptr %53, i64 -12
  %55 = getelementptr inbounds i8, ptr %53, i64 -28
  %wide.load89 = load <4 x i32>, ptr %54, align 4, !tbaa !5, !alias.scope !14
  %reverse90 = shufflevector <4 x i32> %wide.load89, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load91 = load <4 x i32>, ptr %55, align 4, !tbaa !5, !alias.scope !14
  %reverse92 = shufflevector <4 x i32> %wide.load91, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %56 = add nsw <4 x i32> %broadcast.splat, %reverse90
  %57 = add nsw <4 x i32> %broadcast.splat, %reverse92
  %58 = icmp slt <4 x i32> %reverse, %56
  %59 = icmp slt <4 x i32> %reverse88, %57
  %60 = extractelement <4 x i1> %58, i64 0
  br i1 %60, label %pred.store.if93, label %pred.store.continue94

pred.store.if93:                                  ; preds = %vector.body83
  %61 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %offset.idx85
  %62 = extractelement <4 x i32> %56, i64 0
  store i32 %62, ptr %61, align 4, !tbaa !5, !alias.scope !11, !noalias !14
  br label %pred.store.continue94

pred.store.continue94:                            ; preds = %pred.store.if93, %vector.body83
  %63 = extractelement <4 x i1> %58, i64 1
  br i1 %63, label %pred.store.if95, label %pred.store.continue96

pred.store.if95:                                  ; preds = %pred.store.continue94
  %64 = add i64 %offset.idx85, -1
  %65 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %64
  %66 = extractelement <4 x i32> %56, i64 1
  store i32 %66, ptr %65, align 4, !tbaa !5, !alias.scope !11, !noalias !14
  br label %pred.store.continue96

pred.store.continue96:                            ; preds = %pred.store.if95, %pred.store.continue94
  %67 = extractelement <4 x i1> %58, i64 2
  br i1 %67, label %pred.store.if97, label %pred.store.continue98

pred.store.if97:                                  ; preds = %pred.store.continue96
  %68 = add i64 %offset.idx85, -2
  %69 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %68
  %70 = extractelement <4 x i32> %56, i64 2
  store i32 %70, ptr %69, align 4, !tbaa !5, !alias.scope !11, !noalias !14
  br label %pred.store.continue98

pred.store.continue98:                            ; preds = %pred.store.if97, %pred.store.continue96
  %71 = extractelement <4 x i1> %58, i64 3
  br i1 %71, label %pred.store.if99, label %pred.store.continue100

pred.store.if99:                                  ; preds = %pred.store.continue98
  %72 = add i64 %offset.idx85, -3
  %73 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %72
  %74 = extractelement <4 x i32> %56, i64 3
  store i32 %74, ptr %73, align 4, !tbaa !5, !alias.scope !11, !noalias !14
  br label %pred.store.continue100

pred.store.continue100:                           ; preds = %pred.store.if99, %pred.store.continue98
  %75 = extractelement <4 x i1> %59, i64 0
  br i1 %75, label %pred.store.if101, label %pred.store.continue102

pred.store.if101:                                 ; preds = %pred.store.continue100
  %76 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %48
  %77 = extractelement <4 x i32> %57, i64 0
  store i32 %77, ptr %76, align 4, !tbaa !5, !alias.scope !11, !noalias !14
  br label %pred.store.continue102

pred.store.continue102:                           ; preds = %pred.store.if101, %pred.store.continue100
  %78 = extractelement <4 x i1> %59, i64 1
  br i1 %78, label %pred.store.if103, label %pred.store.continue104

pred.store.if103:                                 ; preds = %pred.store.continue102
  %79 = add i64 %offset.idx85, -5
  %80 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %79
  %81 = extractelement <4 x i32> %57, i64 1
  store i32 %81, ptr %80, align 4, !tbaa !5, !alias.scope !11, !noalias !14
  br label %pred.store.continue104

pred.store.continue104:                           ; preds = %pred.store.if103, %pred.store.continue102
  %82 = extractelement <4 x i1> %59, i64 2
  br i1 %82, label %pred.store.if105, label %pred.store.continue106

pred.store.if105:                                 ; preds = %pred.store.continue104
  %83 = add i64 %offset.idx85, -6
  %84 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %83
  %85 = extractelement <4 x i32> %57, i64 2
  store i32 %85, ptr %84, align 4, !tbaa !5, !alias.scope !11, !noalias !14
  br label %pred.store.continue106

pred.store.continue106:                           ; preds = %pred.store.if105, %pred.store.continue104
  %86 = extractelement <4 x i1> %59, i64 3
  br i1 %86, label %pred.store.if107, label %pred.store.continue108

pred.store.if107:                                 ; preds = %pred.store.continue106
  %87 = add i64 %offset.idx85, -7
  %88 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %87
  %89 = extractelement <4 x i32> %57, i64 3
  store i32 %89, ptr %88, align 4, !tbaa !5, !alias.scope !11, !noalias !14
  br label %pred.store.continue108

pred.store.continue108:                           ; preds = %pred.store.if107, %pred.store.continue106
  %index.next109 = add nuw i64 %index84, 8
  %90 = icmp eq i64 %index.next109, %n.vec80
  br i1 %90, label %middle.block75, label %vector.body83, !llvm.loop !16

middle.block75:                                   ; preds = %pred.store.continue108
  %cmp.n110 = icmp eq i64 %31, %n.vec80
  br i1 %cmp.n110, label %.loopexit, label %scalar.ph76.preheader

scalar.ph76.preheader:                            ; preds = %middle.block75, %vector.memcheck, %vector.scevcheck, %.lr.ph28
  %indvars.iv.ph = phi i64 [ %27, %vector.memcheck ], [ %27, %vector.scevcheck ], [ %27, %.lr.ph28 ], [ %ind.end81, %middle.block75 ]
  br label %scalar.ph76

scalar.ph76:                                      ; preds = %scalar.ph76.preheader, %99
  %indvars.iv = phi i64 [ %indvars.iv.next, %99 ], [ %indvars.iv.ph, %scalar.ph76.preheader ]
  %91 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %indvars.iv
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sub nsw i64 %indvars.iv, %28
  %94 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = add nsw i32 %26, %95
  %97 = icmp slt i32 %92, %96
  br i1 %97, label %98, label %99

98:                                               ; preds = %scalar.ph76
  store i32 %96, ptr %91, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %scalar.ph76, %98
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %.not23.not = icmp sgt i64 %indvars.iv, %29
  br i1 %.not23.not, label %scalar.ph76, label %.loopexit, !llvm.loop !19

._crit_edge:                                      ; preds = %.loopexit, %.preheader
  %100 = phi i32 [ %10, %.preheader ], [ %22, %.loopexit ]
  %101 = phi i32 [ %9, %.preheader ], [ %24, %.loopexit ]
  %.not2231 = icmp sgt i32 %101, %100
  br i1 %.not2231, label %._crit_edge35, label %.lr.ph34.preheader

.lr.ph34.preheader:                               ; preds = %._crit_edge
  %102 = sext i32 %101 to i64
  %103 = add i32 %100, 1
  %104 = sub i32 %100, %101
  %105 = zext i32 %104 to i64
  %106 = add nuw nsw i64 %105, 1
  %min.iters.check = icmp ult i32 %104, 7
  br i1 %min.iters.check, label %.lr.ph34.preheader111, label %vector.ph

.lr.ph34.preheader111:                            ; preds = %middle.block, %.lr.ph34.preheader
  %indvars.iv42.ph = phi i64 [ %102, %.lr.ph34.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph34

vector.ph:                                        ; preds = %.lr.ph34.preheader
  %n.vec = and i64 %106, 8589934584
  %ind.end = add nsw i64 %n.vec, %102
  br label %vector.body

vector.body:                                      ; preds = %pred.store.continue65, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue65 ]
  %offset.idx = add i64 %index, %102
  %107 = add i64 %offset.idx, 4
  %108 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %offset.idx
  %109 = getelementptr inbounds i8, ptr %108, i64 16
  %wide.load = load <4 x i32>, ptr %108, align 4, !tbaa !5
  %wide.load49 = load <4 x i32>, ptr %109, align 4, !tbaa !5
  %110 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %offset.idx
  %111 = getelementptr inbounds i8, ptr %110, i64 16
  %wide.load50 = load <4 x i32>, ptr %110, align 4, !tbaa !5
  %wide.load51 = load <4 x i32>, ptr %111, align 4, !tbaa !5
  %112 = icmp slt <4 x i32> %wide.load, %wide.load50
  %113 = icmp slt <4 x i32> %wide.load49, %wide.load51
  %114 = extractelement <4 x i1> %112, i64 0
  br i1 %114, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body
  %115 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %offset.idx
  %116 = extractelement <4 x i32> %wide.load50, i64 0
  store i32 %116, ptr %115, align 4, !tbaa !5
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body
  %117 = extractelement <4 x i1> %112, i64 1
  br i1 %117, label %pred.store.if52, label %pred.store.continue53

pred.store.if52:                                  ; preds = %pred.store.continue
  %118 = add i64 %offset.idx, 1
  %119 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %118
  %120 = extractelement <4 x i32> %wide.load50, i64 1
  store i32 %120, ptr %119, align 4, !tbaa !5
  br label %pred.store.continue53

pred.store.continue53:                            ; preds = %pred.store.if52, %pred.store.continue
  %121 = extractelement <4 x i1> %112, i64 2
  br i1 %121, label %pred.store.if54, label %pred.store.continue55

pred.store.if54:                                  ; preds = %pred.store.continue53
  %122 = add i64 %offset.idx, 2
  %123 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %122
  %124 = extractelement <4 x i32> %wide.load50, i64 2
  store i32 %124, ptr %123, align 4, !tbaa !5
  br label %pred.store.continue55

pred.store.continue55:                            ; preds = %pred.store.if54, %pred.store.continue53
  %125 = extractelement <4 x i1> %112, i64 3
  br i1 %125, label %pred.store.if56, label %pred.store.continue57

pred.store.if56:                                  ; preds = %pred.store.continue55
  %126 = add i64 %offset.idx, 3
  %127 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %126
  %128 = extractelement <4 x i32> %wide.load50, i64 3
  store i32 %128, ptr %127, align 4, !tbaa !5
  br label %pred.store.continue57

pred.store.continue57:                            ; preds = %pred.store.if56, %pred.store.continue55
  %129 = extractelement <4 x i1> %113, i64 0
  br i1 %129, label %pred.store.if58, label %pred.store.continue59

pred.store.if58:                                  ; preds = %pred.store.continue57
  %130 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %107
  %131 = extractelement <4 x i32> %wide.load51, i64 0
  store i32 %131, ptr %130, align 4, !tbaa !5
  br label %pred.store.continue59

pred.store.continue59:                            ; preds = %pred.store.if58, %pred.store.continue57
  %132 = extractelement <4 x i1> %113, i64 1
  br i1 %132, label %pred.store.if60, label %pred.store.continue61

pred.store.if60:                                  ; preds = %pred.store.continue59
  %133 = add i64 %offset.idx, 5
  %134 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %133
  %135 = extractelement <4 x i32> %wide.load51, i64 1
  store i32 %135, ptr %134, align 4, !tbaa !5
  br label %pred.store.continue61

pred.store.continue61:                            ; preds = %pred.store.if60, %pred.store.continue59
  %136 = extractelement <4 x i1> %113, i64 2
  br i1 %136, label %pred.store.if62, label %pred.store.continue63

pred.store.if62:                                  ; preds = %pred.store.continue61
  %137 = add i64 %offset.idx, 6
  %138 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %137
  %139 = extractelement <4 x i32> %wide.load51, i64 2
  store i32 %139, ptr %138, align 4, !tbaa !5
  br label %pred.store.continue63

pred.store.continue63:                            ; preds = %pred.store.if62, %pred.store.continue61
  %140 = extractelement <4 x i1> %113, i64 3
  br i1 %140, label %pred.store.if64, label %pred.store.continue65

pred.store.if64:                                  ; preds = %pred.store.continue63
  %141 = add i64 %offset.idx, 7
  %142 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %141
  %143 = extractelement <4 x i32> %wide.load51, i64 3
  store i32 %143, ptr %142, align 4, !tbaa !5
  br label %pred.store.continue65

pred.store.continue65:                            ; preds = %pred.store.if64, %pred.store.continue63
  %index.next = add nuw i64 %index, 8
  %144 = icmp eq i64 %index.next, %n.vec
  br i1 %144, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %pred.store.continue65
  %cmp.n = icmp eq i64 %106, %n.vec
  br i1 %cmp.n, label %._crit_edge35, label %.lr.ph34.preheader111

._crit_edge35:                                    ; preds = %153, %middle.block, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  %145 = load i32, ptr @n, align 4, !tbaa !5
  %146 = add nsw i32 %145, -1
  store i32 %146, ptr @n, align 4, !tbaa !5
  %.not = icmp eq i32 %145, 0
  br i1 %.not, label %._crit_edge39, label %.lr.ph38, !llvm.loop !21

.lr.ph34:                                         ; preds = %.lr.ph34.preheader111, %153
  %indvars.iv42 = phi i64 [ %indvars.iv.next43, %153 ], [ %indvars.iv42.ph, %.lr.ph34.preheader111 ]
  %147 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv42
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %indvars.iv42
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = icmp slt i32 %148, %150
  br i1 %151, label %152, label %153

152:                                              ; preds = %.lr.ph34
  store i32 %150, ptr %147, align 4, !tbaa !5
  br label %153

153:                                              ; preds = %.lr.ph34, %152
  %indvars.iv.next43 = add nsw i64 %indvars.iv42, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next43 to i32
  %exitcond.not = icmp eq i32 %103, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge35, label %.lr.ph34, !llvm.loop !22

._crit_edge39:                                    ; preds = %._crit_edge35, %.._crit_edge39_crit_edge
  %154 = phi i32 [ %.pre, %.._crit_edge39_crit_edge ], [ %100, %._crit_edge35 ]
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %157)
  ret i32 0
}

; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!12}
!12 = distinct !{!12, !13}
!13 = distinct !{!13, !"LVerDomain"}
!14 = !{!15}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !10, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !10, !17}
!20 = distinct !{!20, !10, !17, !18}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !18, !17}


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