; LLVM IR from ryanlayer/giggle :: src (cache)

; 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.simple_cache = type { ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, %union.pthread_mutex_t, ptr, ptr, i64, i64, i32 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.lru_ll_element = type { i32, i32, i64, ptr, ptr }

@CACHE_NAME_SPACE = external dso_local global i32, align 4
@_cache = external dso_local global [10 x ptr], align 16
@.str.7 = external hidden unnamed_addr constant [32 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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @simple_cache_destroy() #3 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = load i32, ptr @CACHE_NAME_SPACE, align 4, !tbaa !5
  %7 = zext i32 %6 to i64
  %8 = getelementptr inbounds [10 x ptr], ptr @_cache, i64 0, i64 %7
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %12

11:                                               ; preds = %0
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef @.str.7) #5
  unreachable

12:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #6
  %13 = load i32, ptr @CACHE_NAME_SPACE, align 4, !tbaa !5
  %14 = zext i32 %13 to i64
  %15 = getelementptr inbounds [10 x ptr], ptr @_cache, i64 0, i64 %14
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %16, ptr %1, align 8, !tbaa !9
  %17 = load ptr, ptr %1, align 8, !tbaa !9
  %18 = getelementptr inbounds %struct.simple_cache, ptr %17, i32 0, i32 9
  %19 = call i32 @pthread_mutex_destroy(ptr noundef %18) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %59, %12
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = load ptr, ptr %1, align 8, !tbaa !9
  %23 = getelementptr inbounds %struct.simple_cache, ptr %22, i32 0, i32 5
  %24 = load i32, ptr %23, align 8, !tbaa !11
  %25 = icmp ult i32 %21, %24
  br i1 %25, label %26, label %62

26:                                               ; preds = %20
  %27 = load ptr, ptr %1, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.simple_cache, ptr %27, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = zext i32 %30 to i64
  %32 = getelementptr inbounds ptr, ptr %29, i64 %31
  call void @hash_list_value_cache_handler_pair_destroy(ptr noundef %32)
  %33 = load ptr, ptr %1, align 8, !tbaa !9
  %34 = getelementptr inbounds %struct.simple_cache, ptr %33, i32 0, i32 7
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %45

37:                                               ; preds = %26
  %38 = load ptr, ptr %1, align 8, !tbaa !9
  %39 = getelementptr inbounds %struct.simple_cache, ptr %38, i32 0, i32 7
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds ptr, ptr %40, i64 %42
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  call void @free(ptr noundef %44) #6
  br label %45

45:                                               ; preds = %37, %26
  %46 = load ptr, ptr %1, align 8, !tbaa !9
  %47 = getelementptr inbounds %struct.simple_cache, ptr %46, i32 0, i32 6
  %48 = load ptr, ptr %47, align 8, !tbaa !16
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %58

50:                                               ; preds = %45
  %51 = load ptr, ptr %1, align 8, !tbaa !9
  %52 = getelementptr inbounds %struct.simple_cache, ptr %51, i32 0, i32 6
  %53 = load ptr, ptr %52, align 8, !tbaa !16
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = zext i32 %54 to i64
  %56 = getelementptr inbounds ptr, ptr %53, i64 %55
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  call void @free(ptr noundef %57) #6
  br label %58

58:                                               ; preds = %50, %45
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = add i32 %60, 1
  store i32 %61, ptr %2, align 4, !tbaa !5
  br label %20, !llvm.loop !17

62:                                               ; preds = %20
  %63 = load ptr, ptr %1, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.simple_cache, ptr %63, i32 0, i32 7
  %65 = load ptr, ptr %64, align 8, !tbaa !15
  %66 = icmp ne ptr %65, null
  br i1 %66, label %67, label %71

67:                                               ; preds = %62
  %68 = load ptr, ptr %1, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct.simple_cache, ptr %68, i32 0, i32 7
  %70 = load ptr, ptr %69, align 8, !tbaa !15
  call void @free(ptr noundef %70) #6
  br label %71

71:                                               ; preds = %67, %62
  %72 = load ptr, ptr %1, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct.simple_cache, ptr %72, i32 0, i32 6
  %74 = load ptr, ptr %73, align 8, !tbaa !16
  %75 = icmp ne ptr %74, null
  br i1 %75, label %76, label %80

76:                                               ; preds = %71
  %77 = load ptr, ptr %1, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct.simple_cache, ptr %77, i32 0, i32 6
  %79 = load ptr, ptr %78, align 8, !tbaa !16
  call void @free(ptr noundef %79) #6
  br label %80

80:                                               ; preds = %76, %71
  %81 = load ptr, ptr %1, align 8, !tbaa !9
  %82 = getelementptr inbounds %struct.simple_cache, ptr %81, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !14
  call void @free(ptr noundef %83) #6
  %84 = load ptr, ptr %1, align 8, !tbaa !9
  %85 = getelementptr inbounds %struct.simple_cache, ptr %84, i32 0, i32 3
  %86 = load ptr, ptr %85, align 8, !tbaa !19
  call void @free(ptr noundef %86) #6
  %87 = load ptr, ptr %1, align 8, !tbaa !9
  %88 = getelementptr inbounds %struct.simple_cache, ptr %87, i32 0, i32 4
  %89 = load ptr, ptr %88, align 8, !tbaa !20
  call void @free(ptr noundef %89) #6
  %90 = load ptr, ptr %1, align 8, !tbaa !9
  %91 = getelementptr inbounds %struct.simple_cache, ptr %90, i32 0, i32 8
  %92 = load ptr, ptr %91, align 8, !tbaa !21
  %93 = icmp ne ptr %92, null
  br i1 %93, label %94, label %125

94:                                               ; preds = %80
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %118, %94
  %96 = load i32, ptr %2, align 4, !tbaa !5
  %97 = load ptr, ptr %1, align 8, !tbaa !9
  %98 = getelementptr inbounds %struct.simple_cache, ptr %97, i32 0, i32 5
  %99 = load i32, ptr %98, align 8, !tbaa !11
  %100 = icmp ult i32 %96, %99
  br i1 %100, label %101, label %121

101:                                              ; preds = %95
  %102 = load ptr, ptr %1, align 8, !tbaa !9
  %103 = getelementptr inbounds %struct.simple_cache, ptr %102, i32 0, i32 8
  %104 = load ptr, ptr %103, align 8, !tbaa !21
  %105 = load i32, ptr %2, align 4, !tbaa !5
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds ptr, ptr %104, i64 %106
  %108 = load ptr, ptr %107, align 8, !tbaa !9
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %117

110:                                              ; preds = %101
  %111 = load ptr, ptr %1, align 8, !tbaa !9
  %112 = getelementptr inbounds %struct.simple_cache, ptr %111, i32 0, i32 8
  %113 = load ptr, ptr %112, align 8, !tbaa !21
  %114 = load i32, ptr %2, align 4, !tbaa !5
  %115 = zext i32 %114 to i64
  %116 = getelementptr inbounds ptr, ptr %113, i64 %115
  call void @disk_store_destroy(ptr noundef %116)
  br label %117

117:                                              ; preds = %110, %101
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %2, align 4, !tbaa !5
  %120 = add i32 %119, 1
  store i32 %120, ptr %2, align 4, !tbaa !5
  br label %95, !llvm.loop !22

121:                                              ; preds = %95
  %122 = load ptr, ptr %1, align 8, !tbaa !9
  %123 = getelementptr inbounds %struct.simple_cache, ptr %122, i32 0, i32 8
  %124 = load ptr, ptr %123, align 8, !tbaa !21
  call void @free(ptr noundef %124) #6
  br label %125

125:                                              ; preds = %121, %80
  %126 = load ptr, ptr %1, align 8, !tbaa !9
  %127 = getelementptr inbounds %struct.simple_cache, ptr %126, i32 0, i32 2
  %128 = load ptr, ptr %127, align 8, !tbaa !23
  call void @free(ptr noundef %128) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %129 = load ptr, ptr %1, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct.simple_cache, ptr %129, i32 0, i32 10
  %131 = load ptr, ptr %130, align 8, !tbaa !24
  store ptr %131, ptr %5, align 8, !tbaa !9
  br label %132

132:                                              ; preds = %135, %125
  %133 = load ptr, ptr %5, align 8, !tbaa !9
  %134 = icmp ne ptr %133, null
  br i1 %134, label %135, label %141

135:                                              ; preds = %132
  %136 = load ptr, ptr %5, align 8, !tbaa !9
  %137 = getelementptr inbounds %struct.lru_ll_element, ptr %136, i32 0, i32 4
  %138 = load ptr, ptr %137, align 8, !tbaa !25
  store ptr %138, ptr %4, align 8, !tbaa !9
  %139 = load ptr, ptr %5, align 8, !tbaa !9
  call void @free(ptr noundef %139) #6
  %140 = load ptr, ptr %4, align 8, !tbaa !9
  store ptr %140, ptr %5, align 8, !tbaa !9
  br label %132, !llvm.loop !27

141:                                              ; preds = %132
  %142 = load ptr, ptr %1, align 8, !tbaa !9
  call void @free(ptr noundef %142) #6
  %143 = load i32, ptr @CACHE_NAME_SPACE, align 4, !tbaa !5
  %144 = zext i32 %143 to i64
  %145 = getelementptr inbounds [10 x ptr], ptr @_cache, i64 0, i64 %144
  store ptr null, ptr %145, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  ret void
}

; Function Attrs: nounwind
declare i32 @pthread_mutex_destroy(ptr noundef) #1

declare void @hash_list_value_cache_handler_pair_destroy(ptr noundef) #4

declare void @disk_store_destroy(ptr noundef) #4

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 = { noreturn "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 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 = { "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 }
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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 40}
!12 = !{!"simple_cache", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !6, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !10, i64 112, !10, i64 120, !13, i64 128, !13, i64 136, !6, i64 144}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !10, i64 56}
!16 = !{!12, !10, i64 48}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!12, !10, i64 24}
!20 = !{!12, !10, i64 32}
!21 = !{!12, !10, i64 64}
!22 = distinct !{!22, !18}
!23 = !{!12, !10, i64 16}
!24 = !{!12, !10, i64 112}
!25 = !{!26, !10, i64 24}
!26 = !{!"lru_ll_element", !6, i64 0, !6, i64 4, !13, i64 8, !10, i64 16, !10, i64 24}
!27 = distinct !{!27, !18}


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

@CACHE_NAME_SPACE = external dso_local local_unnamed_addr global i32, align 4
@_cache = external dso_local local_unnamed_addr global [10 x ptr], align 16
@.str.7 = external hidden unnamed_addr constant [32 x i8], align 1

; 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: noreturn
declare void @errx(i32 noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @simple_cache_destroy() local_unnamed_addr #2 {
  %1 = load i32, ptr @CACHE_NAME_SPACE, align 4, !tbaa !5
  %2 = zext i32 %1 to i64
  %3 = getelementptr inbounds [10 x ptr], ptr @_cache, i64 0, i64 %2
  %4 = load ptr, ptr %3, align 8, !tbaa !9
  %5 = icmp eq ptr %4, null
  br i1 %5, label %6, label %7

6:                                                ; preds = %0
  tail call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef nonnull @.str.7) #5
  unreachable

7:                                                ; preds = %0
  %8 = getelementptr inbounds i8, ptr %4, i64 72
  %9 = tail call i32 @pthread_mutex_destroy(ptr noundef nonnull %8) #6
  %10 = getelementptr inbounds i8, ptr %4, i64 40
  %11 = load i32, ptr %10, align 8, !tbaa !11
  %.not55 = icmp eq i32 %11, 0
  br i1 %.not55, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %7
  %12 = getelementptr inbounds i8, ptr %4, i64 8
  %13 = getelementptr inbounds i8, ptr %4, i64 56
  %14 = getelementptr inbounds i8, ptr %4, i64 48
  br label %15

15:                                               ; preds = %.lr.ph, %27
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %27 ]
  %16 = load ptr, ptr %12, align 8, !tbaa !14
  %17 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv
  tail call void @hash_list_value_cache_handler_pair_destroy(ptr noundef %17) #6
  %18 = load ptr, ptr %13, align 8, !tbaa !15
  %.not44 = icmp eq ptr %18, null
  br i1 %.not44, label %22, label %19

19:                                               ; preds = %15
  %20 = getelementptr inbounds ptr, ptr %18, i64 %indvars.iv
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  tail call void @free(ptr noundef %21) #6
  br label %22

22:                                               ; preds = %19, %15
  %23 = load ptr, ptr %14, align 8, !tbaa !16
  %.not45 = icmp eq ptr %23, null
  br i1 %.not45, label %27, label %24

24:                                               ; preds = %22
  %25 = getelementptr inbounds ptr, ptr %23, i64 %indvars.iv
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  tail call void @free(ptr noundef %26) #6
  br label %27

27:                                               ; preds = %22, %24
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = load i32, ptr %10, align 8, !tbaa !11
  %29 = zext i32 %28 to i64
  %30 = icmp ult i64 %indvars.iv.next, %29
  br i1 %30, label %15, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %27, %7
  %31 = getelementptr inbounds i8, ptr %4, i64 56
  %32 = load ptr, ptr %31, align 8, !tbaa !15
  %.not = icmp eq ptr %32, null
  br i1 %.not, label %34, label %33

33:                                               ; preds = %._crit_edge
  tail call void @free(ptr noundef nonnull %32) #6
  br label %34

34:                                               ; preds = %33, %._crit_edge
  %35 = getelementptr inbounds i8, ptr %4, i64 48
  %36 = load ptr, ptr %35, align 8, !tbaa !16
  %.not40 = icmp eq ptr %36, null
  br i1 %.not40, label %38, label %37

37:                                               ; preds = %34
  tail call void @free(ptr noundef nonnull %36) #6
  br label %38

38:                                               ; preds = %37, %34
  %39 = getelementptr inbounds i8, ptr %4, i64 8
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  tail call void @free(ptr noundef %40) #6
  %41 = getelementptr inbounds i8, ptr %4, i64 24
  %42 = load ptr, ptr %41, align 8, !tbaa !19
  tail call void @free(ptr noundef %42) #6
  %43 = getelementptr inbounds i8, ptr %4, i64 32
  %44 = load ptr, ptr %43, align 8, !tbaa !20
  tail call void @free(ptr noundef %44) #6
  %45 = getelementptr inbounds i8, ptr %4, i64 64
  %46 = load ptr, ptr %45, align 8, !tbaa !21
  %.not41 = icmp eq ptr %46, null
  br i1 %.not41, label %58, label %.preheader

.preheader:                                       ; preds = %38
  %47 = load i32, ptr %10, align 8, !tbaa !11
  %.not56 = icmp eq i32 %47, 0
  br i1 %.not56, label %._crit_edge49, label %.lr.ph48

.lr.ph48:                                         ; preds = %.preheader, %53
  %48 = phi i32 [ %54, %53 ], [ %47, %.preheader ]
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %53 ], [ 0, %.preheader ]
  %49 = load ptr, ptr %45, align 8, !tbaa !21
  %50 = getelementptr inbounds ptr, ptr %49, i64 %indvars.iv58
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  %.not43 = icmp eq ptr %51, null
  br i1 %.not43, label %53, label %52

52:                                               ; preds = %.lr.ph48
  tail call void @disk_store_destroy(ptr noundef nonnull %50) #6
  %.pre = load i32, ptr %10, align 8, !tbaa !11
  br label %53

53:                                               ; preds = %.lr.ph48, %52
  %54 = phi i32 [ %48, %.lr.ph48 ], [ %.pre, %52 ]
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %55 = zext i32 %54 to i64
  %56 = icmp ult i64 %indvars.iv.next59, %55
  br i1 %56, label %.lr.ph48, label %._crit_edge49.loopexit, !llvm.loop !22

._crit_edge49.loopexit:                           ; preds = %53
  %.pre61 = load ptr, ptr %45, align 8, !tbaa !21
  br label %._crit_edge49

._crit_edge49:                                    ; preds = %._crit_edge49.loopexit, %.preheader
  %57 = phi ptr [ %.pre61, %._crit_edge49.loopexit ], [ %46, %.preheader ]
  tail call void @free(ptr noundef %57) #6
  br label %58

58:                                               ; preds = %._crit_edge49, %38
  %59 = getelementptr inbounds i8, ptr %4, i64 16
  %60 = load ptr, ptr %59, align 8, !tbaa !23
  tail call void @free(ptr noundef %60) #6
  %61 = getelementptr inbounds i8, ptr %4, i64 112
  %62 = load ptr, ptr %61, align 8, !tbaa !24
  %.not4250 = icmp eq ptr %62, null
  br i1 %.not4250, label %._crit_edge54, label %.lr.ph53

.lr.ph53:                                         ; preds = %58, %.lr.ph53
  %.051 = phi ptr [ %64, %.lr.ph53 ], [ %62, %58 ]
  %63 = getelementptr inbounds i8, ptr %.051, i64 24
  %64 = load ptr, ptr %63, align 8, !tbaa !25
  tail call void @free(ptr noundef nonnull %.051) #6
  %.not42 = icmp eq ptr %64, null
  br i1 %.not42, label %._crit_edge54, label %.lr.ph53, !llvm.loop !27

._crit_edge54:                                    ; preds = %.lr.ph53, %58
  tail call void @free(ptr noundef %4) #6
  %65 = load i32, ptr @CACHE_NAME_SPACE, align 4, !tbaa !5
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds [10 x ptr], ptr @_cache, i64 0, i64 %66
  store ptr null, ptr %67, align 8, !tbaa !9
  ret void
}

; Function Attrs: nounwind
declare i32 @pthread_mutex_destroy(ptr noundef) local_unnamed_addr #3

declare void @hash_list_value_cache_handler_pair_destroy(ptr noundef) local_unnamed_addr #4

declare void @disk_store_destroy(ptr noundef) local_unnamed_addr #4

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 = { noreturn "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 = { 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 "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 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 40}
!12 = !{!"simple_cache", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !6, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !10, i64 112, !10, i64 120, !13, i64 128, !13, i64 136, !6, i64 144}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !10, i64 56}
!16 = !{!12, !10, i64 48}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!12, !10, i64 24}
!20 = !{!12, !10, i64 32}
!21 = !{!12, !10, i64 64}
!22 = distinct !{!22, !18}
!23 = !{!12, !10, i64 16}
!24 = !{!12, !10, i64 112}
!25 = !{!26, !10, i64 24}
!26 = !{!"lru_ll_element", !6, i64 0, !6, i64 4, !13, i64 8, !10, i64 16, !10, i64 24}
!27 = distinct !{!27, !18}


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