; LLVM IR from ryanlayer/giggle :: test/unit (test_giggle)

; 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.cache_def = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.giggle_index = type { ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.chrm_index = type { ptr, ptr }
%struct.ordered_set = type { ptr, i32, i32, ptr, ptr, ptr }
%struct.uint64_t_ll = type { i64, ptr, ptr }

@ORDER = external dso_local global i32, align 4
@cache = external dso_local global %struct.cache_def, align 8
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1
@__const.test_giggle_index_file.sizes = external hidden unnamed_addr constant [23 x i32], align 16
@__const.test_giggle_index_file.chrms = external hidden unnamed_addr constant [23 x ptr], align 16
@__const.test_giggle_index_file.ids = external hidden unnamed_addr constant <{ [152 x i32], <{ [44 x i32], [108 x i32] }>, <{ [66 x i32], [86 x i32] }>, <{ [41 x i32], [111 x i32] }>, <{ [9 x i32], [143 x i32] }>, <{ i32, i32, i32, i32, i32, i32, i32, [145 x i32] }>, <{ [30 x i32], [122 x i32] }>, <{ [43 x i32], [109 x i32] }>, <{ [38 x i32], [114 x i32] }>, <{ [23 x i32], [129 x i32] }>, <{ [77 x i32], [75 x i32] }>, <{ [64 x i32], [88 x i32] }>, <{ [21 x i32], [131 x i32] }>, <{ [18 x i32], [134 x i32] }>, <{ [27 x i32], [125 x i32] }>, <{ [50 x i32], [102 x i32] }>, <{ [20 x i32], [132 x i32] }>, <{ [40 x i32], [112 x i32] }>, <{ [73 x i32], [79 x i32] }>, <{ [80 x i32], [72 x i32] }>, <{ [33 x i32], [119 x i32] }>, <{ [32 x i32], [120 x i32] }>, <{ [12 x i32], [140 x i32] }> }>, align 16

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

declare ptr @simple_cache_init(i32 noundef, i32 noundef, ptr noundef) #1

declare void @uint64_t_ll_giggle_set_data_handler(...) #1

declare void @UnityAssertEqualNumber(i64 noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef) #1

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

declare ptr @giggle_search(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare i64 @uint64_t_ll_contains(ptr noundef, i64 noundef) #1

declare void @uint64_t_ll_free(ptr noundef) #1

declare ptr @giggle_init_index(i32 noundef, ptr noundef) #1

declare i32 @giggle_get_chrm_id(ptr noundef, ptr noundef) #1

declare void @giggle_index_destroy(ptr noundef) #1

; Function Attrs: nounwind
declare i32 @remove(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @test_giggle_index_file() #3 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca [23 x i32], align 16
  %6 = alloca [23 x ptr], align 16
  %7 = alloca [23 x [152 x i32]], align 16
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  store i32 10, ptr @ORDER, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  %12 = call ptr @simple_cache_init(i32 noundef 1000, i32 noundef 30, ptr noundef null)
  store ptr %12, ptr %1, align 8, !tbaa !9
  call void (...) @uint64_t_ll_giggle_set_data_handler()
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %13 = call ptr @giggle_init_index(i32 noundef 30, ptr noundef @.str.1)
  store ptr %13, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store ptr @.str.8, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %14 = load ptr, ptr %2, align 8, !tbaa !9
  %15 = load ptr, ptr %3, align 8, !tbaa !9
  %16 = call i32 @giggle_index_file(ptr noundef %14, ptr noundef %15)
  store i32 %16, ptr %4, align 4, !tbaa !5
  %17 = load ptr, ptr %2, align 8, !tbaa !9
  call void @valid_giggle_index(ptr noundef %17)
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = zext i32 %18 to i64
  call void @UnityAssertEqualNumber(i64 noundef 1000, i64 noundef %19, ptr noundef null, i64 noundef 914, i32 noundef 148)
  %20 = load ptr, ptr %2, align 8, !tbaa !9
  %21 = getelementptr inbounds %struct.giggle_index, ptr %20, i32 0, i32 3
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = getelementptr inbounds %struct.chrm_index, ptr %22, i32 0, i32 1
  %24 = load ptr, ptr %23, align 8, !tbaa !13
  %25 = getelementptr inbounds %struct.ordered_set, ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 8, !tbaa !15
  %27 = zext i32 %26 to i64
  call void @UnityAssertEqualNumber(i64 noundef 23, i64 noundef %27, ptr noundef null, i64 noundef 916, i32 noundef 148)
  %28 = load ptr, ptr %2, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.giggle_index, ptr %28, i32 0, i32 2
  %30 = load i32, ptr %29, align 4, !tbaa !17
  %31 = zext i32 %30 to i64
  call void @UnityAssertEqualNumber(i64 noundef 23, i64 noundef %31, ptr noundef null, i64 noundef 917, i32 noundef 148)
  call void @llvm.lifetime.start.p0(i64 92, ptr %5) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %5, ptr align 16 @__const.test_giggle_index_file.sizes, i64 92, i1 false)
  call void @llvm.lifetime.start.p0(i64 184, ptr %6) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 @__const.test_giggle_index_file.chrms, i64 184, i1 false)
  call void @llvm.lifetime.start.p0(i64 13984, ptr %7) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %7, ptr align 16 @__const.test_giggle_index_file.ids, i64 13984, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %82, %0
  %33 = load i32, ptr %8, align 4, !tbaa !5
  %34 = icmp slt i32 %33, 23
  br i1 %34, label %35, label %85

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %36 = load ptr, ptr %2, align 8, !tbaa !9
  %37 = load i32, ptr %8, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [23 x ptr], ptr %6, i64 0, i64 %38
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = call i32 @giggle_get_chrm_id(ptr noundef %36, ptr noundef %40)
  store i32 %41, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %42 = load i32, ptr %10, align 4, !tbaa !5
  %43 = load ptr, ptr %2, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.giggle_index, ptr %43, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !18
  %46 = load i32, ptr %10, align 4, !tbaa !5
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds i32, ptr %45, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = call ptr @giggle_search(i32 noundef %42, i32 noundef %49, i32 noundef 0, i32 noundef -1294967296)
  store ptr %50, ptr %11, align 8, !tbaa !9
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [23 x i32], ptr %5, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = zext i32 %54 to i64
  %56 = load ptr, ptr %11, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct.uint64_t_ll, ptr %56, i32 0, i32 0
  %58 = load i64, ptr %57, align 8, !tbaa !19
  call void @UnityAssertEqualNumber(i64 noundef %55, i64 noundef %58, ptr noundef null, i64 noundef 1005, i32 noundef 148)
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %78, %35
  %60 = load i32, ptr %9, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = load ptr, ptr %11, align 8, !tbaa !9
  %63 = getelementptr inbounds %struct.uint64_t_ll, ptr %62, i32 0, i32 0
  %64 = load i64, ptr %63, align 8, !tbaa !19
  %65 = icmp ult i64 %61, %64
  br i1 %65, label %66, label %81

66:                                               ; preds = %59
  %67 = load ptr, ptr %11, align 8, !tbaa !9
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [23 x [152 x i32]], ptr %7, i64 0, i64 %69
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [152 x i32], ptr %70, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = sub i32 %74, 1
  %76 = zext i32 %75 to i64
  %77 = call i64 @uint64_t_ll_contains(ptr noundef %67, i64 noundef %76)
  call void @UnityAssertEqualNumber(i64 noundef 1, i64 noundef %77, ptr noundef null, i64 noundef 1007, i32 noundef 148)
  br label %78

78:                                               ; preds = %66
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %9, align 4, !tbaa !5
  br label %59, !llvm.loop !22

81:                                               ; preds = %59
  call void @uint64_t_ll_free(ptr noundef %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %8, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %8, align 4, !tbaa !5
  br label %32, !llvm.loop !24

85:                                               ; preds = %32
  call void @giggle_index_destroy(ptr noundef %2)
  %86 = load ptr, ptr getelementptr inbounds (%struct.cache_def, ptr @cache, i32 0, i32 6), align 8, !tbaa !25
  call void (...) %86()
  %87 = call i32 @remove(ptr noundef @.str.1) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 13984, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 184, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 92, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  ret void
}

declare i32 @giggle_index_file(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @valid_giggle_index(ptr noundef) #3

; 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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"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, !10, i64 16}
!12 = !{!"giggle_index", !10, i64 0, !6, i64 8, !6, i64 12, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56}
!13 = !{!14, !10, i64 8}
!14 = !{!"chrm_index", !10, i64 0, !10, i64 8}
!15 = !{!16, !6, i64 8}
!16 = !{!"ordered_set", !10, i64 0, !6, i64 8, !6, i64 12, !10, i64 16, !10, i64 24, !10, i64 32}
!17 = !{!12, !6, i64 12}
!18 = !{!12, !10, i64 0}
!19 = !{!20, !21, i64 0}
!20 = !{!"uint64_t_ll", !21, i64 0, !10, i64 8, !10, i64 16}
!21 = !{!"long", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = !{!26, !10, i64 48}
!26 = !{!"cache_def", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}


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

@ORDER = external dso_local local_unnamed_addr global i32, align 4
@cache = external dso_local local_unnamed_addr global %struct.cache_def, align 8
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1
@__const.test_giggle_index_file.sizes = external hidden unnamed_addr constant [23 x i32], align 16
@__const.test_giggle_index_file.chrms = external hidden unnamed_addr constant [23 x ptr], align 16
@__const.test_giggle_index_file.ids = external hidden unnamed_addr constant <{ [152 x i32], <{ [44 x i32], [108 x i32] }>, <{ [66 x i32], [86 x i32] }>, <{ [41 x i32], [111 x i32] }>, <{ [9 x i32], [143 x i32] }>, <{ i32, i32, i32, i32, i32, i32, i32, [145 x i32] }>, <{ [30 x i32], [122 x i32] }>, <{ [43 x i32], [109 x i32] }>, <{ [38 x i32], [114 x i32] }>, <{ [23 x i32], [129 x i32] }>, <{ [77 x i32], [75 x i32] }>, <{ [64 x i32], [88 x i32] }>, <{ [21 x i32], [131 x i32] }>, <{ [18 x i32], [134 x i32] }>, <{ [27 x i32], [125 x i32] }>, <{ [50 x i32], [102 x i32] }>, <{ [20 x i32], [132 x i32] }>, <{ [40 x i32], [112 x i32] }>, <{ [73 x i32], [79 x i32] }>, <{ [80 x i32], [72 x i32] }>, <{ [33 x i32], [119 x i32] }>, <{ [32 x i32], [120 x i32] }>, <{ [12 x i32], [140 x i32] }> }>, align 16

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

declare ptr @simple_cache_init(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @uint64_t_ll_giggle_set_data_handler(...) local_unnamed_addr #1

declare void @UnityAssertEqualNumber(i64 noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

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

declare ptr @giggle_search(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare i64 @uint64_t_ll_contains(ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @uint64_t_ll_free(ptr noundef) local_unnamed_addr #1

declare ptr @giggle_init_index(i32 noundef, ptr noundef) local_unnamed_addr #1

declare i32 @giggle_get_chrm_id(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @giggle_index_destroy(ptr noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @remove(ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @test_giggle_index_file() local_unnamed_addr #3 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  store i32 10, ptr @ORDER, align 4, !tbaa !5
  %3 = tail call ptr @simple_cache_init(i32 noundef 1000, i32 noundef 30, ptr noundef null) #4
  tail call void (...) @uint64_t_ll_giggle_set_data_handler() #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  %4 = tail call ptr @giggle_init_index(i32 noundef 30, ptr noundef nonnull @.str.1) #4
  store ptr %4, ptr %1, align 8, !tbaa !9
  %5 = tail call i32 @giggle_index_file(ptr noundef %4, ptr noundef nonnull @.str.8) #4
  tail call void @valid_giggle_index(ptr noundef %4)
  %6 = zext i32 %5 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 1000, i64 noundef %6, ptr noundef null, i64 noundef 914, i32 noundef 148) #4
  %7 = getelementptr inbounds i8, ptr %4, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %8, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !13
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  %12 = load i32, ptr %11, align 8, !tbaa !15
  %13 = zext i32 %12 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 23, i64 noundef %13, ptr noundef null, i64 noundef 916, i32 noundef 148) #4
  %14 = getelementptr inbounds i8, ptr %4, i64 12
  %15 = load i32, ptr %14, align 4, !tbaa !17
  %16 = zext i32 %15 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 23, i64 noundef %16, ptr noundef null, i64 noundef 917, i32 noundef 148) #4
  br label %17

17:                                               ; preds = %0, %._crit_edge
  %indvars.iv16 = phi i64 [ 0, %0 ], [ %indvars.iv.next17, %._crit_edge ]
  %18 = getelementptr inbounds [23 x ptr], ptr @__const.test_giggle_index_file.chrms, i64 0, i64 %indvars.iv16
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = call i32 @giggle_get_chrm_id(ptr noundef %4, ptr noundef %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %21 = load ptr, ptr %4, align 8, !tbaa !18
  %22 = zext i32 %20 to i64
  %23 = getelementptr inbounds i32, ptr %21, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = call ptr @giggle_search(i32 noundef %20, i32 noundef %24, i32 noundef 0, i32 noundef -1294967296) #4
  store ptr %25, ptr %2, align 8, !tbaa !9
  %26 = getelementptr inbounds [23 x i32], ptr @__const.test_giggle_index_file.sizes, i64 0, i64 %indvars.iv16
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = zext i32 %27 to i64
  %29 = load i64, ptr %25, align 8, !tbaa !19
  call void @UnityAssertEqualNumber(i64 noundef %28, i64 noundef %29, ptr noundef null, i64 noundef 1005, i32 noundef 148) #4
  %30 = load ptr, ptr %2, align 8, !tbaa !9
  %31 = load i64, ptr %30, align 8, !tbaa !19
  %.not = icmp eq i64 %31, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %17, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %17 ]
  %32 = phi ptr [ %38, %.lr.ph ], [ %30, %17 ]
  %33 = getelementptr inbounds [23 x [152 x i32]], ptr @__const.test_giggle_index_file.ids, i64 0, i64 %indvars.iv16, i64 %indvars.iv
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = add i32 %34, -1
  %36 = zext i32 %35 to i64
  %37 = call i64 @uint64_t_ll_contains(ptr noundef nonnull %32, i64 noundef %36) #4
  call void @UnityAssertEqualNumber(i64 noundef 1, i64 noundef %37, ptr noundef null, i64 noundef 1007, i32 noundef 148) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %38 = load ptr, ptr %2, align 8, !tbaa !9
  %39 = load i64, ptr %38, align 8, !tbaa !19
  %40 = icmp ugt i64 %39, %indvars.iv.next
  br i1 %40, label %.lr.ph, label %._crit_edge, !llvm.loop !22

._crit_edge:                                      ; preds = %.lr.ph, %17
  call void @uint64_t_ll_free(ptr noundef nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  %indvars.iv.next17 = add nuw nsw i64 %indvars.iv16, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next17, 23
  br i1 %exitcond.not, label %41, label %17, !llvm.loop !24

41:                                               ; preds = %._crit_edge
  call void @giggle_index_destroy(ptr noundef nonnull %1) #4
  %42 = load ptr, ptr getelementptr inbounds (i8, ptr @cache, i64 48), align 8, !tbaa !25
  call void (...) %42() #4
  %43 = call i32 @remove(ptr noundef nonnull @.str.1) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  ret void
}

declare i32 @giggle_index_file(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @valid_giggle_index(ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { nofree 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 = { 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, !10, i64 16}
!12 = !{!"giggle_index", !10, i64 0, !6, i64 8, !6, i64 12, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56}
!13 = !{!14, !10, i64 8}
!14 = !{!"chrm_index", !10, i64 0, !10, i64 8}
!15 = !{!16, !6, i64 8}
!16 = !{!"ordered_set", !10, i64 0, !6, i64 8, !6, i64 12, !10, i64 16, !10, i64 24, !10, i64 32}
!17 = !{!12, !6, i64 12}
!18 = !{!12, !10, i64 0}
!19 = !{!20, !21, i64 0}
!20 = !{!"uint64_t_ll", !21, i64 0, !10, i64 8, !10, i64 16}
!21 = !{!"long", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = !{!26, !10, i64 48}
!26 = !{!"cache_def", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}


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