; LLVM IR from gem5/gem5 :: ext/systemc/src/sysc/datatypes/fx/scfx_pow10.ll (ZN5sc_dt10scfx_pow10D2Ev)

; 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.sc_dt::scfx_pow10" = type { [32 x %"class.sc_dt::scfx_rep"], [32 x %"class.sc_dt::scfx_rep"] }
%"class.sc_dt::scfx_rep" = type <{ %"class.sc_dt::scfx_mant", i32, i32, i32, i32, i32, i8, [3 x i8] }>
%"class.sc_dt::scfx_mant" = type <{ ptr, i32, [4 x i8] }>

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5sc_dt10scfx_pow10D2Ev(ptr noundef nonnull align 8 dereferenceable(2560) %0) unnamed_addr #1 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %"class.sc_dt::scfx_pow10", ptr %3, i32 0, i32 1
  %5 = getelementptr inbounds [32 x %"class.sc_dt::scfx_rep"], ptr %4, i32 0, i32 0
  %6 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %5, i64 32
  br label %7

7:                                                ; preds = %7, %1
  %8 = phi ptr [ %6, %1 ], [ %9, %7 ]
  %9 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %8, i64 -1
  call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %9) #2
  %10 = icmp eq ptr %9, %5
  br i1 %10, label %11, label %7

11:                                               ; preds = %7
  %12 = getelementptr inbounds %"class.sc_dt::scfx_pow10", ptr %3, i32 0, i32 0
  %13 = getelementptr inbounds [32 x %"class.sc_dt::scfx_rep"], ptr %12, i32 0, i32 0
  %14 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i64 32
  br label %15

15:                                               ; preds = %15, %11
  %16 = phi ptr [ %14, %11 ], [ %17, %15 ]
  %17 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %16, i64 -1
  call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %17) #2
  %18 = icmp eq ptr %17, %13
  br i1 %18, label %19, label %15

19:                                               ; preds = %15
  ret void
}

attributes #0 = { 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 #1 = { 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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5sc_dt10scfx_pow10D2Ev(ptr noundef nonnull align 8 dereferenceable(2560) %0) unnamed_addr #1 align 2 {
.preheader.preheader:
  %.ptr1 = getelementptr inbounds i8, ptr %0, i64 2520
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1) #2
  %.ptr1.1 = getelementptr inbounds i8, ptr %0, i64 2480
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.1) #2
  %.ptr1.2 = getelementptr inbounds i8, ptr %0, i64 2440
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.2) #2
  %.ptr1.3 = getelementptr inbounds i8, ptr %0, i64 2400
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.3) #2
  %.ptr1.4 = getelementptr inbounds i8, ptr %0, i64 2360
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.4) #2
  %.ptr1.5 = getelementptr inbounds i8, ptr %0, i64 2320
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.5) #2
  %.ptr1.6 = getelementptr inbounds i8, ptr %0, i64 2280
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.6) #2
  %.ptr1.7 = getelementptr inbounds i8, ptr %0, i64 2240
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.7) #2
  %.ptr1.8 = getelementptr inbounds i8, ptr %0, i64 2200
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.8) #2
  %.ptr1.9 = getelementptr inbounds i8, ptr %0, i64 2160
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.9) #2
  %.ptr1.10 = getelementptr inbounds i8, ptr %0, i64 2120
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.10) #2
  %.ptr1.11 = getelementptr inbounds i8, ptr %0, i64 2080
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.11) #2
  %.ptr1.12 = getelementptr inbounds i8, ptr %0, i64 2040
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.12) #2
  %.ptr1.13 = getelementptr inbounds i8, ptr %0, i64 2000
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.13) #2
  %.ptr1.14 = getelementptr inbounds i8, ptr %0, i64 1960
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.14) #2
  %.ptr1.15 = getelementptr inbounds i8, ptr %0, i64 1920
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.15) #2
  %.ptr1.16 = getelementptr inbounds i8, ptr %0, i64 1880
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.16) #2
  %.ptr1.17 = getelementptr inbounds i8, ptr %0, i64 1840
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.17) #2
  %.ptr1.18 = getelementptr inbounds i8, ptr %0, i64 1800
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.18) #2
  %.ptr1.19 = getelementptr inbounds i8, ptr %0, i64 1760
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.19) #2
  %.ptr1.20 = getelementptr inbounds i8, ptr %0, i64 1720
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.20) #2
  %.ptr1.21 = getelementptr inbounds i8, ptr %0, i64 1680
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.21) #2
  %.ptr1.22 = getelementptr inbounds i8, ptr %0, i64 1640
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.22) #2
  %.ptr1.23 = getelementptr inbounds i8, ptr %0, i64 1600
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.23) #2
  %.ptr1.24 = getelementptr inbounds i8, ptr %0, i64 1560
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.24) #2
  %.ptr1.25 = getelementptr inbounds i8, ptr %0, i64 1520
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.25) #2
  %.ptr1.26 = getelementptr inbounds i8, ptr %0, i64 1480
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.26) #2
  %.ptr1.27 = getelementptr inbounds i8, ptr %0, i64 1440
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.27) #2
  %.ptr1.28 = getelementptr inbounds i8, ptr %0, i64 1400
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.28) #2
  %.ptr1.29 = getelementptr inbounds i8, ptr %0, i64 1360
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.29) #2
  %.ptr1.30 = getelementptr inbounds i8, ptr %0, i64 1320
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.30) #2
  %.ptr1.31 = getelementptr inbounds i8, ptr %0, i64 1280
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %.ptr1.31) #2
  %1 = getelementptr inbounds i8, ptr %0, i64 1240
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %1) #2
  %2 = getelementptr inbounds i8, ptr %0, i64 1200
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %2) #2
  %3 = getelementptr inbounds i8, ptr %0, i64 1160
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %3) #2
  %4 = getelementptr inbounds i8, ptr %0, i64 1120
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %4) #2
  %5 = getelementptr inbounds i8, ptr %0, i64 1080
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %5) #2
  %6 = getelementptr inbounds i8, ptr %0, i64 1040
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %6) #2
  %7 = getelementptr inbounds i8, ptr %0, i64 1000
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %7) #2
  %8 = getelementptr inbounds i8, ptr %0, i64 960
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %8) #2
  %9 = getelementptr inbounds i8, ptr %0, i64 920
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %9) #2
  %10 = getelementptr inbounds i8, ptr %0, i64 880
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %10) #2
  %11 = getelementptr inbounds i8, ptr %0, i64 840
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %11) #2
  %12 = getelementptr inbounds i8, ptr %0, i64 800
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %12) #2
  %13 = getelementptr inbounds i8, ptr %0, i64 760
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %13) #2
  %14 = getelementptr inbounds i8, ptr %0, i64 720
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %14) #2
  %15 = getelementptr inbounds i8, ptr %0, i64 680
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %15) #2
  %16 = getelementptr inbounds i8, ptr %0, i64 640
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %16) #2
  %17 = getelementptr inbounds i8, ptr %0, i64 600
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %17) #2
  %18 = getelementptr inbounds i8, ptr %0, i64 560
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %18) #2
  %19 = getelementptr inbounds i8, ptr %0, i64 520
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %19) #2
  %20 = getelementptr inbounds i8, ptr %0, i64 480
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %20) #2
  %21 = getelementptr inbounds i8, ptr %0, i64 440
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %21) #2
  %22 = getelementptr inbounds i8, ptr %0, i64 400
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %22) #2
  %23 = getelementptr inbounds i8, ptr %0, i64 360
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %23) #2
  %24 = getelementptr inbounds i8, ptr %0, i64 320
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %24) #2
  %25 = getelementptr inbounds i8, ptr %0, i64 280
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %25) #2
  %26 = getelementptr inbounds i8, ptr %0, i64 240
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %26) #2
  %27 = getelementptr inbounds i8, ptr %0, i64 200
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %27) #2
  %28 = getelementptr inbounds i8, ptr %0, i64 160
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %28) #2
  %29 = getelementptr inbounds i8, ptr %0, i64 120
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %29) #2
  %30 = getelementptr inbounds i8, ptr %0, i64 80
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %30) #2
  %31 = getelementptr inbounds i8, ptr %0, i64 40
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %31) #2
  tail call void @_ZN5sc_dt8scfx_repD2Ev(ptr noundef nonnull align 8 dereferenceable(37) %0) #2
  ret void
}

attributes #0 = { 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 #1 = { 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 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GVNPass,IndVarSimplifyPass,InstCombinePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass,TailCallElimPass