; LLVM IR from stonne-simulator/omega :: omega-code/stonne/src/MultiplierOS.ll (ZN12MultiplierOS12resetSignalsEv)

; 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.MultiplierOS = type <{ %class.Unit, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %class.MultiplierOSStats, i32, i8, i8, [2 x i8] }>
%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.MultiplierOSStats = type <{ %class.Stats, i32, i32, i32, i32, i32, i32, i32, [4 x i8] }>
%class.Stats = type { ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12MultiplierOS12resetSignalsEv(ptr noundef nonnull align 8 dereferenceable(222) %0) #0 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.MultiplierOS, ptr %3, i32 0, i32 25
  store i8 0, ptr %4, align 4, !tbaa !9
  %5 = getelementptr inbounds %class.MultiplierOS, ptr %3, i32 0, i32 26
  store i8 0, ptr %5, align 1, !tbaa !19
  %6 = getelementptr inbounds %class.MultiplierOS, ptr %3, i32 0, i32 24
  store i32 0, ptr %6, align 8, !tbaa !20
  br label %7

7:                                                ; preds = %12, %1
  %8 = getelementptr inbounds %class.MultiplierOS, ptr %3, i32 0, i32 2
  %9 = load ptr, ptr %8, align 8, !tbaa !21
  %10 = call noundef zeroext i1 @_ZN4Fifo7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %9)
  %11 = xor i1 %10, true
  br i1 %11, label %12, label %16

12:                                               ; preds = %7
  %13 = getelementptr inbounds %class.MultiplierOS, ptr %3, i32 0, i32 2
  %14 = load ptr, ptr %13, align 8, !tbaa !21
  %15 = call noundef ptr @_ZN4Fifo3popEv(ptr noundef nonnull align 8 dereferenceable(120) %14)
  br label %7, !llvm.loop !22

16:                                               ; preds = %7
  br label %17

17:                                               ; preds = %22, %16
  %18 = getelementptr inbounds %class.MultiplierOS, ptr %3, i32 0, i32 3
  %19 = load ptr, ptr %18, align 8, !tbaa !24
  %20 = call noundef zeroext i1 @_ZN4Fifo7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %19)
  %21 = xor i1 %20, true
  br i1 %21, label %22, label %26

22:                                               ; preds = %17
  %23 = getelementptr inbounds %class.MultiplierOS, ptr %3, i32 0, i32 3
  %24 = load ptr, ptr %23, align 8, !tbaa !24
  %25 = call noundef ptr @_ZN4Fifo3popEv(ptr noundef nonnull align 8 dereferenceable(120) %24)
  br label %17, !llvm.loop !25

26:                                               ; preds = %17
  br label %27

27:                                               ; preds = %32, %26
  %28 = getelementptr inbounds %class.MultiplierOS, ptr %3, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !26
  %30 = call noundef zeroext i1 @_ZN4Fifo7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %29)
  %31 = xor i1 %30, true
  br i1 %31, label %32, label %36

32:                                               ; preds = %27
  %33 = getelementptr inbounds %class.MultiplierOS, ptr %3, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !26
  %35 = call noundef ptr @_ZN4Fifo3popEv(ptr noundef nonnull align 8 dereferenceable(120) %34)
  br label %27, !llvm.loop !27

36:                                               ; preds = %27
  br label %37

37:                                               ; preds = %42, %36
  %38 = getelementptr inbounds %class.MultiplierOS, ptr %3, i32 0, i32 4
  %39 = load ptr, ptr %38, align 8, !tbaa !28
  %40 = call noundef zeroext i1 @_ZN4Fifo7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %39)
  %41 = xor i1 %40, true
  br i1 %41, label %42, label %46

42:                                               ; preds = %37
  %43 = getelementptr inbounds %class.MultiplierOS, ptr %3, i32 0, i32 4
  %44 = load ptr, ptr %43, align 8, !tbaa !28
  %45 = call noundef ptr @_ZN4Fifo3popEv(ptr noundef nonnull align 8 dereferenceable(120) %44)
  br label %37, !llvm.loop !29

46:                                               ; preds = %37
  ret void
}

declare noundef zeroext i1 @_ZN4Fifo7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(120)) #1

declare noundef ptr @_ZN4Fifo3popEv(ptr noundef nonnull align 8 dereferenceable(120)) #1

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 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !18, i64 220}
!10 = !{!"_ZTS12MultiplierOS", !11, i64 0, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !12, i64 148, !12, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !12, i64 172, !16, i64 176, !12, i64 216, !18, i64 220, !18, i64 221}
!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 = !{!"_ZTS17MultiplierOSStats", !17, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32}
!17 = !{!"_ZTS5Stats"}
!18 = !{!"bool", !7, i64 0}
!19 = !{!10, !18, i64 221}
!20 = !{!10, !12, i64 216}
!21 = !{!10, !6, i64 56}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!10, !6, i64 64}
!25 = distinct !{!25, !23}
!26 = !{!10, !6, i64 48}
!27 = distinct !{!27, !23}
!28 = !{!10, !6, i64 72}
!29 = distinct !{!29, !23}


; 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: mustprogress uwtable
define dso_local void @_ZN12MultiplierOS12resetSignalsEv(ptr nocapture noundef nonnull align 8 dereferenceable(222) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 220
  store i8 0, ptr %2, align 4, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 221
  store i8 0, ptr %3, align 1, !tbaa !18
  %4 = getelementptr inbounds i8, ptr %0, i64 216
  store i32 0, ptr %4, align 8, !tbaa !19
  %5 = getelementptr inbounds i8, ptr %0, i64 56
  %6 = load ptr, ptr %5, align 8, !tbaa !20
  %7 = tail call noundef zeroext i1 @_ZN4Fifo7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %6)
  br i1 %7, label %.preheader2, label %.lr.ph

.preheader2:                                      ; preds = %.lr.ph, %1
  %8 = getelementptr inbounds i8, ptr %0, i64 64
  %9 = load ptr, ptr %8, align 8, !tbaa !21
  %10 = tail call noundef zeroext i1 @_ZN4Fifo7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %9)
  br i1 %10, label %.preheader1, label %.lr.ph3

.lr.ph:                                           ; preds = %1, %.lr.ph
  %11 = load ptr, ptr %5, align 8, !tbaa !20
  %12 = tail call noundef ptr @_ZN4Fifo3popEv(ptr noundef nonnull align 8 dereferenceable(120) %11)
  %13 = load ptr, ptr %5, align 8, !tbaa !20
  %14 = tail call noundef zeroext i1 @_ZN4Fifo7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %13)
  br i1 %14, label %.preheader2, label %.lr.ph, !llvm.loop !22

.preheader1:                                      ; preds = %.lr.ph3, %.preheader2
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  %16 = load ptr, ptr %15, align 8, !tbaa !24
  %17 = tail call noundef zeroext i1 @_ZN4Fifo7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %16)
  br i1 %17, label %.preheader, label %.lr.ph4

.lr.ph3:                                          ; preds = %.preheader2, %.lr.ph3
  %18 = load ptr, ptr %8, align 8, !tbaa !21
  %19 = tail call noundef ptr @_ZN4Fifo3popEv(ptr noundef nonnull align 8 dereferenceable(120) %18)
  %20 = load ptr, ptr %8, align 8, !tbaa !21
  %21 = tail call noundef zeroext i1 @_ZN4Fifo7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %20)
  br i1 %21, label %.preheader1, label %.lr.ph3, !llvm.loop !25

.preheader:                                       ; preds = %.lr.ph4, %.preheader1
  %22 = getelementptr inbounds i8, ptr %0, i64 72
  %23 = load ptr, ptr %22, align 8, !tbaa !26
  %24 = tail call noundef zeroext i1 @_ZN4Fifo7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %23)
  br i1 %24, label %._crit_edge, label %.lr.ph5

.lr.ph4:                                          ; preds = %.preheader1, %.lr.ph4
  %25 = load ptr, ptr %15, align 8, !tbaa !24
  %26 = tail call noundef ptr @_ZN4Fifo3popEv(ptr noundef nonnull align 8 dereferenceable(120) %25)
  %27 = load ptr, ptr %15, align 8, !tbaa !24
  %28 = tail call noundef zeroext i1 @_ZN4Fifo7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %27)
  br i1 %28, label %.preheader, label %.lr.ph4, !llvm.loop !27

.lr.ph5:                                          ; preds = %.preheader, %.lr.ph5
  %29 = load ptr, ptr %22, align 8, !tbaa !26
  %30 = tail call noundef ptr @_ZN4Fifo3popEv(ptr noundef nonnull align 8 dereferenceable(120) %29)
  %31 = load ptr, ptr %22, align 8, !tbaa !26
  %32 = tail call noundef zeroext i1 @_ZN4Fifo7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %31)
  br i1 %32, label %._crit_edge, label %.lr.ph5, !llvm.loop !28

._crit_edge:                                      ; preds = %.lr.ph5, %.preheader
  ret void
}

declare noundef zeroext i1 @_ZN4Fifo7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #1

declare noundef ptr @_ZN4Fifo3popEv(ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #1

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 = { "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, !17, i64 220}
!6 = !{!"_ZTS12MultiplierOS", !7, i64 0, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !8, i64 128, !8, i64 132, !8, i64 136, !8, i64 140, !8, i64 144, !8, i64 148, !8, i64 152, !8, i64 156, !8, i64 160, !8, i64 164, !8, i64 168, !8, i64 172, !15, i64 176, !8, i64 216, !17, i64 220, !17, i64 221}
!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 = !{!"_ZTS17MultiplierOSStats", !16, i64 0, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28, !8, i64 32}
!16 = !{!"_ZTS5Stats"}
!17 = !{!"bool", !9, i64 0}
!18 = !{!6, !17, i64 221}
!19 = !{!6, !8, i64 216}
!20 = !{!6, !13, i64 56}
!21 = !{!6, !13, i64 64}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!6, !13, i64 48}
!25 = distinct !{!25, !23}
!26 = !{!6, !13, i64 72}
!27 = distinct !{!27, !23}
!28 = distinct !{!28, !23}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass