; LLVM IR from tangjz/acm-icpc :: hdu (6226)

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

%struct.Info = type { i64, i64, i32 }

@t = external dso_local global i32, align 4
@n = external dso_local global i64, align 8
@pw = external dso_local global [19 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@__const.main.ret = external hidden unnamed_addr constant %struct.Info, align 8
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_Z1Fiii(i32 noundef, i32 noundef, 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z8digitSumx(i64 noundef) #2

; 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() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.Info, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  store i64 1, ptr @pw, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !9
  br label %10

10:                                               ; preds = %24, %0
  %11 = load i32, ptr %2, align 4, !tbaa !9
  %12 = icmp slt i32 %11, 19
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %27

14:                                               ; preds = %10
  %15 = load i32, ptr %2, align 4, !tbaa !9
  %16 = sub nsw i32 %15, 1
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [19 x i64], ptr @pw, i64 0, i64 %17
  %19 = load i64, ptr %18, align 8, !tbaa !5
  %20 = mul nsw i64 %19, 10
  %21 = load i32, ptr %2, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [19 x i64], ptr @pw, i64 0, i64 %22
  store i64 %20, ptr %23, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %14
  %25 = load i32, ptr %2, align 4, !tbaa !9
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %2, align 4, !tbaa !9
  br label %10, !llvm.loop !11

27:                                               ; preds = %13
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %157, %27
  %30 = load i32, ptr %3, align 4, !tbaa !9
  %31 = load i32, ptr @t, align 4, !tbaa !9
  %32 = icmp sle i32 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 @__const.main.ret, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 18, ptr %6, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %121, %34
  %37 = load i32, ptr %6, align 4, !tbaa !9
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %36
  br label %41

41:                                               ; preds = %119, %40
  br label %42

42:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %43 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 1
  %44 = load i64, ptr %43, align 8, !tbaa !13
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [19 x i64], ptr @pw, i64 0, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = sdiv i64 %44, %48
  store i64 %49, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %50 = load i64, ptr %7, align 8, !tbaa !5
  %51 = load i32, ptr %6, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [19 x i64], ptr @pw, i64 0, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !5
  %55 = mul nsw i64 %50, %54
  store i64 %55, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = load i64, ptr %7, align 8, !tbaa !5
  %58 = call noundef i32 @_Z8digitSumx(i64 noundef %57)
  %59 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 1
  %60 = load i64, ptr %59, align 8, !tbaa !13
  %61 = load i64, ptr %8, align 8, !tbaa !5
  %62 = sub nsw i64 %60, %61
  %63 = trunc i64 %62 to i32
  %64 = call noundef nonnull align 8 dereferenceable(24) ptr @_Z1Fiii(i32 noundef %56, i32 noundef %58, i32 noundef %63)
  store ptr %64, ptr %9, align 8, !tbaa !15
  %65 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 0
  %66 = load i64, ptr %65, align 8, !tbaa !17
  %67 = load ptr, ptr %9, align 8, !tbaa !15
  %68 = getelementptr inbounds %struct.Info, ptr %67, i32 0, i32 0
  %69 = load i64, ptr %68, align 8, !tbaa !17
  %70 = add nsw i64 %66, %69
  %71 = add nsw i64 %70, 1
  %72 = load i64, ptr @n, align 8, !tbaa !5
  %73 = icmp sgt i64 %71, %72
  br i1 %73, label %74, label %75

74:                                               ; preds = %42
  store i32 12, ptr %4, align 4
  br label %117

75:                                               ; preds = %42
  %76 = load ptr, ptr %9, align 8, !tbaa !15
  %77 = getelementptr inbounds %struct.Info, ptr %76, i32 0, i32 0
  %78 = load i64, ptr %77, align 8, !tbaa !17
  %79 = add nsw i64 %78, 1
  %80 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 0
  %81 = load i64, ptr %80, align 8, !tbaa !17
  %82 = add nsw i64 %81, %79
  store i64 %82, ptr %80, align 8, !tbaa !17
  %83 = load ptr, ptr %9, align 8, !tbaa !15
  %84 = getelementptr inbounds %struct.Info, ptr %83, i32 0, i32 1
  %85 = load i64, ptr %84, align 8, !tbaa !13
  %86 = load i64, ptr %8, align 8, !tbaa !5
  %87 = add nsw i64 %85, %86
  %88 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 1
  store i64 %87, ptr %88, align 8, !tbaa !13
  %89 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 1
  %90 = load i64, ptr %89, align 8, !tbaa !13
  %91 = call noundef i32 @_Z8digitSumx(i64 noundef %90)
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 1
  %94 = load i64, ptr %93, align 8, !tbaa !13
  %95 = add nsw i64 %94, %92
  store i64 %95, ptr %93, align 8, !tbaa !13
  %96 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 2
  %97 = load i32, ptr %96, align 8, !tbaa !18
  %98 = load ptr, ptr %9, align 8, !tbaa !15
  %99 = getelementptr inbounds %struct.Info, ptr %98, i32 0, i32 2
  %100 = load i32, ptr %99, align 8, !tbaa !18
  %101 = add nsw i32 %97, %100
  %102 = sext i32 %101 to i64
  %103 = load ptr, ptr %9, align 8, !tbaa !15
  %104 = getelementptr inbounds %struct.Info, ptr %103, i32 0, i32 0
  %105 = load i64, ptr %104, align 8, !tbaa !17
  %106 = srem i64 %105, 1000000009
  %107 = load i64, ptr %8, align 8, !tbaa !5
  %108 = srem i64 %107, 1000000009
  %109 = mul nsw i64 %106, %108
  %110 = add nsw i64 %102, %109
  %111 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 1
  %112 = load i64, ptr %111, align 8, !tbaa !13
  %113 = add nsw i64 %110, %112
  %114 = srem i64 %113, 1000000009
  %115 = trunc i64 %114 to i32
  %116 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 2
  store i32 %115, ptr %116, align 8, !tbaa !18
  store i32 0, ptr %4, align 4
  br label %117

117:                                              ; preds = %75, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %118 = load i32, ptr %4, align 4
  switch i32 %118, label %161 [
    i32 0, label %119
    i32 12, label %120
  ]

119:                                              ; preds = %117
  br label %41, !llvm.loop !19

120:                                              ; preds = %117
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %6, align 4, !tbaa !9
  %123 = add nsw i32 %122, -1
  store i32 %123, ptr %6, align 4, !tbaa !9
  br label %36, !llvm.loop !20

124:                                              ; preds = %39
  br label %125

125:                                              ; preds = %130, %124
  %126 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 0
  %127 = load i64, ptr %126, align 8, !tbaa !17
  %128 = load i64, ptr @n, align 8, !tbaa !5
  %129 = icmp slt i64 %127, %128
  br i1 %129, label %130, label %150

130:                                              ; preds = %125
  %131 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 0
  %132 = load i64, ptr %131, align 8, !tbaa !17
  %133 = add nsw i64 %132, 1
  store i64 %133, ptr %131, align 8, !tbaa !17
  %134 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 1
  %135 = load i64, ptr %134, align 8, !tbaa !13
  %136 = call noundef i32 @_Z8digitSumx(i64 noundef %135)
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 1
  %139 = load i64, ptr %138, align 8, !tbaa !13
  %140 = add nsw i64 %139, %137
  store i64 %140, ptr %138, align 8, !tbaa !13
  %141 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 2
  %142 = load i32, ptr %141, align 8, !tbaa !18
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 1
  %145 = load i64, ptr %144, align 8, !tbaa !13
  %146 = add nsw i64 %143, %145
  %147 = srem i64 %146, 1000000009
  %148 = trunc i64 %147 to i32
  %149 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 2
  store i32 %148, ptr %149, align 8, !tbaa !18
  br label %125, !llvm.loop !21

150:                                              ; preds = %125
  %151 = load i32, ptr %3, align 4, !tbaa !9
  %152 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 1
  %153 = load i64, ptr %152, align 8, !tbaa !13
  %154 = getelementptr inbounds %struct.Info, ptr %5, i32 0, i32 2
  %155 = load i32, ptr %154, align 8, !tbaa !18
  %156 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %151, i64 noundef %153, i32 noundef %155)
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  br label %157

157:                                              ; preds = %150
  %158 = load i32, ptr %3, align 4, !tbaa !9
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %3, align 4, !tbaa !9
  br label %29, !llvm.loop !22

160:                                              ; preds = %33
  ret i32 0

161:                                              ; preds = %117
  unreachable
}

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

; 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) #5

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

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 = { 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 = { 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 #4 = { "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 nounwind willreturn memory(argmem: readwrite) }
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 = !{!"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, !6, i64 8}
!14 = !{!"_ZTS4Info", !6, i64 0, !6, i64 8, !10, i64 16}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!14, !6, i64 0}
!18 = !{!14, !10, i64 16}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !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"

%struct.Info = type { i64, i64, i32 }

@t = external dso_local global i32, align 4
@n = external dso_local global i64, align 8
@pw = external dso_local local_unnamed_addr global [19 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@__const.main.ret = external hidden unnamed_addr constant %struct.Info, align 8
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_Z1Fiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z8digitSumx(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  store i64 1, ptr @pw, align 16, !tbaa !5
  store i64 10, ptr getelementptr inbounds (i8, ptr @pw, i64 8), align 8, !tbaa !5
  store i64 100, ptr getelementptr inbounds (i8, ptr @pw, i64 16), align 16, !tbaa !5
  store i64 1000, ptr getelementptr inbounds (i8, ptr @pw, i64 24), align 8, !tbaa !5
  store i64 10000, ptr getelementptr inbounds (i8, ptr @pw, i64 32), align 16, !tbaa !5
  store i64 100000, ptr getelementptr inbounds (i8, ptr @pw, i64 40), align 8, !tbaa !5
  store i64 1000000, ptr getelementptr inbounds (i8, ptr @pw, i64 48), align 16, !tbaa !5
  store i64 10000000, ptr getelementptr inbounds (i8, ptr @pw, i64 56), align 8, !tbaa !5
  store i64 100000000, ptr getelementptr inbounds (i8, ptr @pw, i64 64), align 16, !tbaa !5
  store i64 1000000000, ptr getelementptr inbounds (i8, ptr @pw, i64 72), align 8, !tbaa !5
  store i64 10000000000, ptr getelementptr inbounds (i8, ptr @pw, i64 80), align 16, !tbaa !5
  store i64 100000000000, ptr getelementptr inbounds (i8, ptr @pw, i64 88), align 8, !tbaa !5
  store i64 1000000000000, ptr getelementptr inbounds (i8, ptr @pw, i64 96), align 16, !tbaa !5
  store i64 10000000000000, ptr getelementptr inbounds (i8, ptr @pw, i64 104), align 8, !tbaa !5
  store i64 100000000000000, ptr getelementptr inbounds (i8, ptr @pw, i64 112), align 16, !tbaa !5
  store i64 1000000000000000, ptr getelementptr inbounds (i8, ptr @pw, i64 120), align 8, !tbaa !5
  store i64 10000000000000000, ptr getelementptr inbounds (i8, ptr @pw, i64 128), align 16, !tbaa !5
  store i64 100000000000000000, ptr getelementptr inbounds (i8, ptr @pw, i64 136), align 8, !tbaa !5
  store i64 1000000000000000000, ptr getelementptr inbounds (i8, ptr @pw, i64 144), align 16, !tbaa !5
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %2 = load i32, ptr @t, align 4, !tbaa !9
  %.not57 = icmp slt i32 %2, 1
  br i1 %.not57, label %._crit_edge61, label %.lr.ph60

.lr.ph60:                                         ; preds = %0
  %.sroa.0.0.copyload = load i64, ptr @__const.main.ret, align 8
  %.sroa.9.0.copyload = load i64, ptr getelementptr inbounds (i8, ptr @__const.main.ret, i64 8), align 8
  %.sroa.21.0.copyload = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.ret, i64 16), align 8
  br label %3

._crit_edge61:                                    ; preds = %._crit_edge, %0
  ret i32 0

3:                                                ; preds = %.lr.ph60, %._crit_edge
  %.03558 = phi i32 [ 1, %.lr.ph60 ], [ %51, %._crit_edge ]
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n)
  br label %.preheader

.preheader47:                                     ; preds = %38
  %5 = icmp slt i64 %.sroa.0.1, %17
  br i1 %5, label %.lr.ph, label %._crit_edge

.preheader:                                       ; preds = %3, %38
  %indvars.iv = phi i64 [ 18, %3 ], [ %indvars.iv.next, %38 ]
  %.sroa.0.051 = phi i64 [ %.sroa.0.0.copyload, %3 ], [ %.sroa.0.1, %38 ]
  %.sroa.9.050 = phi i64 [ %.sroa.9.0.copyload, %3 ], [ %.sroa.9.1, %38 ]
  %.sroa.21.049 = phi i32 [ %.sroa.21.0.copyload, %3 ], [ %.sroa.21.1, %38 ]
  %6 = getelementptr inbounds [19 x i64], ptr @pw, i64 0, i64 %indvars.iv
  %7 = trunc nuw nsw i64 %indvars.iv to i32
  br label %8

8:                                                ; preds = %.preheader, %18
  %.sroa.21.1 = phi i32 [ %37, %18 ], [ %.sroa.21.049, %.preheader ]
  %.sroa.9.1 = phi i64 [ %25, %18 ], [ %.sroa.9.050, %.preheader ]
  %.sroa.0.1 = phi i64 [ %19, %18 ], [ %.sroa.0.051, %.preheader ]
  %9 = load i64, ptr %6, align 8, !tbaa !5
  %10 = sdiv i64 %.sroa.9.1, %9
  %11 = mul nsw i64 %10, %9
  %12 = tail call noundef i32 @_Z8digitSumx(i64 noundef %10)
  %.recomposed = srem i64 %.sroa.9.1, %9
  %13 = trunc i64 %.recomposed to i32
  %14 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_Z1Fiii(i32 noundef %7, i32 noundef %12, i32 noundef %13)
  %15 = load i64, ptr %14, align 8, !tbaa !11
  %16 = add nsw i64 %15, %.sroa.0.1
  %17 = load i64, ptr @n, align 8, !tbaa !5
  %.not38 = icmp slt i64 %16, %17
  br i1 %.not38, label %18, label %38

18:                                               ; preds = %8
  %19 = add nsw i64 %16, 1
  %20 = getelementptr inbounds i8, ptr %14, i64 8
  %21 = load i64, ptr %20, align 8, !tbaa !13
  %22 = add nsw i64 %21, %11
  %23 = tail call noundef i32 @_Z8digitSumx(i64 noundef %22)
  %24 = sext i32 %23 to i64
  %25 = add nsw i64 %22, %24
  %26 = getelementptr inbounds i8, ptr %14, i64 16
  %27 = load i32, ptr %26, align 8, !tbaa !14
  %28 = add nsw i32 %27, %.sroa.21.1
  %29 = sext i32 %28 to i64
  %30 = load i64, ptr %14, align 8, !tbaa !11
  %31 = srem i64 %30, 1000000009
  %32 = srem i64 %11, 1000000009
  %33 = mul nsw i64 %31, %32
  %34 = add i64 %25, %29
  %35 = add i64 %34, %33
  %36 = srem i64 %35, 1000000009
  %37 = trunc nsw i64 %36 to i32
  br label %8

38:                                               ; preds = %8
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %39 = icmp ugt i64 %indvars.iv, 1
  br i1 %39, label %.preheader, label %.preheader47, !llvm.loop !15

.lr.ph:                                           ; preds = %.preheader47, %.lr.ph
  %.sroa.0.355 = phi i64 [ %40, %.lr.ph ], [ %.sroa.0.1, %.preheader47 ]
  %.sroa.9.354 = phi i64 [ %43, %.lr.ph ], [ %.sroa.9.1, %.preheader47 ]
  %.sroa.21.353 = phi i32 [ %47, %.lr.ph ], [ %.sroa.21.1, %.preheader47 ]
  %40 = add nsw i64 %.sroa.0.355, 1
  %41 = tail call noundef i32 @_Z8digitSumx(i64 noundef %.sroa.9.354)
  %42 = sext i32 %41 to i64
  %43 = add nsw i64 %.sroa.9.354, %42
  %44 = sext i32 %.sroa.21.353 to i64
  %45 = add nsw i64 %43, %44
  %46 = srem i64 %45, 1000000009
  %47 = trunc nsw i64 %46 to i32
  %48 = load i64, ptr @n, align 8, !tbaa !5
  %49 = icmp slt i64 %40, %48
  br i1 %49, label %.lr.ph, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %.lr.ph, %.preheader47
  %.sroa.21.3.lcssa = phi i32 [ %.sroa.21.1, %.preheader47 ], [ %47, %.lr.ph ]
  %.sroa.9.3.lcssa = phi i64 [ %.sroa.9.1, %.preheader47 ], [ %43, %.lr.ph ]
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.03558, i64 noundef %.sroa.9.3.lcssa, i32 noundef %.sroa.21.3.lcssa)
  %51 = add nuw nsw i32 %.03558, 1
  %52 = load i32, ptr @t, align 4, !tbaa !9
  %.not.not = icmp slt i32 %.03558, %52
  br i1 %.not.not, label %3, label %._crit_edge61, !llvm.loop !18
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { 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 #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 = { 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" }

!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 = !{!12, !6, i64 0}
!12 = !{!"_ZTS4Info", !6, i64 0, !6, i64 8, !10, i64 16}
!13 = !{!12, !6, i64 8}
!14 = !{!12, !10, i64 16}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}


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