; LLVM IR from stonne-simulator/omega :: omega-code/stonne/src (Accumulator)

; 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.Accumulator = type { %class.Unit, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, ptr, ptr, i32, i32, %class.ASwitchStats, ptr, i32, i32, i32, [4 x i8], %class.AccumulatorStats }
%class.Unit = type { ptr, i32, %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%class.ASwitchStats = type <{ %class.Stats, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x i8] }>
%class.Stats = type { ptr }
%class.AccumulatorStats = type <{ %class.Stats, i32, i32, i32, i32, i32, i32, i32, [4 x i8] }>

@.str = external hidden unnamed_addr constant [42 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [94 x i8], align 1
@__PRETTY_FUNCTION__._ZN11Accumulator28perform_operation_2_operandsEP11DataPackageS1_ = external hidden unnamed_addr constant [85 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #0

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN11Accumulator28perform_operation_2_operandsEP11DataPackageS1_(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef %1, ptr noundef %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %11 = load ptr, ptr %4, align 8
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = call noundef i32 @_ZNK11DataPackage6get_vnEv(ptr noundef nonnull align 8 dereferenceable(64) %12)
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = call noundef i32 @_ZNK11DataPackage6get_vnEv(ptr noundef nonnull align 8 dereferenceable(64) %14)
  %16 = icmp eq i32 %13, %15
  br i1 %16, label %17, label %18

17:                                               ; preds = %3
  br label %20

18:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 105, ptr noundef @__PRETTY_FUNCTION__._ZN11Accumulator28perform_operation_2_operandsEP11DataPackageS1_) #7
  unreachable

19:                                               ; No predecessors!
  br label %20

20:                                               ; preds = %19, %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %21 = getelementptr inbounds %class.Accumulator, ptr %11, i32 0, i32 9
  %22 = load i32, ptr %21, align 8, !tbaa !9
  switch i32 %22, label %33 [
    i32 0, label %23
  ]

23:                                               ; preds = %20
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = call noundef float @_ZNK11DataPackage8get_dataEv(ptr noundef nonnull align 8 dereferenceable(64) %24)
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = call noundef float @_ZNK11DataPackage8get_dataEv(ptr noundef nonnull align 8 dereferenceable(64) %26)
  %28 = fadd float %25, %27
  store float %28, ptr %7, align 4, !tbaa !20
  %29 = getelementptr inbounds %class.Accumulator, ptr %11, i32 0, i32 21
  %30 = getelementptr inbounds %class.AccumulatorStats, ptr %29, i32 0, i32 2
  %31 = load i32, ptr %30, align 4, !tbaa !22
  %32 = add i32 %31, 1
  store i32 %32, ptr %30, align 4, !tbaa !22
  br label %34

33:                                               ; preds = %20
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 119, ptr noundef @__PRETTY_FUNCTION__._ZN11Accumulator28perform_operation_2_operandsEP11DataPackageS1_) #7
  unreachable

34:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %35 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 64) #9
  %36 = load float, ptr %7, align 4, !tbaa !20
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = invoke noundef i32 @_ZNK11DataPackage6get_vnEv(ptr noundef nonnull align 8 dereferenceable(64) %37)
          to label %39 unwind label %44

39:                                               ; preds = %34
  %40 = getelementptr inbounds %class.Accumulator, ptr %11, i32 0, i32 9
  %41 = load i32, ptr %40, align 8, !tbaa !9
  invoke void @_ZN11DataPackageC1Emf9operand_tjj16adderoperation_t(ptr noundef nonnull align 8 dereferenceable(64) %35, i64 noundef 4, float noundef %36, i32 noundef 3, i32 noundef 0, i32 noundef %38, i32 noundef %41)
          to label %42 unwind label %44

42:                                               ; preds = %39
  store ptr %35, ptr %8, align 8, !tbaa !5
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  ret ptr %43

44:                                               ; preds = %39, %34
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %9, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %10, align 4
  call void @_ZdlPvm(ptr noundef %35, i64 noundef 64) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %48

48:                                               ; preds = %44
  %49 = load ptr, ptr %9, align 8
  %50 = load i32, ptr %10, align 4
  %51 = insertvalue { ptr, i32 } poison, ptr %49, 0
  %52 = insertvalue { ptr, i32 } %51, i32 %50, 1
  resume { ptr, i32 } %52
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK11DataPackage6get_vnEv(ptr noundef nonnull align 8 dereferenceable(64)) #4 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK11DataPackage8get_dataEv(ptr noundef nonnull align 8 dereferenceable(64)) #4 align 2

declare void @_ZN11DataPackageC1Emf9operand_tjj16adderoperation_t(ptr noundef nonnull align 8 dereferenceable(64), i64 noundef, float noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #6

attributes #0 = { nobuiltin allocsize(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 = { nobuiltin 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 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 = { noreturn 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 #6 = { "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 = { noreturn nounwind }
attributes #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin 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"}
!9 = !{!10, !16, i64 88}
!10 = !{!"_ZTS11Accumulator", !11, i64 0, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !6, i64 72, !6, i64 80, !16, i64 88, !12, i64 92, !6, i64 96, !6, i64 104, !12, i64 112, !12, i64 116, !17, i64 120, !6, i64 168, !12, i64 176, !12, i64 180, !12, i64 184, !19, i64 192}
!11 = !{!"_ZTS4Unit", !12, i64 8, !13, i64 16}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !14, i64 0, !15, i64 8, !7, i64 16}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTS16adderoperation_t", !7, i64 0}
!17 = !{!"_ZTS12ASwitchStats", !18, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40}
!18 = !{!"_ZTS5Stats"}
!19 = !{!"_ZTS16AccumulatorStats", !18, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32}
!20 = !{!21, !21, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = !{!10, !12, i64 204}


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

@.str = external hidden unnamed_addr constant [42 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [94 x i8], align 1
@__PRETTY_FUNCTION__._ZN11Accumulator28perform_operation_2_operandsEP11DataPackageS1_ = external hidden unnamed_addr constant [85 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #0

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull ptr @_ZN11Accumulator28perform_operation_2_operandsEP11DataPackageS1_(ptr nocapture noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull %1, ptr noundef %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = tail call noundef i32 @_ZNK11DataPackage6get_vnEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %5 = tail call noundef i32 @_ZNK11DataPackage6get_vnEv(ptr noundef nonnull align 8 dereferenceable(64) %2)
  %6 = icmp eq i32 %4, %5
  br i1 %6, label %8, label %7

7:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 105, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN11Accumulator28perform_operation_2_operandsEP11DataPackageS1_) #6
  unreachable

8:                                                ; preds = %3
  %9 = getelementptr inbounds i8, ptr %0, i64 88
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %cond = icmp eq i32 %10, 0
  br i1 %cond, label %11, label %21

11:                                               ; preds = %8
  %12 = tail call noundef float @_ZNK11DataPackage8get_dataEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %13 = tail call noundef float @_ZNK11DataPackage8get_dataEv(ptr noundef nonnull align 8 dereferenceable(64) %2)
  %14 = fadd float %12, %13
  %15 = getelementptr inbounds i8, ptr %0, i64 204
  %16 = load i32, ptr %15, align 4, !tbaa !19
  %17 = add i32 %16, 1
  store i32 %17, ptr %15, align 4, !tbaa !19
  %18 = tail call noalias noundef nonnull dereferenceable(64) ptr @_Znwm(i64 noundef 64) #7
  %19 = tail call noundef i32 @_ZNK11DataPackage6get_vnEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %20 = load i32, ptr %9, align 8, !tbaa !5
  invoke void @_ZN11DataPackageC1Emf9operand_tjj16adderoperation_t(ptr noundef nonnull align 8 dereferenceable(64) %18, i64 noundef 4, float noundef %14, i32 noundef 3, i32 noundef 0, i32 noundef %19, i32 noundef %20)
          to label %22 unwind label %23

21:                                               ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 119, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN11Accumulator28perform_operation_2_operandsEP11DataPackageS1_) #6
  unreachable

22:                                               ; preds = %11
  ret ptr %18

23:                                               ; preds = %11
  %24 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %18, i64 noundef 64) #8
  resume { ptr, i32 } %24
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK11DataPackage6get_vnEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #3 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK11DataPackage8get_dataEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #3 align 2

declare void @_ZN11DataPackageC1Emf9operand_tjj16adderoperation_t(ptr noundef nonnull align 8 dereferenceable(64), i64 noundef, float noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #5

attributes #0 = { nobuiltin allocsize(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 = { nobuiltin 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 #2 = { 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 #3 = { 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 = { noreturn 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 = { "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 = { noreturn nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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, !15, i64 88}
!6 = !{!"_ZTS11Accumulator", !7, i64 0, !8, i64 48, !8, i64 52, !8, i64 56, !8, i64 60, !8, i64 64, !8, i64 68, !13, i64 72, !13, i64 80, !15, i64 88, !8, i64 92, !13, i64 96, !13, i64 104, !8, i64 112, !8, i64 116, !16, i64 120, !13, i64 168, !8, i64 176, !8, i64 180, !8, i64 184, !18, i64 192}
!7 = !{!"_ZTS4Unit", !8, i64 8, !11, i64 16}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !14, i64 8, !9, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !13, i64 0}
!13 = !{!"any pointer", !9, i64 0}
!14 = !{!"long", !9, i64 0}
!15 = !{!"_ZTS16adderoperation_t", !9, i64 0}
!16 = !{!"_ZTS12ASwitchStats", !17, i64 0, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28, !8, i64 32, !8, i64 36, !8, i64 40}
!17 = !{!"_ZTS5Stats"}
!18 = !{!"_ZTS16AccumulatorStats", !17, i64 0, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28, !8, i64 32}
!19 = !{!6, !8, i64 204}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass