; LLVM IR from robotic-vision-lab/Cloud-Object-Recognition-Engine :: 3rdparty/libsvm/svm.ll (ZN5Cache10swap_indexEii)

; 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.Cache = type { i32, i64, ptr, %"struct.Cache::head_t" }
%"struct.Cache::head_t" = type { ptr, ptr, ptr, i32 }

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

; 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 @_ZN5Cache10lru_deleteEPNS_6head_tE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Cache10lru_insertEPNS_6head_tE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL4swapIiEvRT_S1_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5Cache10swap_indexEii(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %1, i32 noundef %2) #4 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  %8 = load ptr, ptr %4, align 8
  %9 = load i32, ptr %5, align 4, !tbaa !9
  %10 = load i32, ptr %6, align 4, !tbaa !9
  %11 = icmp eq i32 %9, %10
  br i1 %11, label %12, label %13

12:                                               ; preds = %3
  br label %158

13:                                               ; preds = %3
  %14 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 2
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = load i32, ptr %5, align 4, !tbaa !9
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds %"struct.Cache::head_t", ptr %15, i64 %17
  %19 = getelementptr inbounds %"struct.Cache::head_t", ptr %18, i32 0, i32 3
  %20 = load i32, ptr %19, align 8, !tbaa !15
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %28

22:                                               ; preds = %13
  %23 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 2
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  %25 = load i32, ptr %5, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds %"struct.Cache::head_t", ptr %24, i64 %26
  call void @_ZN5Cache10lru_deleteEPNS_6head_tE(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef %27)
  br label %28

28:                                               ; preds = %22, %13
  %29 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 2
  %30 = load ptr, ptr %29, align 8, !tbaa !11
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds %"struct.Cache::head_t", ptr %30, i64 %32
  %34 = getelementptr inbounds %"struct.Cache::head_t", ptr %33, i32 0, i32 3
  %35 = load i32, ptr %34, align 8, !tbaa !15
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %43

37:                                               ; preds = %28
  %38 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 2
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds %"struct.Cache::head_t", ptr %39, i64 %41
  call void @_ZN5Cache10lru_deleteEPNS_6head_tE(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef %42)
  br label %43

43:                                               ; preds = %37, %28
  %44 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 2
  %45 = load ptr, ptr %44, align 8, !tbaa !11
  %46 = load i32, ptr %5, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds %"struct.Cache::head_t", ptr %45, i64 %47
  %49 = getelementptr inbounds %"struct.Cache::head_t", ptr %48, i32 0, i32 2
  %50 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !11
  %52 = load i32, ptr %6, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds %"struct.Cache::head_t", ptr %51, i64 %53
  %55 = getelementptr inbounds %"struct.Cache::head_t", ptr %54, i32 0, i32 2
  call void @_ZL4swapIPfEvRT_S2_(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef nonnull align 8 dereferenceable(8) %55)
  %56 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 2
  %57 = load ptr, ptr %56, align 8, !tbaa !11
  %58 = load i32, ptr %5, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds %"struct.Cache::head_t", ptr %57, i64 %59
  %61 = getelementptr inbounds %"struct.Cache::head_t", ptr %60, i32 0, i32 3
  %62 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 2
  %63 = load ptr, ptr %62, align 8, !tbaa !11
  %64 = load i32, ptr %6, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %"struct.Cache::head_t", ptr %63, i64 %65
  %67 = getelementptr inbounds %"struct.Cache::head_t", ptr %66, i32 0, i32 3
  call void @_ZL4swapIiEvRT_S1_(ptr noundef nonnull align 4 dereferenceable(4) %61, ptr noundef nonnull align 4 dereferenceable(4) %67)
  %68 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 2
  %69 = load ptr, ptr %68, align 8, !tbaa !11
  %70 = load i32, ptr %5, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds %"struct.Cache::head_t", ptr %69, i64 %71
  %73 = getelementptr inbounds %"struct.Cache::head_t", ptr %72, i32 0, i32 3
  %74 = load i32, ptr %73, align 8, !tbaa !15
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %82

76:                                               ; preds = %43
  %77 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 2
  %78 = load ptr, ptr %77, align 8, !tbaa !11
  %79 = load i32, ptr %5, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds %"struct.Cache::head_t", ptr %78, i64 %80
  call void @_ZN5Cache10lru_insertEPNS_6head_tE(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef %81)
  br label %82

82:                                               ; preds = %76, %43
  %83 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 2
  %84 = load ptr, ptr %83, align 8, !tbaa !11
  %85 = load i32, ptr %6, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds %"struct.Cache::head_t", ptr %84, i64 %86
  %88 = getelementptr inbounds %"struct.Cache::head_t", ptr %87, i32 0, i32 3
  %89 = load i32, ptr %88, align 8, !tbaa !15
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %97

91:                                               ; preds = %82
  %92 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 2
  %93 = load ptr, ptr %92, align 8, !tbaa !11
  %94 = load i32, ptr %6, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds %"struct.Cache::head_t", ptr %93, i64 %95
  call void @_ZN5Cache10lru_insertEPNS_6head_tE(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef %96)
  br label %97

97:                                               ; preds = %91, %82
  %98 = load i32, ptr %5, align 4, !tbaa !9
  %99 = load i32, ptr %6, align 4, !tbaa !9
  %100 = icmp sgt i32 %98, %99
  br i1 %100, label %101, label %102

101:                                              ; preds = %97
  call void @_ZL4swapIiEvRT_S1_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  br label %102

102:                                              ; preds = %101, %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %103 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 3
  %104 = getelementptr inbounds %"struct.Cache::head_t", ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !16
  store ptr %105, ptr %7, align 8, !tbaa !5
  br label %106

106:                                              ; preds = %154, %102
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 3
  %109 = icmp ne ptr %107, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %158

111:                                              ; preds = %106
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.Cache::head_t", ptr %112, i32 0, i32 3
  %114 = load i32, ptr %113, align 8, !tbaa !15
  %115 = load i32, ptr %5, align 4, !tbaa !9
  %116 = icmp sgt i32 %114, %115
  br i1 %116, label %117, label %153

117:                                              ; preds = %111
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = getelementptr inbounds %"struct.Cache::head_t", ptr %118, i32 0, i32 3
  %120 = load i32, ptr %119, align 8, !tbaa !15
  %121 = load i32, ptr %6, align 4, !tbaa !9
  %122 = icmp sgt i32 %120, %121
  br i1 %122, label %123, label %136

123:                                              ; preds = %117
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = getelementptr inbounds %"struct.Cache::head_t", ptr %124, i32 0, i32 2
  %126 = load ptr, ptr %125, align 8, !tbaa !17
  %127 = load i32, ptr %5, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds float, ptr %126, i64 %128
  %130 = load ptr, ptr %7, align 8, !tbaa !5
  %131 = getelementptr inbounds %"struct.Cache::head_t", ptr %130, i32 0, i32 2
  %132 = load ptr, ptr %131, align 8, !tbaa !17
  %133 = load i32, ptr %6, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds float, ptr %132, i64 %134
  call void @_ZL4swapIfEvRT_S1_(ptr noundef nonnull align 4 dereferenceable(4) %129, ptr noundef nonnull align 4 dereferenceable(4) %135)
  br label %152

136:                                              ; preds = %117
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN5Cache10lru_deleteEPNS_6head_tE(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef %137)
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = getelementptr inbounds %"struct.Cache::head_t", ptr %138, i32 0, i32 2
  %140 = load ptr, ptr %139, align 8, !tbaa !17
  call void @free(ptr noundef %140) #5
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds %"struct.Cache::head_t", ptr %141, i32 0, i32 3
  %143 = load i32, ptr %142, align 8, !tbaa !15
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds %class.Cache, ptr %8, i32 0, i32 1
  %146 = load i64, ptr %145, align 8, !tbaa !18
  %147 = add nsw i64 %146, %144
  store i64 %147, ptr %145, align 8, !tbaa !18
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = getelementptr inbounds %"struct.Cache::head_t", ptr %148, i32 0, i32 2
  store ptr null, ptr %149, align 8, !tbaa !17
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  %151 = getelementptr inbounds %"struct.Cache::head_t", ptr %150, i32 0, i32 3
  store i32 0, ptr %151, align 8, !tbaa !15
  br label %152

152:                                              ; preds = %136, %123
  br label %153

153:                                              ; preds = %152, %111
  br label %154

154:                                              ; preds = %153
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = getelementptr inbounds %"struct.Cache::head_t", ptr %155, i32 0, i32 1
  %157 = load ptr, ptr %156, align 8, !tbaa !19
  store ptr %157, ptr %7, align 8, !tbaa !5
  br label %106, !llvm.loop !20

158:                                              ; preds = %110, %12
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL4swapIPfEvRT_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL4swapIfEvRT_S1_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 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 #3 = { 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 #4 = { 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 #5 = { 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 = !{!12, !6, i64 16}
!12 = !{!"_ZTS5Cache", !10, i64 0, !13, i64 8, !6, i64 16, !14, i64 24}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSN5Cache6head_tE", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24}
!15 = !{!14, !10, i64 24}
!16 = !{!12, !6, i64 32}
!17 = !{!14, !6, i64 16}
!18 = !{!12, !13, i64 8}
!19 = !{!14, !6, i64 8}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


; 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.Cache::head_t" = type { ptr, ptr, ptr, i32 }

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Cache10lru_deleteEPNS_6head_tE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Cache10lru_insertEPNS_6head_tE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL4swapIiEvRT_S1_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5Cache10swap_indexEii(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #1 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store i32 %1, ptr %4, align 4, !tbaa !5
  store i32 %2, ptr %5, align 4, !tbaa !5
  %6 = icmp eq i32 %1, %2
  br i1 %6, label %.loopexit, label %7

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = sext i32 %1 to i64
  %11 = getelementptr inbounds %"struct.Cache::head_t", ptr %9, i64 %10
  %12 = getelementptr inbounds i8, ptr %11, i64 24
  %13 = load i32, ptr %12, align 8, !tbaa !14
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %15, label %14

14:                                               ; preds = %7
  tail call void @_ZN5Cache10lru_deleteEPNS_6head_tE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull %11)
  %.pre = load ptr, ptr %8, align 8, !tbaa !9
  br label %15

15:                                               ; preds = %14, %7
  %16 = phi ptr [ %.pre, %14 ], [ %9, %7 ]
  %17 = sext i32 %2 to i64
  %18 = getelementptr inbounds %"struct.Cache::head_t", ptr %16, i64 %17
  %19 = getelementptr inbounds i8, ptr %18, i64 24
  %20 = load i32, ptr %19, align 8, !tbaa !14
  %.not16 = icmp eq i32 %20, 0
  br i1 %.not16, label %22, label %21

21:                                               ; preds = %15
  tail call void @_ZN5Cache10lru_deleteEPNS_6head_tE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull %18)
  %.pre23 = load ptr, ptr %8, align 8, !tbaa !9
  br label %22

22:                                               ; preds = %21, %15
  %23 = phi ptr [ %.pre23, %21 ], [ %16, %15 ]
  %24 = getelementptr inbounds %"struct.Cache::head_t", ptr %23, i64 %10, i32 2
  %25 = getelementptr inbounds %"struct.Cache::head_t", ptr %23, i64 %17, i32 2
  tail call void @_ZL4swapIPfEvRT_S2_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25)
  %26 = load ptr, ptr %8, align 8, !tbaa !9
  %27 = getelementptr inbounds %"struct.Cache::head_t", ptr %26, i64 %10, i32 3
  %28 = getelementptr inbounds %"struct.Cache::head_t", ptr %26, i64 %17, i32 3
  tail call void @_ZL4swapIiEvRT_S1_(ptr noundef nonnull align 4 dereferenceable(4) %27, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %29 = load ptr, ptr %8, align 8, !tbaa !9
  %30 = getelementptr inbounds %"struct.Cache::head_t", ptr %29, i64 %10
  %31 = getelementptr inbounds i8, ptr %30, i64 24
  %32 = load i32, ptr %31, align 8, !tbaa !14
  %.not17 = icmp eq i32 %32, 0
  br i1 %.not17, label %34, label %33

33:                                               ; preds = %22
  tail call void @_ZN5Cache10lru_insertEPNS_6head_tE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull %30)
  %.pre24 = load ptr, ptr %8, align 8, !tbaa !9
  br label %34

34:                                               ; preds = %33, %22
  %35 = phi ptr [ %.pre24, %33 ], [ %29, %22 ]
  %36 = getelementptr inbounds %"struct.Cache::head_t", ptr %35, i64 %17
  %37 = getelementptr inbounds i8, ptr %36, i64 24
  %38 = load i32, ptr %37, align 8, !tbaa !14
  %.not18 = icmp eq i32 %38, 0
  br i1 %.not18, label %40, label %39

39:                                               ; preds = %34
  tail call void @_ZN5Cache10lru_insertEPNS_6head_tE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull %36)
  br label %40

40:                                               ; preds = %39, %34
  %41 = icmp sgt i32 %1, %2
  br i1 %41, label %42, label %43

42:                                               ; preds = %40
  call void @_ZL4swapIiEvRT_S1_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %43

43:                                               ; preds = %42, %40
  %44 = getelementptr inbounds i8, ptr %0, i64 24
  %45 = getelementptr inbounds i8, ptr %0, i64 32
  %.020 = load ptr, ptr %45, align 8, !tbaa !15
  %.not1921 = icmp eq ptr %.020, %44
  br i1 %.not1921, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %43
  %46 = getelementptr inbounds i8, ptr %0, i64 8
  br label %47

47:                                               ; preds = %.lr.ph, %69
  %.022 = phi ptr [ %.020, %.lr.ph ], [ %.0, %69 ]
  %48 = getelementptr inbounds i8, ptr %.022, i64 24
  %49 = load i32, ptr %48, align 8, !tbaa !14
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = icmp sgt i32 %49, %50
  br i1 %51, label %52, label %69

52:                                               ; preds = %47
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = icmp sgt i32 %49, %53
  br i1 %54, label %55, label %62

55:                                               ; preds = %52
  %56 = getelementptr inbounds i8, ptr %.022, i64 16
  %57 = load ptr, ptr %56, align 8, !tbaa !16
  %58 = sext i32 %50 to i64
  %59 = getelementptr inbounds float, ptr %57, i64 %58
  %60 = sext i32 %53 to i64
  %61 = getelementptr inbounds float, ptr %57, i64 %60
  call void @_ZL4swapIfEvRT_S1_(ptr noundef nonnull align 4 dereferenceable(4) %59, ptr noundef nonnull align 4 dereferenceable(4) %61)
  br label %69

62:                                               ; preds = %52
  call void @_ZN5Cache10lru_deleteEPNS_6head_tE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull %.022)
  %63 = getelementptr inbounds i8, ptr %.022, i64 16
  %64 = load ptr, ptr %63, align 8, !tbaa !16
  call void @free(ptr noundef %64) #3
  %65 = load i32, ptr %48, align 8, !tbaa !14
  %66 = sext i32 %65 to i64
  %67 = load i64, ptr %46, align 8, !tbaa !17
  %68 = add nsw i64 %67, %66
  store i64 %68, ptr %46, align 8, !tbaa !17
  store ptr null, ptr %63, align 8, !tbaa !16
  store i32 0, ptr %48, align 8, !tbaa !14
  br label %69

69:                                               ; preds = %47, %62, %55
  %70 = getelementptr inbounds i8, ptr %.022, i64 8
  %.0 = load ptr, ptr %70, align 8, !tbaa !15
  %.not19 = icmp eq ptr %.0, %44
  br i1 %.not19, label %.loopexit, label %47, !llvm.loop !18

.loopexit:                                        ; preds = %69, %43, %3
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL4swapIPfEvRT_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL4swapIfEvRT_S1_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

attributes #0 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 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 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 16}
!10 = !{!"_ZTS5Cache", !6, i64 0, !11, i64 8, !12, i64 16, !13, i64 24}
!11 = !{!"long", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"_ZTSN5Cache6head_tE", !12, i64 0, !12, i64 8, !12, i64 16, !6, i64 24}
!14 = !{!13, !6, i64 24}
!15 = !{!13, !12, i64 8}
!16 = !{!13, !12, i64 16}
!17 = !{!10, !11, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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