; 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.value_cache_handler_pair = type { ptr, ptr, ptr }
%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 }
%struct.cache_handler = type { ptr, 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
@.str.8 = external hidden unnamed_addr constant [54 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 allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @simple_cache_add(i32 noundef %0, i32 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4) #3 {
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %struct.value_cache_handler_pair, align 8
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !9
  store i64 %3, ptr %9, align 8, !tbaa !11
  store ptr %4, ptr %10, align 8, !tbaa !9
  %15 = load i32, ptr @CACHE_NAME_SPACE, align 4, !tbaa !5
  %16 = zext i32 %15 to i64
  %17 = getelementptr inbounds [10 x ptr], ptr @_cache, i64 0, i64 %16
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %21

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

21:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %22 = load i32, ptr @CACHE_NAME_SPACE, align 4, !tbaa !5
  %23 = zext i32 %22 to i64
  %24 = getelementptr inbounds [10 x ptr], ptr @_cache, i64 0, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  store ptr %25, ptr %11, align 8, !tbaa !9
  br label %26

26:                                               ; preds = %81, %21
  %27 = load ptr, ptr %11, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.simple_cache, ptr %27, i32 0, i32 12
  %29 = load i64, ptr %28, align 8, !tbaa !13
  %30 = load ptr, ptr %11, align 8, !tbaa !9
  %31 = getelementptr inbounds %struct.simple_cache, ptr %30, i32 0, i32 13
  %32 = load i64, ptr %31, align 8, !tbaa !15
  %33 = load i64, ptr %9, align 8, !tbaa !11
  %34 = add i64 %32, %33
  %35 = icmp ult i64 %29, %34
  br i1 %35, label %36, label %95

36:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %37 = load ptr, ptr %11, align 8, !tbaa !9
  %38 = getelementptr inbounds %struct.simple_cache, ptr %37, i32 0, i32 10
  %39 = load ptr, ptr %38, align 8, !tbaa !16
  store ptr %39, ptr %12, align 8, !tbaa !9
  %40 = load ptr, ptr %12, align 8, !tbaa !9
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %43

42:                                               ; preds = %36
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef @.str.8) #6
  unreachable

43:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %44 = load ptr, ptr %11, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.simple_cache, ptr %44, i32 0, i32 1
  %46 = load ptr, ptr %45, align 8, !tbaa !17
  %47 = load ptr, ptr %12, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.lru_ll_element, ptr %47, i32 0, i32 0
  %49 = load i32, ptr %48, align 8, !tbaa !18
  %50 = zext i32 %49 to i64
  %51 = getelementptr inbounds ptr, ptr %46, i64 %50
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = load ptr, ptr %12, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.lru_ll_element, ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !20
  %56 = call ptr @hash_list_remove(ptr noundef %52, i32 noundef %55)
  store ptr %56, ptr %13, align 8, !tbaa !9
  %57 = load ptr, ptr %13, align 8, !tbaa !9
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %81

59:                                               ; preds = %43
  %60 = load ptr, ptr %13, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %60, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8, !tbaa !21
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %79

64:                                               ; preds = %59
  %65 = load ptr, ptr %13, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %65, i32 0, i32 1
  %67 = load ptr, ptr %66, align 8, !tbaa !21
  %68 = getelementptr inbounds %struct.cache_handler, ptr %67, i32 0, i32 2
  %69 = load ptr, ptr %68, align 8, !tbaa !23
  %70 = icmp ne ptr %69, null
  br i1 %70, label %71, label %79

71:                                               ; preds = %64
  %72 = load ptr, ptr %13, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %72, i32 0, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !21
  %75 = getelementptr inbounds %struct.cache_handler, ptr %74, i32 0, i32 2
  %76 = load ptr, ptr %75, align 8, !tbaa !23
  %77 = load ptr, ptr %13, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %77, i32 0, i32 0
  call void %76(ptr noundef %78)
  br label %79

79:                                               ; preds = %71, %64, %59
  %80 = load ptr, ptr %13, align 8, !tbaa !9
  call void @free(ptr noundef %80) #7
  br label %81

81:                                               ; preds = %79, %43
  %82 = load ptr, ptr %12, align 8, !tbaa !9
  %83 = getelementptr inbounds %struct.lru_ll_element, ptr %82, i32 0, i32 2
  %84 = load i64, ptr %83, align 8, !tbaa !25
  %85 = load ptr, ptr %11, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.simple_cache, ptr %85, i32 0, i32 13
  %87 = load i64, ptr %86, align 8, !tbaa !15
  %88 = sub i64 %87, %84
  store i64 %88, ptr %86, align 8, !tbaa !15
  %89 = load ptr, ptr %12, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.lru_ll_element, ptr %89, i32 0, i32 4
  %91 = load ptr, ptr %90, align 8, !tbaa !26
  %92 = load ptr, ptr %11, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct.simple_cache, ptr %92, i32 0, i32 10
  store ptr %91, ptr %93, align 8, !tbaa !16
  %94 = load ptr, ptr %12, align 8, !tbaa !9
  call void @free(ptr noundef %94) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %26, !llvm.loop !27

95:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #7
  %96 = load ptr, ptr %8, align 8, !tbaa !9
  %97 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %14, i32 0, i32 0
  store ptr %96, ptr %97, align 8, !tbaa !29
  %98 = load ptr, ptr %10, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %14, i32 0, i32 1
  store ptr %98, ptr %99, align 8, !tbaa !21
  %100 = call noalias ptr @malloc(i64 noundef 32) #8
  %101 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %14, i32 0, i32 2
  store ptr %100, ptr %101, align 8, !tbaa !30
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %14, i32 0, i32 2
  %104 = load ptr, ptr %103, align 8, !tbaa !30
  %105 = getelementptr inbounds %struct.lru_ll_element, ptr %104, i32 0, i32 0
  store i32 %102, ptr %105, align 8, !tbaa !18
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %14, i32 0, i32 2
  %108 = load ptr, ptr %107, align 8, !tbaa !30
  %109 = getelementptr inbounds %struct.lru_ll_element, ptr %108, i32 0, i32 1
  store i32 %106, ptr %109, align 4, !tbaa !20
  %110 = load i64, ptr %9, align 8, !tbaa !11
  %111 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %14, i32 0, i32 2
  %112 = load ptr, ptr %111, align 8, !tbaa !30
  %113 = getelementptr inbounds %struct.lru_ll_element, ptr %112, i32 0, i32 2
  store i64 %110, ptr %113, align 8, !tbaa !25
  %114 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %14, i32 0, i32 2
  %115 = load ptr, ptr %114, align 8, !tbaa !30
  %116 = getelementptr inbounds %struct.lru_ll_element, ptr %115, i32 0, i32 3
  store ptr null, ptr %116, align 8, !tbaa !31
  %117 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %14, i32 0, i32 2
  %118 = load ptr, ptr %117, align 8, !tbaa !30
  %119 = getelementptr inbounds %struct.lru_ll_element, ptr %118, i32 0, i32 4
  store ptr null, ptr %119, align 8, !tbaa !26
  %120 = load ptr, ptr %11, align 8, !tbaa !9
  %121 = getelementptr inbounds %struct.simple_cache, ptr %120, i32 0, i32 10
  %122 = load ptr, ptr %121, align 8, !tbaa !16
  %123 = icmp eq ptr %122, null
  br i1 %123, label %124, label %133

124:                                              ; preds = %95
  %125 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %14, i32 0, i32 2
  %126 = load ptr, ptr %125, align 8, !tbaa !30
  %127 = load ptr, ptr %11, align 8, !tbaa !9
  %128 = getelementptr inbounds %struct.simple_cache, ptr %127, i32 0, i32 10
  store ptr %126, ptr %128, align 8, !tbaa !16
  %129 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %14, i32 0, i32 2
  %130 = load ptr, ptr %129, align 8, !tbaa !30
  %131 = load ptr, ptr %11, align 8, !tbaa !9
  %132 = getelementptr inbounds %struct.simple_cache, ptr %131, i32 0, i32 11
  store ptr %130, ptr %132, align 8, !tbaa !32
  br label %150

133:                                              ; preds = %95
  %134 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %14, i32 0, i32 2
  %135 = load ptr, ptr %134, align 8, !tbaa !30
  %136 = load ptr, ptr %11, align 8, !tbaa !9
  %137 = getelementptr inbounds %struct.simple_cache, ptr %136, i32 0, i32 11
  %138 = load ptr, ptr %137, align 8, !tbaa !32
  %139 = getelementptr inbounds %struct.lru_ll_element, ptr %138, i32 0, i32 4
  store ptr %135, ptr %139, align 8, !tbaa !26
  %140 = load ptr, ptr %11, align 8, !tbaa !9
  %141 = getelementptr inbounds %struct.simple_cache, ptr %140, i32 0, i32 11
  %142 = load ptr, ptr %141, align 8, !tbaa !32
  %143 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %14, i32 0, i32 2
  %144 = load ptr, ptr %143, align 8, !tbaa !30
  %145 = getelementptr inbounds %struct.lru_ll_element, ptr %144, i32 0, i32 3
  store ptr %142, ptr %145, align 8, !tbaa !31
  %146 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %14, i32 0, i32 2
  %147 = load ptr, ptr %146, align 8, !tbaa !30
  %148 = load ptr, ptr %11, align 8, !tbaa !9
  %149 = getelementptr inbounds %struct.simple_cache, ptr %148, i32 0, i32 11
  store ptr %147, ptr %149, align 8, !tbaa !32
  br label %150

150:                                              ; preds = %133, %124
  %151 = load ptr, ptr %11, align 8, !tbaa !9
  %152 = getelementptr inbounds %struct.simple_cache, ptr %151, i32 0, i32 1
  %153 = load ptr, ptr %152, align 8, !tbaa !17
  %154 = load i32, ptr %6, align 4, !tbaa !5
  %155 = zext i32 %154 to i64
  %156 = getelementptr inbounds ptr, ptr %153, i64 %155
  %157 = load ptr, ptr %156, align 8, !tbaa !9
  %158 = load i32, ptr %7, align 4, !tbaa !5
  %159 = call i32 @hash_list_add(ptr noundef %157, i32 noundef %158, ptr noundef %14, i32 noundef 24)
  %160 = load ptr, ptr %11, align 8, !tbaa !9
  %161 = getelementptr inbounds %struct.simple_cache, ptr %160, i32 0, i32 3
  %162 = load ptr, ptr %161, align 8, !tbaa !33
  %163 = load i32, ptr %6, align 4, !tbaa !5
  %164 = zext i32 %163 to i64
  %165 = getelementptr inbounds i32, ptr %162, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = add i32 %166, 1
  store i32 %167, ptr %165, align 4, !tbaa !5
  %168 = load ptr, ptr %11, align 8, !tbaa !9
  %169 = getelementptr inbounds %struct.simple_cache, ptr %168, i32 0, i32 4
  %170 = load ptr, ptr %169, align 8, !tbaa !34
  %171 = load i32, ptr %6, align 4, !tbaa !5
  %172 = zext i32 %171 to i64
  %173 = getelementptr inbounds i32, ptr %170, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = add i32 %174, 1
  store i32 %175, ptr %173, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  ret void
}

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

declare ptr @hash_list_remove(ptr noundef, i32 noundef) #5

declare i32 @hash_list_add(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(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 = { 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 #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 = { 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 #5 = { "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 = { noreturn }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }

!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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 128}
!14 = !{!"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, !12, i64 128, !12, i64 136, !6, i64 144}
!15 = !{!14, !12, i64 136}
!16 = !{!14, !10, i64 112}
!17 = !{!14, !10, i64 8}
!18 = !{!19, !6, i64 0}
!19 = !{!"lru_ll_element", !6, i64 0, !6, i64 4, !12, i64 8, !10, i64 16, !10, i64 24}
!20 = !{!19, !6, i64 4}
!21 = !{!22, !10, i64 8}
!22 = !{!"value_cache_handler_pair", !10, i64 0, !10, i64 8, !10, i64 16}
!23 = !{!24, !10, i64 16}
!24 = !{!"cache_handler", !10, i64 0, !10, i64 8, !10, i64 16}
!25 = !{!19, !12, i64 8}
!26 = !{!19, !10, i64 24}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!22, !10, i64 0}
!30 = !{!22, !10, i64 16}
!31 = !{!19, !10, i64 16}
!32 = !{!14, !10, i64 120}
!33 = !{!14, !10, i64 24}
!34 = !{!14, !10, i64 32}


; 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.value_cache_handler_pair = type { ptr, ptr, ptr }

@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
@.str.8 = external hidden unnamed_addr constant [54 x i8], align 1

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

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

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

.preheader:                                       ; preds = %5
  %12 = getelementptr inbounds i8, ptr %10, i64 128
  %13 = getelementptr inbounds i8, ptr %10, i64 136
  %14 = load i64, ptr %12, align 8, !tbaa !11
  %15 = load i64, ptr %13, align 8, !tbaa !14
  %16 = add i64 %15, %3
  %17 = icmp ult i64 %14, %16
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %18 = getelementptr inbounds i8, ptr %10, i64 112
  %19 = getelementptr inbounds i8, ptr %10, i64 8
  br label %21

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

21:                                               ; preds = %.lr.ph, %42
  %22 = load ptr, ptr %18, align 8, !tbaa !15
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %25

24:                                               ; preds = %21
  tail call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef nonnull @.str.8) #7
  unreachable

25:                                               ; preds = %21
  %26 = load ptr, ptr %19, align 8, !tbaa !16
  %27 = load i32, ptr %22, align 8, !tbaa !17
  %28 = zext i32 %27 to i64
  %29 = getelementptr inbounds ptr, ptr %26, i64 %28
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = getelementptr inbounds i8, ptr %22, i64 4
  %32 = load i32, ptr %31, align 4, !tbaa !19
  %33 = tail call ptr @hash_list_remove(ptr noundef %30, i32 noundef %32) #8
  %.not = icmp eq ptr %33, null
  br i1 %.not, label %42, label %34

34:                                               ; preds = %25
  %35 = getelementptr inbounds i8, ptr %33, i64 8
  %36 = load ptr, ptr %35, align 8, !tbaa !20
  %.not40 = icmp eq ptr %36, null
  br i1 %.not40, label %41, label %37

37:                                               ; preds = %34
  %38 = getelementptr inbounds i8, ptr %36, i64 16
  %39 = load ptr, ptr %38, align 8, !tbaa !22
  %.not41 = icmp eq ptr %39, null
  br i1 %.not41, label %41, label %40

40:                                               ; preds = %37
  tail call void %39(ptr noundef nonnull %33) #8
  br label %41

41:                                               ; preds = %40, %37, %34
  tail call void @free(ptr noundef nonnull %33) #8
  br label %42

42:                                               ; preds = %41, %25
  %43 = getelementptr inbounds i8, ptr %22, i64 8
  %44 = load i64, ptr %43, align 8, !tbaa !24
  %45 = load i64, ptr %13, align 8, !tbaa !14
  %46 = sub i64 %45, %44
  store i64 %46, ptr %13, align 8, !tbaa !14
  %47 = getelementptr inbounds i8, ptr %22, i64 24
  %48 = load ptr, ptr %47, align 8, !tbaa !25
  store ptr %48, ptr %18, align 8, !tbaa !15
  tail call void @free(ptr noundef nonnull %22) #8
  %49 = load i64, ptr %12, align 8, !tbaa !11
  %50 = load i64, ptr %13, align 8, !tbaa !14
  %51 = add i64 %50, %3
  %52 = icmp ult i64 %49, %51
  br i1 %52, label %21, label %._crit_edge, !llvm.loop !26

._crit_edge:                                      ; preds = %42, %.preheader
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #8
  store ptr %2, ptr %6, align 8, !tbaa !28
  %53 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %4, ptr %53, align 8, !tbaa !20
  %54 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
  %55 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %54, ptr %55, align 8, !tbaa !29
  store i32 %0, ptr %54, align 8, !tbaa !17
  %56 = getelementptr inbounds i8, ptr %54, i64 4
  store i32 %1, ptr %56, align 4, !tbaa !19
  %57 = getelementptr inbounds i8, ptr %54, i64 8
  store i64 %3, ptr %57, align 8, !tbaa !24
  %58 = getelementptr inbounds i8, ptr %54, i64 16
  %59 = getelementptr inbounds i8, ptr %10, i64 112
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %58, i8 0, i64 16, i1 false)
  %60 = load ptr, ptr %59, align 8, !tbaa !15
  %61 = icmp eq ptr %60, null
  br i1 %61, label %62, label %64

62:                                               ; preds = %._crit_edge
  store ptr %54, ptr %59, align 8, !tbaa !15
  %63 = getelementptr inbounds i8, ptr %10, i64 120
  br label %68

64:                                               ; preds = %._crit_edge
  %65 = getelementptr inbounds i8, ptr %10, i64 120
  %66 = load ptr, ptr %65, align 8, !tbaa !30
  %67 = getelementptr inbounds i8, ptr %66, i64 24
  store ptr %54, ptr %67, align 8, !tbaa !25
  store ptr %66, ptr %58, align 8, !tbaa !31
  br label %68

68:                                               ; preds = %64, %62
  %.sink = phi ptr [ %65, %64 ], [ %63, %62 ]
  store ptr %54, ptr %.sink, align 8, !tbaa !30
  %69 = getelementptr inbounds i8, ptr %10, i64 8
  %70 = load ptr, ptr %69, align 8, !tbaa !16
  %71 = zext i32 %0 to i64
  %72 = getelementptr inbounds ptr, ptr %70, i64 %71
  %73 = load ptr, ptr %72, align 8, !tbaa !9
  %74 = call i32 @hash_list_add(ptr noundef %73, i32 noundef %1, ptr noundef nonnull %6, i32 noundef 24) #8
  %75 = getelementptr inbounds i8, ptr %10, i64 24
  %76 = load ptr, ptr %75, align 8, !tbaa !32
  %77 = getelementptr inbounds i32, ptr %76, i64 %71
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = add i32 %78, 1
  store i32 %79, ptr %77, align 4, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %10, i64 32
  %81 = load ptr, ptr %80, align 8, !tbaa !33
  %82 = getelementptr inbounds i32, ptr %81, i64 %71
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = add i32 %83, 1
  store i32 %84, ptr %82, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #8
  ret void
}

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

declare ptr @hash_list_remove(ptr noundef, i32 noundef) local_unnamed_addr #5

declare i32 @hash_list_add(ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 #2 = { 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 #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 = { 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 #5 = { "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 nounwind willreturn memory(argmem: write) }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }

!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, !13, i64 128}
!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, !13, i64 136}
!15 = !{!12, !10, i64 112}
!16 = !{!12, !10, i64 8}
!17 = !{!18, !6, i64 0}
!18 = !{!"lru_ll_element", !6, i64 0, !6, i64 4, !13, i64 8, !10, i64 16, !10, i64 24}
!19 = !{!18, !6, i64 4}
!20 = !{!21, !10, i64 8}
!21 = !{!"value_cache_handler_pair", !10, i64 0, !10, i64 8, !10, i64 16}
!22 = !{!23, !10, i64 16}
!23 = !{!"cache_handler", !10, i64 0, !10, i64 8, !10, i64 16}
!24 = !{!18, !13, i64 8}
!25 = !{!18, !10, i64 24}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!21, !10, i64 0}
!29 = !{!21, !10, i64 16}
!30 = !{!12, !10, i64 120}
!31 = !{!18, !10, i64 16}
!32 = !{!12, !10, i64 24}
!33 = !{!12, !10, i64 32}


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