; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/Random/TASUMOBC/A.ll (Z3getx)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@dp = external dso_local global [40 x [3 x [2 x i64]]], align 16

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4itovx(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, i64 noundef) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z1Cii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z3getx(i64 noundef %0) #0 {
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %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
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store i64 %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #4
  %17 = load i64, ptr %2, align 8, !tbaa !5
  call void @_Z4itovx(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %3, i64 noundef %17)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %18 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr %4, align 4, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 16 @dp, i8 0, i64 1920, i1 false)
  store i64 1, ptr getelementptr inbounds ([2 x i64], ptr getelementptr inbounds ([3 x [2 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 1), align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %115, %1
  %21 = load i32, ptr %5, align 4, !tbaa !9
  %22 = load i32, ptr %4, align 4, !tbaa !9
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %118

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %111, %25
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = icmp slt i32 %27, 3
  br i1 %28, label %30, label %29

29:                                               ; preds = %26
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %114

30:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %107, %30
  %32 = load i32, ptr %8, align 4, !tbaa !9
  %33 = icmp slt i32 %32, 2
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %36 = load i32, ptr %5, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %37
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [3 x [2 x i64]], ptr %38, i64 0, i64 %40
  %42 = load i32, ptr %8, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [2 x i64], ptr %41, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !5
  store i64 %45, ptr %9, align 8, !tbaa !5
  %46 = load i64, ptr %9, align 8, !tbaa !5
  %47 = icmp ne i64 %46, 0
  br i1 %47, label %49, label %48

48:                                               ; preds = %35
  store i32 10, ptr %6, align 4
  br label %104

49:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %57

52:                                               ; preds = %49
  %53 = load i32, ptr %5, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %54) #4
  %56 = load i32, ptr %55, align 4, !tbaa !9
  br label %58

57:                                               ; preds = %49
  br label %58

58:                                               ; preds = %57, %52
  %59 = phi i32 [ %56, %52 ], [ 2, %57 ]
  store i32 %59, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %100, %58
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = icmp sle i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %103

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %66 = load i32, ptr %8, align 4, !tbaa !9
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %75

68:                                               ; preds = %65
  %69 = load i32, ptr %11, align 4, !tbaa !9
  %70 = load i32, ptr %5, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %71) #4
  %73 = load i32, ptr %72, align 4, !tbaa !9
  %74 = icmp eq i32 %69, %73
  br label %75

75:                                               ; preds = %68, %65
  %76 = phi i1 [ false, %65 ], [ %74, %68 ]
  %77 = zext i1 %76 to i32
  store i32 %77, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %78 = load i32, ptr %7, align 4, !tbaa !9
  %79 = load i32, ptr %5, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %80) #4
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = load i32, ptr %11, align 4, !tbaa !9
  %84 = call noundef i32 @_Z1Cii(i32 noundef %82, i32 noundef %83)
  %85 = mul nsw i32 %78, %84
  %86 = srem i32 %85, 3
  store i32 %86, ptr %13, align 4, !tbaa !9
  %87 = load i64, ptr %9, align 8, !tbaa !5
  %88 = load i32, ptr %5, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %90
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [3 x [2 x i64]], ptr %91, i64 0, i64 %93
  %95 = load i32, ptr %12, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [2 x i64], ptr %94, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !5
  %99 = add nsw i64 %98, %87
  store i64 %99, ptr %97, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %100

100:                                              ; preds = %75
  %101 = load i32, ptr %11, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %11, align 4, !tbaa !9
  br label %60, !llvm.loop !11

103:                                              ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  store i32 0, ptr %6, align 4
  br label %104

104:                                              ; preds = %103, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %105 = load i32, ptr %6, align 4
  switch i32 %105, label %160 [
    i32 0, label %106
    i32 10, label %107
  ]

106:                                              ; preds = %104
  br label %107

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

110:                                              ; preds = %34
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %7, align 4, !tbaa !9
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %7, align 4, !tbaa !9
  br label %26, !llvm.loop !14

114:                                              ; preds = %29
  br label %115

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

118:                                              ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  store i64 0, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %155, %118
  %120 = load i32, ptr %15, align 4, !tbaa !9
  %121 = icmp slt i32 %120, 2
  br i1 %121, label %123, label %122

122:                                              ; preds = %119
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %158

123:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 1, ptr %16, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %151, %123
  %125 = load i32, ptr %16, align 4, !tbaa !9
  %126 = icmp slt i32 %125, 3
  br i1 %126, label %128, label %127

127:                                              ; preds = %124
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %154

128:                                              ; preds = %124
  %129 = load i32, ptr %4, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %130
  %132 = load i32, ptr %16, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [3 x [2 x i64]], ptr %131, i64 0, i64 %133
  %135 = load i32, ptr %15, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [2 x i64], ptr %134, i64 0, i64 %136
  %138 = load i64, ptr %137, align 8, !tbaa !5
  %139 = load i32, ptr %16, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = mul nsw i64 %138, %140
  %142 = srem i64 %141, 1000000007
  %143 = load i64, ptr %14, align 8, !tbaa !5
  %144 = add nsw i64 %143, %142
  store i64 %144, ptr %14, align 8, !tbaa !5
  %145 = load i64, ptr %14, align 8, !tbaa !5
  %146 = icmp sge i64 %145, 1000000007
  br i1 %146, label %147, label %150

147:                                              ; preds = %128
  %148 = load i64, ptr %14, align 8, !tbaa !5
  %149 = sub nsw i64 %148, 1000000007
  store i64 %149, ptr %14, align 8, !tbaa !5
  br label %150

150:                                              ; preds = %147, %128
  br label %151

151:                                              ; preds = %150
  %152 = load i32, ptr %16, align 4, !tbaa !9
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %16, align 4, !tbaa !9
  br label %124, !llvm.loop !16

154:                                              ; preds = %127
  br label %155

155:                                              ; preds = %154
  %156 = load i32, ptr %15, align 4, !tbaa !9
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %15, align 4, !tbaa !9
  br label %119, !llvm.loop !17

158:                                              ; preds = %122
  %159 = load i64, ptr %14, align 8, !tbaa !5
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #4
  ret i64 %159

160:                                              ; preds = %104
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

attributes #0 = { mustprogress 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 = { 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 nounwind willreturn memory(argmem: write) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !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}
!17 = distinct !{!17, !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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@dp = external dso_local local_unnamed_addr global [40 x [3 x [2 x i64]]], align 16

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4itovx(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, i64 noundef) local_unnamed_addr #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z1Cii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z3getx(i64 noundef %0) local_unnamed_addr #0 {
  %2 = alloca %"class.std::vector", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #4
  call void @_Z4itovx(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %2, i64 noundef %0)
  %3 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %4 = trunc i64 %3 to i32
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1920) @dp, i8 0, i64 1920, i1 false)
  store i64 1, ptr getelementptr inbounds (i8, ptr @dp, i64 24), align 8, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.preheader53.preheader, label %.preheader51

.preheader53.preheader:                           ; preds = %1
  %wide.trip.count = and i64 %3, 2147483647
  br label %.preheader53

.preheader53:                                     ; preds = %.preheader53.preheader, %.loopexit.1.1
  %indvars.iv = phi i64 [ 0, %.preheader53.preheader ], [ %indvars.iv.next, %.loopexit.1.1 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %6 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv, i64 1, i64 0
  %7 = load i64, ptr %6, align 16, !tbaa !5
  %.not = icmp eq i64 %7, 0
  br i1 %.not, label %.loopexit, label %.lr.ph.split.us

.preheader51:                                     ; preds = %.loopexit.1.1, %1
  %sext = shl i64 %3, 32
  %8 = ashr exact i64 %sext, 32
  %9 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %8, i64 1, i64 0
  %10 = load i64, ptr %9, align 16, !tbaa !5
  %11 = srem i64 %10, 1000000007
  %12 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %8, i64 2, i64 0
  %13 = load i64, ptr %12, align 16, !tbaa !5
  %14 = shl nsw i64 %13, 1
  %15 = srem i64 %14, 1000000007
  %16 = add nsw i64 %15, %11
  %17 = icmp sgt i64 %16, 1000000006
  %18 = add nsw i64 %16, -1000000007
  %spec.select.1 = select i1 %17, i64 %18, i64 %16
  %19 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %8, i64 1, i64 1
  %20 = load i64, ptr %19, align 8, !tbaa !5
  %21 = srem i64 %20, 1000000007
  %22 = add nsw i64 %21, %spec.select.1
  %23 = icmp sgt i64 %22, 1000000006
  %24 = add nsw i64 %22, -1000000007
  %spec.select.184 = select i1 %23, i64 %24, i64 %22
  %25 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %8, i64 2, i64 1
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = shl nsw i64 %26, 1
  %28 = srem i64 %27, 1000000007
  %29 = add nsw i64 %28, %spec.select.184
  %30 = icmp sgt i64 %29, 1000000006
  %31 = add nsw i64 %29, -1000000007
  %spec.select.1.1 = select i1 %30, i64 %31, i64 %29
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #4
  ret i64 %spec.select.1.1

.lr.ph.split.us:                                  ; preds = %.preheader53
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = call noundef i32 @_Z1Cii(i32 noundef %33, i32 noundef 0)
  %35 = srem i32 %34, 3
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next, i64 %36, i64 0
  %38 = load i64, ptr %37, align 16, !tbaa !5
  %39 = add nsw i64 %38, %7
  store i64 %39, ptr %37, align 16, !tbaa !5
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %41 = load i32, ptr %40, align 4, !tbaa !9
  %42 = call noundef i32 @_Z1Cii(i32 noundef %41, i32 noundef 1)
  %43 = srem i32 %42, 3
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next, i64 %44, i64 0
  %46 = load i64, ptr %45, align 16, !tbaa !5
  %47 = add nsw i64 %46, %7
  store i64 %47, ptr %45, align 16, !tbaa !5
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = call noundef i32 @_Z1Cii(i32 noundef %49, i32 noundef 2)
  %51 = srem i32 %50, 3
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next, i64 %52, i64 0
  %54 = load i64, ptr %53, align 16, !tbaa !5
  %55 = add nsw i64 %54, %7
  store i64 %55, ptr %53, align 16, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph.split.us, %.preheader53
  %56 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv, i64 1, i64 1
  %57 = load i64, ptr %56, align 8, !tbaa !5
  %.not.1 = icmp eq i64 %57, 0
  br i1 %.not.1, label %.loopexit.1, label %58

58:                                               ; preds = %.loopexit
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %.not5054.1 = icmp slt i32 %60, 0
  br i1 %.not5054.1, label %.loopexit.1, label %.lr.ph.split.1

.lr.ph.split.1:                                   ; preds = %58, %.lr.ph.split.1
  %.04255.1 = phi i32 [ %73, %.lr.ph.split.1 ], [ 0, %58 ]
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = icmp eq i32 %.04255.1, %62
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = call noundef i32 @_Z1Cii(i32 noundef %65, i32 noundef %.04255.1)
  %67 = srem i32 %66, 3
  %68 = sext i32 %67 to i64
  %69 = zext i1 %63 to i64
  %70 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next, i64 %68, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !5
  %72 = add nsw i64 %71, %57
  store i64 %72, ptr %70, align 8, !tbaa !5
  %73 = add nuw i32 %.04255.1, 1
  %exitcond.1.not = icmp eq i32 %.04255.1, %60
  br i1 %exitcond.1.not, label %.loopexit.1, label %.lr.ph.split.1, !llvm.loop !11

.loopexit.1:                                      ; preds = %.lr.ph.split.1, %58, %.loopexit
  %74 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv, i64 2, i64 0
  %75 = load i64, ptr %74, align 16, !tbaa !5
  %.not.167 = icmp eq i64 %75, 0
  br i1 %.not.167, label %.loopexit.174, label %.lr.ph.split.us.1

.lr.ph.split.us.1:                                ; preds = %.loopexit.1
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = call noundef i32 @_Z1Cii(i32 noundef %77, i32 noundef 0)
  %79 = shl nsw i32 %78, 1
  %80 = srem i32 %79, 3
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next, i64 %81, i64 0
  %83 = load i64, ptr %82, align 16, !tbaa !5
  %84 = add nsw i64 %83, %75
  store i64 %84, ptr %82, align 16, !tbaa !5
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %86 = load i32, ptr %85, align 4, !tbaa !9
  %87 = call noundef i32 @_Z1Cii(i32 noundef %86, i32 noundef 1)
  %88 = shl nsw i32 %87, 1
  %89 = srem i32 %88, 3
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next, i64 %90, i64 0
  %92 = load i64, ptr %91, align 16, !tbaa !5
  %93 = add nsw i64 %92, %75
  store i64 %93, ptr %91, align 16, !tbaa !5
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %95 = load i32, ptr %94, align 4, !tbaa !9
  %96 = call noundef i32 @_Z1Cii(i32 noundef %95, i32 noundef 2)
  %97 = shl nsw i32 %96, 1
  %98 = srem i32 %97, 3
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next, i64 %99, i64 0
  %101 = load i64, ptr %100, align 16, !tbaa !5
  %102 = add nsw i64 %101, %75
  store i64 %102, ptr %100, align 16, !tbaa !5
  br label %.loopexit.174

.loopexit.174:                                    ; preds = %.lr.ph.split.us.1, %.loopexit.1
  %103 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv, i64 2, i64 1
  %104 = load i64, ptr %103, align 8, !tbaa !5
  %.not.1.1 = icmp eq i64 %104, 0
  br i1 %.not.1.1, label %.loopexit.1.1, label %105

105:                                              ; preds = %.loopexit.174
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %107 = load i32, ptr %106, align 4, !tbaa !9
  %.not5054.1.1 = icmp slt i32 %107, 0
  br i1 %.not5054.1.1, label %.loopexit.1.1, label %.lr.ph.split.1.1

.lr.ph.split.1.1:                                 ; preds = %105, %.lr.ph.split.1.1
  %.04255.1.1 = phi i32 [ %121, %.lr.ph.split.1.1 ], [ 0, %105 ]
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = icmp eq i32 %.04255.1.1, %109
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = call noundef i32 @_Z1Cii(i32 noundef %112, i32 noundef %.04255.1.1)
  %114 = shl nsw i32 %113, 1
  %115 = srem i32 %114, 3
  %116 = sext i32 %115 to i64
  %117 = zext i1 %110 to i64
  %118 = getelementptr inbounds [40 x [3 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next, i64 %116, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !5
  %120 = add nsw i64 %119, %104
  store i64 %120, ptr %118, align 8, !tbaa !5
  %121 = add nuw i32 %.04255.1.1, 1
  %exitcond.1.1.not = icmp eq i32 %.04255.1.1, %107
  br i1 %exitcond.1.1.not, label %.loopexit.1.1, label %.lr.ph.split.1.1, !llvm.loop !11

.loopexit.1.1:                                    ; preds = %.lr.ph.split.1.1, %105, %.loopexit.174
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader51, label %.preheader53, !llvm.loop !13
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress 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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass