; LLVM IR from yuikns/panther :: ann/src/perf.ll (Z13annPrintStats7ANNbool)

; 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.ANNsampStat = type { i32, double, double, double, double }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@ann_Ndata_pts = external dso_local global i32, align 4
@ann_visit_lfs = external dso_local global %class.ANNsampStat, align 8
@ann_visit_spl = external dso_local global %class.ANNsampStat, align 8
@ann_visit_shr = external dso_local global %class.ANNsampStat, align 8
@ann_visit_nds = external dso_local global %class.ANNsampStat, align 8
@ann_visit_pts = external dso_local global %class.ANNsampStat, align 8
@ann_coord_hts = external dso_local global %class.ANNsampStat, align 8
@ann_float_ops = external dso_local global %class.ANNsampStat, align 8
@ann_average_err = external dso_local global %class.ANNsampStat, align 8
@ann_rank_err = external dso_local global %class.ANNsampStat, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef, ptr noundef byval(%class.ANNsampStat) align 8, double noundef) #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13annPrintStats7ANNbool(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca %class.ANNsampStat, align 8
  %4 = alloca %class.ANNsampStat, align 8
  %5 = alloca %class.ANNsampStat, align 8
  %6 = alloca %class.ANNsampStat, align 8
  %7 = alloca %class.ANNsampStat, align 8
  %8 = alloca %class.ANNsampStat, align 8
  %9 = alloca %class.ANNsampStat, align 8
  %10 = alloca %class.ANNsampStat, align 8
  %11 = alloca %class.ANNsampStat, align 8
  store i32 %0, ptr %2, align 4, !tbaa !5
  %12 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !9
  %13 = getelementptr i8, ptr %12, i64 -24
  %14 = load i64, ptr %13, align 8
  %15 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %14
  %16 = call noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216) %15, i64 noundef 4)
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.14)
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef @.str.15)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 @ann_visit_lfs, i64 40, i1 false), !tbaa.struct !11
  call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef @.str.16, ptr noundef byval(%class.ANNsampStat) align 8 %3, double noundef 1.000000e+00)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 @ann_visit_spl, i64 40, i1 false), !tbaa.struct !11
  call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef @.str.17, ptr noundef byval(%class.ANNsampStat) align 8 %4, double noundef 1.000000e+00)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 @ann_visit_shr, i64 40, i1 false), !tbaa.struct !11
  call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef @.str.18, ptr noundef byval(%class.ANNsampStat) align 8 %5, double noundef 1.000000e+00)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 @ann_visit_nds, i64 40, i1 false), !tbaa.struct !11
  call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef @.str.19, ptr noundef byval(%class.ANNsampStat) align 8 %6, double noundef 1.000000e+00)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 @ann_visit_pts, i64 40, i1 false), !tbaa.struct !11
  call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef @.str.20, ptr noundef byval(%class.ANNsampStat) align 8 %7, double noundef 1.000000e+00)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 @ann_coord_hts, i64 40, i1 false), !tbaa.struct !11
  %19 = load i32, ptr @ann_Ndata_pts, align 4, !tbaa !12
  %20 = sitofp i32 %19 to double
  call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef @.str.21, ptr noundef byval(%class.ANNsampStat) align 8 %8, double noundef %20)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 @ann_float_ops, i64 40, i1 false), !tbaa.struct !11
  call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef @.str.22, ptr noundef byval(%class.ANNsampStat) align 8 %9, double noundef 1.000000e+03)
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 @ann_average_err, i64 40, i1 false), !tbaa.struct !11
  call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef @.str.23, ptr noundef byval(%class.ANNsampStat) align 8 %10, double noundef 1.000000e+00)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 @ann_rank_err, i64 40, i1 false), !tbaa.struct !11
  call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef @.str.24, ptr noundef byval(%class.ANNsampStat) align 8 %11, double noundef 1.000000e+00)
  br label %24

24:                                               ; preds = %23, %1
  %25 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !9
  %26 = getelementptr i8, ptr %25, i64 -24
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %27
  %29 = call noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216) %28, i64 noundef 0)
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.25)
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout)
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216), i64 noundef) #2 align 2

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8)) #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 = { 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 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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" }

!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 = !{!"_ZTS7ANNbool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{i64 0, i64 4, !12, i64 8, i64 8, !14, i64 16, i64 8, !14, i64 24, i64 8, !14, i64 32, i64 8, !14}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}


; 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.ANNsampStat = type { i32, double, double, double, double }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@ann_Ndata_pts = external dso_local local_unnamed_addr global i32, align 4
@ann_visit_lfs = external dso_local local_unnamed_addr global %class.ANNsampStat, align 8
@ann_visit_spl = external dso_local local_unnamed_addr global %class.ANNsampStat, align 8
@ann_visit_shr = external dso_local local_unnamed_addr global %class.ANNsampStat, align 8
@ann_visit_nds = external dso_local local_unnamed_addr global %class.ANNsampStat, align 8
@ann_visit_pts = external dso_local local_unnamed_addr global %class.ANNsampStat, align 8
@ann_coord_hts = external dso_local local_unnamed_addr global %class.ANNsampStat, align 8
@ann_float_ops = external dso_local local_unnamed_addr global %class.ANNsampStat, align 8
@ann_average_err = external dso_local local_unnamed_addr global %class.ANNsampStat, align 8
@ann_rank_err = external dso_local local_unnamed_addr global %class.ANNsampStat, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef, ptr noundef byval(%class.ANNsampStat) align 8, double noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13annPrintStats7ANNbool(i32 noundef %0) local_unnamed_addr #0 {
  %2 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %4
  %6 = tail call noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216) %5, i64 noundef 4)
  %7 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.14)
  %8 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull @.str.15)
  tail call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef nonnull @.str.16, ptr noundef nonnull byval(%class.ANNsampStat) align 8 @ann_visit_lfs, double noundef 1.000000e+00)
  tail call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef nonnull @.str.17, ptr noundef nonnull byval(%class.ANNsampStat) align 8 @ann_visit_spl, double noundef 1.000000e+00)
  tail call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef nonnull @.str.18, ptr noundef nonnull byval(%class.ANNsampStat) align 8 @ann_visit_shr, double noundef 1.000000e+00)
  tail call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef nonnull @.str.19, ptr noundef nonnull byval(%class.ANNsampStat) align 8 @ann_visit_nds, double noundef 1.000000e+00)
  tail call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef nonnull @.str.20, ptr noundef nonnull byval(%class.ANNsampStat) align 8 @ann_visit_pts, double noundef 1.000000e+00)
  %9 = load i32, ptr @ann_Ndata_pts, align 4, !tbaa !8
  %10 = sitofp i32 %9 to double
  tail call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef nonnull @.str.21, ptr noundef nonnull byval(%class.ANNsampStat) align 8 @ann_coord_hts, double noundef %10)
  tail call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef nonnull @.str.22, ptr noundef nonnull byval(%class.ANNsampStat) align 8 @ann_float_ops, double noundef 1.000000e+03)
  %.not = icmp eq i32 %0, 0
  br i1 %.not, label %12, label %11

11:                                               ; preds = %1
  tail call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef nonnull @.str.23, ptr noundef nonnull byval(%class.ANNsampStat) align 8 @ann_average_err, double noundef 1.000000e+00)
  tail call void @_Z14print_one_statPKc11ANNsampStatd(ptr noundef nonnull @.str.24, ptr noundef nonnull byval(%class.ANNsampStat) align 8 @ann_rank_err, double noundef 1.000000e+00)
  br label %12

12:                                               ; preds = %11, %1
  %13 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %15
  %17 = tail call noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216) %16, i64 noundef 0)
  %18 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.25)
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout)
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216), i64 noundef) local_unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8)) 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 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 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 = { "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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}


; Effective O3 passes: DSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SROAPass,TailCallElimPass