; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/World Cup 2016/World Cup Round 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"

@t = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@n = external dso_local global i64, align 8
@dp = external dso_local global [35000 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

9:                                                ; preds = %169, %167, %17, %0
  %10 = load i32, ptr @t, align 4, !tbaa !5
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr @t, align 4, !tbaa !5
  %12 = icmp ne i32 %10, 0
  br i1 %12, label %13, label %170

13:                                               ; preds = %9
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @a, ptr noundef @b, ptr noundef @c)
  %15 = load i64, ptr @n, align 8, !tbaa !9
  %16 = icmp eq i64 %15, 1
  br i1 %16, label %17, label %19

17:                                               ; preds = %13
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %9, !llvm.loop !11

19:                                               ; preds = %13
  %20 = load i32, ptr @a, align 4, !tbaa !5
  %21 = load i32, ptr @b, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %23, label %24

23:                                               ; preds = %19
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @a, ptr noundef nonnull align 4 dereferenceable(4) @b) #4
  br label %24

24:                                               ; preds = %23, %19
  %25 = load i32, ptr @b, align 4, !tbaa !5
  %26 = load i32, ptr @c, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %28, label %29

28:                                               ; preds = %24
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @b, ptr noundef nonnull align 4 dereferenceable(4) @c) #4
  br label %29

29:                                               ; preds = %28, %24
  %30 = load i32, ptr @a, align 4, !tbaa !5
  %31 = load i32, ptr @b, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %29
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @a, ptr noundef nonnull align 4 dereferenceable(4) @b) #4
  br label %34

34:                                               ; preds = %33, %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %44, %34
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = load i32, ptr @c, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %47

40:                                               ; preds = %35
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %42
  store i64 1, ptr %43, align 8, !tbaa !9
  br label %44

44:                                               ; preds = %40
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %2, align 4, !tbaa !5
  br label %35, !llvm.loop !13

47:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 -1, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %48 = load i32, ptr @c, align 4, !tbaa !5
  store i32 %48, ptr %4, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %73, %47
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = load i32, ptr @b, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 7, ptr %5, align 4
  br label %76

54:                                               ; preds = %49
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = load i32, ptr @c, align 4, !tbaa !5
  %57 = sub nsw i32 %55, %56
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !9
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %62
  store i64 %60, ptr %63, align 8, !tbaa !9
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !9
  %68 = load i64, ptr @n, align 8, !tbaa !9
  %69 = icmp sge i64 %67, %68
  br i1 %69, label %70, label %72

70:                                               ; preds = %54
  %71 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %71, ptr %3, align 4, !tbaa !5
  store i32 7, ptr %5, align 4
  br label %76

72:                                               ; preds = %54
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %4, align 4, !tbaa !5
  br label %49, !llvm.loop !14

76:                                               ; preds = %70, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = icmp ne i32 %78, -1
  br i1 %79, label %80, label %83

80:                                               ; preds = %77
  %81 = load i32, ptr %3, align 4, !tbaa !5
  %82 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %81)
  store i32 2, ptr %5, align 4
  br label %167, !llvm.loop !11

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

85:                                               ; preds = %116, %83
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = load i32, ptr @a, align 4, !tbaa !5
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %85
  store i32 10, ptr %5, align 4
  br label %119

90:                                               ; preds = %85
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = load i32, ptr @b, align 4, !tbaa !5
  %93 = sub nsw i32 %91, %92
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !9
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = load i32, ptr @c, align 4, !tbaa !5
  %99 = sub nsw i32 %97, %98
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !9
  %103 = add nsw i64 %96, %102
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %105
  store i64 %103, ptr %106, align 8, !tbaa !9
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !9
  %111 = load i64, ptr @n, align 8, !tbaa !9
  %112 = icmp sge i64 %110, %111
  br i1 %112, label %113, label %115

113:                                              ; preds = %90
  %114 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %114, ptr %3, align 4, !tbaa !5
  store i32 10, ptr %5, align 4
  br label %119

115:                                              ; preds = %90
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %6, align 4, !tbaa !5
  br label %85, !llvm.loop !15

119:                                              ; preds = %113, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %3, align 4, !tbaa !5
  %122 = icmp ne i32 %121, -1
  br i1 %122, label %123, label %126

123:                                              ; preds = %120
  %124 = load i32, ptr %3, align 4, !tbaa !5
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %124)
  store i32 2, ptr %5, align 4
  br label %167, !llvm.loop !11

126:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %127 = load i32, ptr @a, align 4, !tbaa !5
  store i32 %127, ptr %7, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %161, %126
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = load i32, ptr @a, align 4, !tbaa !5
  %131 = sub nsw i32 %129, %130
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !9
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = load i32, ptr @b, align 4, !tbaa !5
  %137 = sub nsw i32 %135, %136
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %138
  %140 = load i64, ptr %139, align 8, !tbaa !9
  %141 = add nsw i64 %134, %140
  %142 = load i32, ptr %7, align 4, !tbaa !5
  %143 = load i32, ptr @c, align 4, !tbaa !5
  %144 = sub nsw i32 %142, %143
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %145
  %147 = load i64, ptr %146, align 8, !tbaa !9
  %148 = add nsw i64 %141, %147
  %149 = load i32, ptr %7, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %150
  store i64 %148, ptr %151, align 8, !tbaa !9
  %152 = load i32, ptr %7, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %153
  %155 = load i64, ptr %154, align 8, !tbaa !9
  %156 = load i64, ptr @n, align 8, !tbaa !9
  %157 = icmp sge i64 %155, %156
  br i1 %157, label %158, label %160

158:                                              ; preds = %128
  %159 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %159, ptr %3, align 4, !tbaa !5
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %164

160:                                              ; preds = %128
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %7, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %7, align 4, !tbaa !5
  br label %128, !llvm.loop !16

164:                                              ; preds = %158
  %165 = load i32, ptr %3, align 4, !tbaa !5
  %166 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %165)
  store i32 0, ptr %5, align 4
  br label %167

167:                                              ; preds = %164, %123, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  %168 = load i32, ptr %5, align 4
  switch i32 %168, label %171 [
    i32 0, label %169
    i32 2, label %9
  ]

169:                                              ; preds = %167
  br label %9, !llvm.loop !11

170:                                              ; preds = %9
  ret i32 0

171:                                              ; preds = %167
  unreachable
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

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 = { 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 #3 = { nocallback nofree nosync 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !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"

@t = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@n = external dso_local global i64, align 8
@dp = external dso_local local_unnamed_addr global [35000 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = 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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @t, align 4, !tbaa !5
  %.not56 = icmp eq i32 %2, 0
  br i1 %.not56, label %._crit_edge, label %.lr.ph57

.lr.ph57:                                         ; preds = %0, %.backedge
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @a, ptr noundef nonnull @b, ptr noundef nonnull @c)
  %5 = load i64, ptr @n, align 8, !tbaa !9
  %6 = icmp eq i64 %5, 1
  br i1 %6, label %7, label %11

7:                                                ; preds = %.lr.ph57
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %.backedge

.backedge:                                        ; preds = %43, %61, %77, %7
  %9 = load i32, ptr @t, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph57, !llvm.loop !11

11:                                               ; preds = %.lr.ph57
  %12 = load i32, ptr @a, align 4, !tbaa !5
  %13 = load i32, ptr @b, align 4, !tbaa !5
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %15, label %16

15:                                               ; preds = %11
  tail call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @a, ptr noundef nonnull align 4 dereferenceable(4) @b) #3
  %.pre = load i32, ptr @b, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %15, %11
  %17 = phi i32 [ %.pre, %15 ], [ %13, %11 ]
  %18 = load i32, ptr @c, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %20, label %21

20:                                               ; preds = %16
  tail call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @b, ptr noundef nonnull align 4 dereferenceable(4) @c) #3
  %.pre74 = load i32, ptr @b, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %20, %16
  %22 = phi i32 [ %.pre74, %20 ], [ %17, %16 ]
  %23 = load i32, ptr @a, align 4, !tbaa !5
  %24 = icmp slt i32 %23, %22
  br i1 %24, label %25, label %26

25:                                               ; preds = %21
  tail call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @a, ptr noundef nonnull align 4 dereferenceable(4) @b) #3
  br label %26

26:                                               ; preds = %25, %21
  %27 = load i32, ptr @c, align 4, !tbaa !5
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph.preheader, label %.preheader

.lr.ph.preheader:                                 ; preds = %26
  %wide.trip.count = zext nneg i32 %27 to i64
  %min.iters.check = icmp ult i32 %27, 4
  br i1 %min.iters.check, label %.lr.ph.preheader85, label %vector.ph

.lr.ph.preheader85:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %29 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %index
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  store <2 x i64> <i64 1, i64 1>, ptr %29, align 16, !tbaa !9
  store <2 x i64> <i64 1, i64 1>, ptr %30, align 16, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %31 = icmp eq i64 %index.next, %n.vec
  br i1 %31, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader, label %.lr.ph.preheader85

.preheader:                                       ; preds = %.lr.ph, %middle.block, %26
  %32 = load i32, ptr @b, align 4, !tbaa !5
  %33 = icmp slt i32 %27, %32
  %.pre75.pre = load i64, ptr @n, align 8, !tbaa !9
  br i1 %33, label %.lr.ph51, label %.thread

.lr.ph51:                                         ; preds = %.preheader
  %34 = sext i32 %27 to i64
  %wide.trip.count64 = sext i32 %32 to i64
  br label %36

.lr.ph:                                           ; preds = %.lr.ph.preheader85, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader85 ]
  %35 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %indvars.iv
  store i64 1, ptr %35, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph, !llvm.loop !16

36:                                               ; preds = %.lr.ph51, %41
  %indvars.iv61 = phi i64 [ %34, %.lr.ph51 ], [ %indvars.iv.next62, %41 ]
  %37 = sub nsw i64 %indvars.iv61, %34
  %38 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %indvars.iv61
  store i64 %39, ptr %40, align 8, !tbaa !9
  %.not33 = icmp slt i64 %39, %.pre75.pre
  br i1 %.not33, label %41, label %42

41:                                               ; preds = %36
  %indvars.iv.next62 = add nsw i64 %indvars.iv61, 1
  %exitcond65.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count64
  br i1 %exitcond65.not, label %.thread, label %36, !llvm.loop !17

42:                                               ; preds = %36
  %.not34 = icmp eq i64 %indvars.iv61, -1
  br i1 %.not34, label %.thread, label %43

43:                                               ; preds = %42
  %44 = trunc nsw i64 %indvars.iv61 to i32
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %44)
  br label %.backedge, !llvm.loop !11

.thread:                                          ; preds = %41, %.preheader, %42
  %46 = load i32, ptr @a, align 4, !tbaa !5
  %47 = icmp slt i32 %32, %46
  br i1 %47, label %.lr.ph54, label %.thread..thread40_crit_edge

.thread..thread40_crit_edge:                      ; preds = %.thread
  %.pre76 = sext i32 %46 to i64
  %.pre77 = sext i32 %32 to i64
  %.pre79 = sext i32 %27 to i64
  br label %.thread40

.lr.ph54:                                         ; preds = %.thread
  %48 = sext i32 %32 to i64
  %49 = sext i32 %27 to i64
  %wide.trip.count69 = sext i32 %46 to i64
  br label %50

50:                                               ; preds = %.lr.ph54, %59
  %indvars.iv66 = phi i64 [ %48, %.lr.ph54 ], [ %indvars.iv.next67, %59 ]
  %51 = sub nsw i64 %indvars.iv66, %48
  %52 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !9
  %54 = sub nsw i64 %indvars.iv66, %49
  %55 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !9
  %57 = add nsw i64 %56, %53
  %58 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %indvars.iv66
  store i64 %57, ptr %58, align 8, !tbaa !9
  %.not35 = icmp slt i64 %57, %.pre75.pre
  br i1 %.not35, label %59, label %60

59:                                               ; preds = %50
  %indvars.iv.next67 = add nsw i64 %indvars.iv66, 1
  %exitcond70.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count69
  br i1 %exitcond70.not, label %.thread40, label %50, !llvm.loop !18

60:                                               ; preds = %50
  %.not36 = icmp eq i64 %indvars.iv66, -1
  br i1 %.not36, label %.thread40, label %61

61:                                               ; preds = %60
  %62 = trunc nsw i64 %indvars.iv66 to i32
  %63 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %62)
  br label %.backedge, !llvm.loop !11

.thread40:                                        ; preds = %59, %.thread..thread40_crit_edge, %60
  %.pre-phi80 = phi i64 [ %.pre79, %.thread..thread40_crit_edge ], [ %49, %60 ], [ %49, %59 ]
  %.pre-phi78 = phi i64 [ %.pre77, %.thread..thread40_crit_edge ], [ %48, %60 ], [ %48, %59 ]
  %.pre-phi = phi i64 [ %.pre76, %.thread..thread40_crit_edge ], [ %wide.trip.count69, %60 ], [ %wide.trip.count69, %59 ]
  br label %64

64:                                               ; preds = %64, %.thread40
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %64 ], [ %.pre-phi, %.thread40 ]
  %65 = sub nsw i64 %indvars.iv71, %.pre-phi
  %66 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !9
  %68 = sub nsw i64 %indvars.iv71, %.pre-phi78
  %69 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !9
  %71 = add nsw i64 %70, %67
  %72 = sub nsw i64 %indvars.iv71, %.pre-phi80
  %73 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !9
  %75 = add nsw i64 %71, %74
  %76 = getelementptr inbounds [35000 x i64], ptr @dp, i64 0, i64 %indvars.iv71
  store i64 %75, ptr %76, align 8, !tbaa !9
  %.not37 = icmp slt i64 %75, %.pre75.pre
  %indvars.iv.next72 = add nsw i64 %indvars.iv71, 1
  br i1 %.not37, label %64, label %77, !llvm.loop !19

77:                                               ; preds = %64
  %78 = trunc nsw i64 %indvars.iv71 to i32
  %79 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %78)
  br label %.backedge

._crit_edge:                                      ; preds = %.backedge, %0
  ret i32 0
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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 = { 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 #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 = !{!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, !15, !14}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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