; LLVM IR from tangjz/acm-icpc :: 51nod (2026)

; 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::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@pr = external dso_local global [1000001 x i32], align 16
@d = external dso_local global [1000001 x i32], align 16
@f = external dso_local global [1000001 x i32], align 16
@sf = external dso_local global %"class.std::unordered_map", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4calci(i32 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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = sitofp i32 %11 to double
  %13 = call double @pow(double noundef %12, double noundef 0x3FE5555555555555) #6
  %14 = call double @llvm.ceil.f64(double %13)
  %15 = fptosi double %14 to i32
  store i32 %15, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %16 = load i32, ptr @m, align 4, !tbaa !5
  %17 = add nsw i32 %16, 1
  store i32 %17, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  br label %18

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

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %34

23:                                               ; preds = %18
  br label %24

24:                                               ; preds = %23
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sdiv i32 %25, %26
  store i32 %27, ptr %3, align 4, !tbaa !5
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = sdiv i32 %28, %29
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %2, align 4, !tbaa !5
  %32 = load i32, ptr @tot, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr @tot, align 4, !tbaa !5
  br label %18, !llvm.loop !9

34:                                               ; preds = %22
  %35 = load i32, ptr @tot, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  call void @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(56) @sf, i64 noundef %36)
  store i32 0, ptr @tot, align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds ([1000001 x i32], ptr @f, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 2, ptr %4, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %123, %34
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = load i32, ptr @m, align 4, !tbaa !5
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %126

42:                                               ; preds = %37
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [1000001 x i32], ptr @d, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %62, label %48

48:                                               ; preds = %42
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [1000001 x i32], ptr @d, i64 0, i64 %51
  store i32 %49, ptr %52, align 4, !tbaa !5
  %53 = load i32, ptr @tot, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr @tot, align 4, !tbaa !5
  %55 = sext i32 %53 to i64
  %56 = getelementptr inbounds [1000001 x i32], ptr @pr, i64 0, i64 %55
  store i32 %49, ptr %56, align 4, !tbaa !5
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sub nsw i32 1000000008, %57
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %60
  store i32 %58, ptr %61, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %48, %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  br label %63

63:                                               ; preds = %118, %62
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [1000001 x i32], ptr @pr, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = mul nsw i32 %64, %68
  store i32 %69, ptr %7, align 4, !tbaa !5
  %70 = load i32, ptr @m, align 4, !tbaa !5
  %71 = icmp sle i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %63
  store i32 8, ptr %5, align 4
  br label %121

73:                                               ; preds = %63
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [1000001 x i32], ptr @pr, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [1000001 x i32], ptr @d, i64 0, i64 %79
  store i32 %77, ptr %80, align 4, !tbaa !5
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [1000001 x i32], ptr @d, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [1000001 x i32], ptr @pr, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = icmp eq i32 %84, %88
  br i1 %89, label %90, label %98

90:                                               ; preds = %73
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %96
  store i32 %94, ptr %97, align 4, !tbaa !5
  store i32 8, ptr %5, align 4
  br label %121

98:                                               ; preds = %73
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [1000001 x i32], ptr @pr, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = mul nsw i64 %103, %111
  %113 = srem i64 %112, 1000000007
  %114 = trunc i64 %113 to i32
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %116
  store i32 %114, ptr %117, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %98
  %119 = load i32, ptr %6, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %6, align 4, !tbaa !5
  br label %63, !llvm.loop !11

121:                                              ; preds = %90, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %122

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %4, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %4, align 4, !tbaa !5
  br label %37, !llvm.loop !12

126:                                              ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 2, ptr %8, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %153, %126
  %128 = load i32, ptr %8, align 4, !tbaa !5
  %129 = load i32, ptr @m, align 4, !tbaa !5
  %130 = icmp sle i32 %128, %129
  br i1 %130, label %132, label %131

131:                                              ; preds = %127
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %156

132:                                              ; preds = %127
  %133 = load i32, ptr %8, align 4, !tbaa !5
  %134 = sub nsw i32 %133, 1
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = load i32, ptr %8, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = add nsw i32 %141, %137
  store i32 %142, ptr %140, align 4, !tbaa !5
  %143 = icmp sge i32 %142, 1000000007
  br i1 %143, label %144, label %151

144:                                              ; preds = %132
  %145 = load i32, ptr %8, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = sub nsw i32 %148, 1000000007
  store i32 %149, ptr %147, align 4, !tbaa !5
  %150 = icmp ne i32 %149, 0
  br label %151

151:                                              ; preds = %144, %132
  %152 = phi i1 [ false, %132 ], [ %150, %144 ]
  br label %153

153:                                              ; preds = %151
  %154 = load i32, ptr %8, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %8, align 4, !tbaa !5
  br label %127, !llvm.loop !13

156:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %157 = load i32, ptr @n, align 4, !tbaa !5
  %158 = call noundef i32 @_Z4calci(i32 noundef %157)
  store i32 %158, ptr %9, align 4, !tbaa !5
  %159 = load i32, ptr %9, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = load i32, ptr %9, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = mul nsw i64 %160, %162
  %164 = srem i64 %163, 1000000007
  %165 = trunc i64 %164 to i32
  %166 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %165)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %167 = load i32, ptr %1, align 4
  ret i32 %167
}

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

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef) #0 align 2

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

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 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 #3 = { "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 "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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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}


; 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::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }

@n = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@pr = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@d = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@f = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@sf = external dso_local global %"class.std::unordered_map", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4calci(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = sitofp i32 %2 to double
  %4 = tail call double @pow(double noundef %3, double noundef 0x3FE5555555555555) #5
  %5 = tail call double @llvm.ceil.f64(double %4)
  %6 = fptosi double %5 to i32
  store i32 %6, ptr @m, align 4, !tbaa !5
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  %.not.not41 = icmp sgt i32 %7, %6
  br i1 %.not.not41, label %.lr.ph, label %8

._crit_edge:                                      ; preds = %.lr.ph
  store i32 %16, ptr @tot, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %._crit_edge, %0
  %9 = phi i32 [ %16, %._crit_edge ], [ %tot.promoted, %0 ]
  %10 = sext i32 %9 to i64
  tail call void @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(56) @sf, i64 noundef %10)
  store i32 0, ptr @tot, align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @f, i64 4), align 4, !tbaa !5
  %11 = load i32, ptr @m, align 4, !tbaa !5
  %.not49 = icmp slt i32 %11, 2
  br i1 %.not49, label %._crit_edge57, label %.lr.ph53.preheader

.lr.ph53.preheader:                               ; preds = %8
  %12 = add nuw i32 %11, 1
  %wide.trip.count = zext i32 %12 to i64
  br label %.lr.ph53

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.030.in42 = phi i32 [ %15, %.lr.ph ], [ %6, %0 ]
  %13 = phi i32 [ %16, %.lr.ph ], [ %tot.promoted, %0 ]
  %.030 = add nsw i32 %.030.in42, 1
  %14 = sdiv i32 %7, %.030
  %15 = sdiv i32 %7, %14
  %16 = add nsw i32 %13, 1
  %.not.not = icmp slt i32 %15, %7
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader:                                       ; preds = %.loopexit
  br i1 %.not49, label %._crit_edge57, label %.lr.ph56.preheader

.lr.ph56.preheader:                               ; preds = %.preheader
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 4), align 4, !tbaa !5
  %xtraiter = and i64 %wide.trip.count, 1
  %17 = icmp eq i32 %12, 3
  br i1 %17, label %._crit_edge57.loopexit.unr-lcssa, label %.lr.ph56.preheader.new

.lr.ph56.preheader.new:                           ; preds = %.lr.ph56.preheader
  %18 = and i64 %wide.trip.count, 4294967294
  %19 = add nsw i64 %18, -4
  br label %.lr.ph56

.lr.ph53:                                         ; preds = %.lr.ph53.preheader, %.loopexit
  %indvars.iv62 = phi i64 [ 2, %.lr.ph53.preheader ], [ %indvars.iv.next63, %.loopexit ]
  %20 = phi i32 [ 0, %.lr.ph53.preheader ], [ %31, %.loopexit ]
  %21 = getelementptr inbounds [1000001 x i32], ptr @d, i64 0, i64 %indvars.iv62
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %.not38 = icmp eq i32 %22, 0
  %23 = trunc nuw nsw i64 %indvars.iv62 to i32
  br i1 %.not38, label %24, label %.lr.ph53._crit_edge

24:                                               ; preds = %.lr.ph53
  store i32 %23, ptr %21, align 4, !tbaa !5
  %25 = add nsw i32 %20, 1
  store i32 %25, ptr @tot, align 4, !tbaa !5
  %26 = sext i32 %20 to i64
  %27 = getelementptr inbounds [1000001 x i32], ptr @pr, i64 0, i64 %26
  store i32 %23, ptr %27, align 4, !tbaa !5
  %28 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %indvars.iv62
  %29 = trunc i64 %indvars.iv62 to i32
  %30 = sub i32 1000000008, %29
  store i32 %30, ptr %28, align 4, !tbaa !5
  br label %.lr.ph53._crit_edge

.lr.ph53._crit_edge:                              ; preds = %.lr.ph53, %24
  %31 = phi i32 [ %25, %24 ], [ %20, %.lr.ph53 ]
  %32 = load i32, ptr @pr, align 16, !tbaa !5
  %33 = mul nsw i32 %32, %23
  %.not3944 = icmp sgt i32 %33, %11
  br i1 %.not3944, label %.loopexit, label %.lr.ph47

.lr.ph47:                                         ; preds = %.lr.ph53._crit_edge
  %34 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %indvars.iv62
  br label %35

35:                                               ; preds = %.lr.ph47, %45
  %indvars.iv = phi i64 [ 0, %.lr.ph47 ], [ %indvars.iv.next, %45 ]
  %36 = phi i32 [ %33, %.lr.ph47 ], [ %57, %45 ]
  %37 = phi i32 [ %32, %.lr.ph47 ], [ %56, %45 ]
  %38 = sext i32 %36 to i64
  %39 = getelementptr inbounds [1000001 x i32], ptr @d, i64 0, i64 %38
  store i32 %37, ptr %39, align 4, !tbaa !5
  %40 = load i32, ptr %21, align 4, !tbaa !5
  %41 = icmp eq i32 %40, %37
  %42 = load i32, ptr %34, align 4, !tbaa !5
  br i1 %41, label %43, label %45

43:                                               ; preds = %35
  %44 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %38
  store i32 %42, ptr %44, align 4, !tbaa !5
  br label %.loopexit

45:                                               ; preds = %35
  %46 = sext i32 %42 to i64
  %47 = sext i32 %37 to i64
  %48 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = mul nsw i64 %50, %46
  %52 = srem i64 %51, 1000000007
  %53 = trunc nsw i64 %52 to i32
  %54 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %38
  store i32 %53, ptr %54, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %55 = getelementptr inbounds [1000001 x i32], ptr @pr, i64 0, i64 %indvars.iv.next
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = mul nsw i32 %56, %23
  %.not39 = icmp sgt i32 %57, %11
  br i1 %.not39, label %.loopexit, label %35, !llvm.loop !11

.loopexit:                                        ; preds = %45, %.lr.ph53._crit_edge, %43
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph53, !llvm.loop !12

._crit_edge57.loopexit.unr-lcssa:                 ; preds = %.lr.ph56, %.lr.ph56.preheader
  %.unr = phi i32 [ %.pre, %.lr.ph56.preheader ], [ %spec.select.1, %.lr.ph56 ]
  %indvars.iv65.unr = phi i64 [ 2, %.lr.ph56.preheader ], [ %indvars.iv.next66.1, %.lr.ph56 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge57, label %.lr.ph56.epil

.lr.ph56.epil:                                    ; preds = %._crit_edge57.loopexit.unr-lcssa
  %58 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %indvars.iv65.unr
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = add nsw i32 %59, %.unr
  %61 = icmp sgt i32 %60, 1000000006
  %62 = add nsw i32 %60, -1000000007
  %spec.select.epil = select i1 %61, i32 %62, i32 %60
  store i32 %spec.select.epil, ptr %58, align 4, !tbaa !5
  br label %._crit_edge57

._crit_edge57:                                    ; preds = %.lr.ph56.epil, %._crit_edge57.loopexit.unr-lcssa, %8, %.preheader
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = tail call noundef i32 @_Z4calci(i32 noundef %63)
  %65 = sext i32 %64 to i64
  %66 = mul nsw i64 %65, %65
  %67 = urem i64 %66, 1000000007
  %68 = trunc nuw nsw i64 %67 to i32
  %69 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %68)
  ret i32 0

.lr.ph56:                                         ; preds = %.lr.ph56, %.lr.ph56.preheader.new
  %70 = phi i32 [ %.pre, %.lr.ph56.preheader.new ], [ %spec.select.1, %.lr.ph56 ]
  %indvars.iv65 = phi i64 [ 2, %.lr.ph56.preheader.new ], [ %indvars.iv.next66.1, %.lr.ph56 ]
  %niter = phi i64 [ 0, %.lr.ph56.preheader.new ], [ %niter.next.1, %.lr.ph56 ]
  %71 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %indvars.iv65
  %72 = load i32, ptr %71, align 8, !tbaa !5
  %73 = add nsw i32 %72, %70
  %74 = icmp sgt i32 %73, 1000000006
  %75 = add nsw i32 %73, -1000000007
  %spec.select = select i1 %74, i32 %75, i32 %73
  store i32 %spec.select, ptr %71, align 8, !tbaa !5
  %indvars.iv.next66 = or disjoint i64 %indvars.iv65, 1
  %76 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %indvars.iv.next66
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = add nsw i32 %77, %spec.select
  %79 = icmp sgt i32 %78, 1000000006
  %80 = add nsw i32 %78, -1000000007
  %spec.select.1 = select i1 %79, i32 %80, i32 %78
  store i32 %spec.select.1, ptr %76, align 4, !tbaa !5
  %indvars.iv.next66.1 = add nuw nsw i64 %indvars.iv65, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter, %19
  br i1 %niter.ncmp.1, label %._crit_edge57.loopexit.unr-lcssa, label %.lr.ph56, !llvm.loop !13
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 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 #2 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(write) "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

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

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


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