; LLVM IR from VAR-solutions/Algorithms :: Branch And Bound/0_1 Knapsack/CPP/0_1Knapsack.ll (Z8knapsackiP4Itemi)

; 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.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl" }
%"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl" = type { %"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl_data" }
%"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%struct.Node = type { i32, i32, i32, float }
%struct.Item = type { float, i32 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmp4ItemS_(i64, i64) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5bound4NodeiiP4Item(i64, i64, i32 noundef, i32 noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z8knapsackiP4Itemi(i32 noundef %0, ptr noundef %1, i32 noundef %2) #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::queue", align 8
  %8 = alloca %struct.Node, align 4
  %9 = alloca %struct.Node, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.Node, align 4
  %14 = alloca %struct.Node, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !5
  %15 = load ptr, ptr %5, align 8, !tbaa !9
  %16 = load ptr, ptr %5, align 8, !tbaa !9
  %17 = load i32, ptr %6, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds %struct.Item, ptr %16, i64 %18
  call void @_ZSt4sortIP4ItemPFbS0_S0_EEvT_S4_T0_(ptr noundef %15, ptr noundef %19, ptr noundef @_Z3cmp4ItemS_)
  call void @llvm.lifetime.start.p0(i64 80, ptr %7) #6
  call void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  %20 = getelementptr inbounds %struct.Node, ptr %8, i32 0, i32 0
  store i32 -1, ptr %20, align 4, !tbaa !11
  %21 = getelementptr inbounds %struct.Node, ptr %8, i32 0, i32 3
  store float 0.000000e+00, ptr %21, align 4, !tbaa !14
  %22 = getelementptr inbounds %struct.Node, ptr %8, i32 0, i32 1
  store i32 0, ptr %22, align 4, !tbaa !15
  invoke void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(16) %8)
          to label %23 unwind label %37

23:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %130, %51, %23
  %25 = invoke noundef zeroext i1 @_ZNKSt5queueI4NodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %26 unwind label %41

26:                                               ; preds = %24
  %27 = xor i1 %25, true
  br i1 %27, label %28, label %131

28:                                               ; preds = %26
  %29 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %30 unwind label %41

30:                                               ; preds = %28
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %29, i64 16, i1 false), !tbaa.struct !16
  invoke void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %31 unwind label %41

31:                                               ; preds = %30
  %32 = getelementptr inbounds %struct.Node, ptr %8, i32 0, i32 0
  %33 = load i32, ptr %32, align 4, !tbaa !11
  %34 = icmp eq i32 %33, -1
  br i1 %34, label %35, label %45

35:                                               ; preds = %31
  %36 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 0
  store i32 0, ptr %36, align 4, !tbaa !11
  br label %45

37:                                               ; preds = %3
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %10, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %11, align 4
  br label %133

41:                                               ; preds = %128, %106, %30, %28, %24
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %10, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %133

45:                                               ; preds = %35, %31
  %46 = getelementptr inbounds %struct.Node, ptr %8, i32 0, i32 0
  %47 = load i32, ptr %46, align 4, !tbaa !11
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = sub nsw i32 %48, 1
  %50 = icmp eq i32 %47, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %45
  br label %24, !llvm.loop !18

52:                                               ; preds = %45
  %53 = getelementptr inbounds %struct.Node, ptr %8, i32 0, i32 0
  %54 = load i32, ptr %53, align 4, !tbaa !11
  %55 = add nsw i32 %54, 1
  %56 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 0
  store i32 %55, ptr %56, align 4, !tbaa !11
  %57 = getelementptr inbounds %struct.Node, ptr %8, i32 0, i32 3
  %58 = load float, ptr %57, align 4, !tbaa !14
  %59 = load ptr, ptr %5, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 0
  %61 = load i32, ptr %60, align 4, !tbaa !11
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds %struct.Item, ptr %59, i64 %62
  %64 = getelementptr inbounds %struct.Item, ptr %63, i32 0, i32 0
  %65 = load float, ptr %64, align 4, !tbaa !20
  %66 = fadd float %58, %65
  %67 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 3
  store float %66, ptr %67, align 4, !tbaa !14
  %68 = getelementptr inbounds %struct.Node, ptr %8, i32 0, i32 1
  %69 = load i32, ptr %68, align 4, !tbaa !15
  %70 = load ptr, ptr %5, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 0
  %72 = load i32, ptr %71, align 4, !tbaa !11
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds %struct.Item, ptr %70, i64 %73
  %75 = getelementptr inbounds %struct.Item, ptr %74, i32 0, i32 1
  %76 = load i32, ptr %75, align 4, !tbaa !22
  %77 = add nsw i32 %69, %76
  %78 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 1
  store i32 %77, ptr %78, align 4, !tbaa !15
  %79 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 3
  %80 = load float, ptr %79, align 4, !tbaa !14
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = sitofp i32 %81 to float
  %83 = fcmp ole float %80, %82
  br i1 %83, label %84, label %92

84:                                               ; preds = %52
  %85 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !15
  %87 = load i32, ptr %12, align 4, !tbaa !5
  %88 = icmp sgt i32 %86, %87
  br i1 %88, label %89, label %92

89:                                               ; preds = %84
  %90 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 1
  %91 = load i32, ptr %90, align 4, !tbaa !15
  store i32 %91, ptr %12, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %89, %84, %52
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %9, i64 16, i1 false), !tbaa.struct !16
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = load ptr, ptr %5, align 8, !tbaa !9
  %96 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %97 = load i64, ptr %96, align 4
  %98 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %99 = load i64, ptr %98, align 4
  %100 = call noundef i32 @_Z5bound4NodeiiP4Item(i64 %97, i64 %99, i32 noundef %93, i32 noundef %94, ptr noundef %95)
  %101 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 2
  store i32 %100, ptr %101, align 4, !tbaa !23
  %102 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 2
  %103 = load i32, ptr %102, align 4, !tbaa !23
  %104 = load i32, ptr %12, align 4, !tbaa !5
  %105 = icmp sgt i32 %103, %104
  br i1 %105, label %106, label %108

106:                                              ; preds = %92
  invoke void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(16) %9)
          to label %107 unwind label %41

107:                                              ; preds = %106
  br label %108

108:                                              ; preds = %107, %92
  %109 = getelementptr inbounds %struct.Node, ptr %8, i32 0, i32 3
  %110 = load float, ptr %109, align 4, !tbaa !14
  %111 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 3
  store float %110, ptr %111, align 4, !tbaa !14
  %112 = getelementptr inbounds %struct.Node, ptr %8, i32 0, i32 1
  %113 = load i32, ptr %112, align 4, !tbaa !15
  %114 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 1
  store i32 %113, ptr %114, align 4, !tbaa !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %9, i64 16, i1 false), !tbaa.struct !16
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = load i32, ptr %4, align 4, !tbaa !5
  %117 = load ptr, ptr %5, align 8, !tbaa !9
  %118 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %119 = load i64, ptr %118, align 4
  %120 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %121 = load i64, ptr %120, align 4
  %122 = call noundef i32 @_Z5bound4NodeiiP4Item(i64 %119, i64 %121, i32 noundef %115, i32 noundef %116, ptr noundef %117)
  %123 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 2
  store i32 %122, ptr %123, align 4, !tbaa !23
  %124 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 2
  %125 = load i32, ptr %124, align 4, !tbaa !23
  %126 = load i32, ptr %12, align 4, !tbaa !5
  %127 = icmp sgt i32 %125, %126
  br i1 %127, label %128, label %130

128:                                              ; preds = %108
  invoke void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(16) %9)
          to label %129 unwind label %41

129:                                              ; preds = %128
  br label %130

130:                                              ; preds = %129, %108
  br label %24, !llvm.loop !18

131:                                              ; preds = %26
  %132 = load i32, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  call void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #6
  ret i32 %132

133:                                              ; preds = %41, %37
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  call void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #6
  br label %134

134:                                              ; preds = %133
  %135 = load ptr, ptr %10, align 8
  %136 = load i32, ptr %11, align 4
  %137 = insertvalue { ptr, i32 } poison, ptr %135, 0
  %138 = insertvalue { ptr, i32 } %137, i32 %136, 1
  resume { ptr, i32 } %138
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP4ItemPFbS0_S0_EEvT_S4_T0_(ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(16)) #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueI4NodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) #0 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) #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

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" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8, !13, i64 12}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !13, i64 12}
!15 = !{!12, !6, i64 4}
!16 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !17}
!17 = !{!13, !13, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!21, !13, i64 0}
!21 = !{!"_ZTS4Item", !13, i64 0, !6, i64 4}
!22 = !{!21, !6, i64 4}
!23 = !{!12, !6, i64 8}


; 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.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl" }
%"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl" = type { %"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl_data" }
%"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%struct.Node = type { i32, i32, i32, float }
%struct.Item = type { float, i32 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmp4ItemS_(i64, i64) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5bound4NodeiiP4Item(i64, i64, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, -2147483648) i32 @_Z8knapsackiP4Itemi(i32 noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::queue", align 8
  %5 = alloca %struct.Node, align 4
  %6 = alloca %struct.Node, align 8
  %7 = sext i32 %2 to i64
  %8 = getelementptr inbounds %struct.Item, ptr %1, i64 %7
  tail call void @_ZSt4sortIP4ItemPFbS0_S0_EEvT_S4_T0_(ptr noundef %1, ptr noundef %8, ptr noundef nonnull @_Z3cmp4ItemS_)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %4) #7
  call void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  store i32 -1, ptr %5, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %5, i64 12
  store float 0.000000e+00, ptr %9, align 4, !tbaa !11
  %10 = getelementptr inbounds i8, ptr %5, i64 4
  store i32 0, ptr %10, align 4, !tbaa !12
  invoke void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(16) %5)
          to label %.preheader unwind label %22

.preheader:                                       ; preds = %3
  %11 = add nsw i32 %2, -1
  %12 = getelementptr inbounds i8, ptr %6, i64 12
  %13 = getelementptr inbounds i8, ptr %6, i64 4
  %14 = sitofp i32 %0 to float
  %.sroa.22.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  br label %.outer

.outer:                                           ; preds = %.outer.backedge, %.preheader
  %.021.ph = phi i32 [ 0, %.preheader ], [ %.1, %.outer.backedge ]
  br label %15

15:                                               ; preds = %.outer, %26
  %16 = call noundef zeroext i1 @_ZNKSt5queueI4NodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %16, label %50, label %17

17:                                               ; preds = %15
  %18 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(16) %18, i64 16, i1 false), !tbaa.struct !13
  call void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = icmp eq i32 %19, -1
  br i1 %20, label %21, label %26

21:                                               ; preds = %17
  store i32 0, ptr %6, align 8, !tbaa !5
  br label %26

22:                                               ; preds = %3
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %51

24:                                               ; preds = %49, %43
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %51

26:                                               ; preds = %21, %17
  %27 = icmp eq i32 %19, %11
  br i1 %27, label %15, label %28, !llvm.loop !16

28:                                               ; preds = %26
  %29 = add nsw i32 %19, 1
  store i32 %29, ptr %6, align 8, !tbaa !5
  %30 = load float, ptr %9, align 4, !tbaa !11
  %31 = sext i32 %29 to i64
  %32 = getelementptr inbounds %struct.Item, ptr %1, i64 %31
  %33 = load float, ptr %32, align 4, !tbaa !18
  %34 = fadd float %30, %33
  store float %34, ptr %12, align 4, !tbaa !11
  %35 = load i32, ptr %10, align 4, !tbaa !12
  %36 = getelementptr inbounds %struct.Item, ptr %1, i64 %31, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !20
  %38 = add nsw i32 %37, %35
  store i32 %38, ptr %13, align 4, !tbaa !12
  %39 = fcmp ole float %34, %14
  %40 = call i32 @llvm.smax.i32(i32 %38, i32 %.021.ph)
  %.1 = select i1 %39, i32 %40, i32 %.021.ph
  %.sroa.01.0.copyload = load i64, ptr %6, align 8
  %.sroa.22.0.copyload = load i64, ptr %.sroa.22.0..sroa_idx, align 8
  %41 = call noundef i32 @_Z5bound4NodeiiP4Item(i64 %.sroa.01.0.copyload, i64 %.sroa.22.0.copyload, i32 noundef %2, i32 noundef %0, ptr noundef %1)
  store i32 %41, ptr %.sroa.22.0..sroa_idx, align 8, !tbaa !21
  %42 = icmp sgt i32 %41, %.1
  br i1 %42, label %43, label %44

43:                                               ; preds = %28
  invoke void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(16) %6)
          to label %44 unwind label %24

44:                                               ; preds = %43, %28
  %45 = load float, ptr %9, align 4, !tbaa !11
  store float %45, ptr %12, align 4, !tbaa !11
  %46 = load i32, ptr %10, align 4, !tbaa !12
  store i32 %46, ptr %13, align 4, !tbaa !12
  %.sroa.0.0.copyload = load i64, ptr %6, align 8
  %.sroa.2.0.copyload = load i64, ptr %.sroa.22.0..sroa_idx, align 8
  %47 = call noundef i32 @_Z5bound4NodeiiP4Item(i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload, i32 noundef %2, i32 noundef %0, ptr noundef nonnull %1)
  store i32 %47, ptr %.sroa.22.0..sroa_idx, align 8, !tbaa !21
  %48 = icmp sgt i32 %47, %.1
  br i1 %48, label %49, label %.outer.backedge

49:                                               ; preds = %44
  invoke void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(16) %6)
          to label %.outer.backedge unwind label %24

.outer.backedge:                                  ; preds = %49, %44
  br label %.outer, !llvm.loop !16

50:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  call void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #7
  ret i32 %.021.ph

51:                                               ; preds = %24, %22
  %.pn = phi { ptr, i32 } [ %25, %24 ], [ %23, %22 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  call void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP4ItemPFbS0_S0_EEvT_S4_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueI4NodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress 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) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueI4NodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

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" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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, !7, i64 0}
!6 = !{!"_ZTS4Node", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 12}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!6, !10, i64 12}
!12 = !{!6, !7, i64 4}
!13 = !{i64 0, i64 4, !14, i64 4, i64 4, !14, i64 8, i64 4, !14, i64 12, i64 4, !15}
!14 = !{!7, !7, i64 0}
!15 = !{!10, !10, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !10, i64 0}
!19 = !{!"_ZTS4Item", !10, i64 0, !7, i64 4}
!20 = !{!19, !7, i64 4}
!21 = !{!6, !7, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass