; LLVM IR from gem5/gem5 :: ext/mcpat/cacti/decoder.ll (ZN6Predec28get_max_delay_before_decoderESt4pairIddES1_)

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

%"struct.std::pair" = type { double, double }
%class.Predec = type { %class.Component, ptr, ptr, ptr, ptr, %class.powerDef, %class.powerDef }
%class.Component = type { %class.Area, %class.powerDef, %class.powerDef, double, double }
%class.Area = type { double, double, double }
%class.powerDef = type { %class.powerComponents, %class.powerComponents, %class.powerComponents }
%class.powerComponents = type { double, double, double, double, double }
%class.PredecBlkDrv = type { %class.Component, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, double, double, double, double, [20 x double], [20 x double], [20 x double], [20 x double], double, double, %class.powerDef, %class.powerDef, ptr, ptr, i8, i32 }
%class.PredecBlk = type <{ %class.Component, ptr, i8, [3 x i8], i32, double, double, i32, i32, i8, [3 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, [20 x double], [20 x double], [20 x double], [20 x double], [20 x double], [20 x double], double, double, %class.powerDef, %class.powerDef, %class.powerDef, i8, [7 x i8] }>

; 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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local { double, double } @_ZN6Predec28get_max_delay_before_decoderESt4pairIddES1_(ptr noundef nonnull align 8 dereferenceable(552) %0, double %1, double %2, double %3, double %4) #2 align 2 {
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca ptr, align 8
  %10 = alloca double, align 8
  %11 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 0
  store double %1, ptr %11, align 8
  %12 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 1
  store double %2, ptr %12, align 8
  %13 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  store double %3, ptr %13, align 8
  %14 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  store double %4, ptr %14, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  %15 = load ptr, ptr %9, align 8
  call void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %16 = getelementptr inbounds %class.Predec, ptr %15, i32 0, i32 3
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = getelementptr inbounds %class.PredecBlkDrv, ptr %17, i32 0, i32 20
  %19 = load double, ptr %18, align 8, !tbaa !16
  %20 = getelementptr inbounds %class.Predec, ptr %15, i32 0, i32 1
  %21 = load ptr, ptr %20, align 8, !tbaa !20
  %22 = getelementptr inbounds %class.PredecBlk, ptr %21, i32 0, i32 26
  %23 = load double, ptr %22, align 8, !tbaa !21
  %24 = fadd double %19, %23
  store double %24, ptr %10, align 8, !tbaa !23
  %25 = load double, ptr %10, align 8, !tbaa !23
  %26 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  store double %25, ptr %26, align 8, !tbaa !24
  %27 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 0
  %28 = load double, ptr %27, align 8, !tbaa !24
  %29 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  store double %28, ptr %29, align 8, !tbaa !26
  %30 = getelementptr inbounds %class.Predec, ptr %15, i32 0, i32 3
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = getelementptr inbounds %class.PredecBlkDrv, ptr %31, i32 0, i32 21
  %33 = load double, ptr %32, align 8, !tbaa !27
  %34 = getelementptr inbounds %class.Predec, ptr %15, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !20
  %36 = getelementptr inbounds %class.PredecBlk, ptr %35, i32 0, i32 27
  %37 = load double, ptr %36, align 8, !tbaa !28
  %38 = fadd double %33, %37
  store double %38, ptr %10, align 8, !tbaa !23
  %39 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %40 = load double, ptr %39, align 8, !tbaa !24
  %41 = load double, ptr %10, align 8, !tbaa !23
  %42 = fcmp olt double %40, %41
  br i1 %42, label %43, label %49

43:                                               ; preds = %5
  %44 = load double, ptr %10, align 8, !tbaa !23
  %45 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  store double %44, ptr %45, align 8, !tbaa !24
  %46 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 1
  %47 = load double, ptr %46, align 8, !tbaa !26
  %48 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  store double %47, ptr %48, align 8, !tbaa !26
  br label %49

49:                                               ; preds = %43, %5
  %50 = getelementptr inbounds %class.Predec, ptr %15, i32 0, i32 4
  %51 = load ptr, ptr %50, align 8, !tbaa !29
  %52 = getelementptr inbounds %class.PredecBlkDrv, ptr %51, i32 0, i32 20
  %53 = load double, ptr %52, align 8, !tbaa !16
  %54 = getelementptr inbounds %class.Predec, ptr %15, i32 0, i32 2
  %55 = load ptr, ptr %54, align 8, !tbaa !30
  %56 = getelementptr inbounds %class.PredecBlk, ptr %55, i32 0, i32 26
  %57 = load double, ptr %56, align 8, !tbaa !21
  %58 = fadd double %53, %57
  store double %58, ptr %10, align 8, !tbaa !23
  %59 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %60 = load double, ptr %59, align 8, !tbaa !24
  %61 = load double, ptr %10, align 8, !tbaa !23
  %62 = fcmp olt double %60, %61
  br i1 %62, label %63, label %69

63:                                               ; preds = %49
  %64 = load double, ptr %10, align 8, !tbaa !23
  %65 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  store double %64, ptr %65, align 8, !tbaa !24
  %66 = getelementptr inbounds %"struct.std::pair", ptr %8, i32 0, i32 0
  %67 = load double, ptr %66, align 8, !tbaa !24
  %68 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  store double %67, ptr %68, align 8, !tbaa !26
  br label %69

69:                                               ; preds = %63, %49
  %70 = getelementptr inbounds %class.Predec, ptr %15, i32 0, i32 4
  %71 = load ptr, ptr %70, align 8, !tbaa !29
  %72 = getelementptr inbounds %class.PredecBlkDrv, ptr %71, i32 0, i32 21
  %73 = load double, ptr %72, align 8, !tbaa !27
  %74 = getelementptr inbounds %class.Predec, ptr %15, i32 0, i32 2
  %75 = load ptr, ptr %74, align 8, !tbaa !30
  %76 = getelementptr inbounds %class.PredecBlk, ptr %75, i32 0, i32 27
  %77 = load double, ptr %76, align 8, !tbaa !28
  %78 = fadd double %73, %77
  store double %78, ptr %10, align 8, !tbaa !23
  %79 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %80 = load double, ptr %79, align 8, !tbaa !24
  %81 = load double, ptr %10, align 8, !tbaa !23
  %82 = fcmp olt double %80, %81
  br i1 %82, label %83, label %89

83:                                               ; preds = %69
  %84 = load double, ptr %10, align 8, !tbaa !23
  %85 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  store double %84, ptr %85, align 8, !tbaa !24
  %86 = getelementptr inbounds %"struct.std::pair", ptr %8, i32 0, i32 1
  %87 = load double, ptr %86, align 8, !tbaa !26
  %88 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  store double %87, ptr %88, align 8, !tbaa !26
  br label %89

89:                                               ; preds = %83, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %90 = load { double, double }, ptr %6, align 8
  ret { double, double } %90
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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, !6, i64 296}
!10 = !{!"_ZTS6Predec", !11, i64 0, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !14, i64 312, !14, i64 432}
!11 = !{!"_ZTS9Component", !12, i64 0, !14, i64 24, !14, i64 144, !13, i64 264, !13, i64 272}
!12 = !{!"_ZTS4Area", !13, i64 0, !13, i64 8, !13, i64 16}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_ZTS8powerDef", !15, i64 0, !15, i64 40, !15, i64 80}
!15 = !{!"_ZTS15powerComponents", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32}
!16 = !{!17, !13, i64 1000}
!17 = !{!"_ZTS12PredecBlkDrv", !11, i64 0, !18, i64 280, !18, i64 284, !18, i64 288, !18, i64 292, !18, i64 296, !18, i64 300, !18, i64 304, !18, i64 308, !18, i64 312, !18, i64 316, !18, i64 320, !13, i64 328, !13, i64 336, !13, i64 344, !13, i64 352, !7, i64 360, !7, i64 520, !7, i64 680, !7, i64 840, !13, i64 1000, !13, i64 1008, !14, i64 1016, !14, i64 1136, !6, i64 1256, !6, i64 1264, !19, i64 1272, !18, i64 1276}
!18 = !{!"int", !7, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!10, !6, i64 280}
!21 = !{!22, !13, i64 1320}
!22 = !{!"_ZTS9PredecBlk", !11, i64 0, !6, i64 280, !19, i64 288, !18, i64 292, !13, i64 296, !13, i64 304, !18, i64 312, !18, i64 316, !19, i64 320, !18, i64 324, !18, i64 328, !18, i64 332, !18, i64 336, !18, i64 340, !18, i64 344, !18, i64 348, !18, i64 352, !18, i64 356, !7, i64 360, !7, i64 520, !7, i64 680, !7, i64 840, !7, i64 1000, !7, i64 1160, !13, i64 1320, !13, i64 1328, !14, i64 1336, !14, i64 1456, !14, i64 1576, !19, i64 1696}
!23 = !{!13, !13, i64 0}
!24 = !{!25, !13, i64 0}
!25 = !{!"_ZTSSt4pairIddE", !13, i64 0, !13, i64 8}
!26 = !{!25, !13, i64 8}
!27 = !{!17, !13, i64 1008}
!28 = !{!22, !13, i64 1328}
!29 = !{!10, !6, i64 304}
!30 = !{!10, !6, i64 288}


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

%"struct.std::pair" = type { double, double }

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local { double, double } @_ZN6Predec28get_max_delay_before_decoderESt4pairIddES1_(ptr nocapture noundef nonnull readonly align 8 dereferenceable(552) %0, double %1, double %2, double %3, double %4) local_unnamed_addr #0 align 2 {
  %6 = alloca %"struct.std::pair", align 8
  call void @_ZNSt4pairIddEC2IddTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %7 = getelementptr inbounds i8, ptr %0, i64 296
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %8, i64 1000
  %10 = getelementptr inbounds i8, ptr %0, i64 280
  %11 = load ptr, ptr %10, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %11, i64 1320
  %13 = load <2 x double>, ptr %9, align 8, !tbaa !16
  %14 = load <2 x double>, ptr %12, align 8, !tbaa !16
  %15 = fadd <2 x double> %13, %14
  %16 = extractelement <2 x double> %15, i64 0
  %17 = extractelement <2 x double> %15, i64 1
  %18 = fcmp olt double %16, %17
  %.fca.1.load15 = select i1 %18, double %2, double %1
  %19 = select i1 %18, double %17, double %16
  %20 = getelementptr inbounds i8, ptr %0, i64 304
  %21 = load ptr, ptr %20, align 8, !tbaa !17
  %22 = getelementptr inbounds i8, ptr %21, i64 1000
  %23 = load double, ptr %22, align 8, !tbaa !18
  %24 = getelementptr inbounds i8, ptr %0, i64 288
  %25 = load ptr, ptr %24, align 8, !tbaa !22
  %26 = getelementptr inbounds i8, ptr %25, i64 1320
  %27 = load double, ptr %26, align 8, !tbaa !23
  %28 = fadd double %23, %27
  %29 = fcmp olt double %19, %28
  %.fca.1.load14 = select i1 %29, double %3, double %.fca.1.load15
  %30 = select i1 %29, double %28, double %19
  %31 = getelementptr inbounds i8, ptr %21, i64 1008
  %32 = load double, ptr %31, align 8, !tbaa !25
  %33 = getelementptr inbounds i8, ptr %25, i64 1328
  %34 = load double, ptr %33, align 8, !tbaa !26
  %35 = fadd double %32, %34
  %36 = fcmp olt double %30, %35
  %.fca.1.load = select i1 %36, double %4, double %.fca.1.load14
  %.fca.0.load = select i1 %36, double %35, double %30
  %.fca.0.insert = insertvalue { double, double } poison, double %.fca.0.load, 0
  %.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %.fca.1.load, 1
  ret { double, double } %.fca.1.insert
}

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

!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, !14, i64 296}
!6 = !{!"_ZTS6Predec", !7, i64 0, !14, i64 280, !14, i64 288, !14, i64 296, !14, i64 304, !12, i64 312, !12, i64 432}
!7 = !{!"_ZTS9Component", !8, i64 0, !12, i64 24, !12, i64 144, !9, i64 264, !9, i64 272}
!8 = !{!"_ZTS4Area", !9, i64 0, !9, i64 8, !9, i64 16}
!9 = !{!"double", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTS8powerDef", !13, i64 0, !13, i64 40, !13, i64 80}
!13 = !{!"_ZTS15powerComponents", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24, !9, i64 32}
!14 = !{!"any pointer", !10, i64 0}
!15 = !{!6, !14, i64 280}
!16 = !{!9, !9, i64 0}
!17 = !{!6, !14, i64 304}
!18 = !{!19, !9, i64 1000}
!19 = !{!"_ZTS12PredecBlkDrv", !7, i64 0, !20, i64 280, !20, i64 284, !20, i64 288, !20, i64 292, !20, i64 296, !20, i64 300, !20, i64 304, !20, i64 308, !20, i64 312, !20, i64 316, !20, i64 320, !9, i64 328, !9, i64 336, !9, i64 344, !9, i64 352, !10, i64 360, !10, i64 520, !10, i64 680, !10, i64 840, !9, i64 1000, !9, i64 1008, !12, i64 1016, !12, i64 1136, !14, i64 1256, !14, i64 1264, !21, i64 1272, !20, i64 1276}
!20 = !{!"int", !10, i64 0}
!21 = !{!"bool", !10, i64 0}
!22 = !{!6, !14, i64 288}
!23 = !{!24, !9, i64 1320}
!24 = !{!"_ZTS9PredecBlk", !7, i64 0, !14, i64 280, !21, i64 288, !20, i64 292, !9, i64 296, !9, i64 304, !20, i64 312, !20, i64 316, !21, i64 320, !20, i64 324, !20, i64 328, !20, i64 332, !20, i64 336, !20, i64 340, !20, i64 344, !20, i64 348, !20, i64 352, !20, i64 356, !10, i64 360, !10, i64 520, !10, i64 680, !10, i64 840, !10, i64 1000, !10, i64 1160, !9, i64 1320, !9, i64 1328, !12, i64 1336, !12, i64 1456, !12, i64 1576, !21, i64 1696}
!25 = !{!19, !9, i64 1008}
!26 = !{!24, !9, i64 1328}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass