; LLVM IR from ADJA/algos :: NumberTheory (FFT)

; 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::complex" = type { { double, double } }

@a = external dso_local global [1010000 x %"class.std::complex"], align 16
@b = external dso_local global [1010000 x %"class.std::complex"], align 16
@ans = external dso_local global [1010000 x i32], align 16
@alen = external dso_local global i32, align 4
@blen = external dso_local global i32, align 4
@total = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3fftPSt7complexIdEib(ptr noundef, i32 noundef, i1 noundef zeroext) #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: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZStmlIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11readPolynomPSt7complexIdERib(ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), i1 noundef zeroext) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::complex", 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
  store i32 0, ptr %1, align 4
  call void @_Z11readPolynomPSt7complexIdERib(ptr noundef @a, ptr noundef nonnull align 4 dereferenceable(4) @alen, i1 noundef zeroext true)
  call void @_Z11readPolynomPSt7complexIdERib(ptr noundef @b, ptr noundef nonnull align 4 dereferenceable(4) @blen, i1 noundef zeroext false)
  %9 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @alen, ptr noundef nonnull align 4 dereferenceable(4) @blen)
  %10 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %10, ptr @total, align 4, !tbaa !5
  %11 = load i32, ptr @total, align 4, !tbaa !5
  %12 = mul nsw i32 %11, 2
  store i32 %12, ptr @total, align 4, !tbaa !5
  %13 = load i32, ptr @total, align 4, !tbaa !5
  call void @_Z3fftPSt7complexIdEib(ptr noundef @a, i32 noundef %13, i1 noundef zeroext false)
  %14 = load i32, ptr @total, align 4, !tbaa !5
  call void @_Z3fftPSt7complexIdEib(ptr noundef @b, i32 noundef %14, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %36, %0
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr @total, align 4, !tbaa !5
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

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

20:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #9
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [1010000 x %"class.std::complex"], ptr @a, i64 0, i64 %22
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [1010000 x %"class.std::complex"], ptr @b, i64 0, i64 %25
  %27 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(16) %26)
  %28 = getelementptr inbounds %"class.std::complex", ptr %3, i32 0, i32 0
  %29 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 0
  %30 = extractvalue { double, double } %27, 0
  store double %30, ptr %29, align 8
  %31 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 1
  %32 = extractvalue { double, double } %27, 1
  store double %32, ptr %31, align 8
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [1010000 x %"class.std::complex"], ptr @a, i64 0, i64 %34
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %35, ptr align 8 %3, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #9
  br label %36

36:                                               ; preds = %20
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !11

39:                                               ; preds = %19
  %40 = load i32, ptr @total, align 4, !tbaa !5
  call void @_Z3fftPSt7complexIdEib(ptr noundef @a, i32 noundef %40, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %57, %39
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = load i32, ptr @total, align 4, !tbaa !5
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  br label %60

46:                                               ; preds = %41
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [1010000 x %"class.std::complex"], ptr @a, i64 0, i64 %48
  %50 = call noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %49)
  %51 = fadd double %50, 5.000000e-01
  %52 = call double @llvm.floor.f64(double %51)
  %53 = fptosi double %52 to i32
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1010000 x i32], ptr @ans, i64 0, i64 %55
  store i32 %53, ptr %56, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %46
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %4, align 4, !tbaa !5
  br label %41, !llvm.loop !13

60:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %83, %60
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = load i32, ptr @total, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %86

66:                                               ; preds = %61
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [1010000 x i32], ptr @ans, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = add nsw i32 %71, %67
  store i32 %72, ptr %70, align 4, !tbaa !5
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [1010000 x i32], ptr @ans, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = sdiv i32 %76, 10
  store i32 %77, ptr %5, align 4, !tbaa !5
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [1010000 x i32], ptr @ans, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = srem i32 %81, 10
  store i32 %82, ptr %80, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %66
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %6, align 4, !tbaa !5
  br label %61, !llvm.loop !14

86:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  %87 = load i32, ptr @total, align 4, !tbaa !5
  %88 = sub nsw i32 %87, 1
  store i32 %88, ptr %7, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %100, %86
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = icmp sgt i32 %90, 0
  br i1 %91, label %92, label %98

92:                                               ; preds = %89
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [1010000 x i32], ptr @ans, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = icmp eq i32 %96, 0
  br label %98

98:                                               ; preds = %92, %89
  %99 = phi i1 [ false, %89 ], [ %97, %92 ]
  br i1 %99, label %100, label %103

100:                                              ; preds = %98
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = add nsw i32 %101, -1
  store i32 %102, ptr %7, align 4, !tbaa !5
  br label %89, !llvm.loop !15

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %104 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %104, ptr %8, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %115, %103
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = icmp sge i32 %106, 0
  br i1 %107, label %109, label %108

108:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %118

109:                                              ; preds = %105
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [1010000 x i32], ptr @ans, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %113)
  br label %115

115:                                              ; preds = %109
  %116 = load i32, ptr %8, align 4, !tbaa !5
  %117 = add nsw i32 %116, -1
  store i32 %117, ptr %8, align 4, !tbaa !5
  br label %105, !llvm.loop !16

118:                                              ; preds = %108
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  ret i32 0
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16)) #6 align 2

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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 = { 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 #5 = { 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 #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { "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 #9 = { 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 = !{i64 0, i64 16, !10}
!10 = !{!7, !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::complex" = type { { double, double } }

@a = external dso_local global [1010000 x %"class.std::complex"], align 16
@b = external dso_local global [1010000 x %"class.std::complex"], align 16
@ans = external dso_local local_unnamed_addr global [1010000 x i32], align 16
@alen = external dso_local global i32, align 4
@blen = external dso_local global i32, align 4
@total = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3fftPSt7complexIdEib(ptr noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZStmlIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11readPolynomPSt7complexIdERib(ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  tail call void @_Z11readPolynomPSt7complexIdERib(ptr noundef nonnull @a, ptr noundef nonnull align 4 dereferenceable(4) @alen, i1 noundef zeroext true)
  tail call void @_Z11readPolynomPSt7complexIdERib(ptr noundef nonnull @b, ptr noundef nonnull align 4 dereferenceable(4) @blen, i1 noundef zeroext false)
  %1 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @alen, ptr noundef nonnull align 4 dereferenceable(4) @blen)
  %2 = load i32, ptr %1, align 4, !tbaa !5
  %3 = shl nsw i32 %2, 1
  store i32 %3, ptr @total, align 4, !tbaa !5
  tail call void @_Z3fftPSt7complexIdEib(ptr noundef nonnull @a, i32 noundef %3, i1 noundef zeroext false)
  %4 = load i32, ptr @total, align 4, !tbaa !5
  tail call void @_Z3fftPSt7complexIdEib(ptr noundef nonnull @b, i32 noundef %4, i1 noundef zeroext false)
  %5 = load i32, ptr @total, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa30 = phi i32 [ %5, %0 ], [ %14, %.lr.ph ]
  tail call void @_Z3fftPSt7complexIdEib(ptr noundef nonnull @a, i32 noundef %.lcssa30, i1 noundef zeroext true)
  %7 = load i32, ptr @total, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph34, label %.preheader29..preheader_crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %9 = getelementptr inbounds [1010000 x %"class.std::complex"], ptr @a, i64 0, i64 %indvars.iv
  %10 = getelementptr inbounds [1010000 x %"class.std::complex"], ptr @b, i64 0, i64 %indvars.iv
  %11 = tail call { double, double } @_ZStmlIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %10)
  %12 = extractvalue { double, double } %11, 0
  %13 = extractvalue { double, double } %11, 1
  store double %12, ptr %9, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 8
  store double %13, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = load i32, ptr @total, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = icmp slt i64 %indvars.iv.next, %15
  br i1 %16, label %.lr.ph, label %._crit_edge, !llvm.loop !10

.preheader29:                                     ; preds = %.lr.ph34
  %17 = icmp sgt i32 %25, 0
  br i1 %17, label %.lr.ph38.preheader, label %.preheader29..preheader_crit_edge

.preheader29..preheader_crit_edge:                ; preds = %._crit_edge, %.preheader29
  %.lcssa60 = phi i32 [ %25, %.preheader29 ], [ %7, %._crit_edge ]
  %.pre = zext i32 %.lcssa60 to i64
  br label %.preheader

.lr.ph38.preheader:                               ; preds = %.preheader29
  %wide.trip.count = zext nneg i32 %25 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %18 = icmp eq i32 %25, 1
  br i1 %18, label %.preheader.loopexit.unr-lcssa, label %.lr.ph38.preheader.new

.lr.ph38.preheader.new:                           ; preds = %.lr.ph38.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph38

.lr.ph34:                                         ; preds = %._crit_edge, %.lr.ph34
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %.lr.ph34 ], [ 0, %._crit_edge ]
  %19 = getelementptr inbounds [1010000 x %"class.std::complex"], ptr @a, i64 0, i64 %indvars.iv45
  %20 = tail call noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %19)
  %21 = fadd double %20, 5.000000e-01
  %22 = tail call double @llvm.floor.f64(double %21)
  %23 = fptosi double %22 to i32
  %24 = getelementptr inbounds [1010000 x i32], ptr @ans, i64 0, i64 %indvars.iv45
  store i32 %23, ptr %24, align 4, !tbaa !5
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %25 = load i32, ptr @total, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = icmp slt i64 %indvars.iv.next46, %26
  br i1 %27, label %.lr.ph34, label %.preheader29, !llvm.loop !12

.preheader.loopexit.unr-lcssa:                    ; preds = %.lr.ph38, %.lr.ph38.preheader
  %indvars.iv48.unr = phi i64 [ 0, %.lr.ph38.preheader ], [ %indvars.iv.next49.1, %.lr.ph38 ]
  %.02436.unr = phi i32 [ 0, %.lr.ph38.preheader ], [ %41, %.lr.ph38 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph38.epil

.lr.ph38.epil:                                    ; preds = %.preheader.loopexit.unr-lcssa
  %28 = getelementptr inbounds [1010000 x i32], ptr @ans, i64 0, i64 %indvars.iv48.unr
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, %.02436.unr
  %31 = srem i32 %30, 10
  store i32 %31, ptr %28, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph38.epil, %.preheader.loopexit.unr-lcssa, %.preheader29..preheader_crit_edge
  %.lcssa59 = phi i32 [ %.lcssa60, %.preheader29..preheader_crit_edge ], [ %25, %.preheader.loopexit.unr-lcssa ], [ %25, %.lr.ph38.epil ]
  %.pre-phi = phi i64 [ %.pre, %.preheader29..preheader_crit_edge ], [ %wide.trip.count, %.preheader.loopexit.unr-lcssa ], [ %wide.trip.count, %.lr.ph38.epil ]
  %smin = tail call i32 @llvm.smin.i32(i32 %.lcssa59, i32 1)
  %32 = add i32 %smin, -1
  br label %43

.lr.ph38:                                         ; preds = %.lr.ph38, %.lr.ph38.preheader.new
  %indvars.iv48 = phi i64 [ 0, %.lr.ph38.preheader.new ], [ %indvars.iv.next49.1, %.lr.ph38 ]
  %.02436 = phi i32 [ 0, %.lr.ph38.preheader.new ], [ %41, %.lr.ph38 ]
  %niter = phi i64 [ 0, %.lr.ph38.preheader.new ], [ %niter.next.1, %.lr.ph38 ]
  %33 = getelementptr inbounds [1010000 x i32], ptr @ans, i64 0, i64 %indvars.iv48
  %34 = load i32, ptr %33, align 8, !tbaa !5
  %35 = add nsw i32 %34, %.02436
  %36 = sdiv i32 %35, 10
  %37 = srem i32 %35, 10
  store i32 %37, ptr %33, align 8, !tbaa !5
  %indvars.iv.next49 = or disjoint i64 %indvars.iv48, 1
  %38 = getelementptr inbounds [1010000 x i32], ptr @ans, i64 0, i64 %indvars.iv.next49
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = add nsw i32 %39, %36
  %41 = sdiv i32 %40, 10
  %42 = srem i32 %40, 10
  store i32 %42, ptr %38, align 4, !tbaa !5
  %indvars.iv.next49.1 = add nuw nsw i64 %indvars.iv48, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader.loopexit.unr-lcssa, label %.lr.ph38, !llvm.loop !13

43:                                               ; preds = %.preheader, %46
  %indvars.iv51 = phi i64 [ %.pre-phi, %.preheader ], [ %indvars.iv.next52, %46 ]
  %44 = trunc nuw i64 %indvars.iv51 to i32
  %45 = icmp sgt i32 %44, 1
  br i1 %45, label %46, label %.critedge

46:                                               ; preds = %43
  %indvars.iv.next52 = add nsw i64 %indvars.iv51, -1
  %47 = and i64 %indvars.iv.next52, 4294967295
  %48 = getelementptr inbounds [1010000 x i32], ptr @ans, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %43, label %.lr.ph40.preheader.loopexit, !llvm.loop !14

.critedge:                                        ; preds = %43
  %51 = icmp sgt i32 %.lcssa59, 0
  br i1 %51, label %.lr.ph40.preheader, label %._crit_edge41

.lr.ph40.preheader.loopexit:                      ; preds = %46
  %indvars.le = trunc i64 %indvars.iv.next52 to i32
  br label %.lr.ph40.preheader

.lr.ph40.preheader:                               ; preds = %.lr.ph40.preheader.loopexit, %.critedge
  %.022.lcssa63 = phi i32 [ %32, %.critedge ], [ %indvars.le, %.lr.ph40.preheader.loopexit ]
  %52 = zext i32 %.022.lcssa63 to i64
  br label %.lr.ph40

._crit_edge41:                                    ; preds = %.lr.ph40, %.critedge
  %53 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  ret i32 0

.lr.ph40:                                         ; preds = %.lr.ph40.preheader, %.lr.ph40
  %indvars.iv54 = phi i64 [ %52, %.lr.ph40.preheader ], [ %indvars.iv.next55, %.lr.ph40 ]
  %54 = getelementptr inbounds [1010000 x i32], ptr @ans, i64 0, i64 %indvars.iv54
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %55)
  %indvars.iv.next55 = add nsw i64 %indvars.iv54, -1
  %57 = trunc nuw i64 %indvars.iv54 to i32
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %.lr.ph40, label %._crit_edge41, !llvm.loop !15
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #7

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

!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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}


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