; LLVM IR from upupming/algorithm :: acwing/日常刷题/数位DP/1086. 恨7不成妻.ll (Z2dpx)

; 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 }
%struct.F = type { i32, i32, i32 }

@pow7 = external dso_local global [20 x i32], align 16
@powP = external dso_local global [20 x i64], align 16

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { i64, i32 } @_Z3getiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z2dpx(i64 noundef %0) #3 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %struct.F, align 4
  %20 = alloca { i64, i32 }, align 8
  store i64 %0, ptr %3, align 8, !tbaa !5
  %21 = load i64, ptr %3, align 8, !tbaa !5
  %22 = icmp eq i64 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %1
  store i32 0, ptr %2, align 4
  br label %176

24:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #4
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %25 = load i64, ptr %3, align 8, !tbaa !5
  %26 = srem i64 %25, 1000000007
  store i64 %26, ptr %5, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %34, %24
  %28 = load i64, ptr %3, align 8, !tbaa !5
  %29 = icmp ne i64 %28, 0
  br i1 %29, label %30, label %41

30:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %31 = load i64, ptr %3, align 8, !tbaa !5
  %32 = srem i64 %31, 10
  %33 = trunc i64 %32 to i32
  store i32 %33, ptr %6, align 4, !tbaa !9
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %34 unwind label %37

34:                                               ; preds = %30
  %35 = load i64, ptr %3, align 8, !tbaa !5
  %36 = sdiv i64 %35, 10
  store i64 %36, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %27, !llvm.loop !11

37:                                               ; preds = %30
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %7, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #4
  br label %178

41:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %42 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %43 = trunc i64 %42 to i32
  store i32 %43, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i64 0, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store i64 0, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = sub nsw i32 %44, 1
  store i32 %45, ptr %13, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %170, %41
  %47 = load i32, ptr %13, align 4, !tbaa !9
  %48 = icmp sge i32 %47, 0
  br i1 %48, label %50, label %49

49:                                               ; preds = %46
  store i32 4, ptr %14, align 4
  br label %173

50:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %51 = load i32, ptr %13, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %52) #4
  %54 = load i32, ptr %53, align 4, !tbaa !9
  store i32 %54, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %131, %50
  %56 = load i32, ptr %16, align 4, !tbaa !9
  %57 = load i32, ptr %15, align 4, !tbaa !9
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 7, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %134

60:                                               ; preds = %55
  %61 = load i32, ptr %16, align 4, !tbaa !9
  %62 = icmp eq i32 %61, 7
  br i1 %62, label %63, label %64

63:                                               ; preds = %60
  br label %131

64:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %65 = load i64, ptr %11, align 8, !tbaa !5
  %66 = sub nsw i64 0, %65
  %67 = load i32, ptr %13, align 4, !tbaa !9
  %68 = add nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [20 x i32], ptr @pow7, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = mul nsw i64 %66, %72
  %74 = call noundef i32 @_Z3modxx(i64 noundef %73, i64 noundef 7)
  store i32 %74, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %75 = load i64, ptr %12, align 8, !tbaa !5
  %76 = sub nsw i64 0, %75
  %77 = call noundef i32 @_Z3modxx(i64 noundef %76, i64 noundef 7)
  store i32 %77, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #4
  %78 = load i32, ptr %13, align 4, !tbaa !9
  %79 = add nsw i32 %78, 1
  %80 = load i32, ptr %16, align 4, !tbaa !9
  %81 = load i32, ptr %17, align 4, !tbaa !9
  %82 = load i32, ptr %18, align 4, !tbaa !9
  %83 = call { i64, i32 } @_Z3getiiii(i32 noundef %79, i32 noundef %80, i32 noundef %81, i32 noundef %82)
  store { i64, i32 } %83, ptr %20, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 8 %20, i64 12, i1 false)
  %84 = load i32, ptr %10, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = load i64, ptr %11, align 8, !tbaa !5
  %87 = srem i64 %86, 1000000007
  %88 = load i64, ptr %11, align 8, !tbaa !5
  %89 = srem i64 %88, 1000000007
  %90 = mul nsw i64 %87, %89
  %91 = srem i64 %90, 1000000007
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [20 x i64], ptr @powP, i64 0, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !5
  %97 = mul nsw i64 %91, %96
  %98 = srem i64 %97, 1000000007
  %99 = load i32, ptr %13, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [20 x i64], ptr @powP, i64 0, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !5
  %104 = mul nsw i64 %98, %103
  %105 = srem i64 %104, 1000000007
  %106 = getelementptr inbounds %struct.F, ptr %19, i32 0, i32 0
  %107 = load i32, ptr %106, align 4, !tbaa !13
  %108 = sext i32 %107 to i64
  %109 = mul nsw i64 %105, %108
  %110 = add nsw i64 %85, %109
  %111 = load i64, ptr %11, align 8, !tbaa !5
  %112 = mul nsw i64 2, %111
  %113 = srem i64 %112, 1000000007
  %114 = load i32, ptr %13, align 4, !tbaa !9
  %115 = add nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [20 x i64], ptr @powP, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !5
  %119 = mul nsw i64 %113, %118
  %120 = srem i64 %119, 1000000007
  %121 = getelementptr inbounds %struct.F, ptr %19, i32 0, i32 1
  %122 = load i32, ptr %121, align 4, !tbaa !15
  %123 = sext i32 %122 to i64
  %124 = mul nsw i64 %120, %123
  %125 = add nsw i64 %110, %124
  %126 = getelementptr inbounds %struct.F, ptr %19, i32 0, i32 2
  %127 = load i32, ptr %126, align 4, !tbaa !16
  %128 = sext i32 %127 to i64
  %129 = add nsw i64 %125, %128
  %130 = call noundef i32 @_Z3modxx(i64 noundef %129, i64 noundef 1000000007)
  store i32 %130, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %131

131:                                              ; preds = %64, %63
  %132 = load i32, ptr %16, align 4, !tbaa !9
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %16, align 4, !tbaa !9
  br label %55, !llvm.loop !17

134:                                              ; preds = %59
  %135 = load i32, ptr %15, align 4, !tbaa !9
  %136 = icmp eq i32 %135, 7
  br i1 %136, label %137, label %138

137:                                              ; preds = %134
  store i32 4, ptr %14, align 4
  br label %167

138:                                              ; preds = %134
  %139 = load i64, ptr %11, align 8, !tbaa !5
  %140 = mul nsw i64 %139, 10
  %141 = load i32, ptr %15, align 4, !tbaa !9
  %142 = sext i32 %141 to i64
  %143 = add nsw i64 %140, %142
  store i64 %143, ptr %11, align 8, !tbaa !5
  %144 = load i32, ptr %15, align 4, !tbaa !9
  %145 = sext i32 %144 to i64
  %146 = load i64, ptr %12, align 8, !tbaa !5
  %147 = add nsw i64 %146, %145
  store i64 %147, ptr %12, align 8, !tbaa !5
  %148 = load i32, ptr %13, align 4, !tbaa !9
  %149 = icmp eq i32 %148, 0
  br i1 %149, label %150, label %166

150:                                              ; preds = %138
  %151 = load i64, ptr %11, align 8, !tbaa !5
  %152 = srem i64 %151, 7
  %153 = icmp ne i64 %152, 0
  br i1 %153, label %154, label %166

154:                                              ; preds = %150
  %155 = load i64, ptr %12, align 8, !tbaa !5
  %156 = srem i64 %155, 7
  %157 = icmp ne i64 %156, 0
  br i1 %157, label %158, label %166

158:                                              ; preds = %154
  %159 = load i32, ptr %10, align 4, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = load i64, ptr %5, align 8, !tbaa !5
  %162 = load i64, ptr %5, align 8, !tbaa !5
  %163 = mul nsw i64 %161, %162
  %164 = add nsw i64 %160, %163
  %165 = call noundef i32 @_Z3modxx(i64 noundef %164, i64 noundef 1000000007)
  store i32 %165, ptr %10, align 4, !tbaa !9
  br label %166

166:                                              ; preds = %158, %154, %150, %138
  store i32 0, ptr %14, align 4
  br label %167

167:                                              ; preds = %166, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  %168 = load i32, ptr %14, align 4
  switch i32 %168, label %173 [
    i32 0, label %169
  ]

169:                                              ; preds = %167
  br label %170

170:                                              ; preds = %169
  %171 = load i32, ptr %13, align 4, !tbaa !9
  %172 = add nsw i32 %171, -1
  store i32 %172, ptr %13, align 4, !tbaa !9
  br label %46, !llvm.loop !18

173:                                              ; preds = %167, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %174

174:                                              ; preds = %173
  %175 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %175, ptr %2, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #4
  br label %176

176:                                              ; preds = %174, %23
  %177 = load i32, ptr %2, align 4
  ret i32 %177

178:                                              ; preds = %37
  %179 = load ptr, ptr %7, align 8
  %180 = load i32, ptr %8, align 4
  %181 = insertvalue { ptr, i32 } poison, ptr %179, 0
  %182 = insertvalue { ptr, i32 } %181, i32 %180, 1
  resume { ptr, i32 } %182
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

declare i32 @__gxx_personality_v0(...)

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

; 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) #0 align 2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = !{!14, !10, i64 0}
!14 = !{!"_ZTS1F", !10, i64 0, !10, i64 4, !10, i64 8}
!15 = !{!14, !10, i64 4}
!16 = !{!14, !10, i64 8}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !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 }

@pow7 = external dso_local local_unnamed_addr global [20 x i32], align 16
@powP = external dso_local local_unnamed_addr global [20 x i64], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3modxx(i64 noundef, 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 { i64, i32 } @_Z3getiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z2dpx(i64 noundef %0) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca i32, align 4
  %4 = icmp eq i64 %0, 0
  br i1 %4, label %74, label %5

5:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #3
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %6 = srem i64 %0, 1000000007
  br label %7

7:                                                ; preds = %5, %11
  %.04362 = phi i64 [ %0, %5 ], [ %9, %11 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %8 = srem i64 %.04362, 10
  %9 = sdiv i64 %.04362, 10
  %10 = trunc nsw i64 %8 to i32
  store i32 %10, ptr %3, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %11 unwind label %12

11:                                               ; preds = %7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  %.04362.off = add i64 %.04362, 9
  %.not = icmp ult i64 %.04362.off, 19
  br i1 %.not, label %14, label %7, !llvm.loop !9

12:                                               ; preds = %7
  %13 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #3
  resume { ptr, i32 } %13

14:                                               ; preds = %11
  %15 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %16 = trunc i64 %15 to i32
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph72, label %.thread

.lr.ph72:                                         ; preds = %14
  %18 = mul nsw i64 %6, %6
  %19 = and i64 %15, 2147483647
  br label %20

20:                                               ; preds = %.lr.ph72, %72
  %indvars.iv = phi i64 [ %19, %.lr.ph72 ], [ %indvars.iv.next, %72 ]
  %.04469 = phi i32 [ 0, %.lr.ph72 ], [ %.1.lcssa79, %72 ]
  %.04568 = phi i64 [ 0, %.lr.ph72 ], [ %64, %72 ]
  %.04767 = phi i64 [ 0, %.lr.ph72 ], [ %65, %72 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %21 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv.next) #3
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %20
  %24 = getelementptr inbounds [20 x i32], ptr @pow7, i64 0, i64 %indvars.iv
  %25 = sub nsw i64 0, %.04767
  %26 = srem i64 %.04568, 1000000007
  %27 = mul nsw i64 %26, %26
  %28 = urem i64 %27, 1000000007
  %29 = getelementptr inbounds [20 x i64], ptr @powP, i64 0, i64 %indvars.iv
  %30 = shl nsw i64 %.04568, 1
  %31 = srem i64 %30, 1000000007
  %32 = trunc nuw nsw i64 %indvars.iv to i32
  br label %33

._crit_edge:                                      ; preds = %60
  %.not56 = icmp eq i32 %22, 7
  br i1 %.not56, label %.thread, label %._crit_edge.thread

33:                                               ; preds = %.lr.ph, %60
  %.164 = phi i32 [ %.04469, %.lr.ph ], [ %.2, %60 ]
  %.05063 = phi i32 [ 0, %.lr.ph ], [ %61, %60 ]
  %34 = icmp eq i32 %.05063, 7
  br i1 %34, label %60, label %35

35:                                               ; preds = %33
  %36 = load i32, ptr %24, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = mul i64 %.04568, %37
  %39 = sub i64 0, %38
  %40 = call noundef i32 @_Z3modxx(i64 noundef %39, i64 noundef 7)
  %41 = call noundef i32 @_Z3modxx(i64 noundef %25, i64 noundef 7)
  %42 = call { i64, i32 } @_Z3getiiii(i32 noundef %32, i32 noundef %.05063, i32 noundef %40, i32 noundef %41)
  %.fca.0.extract = extractvalue { i64, i32 } %42, 0
  %.fca.1.extract = extractvalue { i64, i32 } %42, 1
  %43 = sext i32 %.164 to i64
  %44 = load i64, ptr %29, align 8, !tbaa !11
  %45 = mul nsw i64 %44, %28
  %46 = srem i64 %45, 1000000007
  %47 = mul nsw i64 %46, %44
  %48 = srem i64 %47, 1000000007
  %sext = shl i64 %.fca.0.extract, 32
  %49 = ashr exact i64 %sext, 32
  %50 = mul nsw i64 %48, %49
  %51 = mul nsw i64 %44, %31
  %52 = srem i64 %51, 1000000007
  %53 = ashr i64 %.fca.0.extract, 32
  %54 = mul nsw i64 %52, %53
  %55 = sext i32 %.fca.1.extract to i64
  %56 = add nsw i64 %55, %43
  %57 = add nsw i64 %56, %54
  %58 = add nsw i64 %57, %50
  %59 = call noundef i32 @_Z3modxx(i64 noundef %58, i64 noundef 1000000007)
  br label %60

60:                                               ; preds = %33, %35
  %.2 = phi i32 [ %.164, %33 ], [ %59, %35 ]
  %61 = add nuw nsw i32 %.05063, 1
  %exitcond.not = icmp eq i32 %61, %22
  br i1 %exitcond.not, label %._crit_edge, label %33, !llvm.loop !13

._crit_edge.thread:                               ; preds = %20, %._crit_edge
  %.1.lcssa79 = phi i32 [ %.2, %._crit_edge ], [ %.04469, %20 ]
  %62 = mul nsw i64 %.04568, 10
  %63 = sext i32 %22 to i64
  %64 = add nsw i64 %62, %63
  %65 = add nsw i64 %.04767, %63
  %66 = icmp ne i64 %indvars.iv.next, 0
  %67 = srem i64 %64, 7
  %.not54 = icmp eq i64 %67, 0
  %or.cond = select i1 %66, i1 true, i1 %.not54
  %68 = srem i64 %65, 7
  %.not55 = icmp eq i64 %68, 0
  %or.cond58 = select i1 %or.cond, i1 true, i1 %.not55
  br i1 %or.cond58, label %72, label %.thread80

.thread80:                                        ; preds = %._crit_edge.thread
  %69 = sext i32 %.1.lcssa79 to i64
  %70 = add nsw i64 %18, %69
  %71 = call noundef i32 @_Z3modxx(i64 noundef %70, i64 noundef 1000000007)
  br label %.thread

72:                                               ; preds = %._crit_edge.thread
  %73 = icmp sgt i64 %indvars.iv, 1
  br i1 %73, label %20, label %.thread, !llvm.loop !14

.thread:                                          ; preds = %72, %._crit_edge, %.thread80, %14
  %.5 = phi i32 [ 0, %14 ], [ %71, %.thread80 ], [ %.2, %._crit_edge ], [ %.1.lcssa79, %72 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #3
  br label %74

74:                                               ; preds = %1, %.thread
  %.0 = phi i32 [ %.5, %.thread ], [ 0, %1 ]
  ret i32 %.0
}

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

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

declare i32 @__gxx_personality_v0(...)

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

; 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 #0 align 2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nounwind }

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,DivRemPairsPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass