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

; 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.CompilerComponent = type <{ ptr, ptr, %"class.std::vector.23", ptr, i32, i8, [3 x i8], i32, [4 x i8] }>
%"class.std::vector.23" = type { %"struct.std::_Vector_base.24" }
%"struct.std::_Vector_base.24" = type { %"struct.std::_Vector_base<SparseVN, std::allocator<SparseVN>>::_Vector_impl" }
%"struct.std::_Vector_base<SparseVN, std::allocator<SparseVN>>::_Vector_impl" = type { %"struct.std::_Vector_base<SparseVN, std::allocator<SparseVN>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SparseVN, std::allocator<SparseVN>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [94 x i8], align 1
@__PRETTY_FUNCTION__._ZN11CompilerMSN22configureSparseSignalsESt6vectorI8SparseVNSaIS1_EEP8DNNLayerj = external hidden unnamed_addr constant [98 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1

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

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

declare noundef zeroext i1 @_Z10ispowerof2j(i32 noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11CompilerMSN22configureSparseSignalsESt6vectorI8SparseVNSaIS1_EEP8DNNLayerj(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) unnamed_addr #3 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  %11 = load ptr, ptr %5, align 8
  %12 = load i32, ptr %8, align 4, !tbaa !9
  %13 = call noundef zeroext i1 @_Z10ispowerof2j(i32 noundef %12)
  br i1 %13, label %14, label %15

14:                                               ; preds = %4
  br label %17

15:                                               ; preds = %4
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 23, ptr noundef @__PRETTY_FUNCTION__._ZN11CompilerMSN22configureSparseSignalsESt6vectorI8SparseVNSaIS1_EEP8DNNLayerj) #5
  unreachable

16:                                               ; No predecessors!
  br label %17

17:                                               ; preds = %16, %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %31, %17
  %19 = load i32, ptr %10, align 4, !tbaa !9
  %20 = sext i32 %19 to i64
  %21 = call noundef i64 @_ZNKSt6vectorI8SparseVNSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %22 = icmp ult i64 %20, %21
  br i1 %22, label %24, label %23

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

24:                                               ; preds = %18
  %25 = load i32, ptr %10, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = call noundef nonnull align 4 dereferenceable(5) ptr @_ZNSt6vectorI8SparseVNSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %26) #6
  %28 = call noundef i32 @_ZN8SparseVN11get_VN_SizeEv(ptr noundef nonnull align 4 dereferenceable(5) %27)
  %29 = load i32, ptr %9, align 4, !tbaa !9
  %30 = add i32 %29, %28
  store i32 %30, ptr %9, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %24
  %32 = load i32, ptr %10, align 4, !tbaa !9
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %10, align 4, !tbaa !9
  br label %18, !llvm.loop !11

34:                                               ; preds = %23
  %35 = load i32, ptr %9, align 4, !tbaa !9
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = icmp ule i32 %35, %36
  br i1 %37, label %38, label %39

38:                                               ; preds = %34
  br label %41

39:                                               ; preds = %34
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 30, ptr noundef @__PRETTY_FUNCTION__._ZN11CompilerMSN22configureSparseSignalsESt6vectorI8SparseVNSaIS1_EEP8DNNLayerj) #5
  unreachable

40:                                               ; No predecessors!
  br label %41

41:                                               ; preds = %40, %38
  %42 = getelementptr inbounds %class.CompilerComponent, ptr %11, i32 0, i32 2
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI8SparseVNSaIS0_EEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %42, ptr noundef nonnull align 8 dereferenceable(24) %1)
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %class.CompilerComponent, ptr %11, i32 0, i32 3
  store ptr %44, ptr %45, align 8, !tbaa !13
  %46 = load i32, ptr %8, align 4, !tbaa !9
  %47 = getelementptr inbounds %class.CompilerComponent, ptr %11, i32 0, i32 4
  store i32 %46, ptr %47, align 8, !tbaa !20
  %48 = getelementptr inbounds %class.CompilerComponent, ptr %11, i32 0, i32 5
  store i8 1, ptr %48, align 4, !tbaa !21
  %49 = load i32, ptr %8, align 4, !tbaa !9
  call void @_ZN11CompilerMSN26generate_ms_sparse_signalsEj(ptr noundef nonnull align 8 dereferenceable(352) %11, i32 noundef %49)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI8SparseVNSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(5) ptr @_ZNSt6vectorI8SparseVNSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI8SparseVNSaIS0_EEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11CompilerMSN26generate_ms_sparse_signalsEj(ptr noundef nonnull align 8 dereferenceable(352), i32 noundef) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #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 }
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 = !{!"any pointer", !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 40}
!14 = !{!"_ZTS17CompilerComponent", !6, i64 8, !15, i64 16, !6, i64 40, !10, i64 48, !19, i64 52, !10, i64 56}
!15 = !{!"_ZTSSt6vectorI8SparseVNSaIS0_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseI8SparseVNSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseI8SparseVNSaIS0_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI8SparseVNSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"bool", !7, i64 0}
!20 = !{!14, !10, i64 48}
!21 = !{!14, !19, i64 52}


; 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 [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [94 x i8], align 1
@__PRETTY_FUNCTION__._ZN11CompilerMSN22configureSparseSignalsESt6vectorI8SparseVNSaIS1_EEP8DNNLayerj = external hidden unnamed_addr constant [98 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1

declare noundef zeroext i1 @_Z10ispowerof2j(i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11CompilerMSN22configureSparseSignalsESt6vectorI8SparseVNSaIS1_EEP8DNNLayerj(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) unnamed_addr #2 align 2 {
  %5 = tail call noundef zeroext i1 @_Z10ispowerof2j(i32 noundef %3)
  br i1 %5, label %.preheader, label %7

.preheader:                                       ; preds = %4
  %6 = tail call noundef i64 @_ZNKSt6vectorI8SparseVNSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %.not15 = icmp eq i64 %6, 0
  br i1 %.not15, label %._crit_edge.thread, label %.lr.ph

7:                                                ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 23, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN11CompilerMSN22configureSparseSignalsESt6vectorI8SparseVNSaIS1_EEP8DNNLayerj) #5
  unreachable

._crit_edge:                                      ; preds = %.lr.ph
  %.not = icmp ugt i32 %10, %3
  br i1 %.not, label %13, label %._crit_edge.thread

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  %.01013 = phi i32 [ %10, %.lr.ph ], [ 0, %.preheader ]
  %8 = tail call noundef nonnull align 4 dereferenceable(5) ptr @_ZNSt6vectorI8SparseVNSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #4
  %9 = tail call noundef i32 @_ZN8SparseVN11get_VN_SizeEv(ptr noundef nonnull align 4 dereferenceable(5) %8)
  %10 = add i32 %9, %.01013
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = tail call noundef i64 @_ZNKSt6vectorI8SparseVNSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %12 = icmp ugt i64 %11, %indvars.iv.next
  br i1 %12, label %.lr.ph, label %._crit_edge, !llvm.loop !5

13:                                               ; preds = %._crit_edge
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 30, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN11CompilerMSN22configureSparseSignalsESt6vectorI8SparseVNSaIS1_EEP8DNNLayerj) #5
  unreachable

._crit_edge.thread:                               ; preds = %.preheader, %._crit_edge
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  %15 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI8SparseVNSaIS0_EEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %1)
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr %2, ptr %16, align 8, !tbaa !7
  %17 = getelementptr inbounds i8, ptr %0, i64 48
  store i32 %3, ptr %17, align 8, !tbaa !18
  %18 = getelementptr inbounds i8, ptr %0, i64 52
  store i8 1, ptr %18, align 4, !tbaa !19
  tail call void @_ZN11CompilerMSN26generate_ms_sparse_signalsEj(ptr noundef nonnull align 8 dereferenceable(352) %0, i32 noundef %3)
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI8SparseVNSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(5) ptr @_ZNSt6vectorI8SparseVNSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN8SparseVN11get_VN_SizeEv(ptr noundef nonnull align 4 dereferenceable(5)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11CompilerMSN26generate_ms_sparse_signalsEj(ptr noundef nonnull align 8 dereferenceable(352), i32 noundef) local_unnamed_addr #2 align 2

attributes #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 = { 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 #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 = { nounwind }
attributes #5 = { noreturn 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !9, i64 40}
!8 = !{!"_ZTS17CompilerComponent", !9, i64 8, !12, i64 16, !9, i64 40, !16, i64 48, !17, i64 52, !16, i64 56}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSSt6vectorI8SparseVNSaIS0_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseI8SparseVNSaIS0_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseI8SparseVNSaIS0_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseI8SparseVNSaIS0_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!16 = !{!"int", !10, i64 0}
!17 = !{!"bool", !10, i64 0}
!18 = !{!8, !16, i64 48}
!19 = !{!8, !17, i64 52}


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