; 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.value_cache_handler_pair = type { ptr, 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.9 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [31 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: nounwind uwtable
define dso_local void @simple_cache_store(i32 noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  %12 = load i32, ptr @CACHE_NAME_SPACE, align 4, !tbaa !5
  %13 = zext i32 %12 to i64
  %14 = getelementptr inbounds [10 x ptr], ptr @_cache, i64 0, i64 %13
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %18

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

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %19 = load i32, ptr @CACHE_NAME_SPACE, align 4, !tbaa !5
  %20 = zext i32 %19 to i64
  %21 = getelementptr inbounds [10 x ptr], ptr @_cache, i64 0, i64 %20
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  store ptr %22, ptr %5, align 8, !tbaa !9
  %23 = load ptr, ptr %5, align 8, !tbaa !9
  %24 = getelementptr inbounds %struct.simple_cache, ptr %23, i32 0, i32 8
  %25 = load ptr, ptr %24, align 8, !tbaa !11
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = zext i32 %26 to i64
  %28 = getelementptr inbounds ptr, ptr %25, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %32

31:                                               ; preds = %18
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef @.str.9) #5
  unreachable

32:                                               ; preds = %18
  %33 = load ptr, ptr %5, align 8, !tbaa !9
  %34 = getelementptr inbounds %struct.simple_cache, ptr %33, i32 0, i32 4
  %35 = load ptr, ptr %34, align 8, !tbaa !14
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = zext i32 %36 to i64
  %38 = getelementptr inbounds i32, ptr %35, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = load ptr, ptr %5, align 8, !tbaa !9
  %41 = getelementptr inbounds %struct.simple_cache, ptr %40, i32 0, i32 6
  %42 = load ptr, ptr %41, align 8, !tbaa !15
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = zext i32 %43 to i64
  %45 = getelementptr inbounds ptr, ptr %42, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = load ptr, ptr %5, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.simple_cache, ptr %47, i32 0, i32 7
  %49 = load ptr, ptr %48, align 8, !tbaa !16
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = zext i32 %50 to i64
  %52 = getelementptr inbounds ptr, ptr %49, i64 %51
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  %54 = call ptr @disk_store_init(i32 noundef %39, ptr noundef null, ptr noundef %46, ptr noundef null, ptr noundef %53)
  %55 = load ptr, ptr %5, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.simple_cache, ptr %55, i32 0, i32 8
  %57 = load ptr, ptr %56, align 8, !tbaa !11
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = zext i32 %58 to i64
  %60 = getelementptr inbounds ptr, ptr %57, i64 %59
  store ptr %54, ptr %60, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %134, %32
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = load ptr, ptr %5, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.simple_cache, ptr %63, i32 0, i32 4
  %65 = load ptr, ptr %64, align 8, !tbaa !14
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = zext i32 %66 to i64
  %68 = getelementptr inbounds i32, ptr %65, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp ult i32 %62, %69
  br i1 %70, label %71, label %137

71:                                               ; preds = %61
  %72 = load ptr, ptr %4, align 8, !tbaa !9
  %73 = icmp ne ptr %72, null
  br i1 %73, label %74, label %80

74:                                               ; preds = %71
  %75 = load ptr, ptr %4, align 8, !tbaa !9
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds i32, ptr %75, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  store i32 %79, ptr %7, align 4, !tbaa !5
  br label %82

80:                                               ; preds = %71
  %81 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %81, ptr %7, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %80, %74
  %83 = load ptr, ptr %5, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.simple_cache, ptr %83, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !17
  %86 = load i32, ptr %3, align 4, !tbaa !5
  %87 = zext i32 %86 to i64
  %88 = getelementptr inbounds ptr, ptr %85, i64 %87
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = call ptr @hash_list_get(ptr noundef %89, i32 noundef %90)
  store ptr %91, ptr %6, align 8, !tbaa !9
  %92 = load ptr, ptr %6, align 8, !tbaa !9
  %93 = icmp eq ptr %92, null
  br i1 %93, label %94, label %95

94:                                               ; preds = %82
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef @.str.10) #5
  unreachable

95:                                               ; preds = %82
  %96 = load ptr, ptr %6, align 8, !tbaa !9
  %97 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %96, i32 0, i32 1
  %98 = load ptr, ptr %97, align 8, !tbaa !18
  %99 = icmp eq ptr %98, null
  br i1 %99, label %107, label %100

100:                                              ; preds = %95
  %101 = load ptr, ptr %6, align 8, !tbaa !9
  %102 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %101, i32 0, i32 1
  %103 = load ptr, ptr %102, align 8, !tbaa !18
  %104 = getelementptr inbounds %struct.cache_handler, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !20
  %106 = icmp eq ptr %105, null
  br i1 %106, label %107, label %108

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

108:                                              ; preds = %100
  %109 = load ptr, ptr %6, align 8, !tbaa !9
  %110 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %109, i32 0, i32 1
  %111 = load ptr, ptr %110, align 8, !tbaa !18
  %112 = getelementptr inbounds %struct.cache_handler, ptr %111, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8, !tbaa !20
  %114 = load ptr, ptr %6, align 8, !tbaa !9
  %115 = getelementptr inbounds %struct.value_cache_handler_pair, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !22
  %117 = call i64 %113(ptr noundef %116, ptr noundef %11)
  store i64 %117, ptr %10, align 8, !tbaa !23
  %118 = load ptr, ptr %5, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.simple_cache, ptr %118, i32 0, i32 8
  %120 = load ptr, ptr %119, align 8, !tbaa !11
  %121 = load i32, ptr %3, align 4, !tbaa !5
  %122 = zext i32 %121 to i64
  %123 = getelementptr inbounds ptr, ptr %120, i64 %122
  %124 = load ptr, ptr %123, align 8, !tbaa !9
  %125 = load ptr, ptr %11, align 8, !tbaa !9
  %126 = load i64, ptr %10, align 8, !tbaa !23
  %127 = call i32 @disk_store_append(ptr noundef %124, ptr noundef %125, i64 noundef %126)
  store i32 %127, ptr %9, align 4, !tbaa !5
  %128 = load i32, ptr %8, align 4, !tbaa !5
  %129 = load i32, ptr %9, align 4, !tbaa !5
  %130 = icmp ne i32 %128, %129
  br i1 %130, label %131, label %132

131:                                              ; preds = %108
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef @.str.12) #5
  unreachable

132:                                              ; preds = %108
  %133 = load ptr, ptr %11, align 8, !tbaa !9
  call void @free(ptr noundef %133) #6
  br label %134

134:                                              ; preds = %132
  %135 = load i32, ptr %8, align 4, !tbaa !5
  %136 = add i32 %135, 1
  store i32 %136, ptr %8, align 4, !tbaa !5
  br label %61, !llvm.loop !24

137:                                              ; preds = %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void
}

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

declare ptr @hash_list_get(ptr noundef, i32 noundef) #4

declare ptr @disk_store_init(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare i32 @disk_store_append(ptr noundef, ptr noundef, i64 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 = { 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 = { 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 #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, !10, i64 64}
!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 32}
!15 = !{!12, !10, i64 48}
!16 = !{!12, !10, i64 56}
!17 = !{!12, !10, i64 8}
!18 = !{!19, !10, i64 8}
!19 = !{!"value_cache_handler_pair", !10, i64 0, !10, i64 8, !10, i64 16}
!20 = !{!21, !10, i64 0}
!21 = !{!"cache_handler", !10, i64 0, !10, i64 8, !10, i64 16}
!22 = !{!19, !10, i64 0}
!23 = !{!13, !13, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"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"

@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.9 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [31 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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

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

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

10:                                               ; preds = %2
  %11 = getelementptr inbounds i8, ptr %7, i64 64
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %13 = zext i32 %0 to i64
  %14 = getelementptr inbounds ptr, ptr %12, i64 %13
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %.not = icmp eq ptr %15, null
  br i1 %.not, label %17, label %16

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

17:                                               ; preds = %10
  %18 = getelementptr inbounds i8, ptr %7, i64 32
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  %20 = getelementptr inbounds i32, ptr %19, i64 %13
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %7, i64 48
  %23 = load ptr, ptr %22, align 8, !tbaa !15
  %24 = getelementptr inbounds ptr, ptr %23, i64 %13
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = getelementptr inbounds i8, ptr %7, i64 56
  %27 = load ptr, ptr %26, align 8, !tbaa !16
  %28 = getelementptr inbounds ptr, ptr %27, i64 %13
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = tail call ptr @disk_store_init(i32 noundef %21, ptr noundef null, ptr noundef %25, ptr noundef null, ptr noundef %29) #6
  %31 = load ptr, ptr %11, align 8, !tbaa !11
  %32 = getelementptr inbounds ptr, ptr %31, i64 %13
  store ptr %30, ptr %32, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %33 = load ptr, ptr %18, align 8, !tbaa !14
  %34 = getelementptr inbounds i32, ptr %33, i64 %13
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %.not43 = icmp eq i32 %35, 0
  br i1 %.not43, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %17
  %.not36 = icmp eq ptr %1, null
  %36 = getelementptr inbounds i8, ptr %7, i64 8
  br i1 %.not36, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %57
  %.03038.us = phi i32 [ %59, %57 ], [ 0, %.lr.ph ]
  %37 = load ptr, ptr %36, align 8, !tbaa !17
  %38 = getelementptr inbounds ptr, ptr %37, i64 %13
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = call ptr @hash_list_get(ptr noundef %39, i32 noundef %.03038.us) #6
  %41 = icmp eq ptr %40, null
  br i1 %41, label %.split.us, label %42

42:                                               ; preds = %.lr.ph.split.us
  %43 = getelementptr inbounds i8, ptr %40, i64 8
  %44 = load ptr, ptr %43, align 8, !tbaa !18
  %45 = icmp eq ptr %44, null
  br i1 %45, label %.split40.us, label %46

46:                                               ; preds = %42
  %47 = load ptr, ptr %44, align 8, !tbaa !20
  %48 = icmp eq ptr %47, null
  br i1 %48, label %.split40.us, label %49

49:                                               ; preds = %46
  %50 = load ptr, ptr %40, align 8, !tbaa !22
  %51 = call i64 %47(ptr noundef %50, ptr noundef nonnull %3) #6
  %52 = load ptr, ptr %11, align 8, !tbaa !11
  %53 = getelementptr inbounds ptr, ptr %52, i64 %13
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %55 = load ptr, ptr %3, align 8, !tbaa !9
  %56 = call i32 @disk_store_append(ptr noundef %54, ptr noundef %55, i64 noundef %51) #6
  %.not37.us = icmp eq i32 %.03038.us, %56
  br i1 %.not37.us, label %57, label %.split42.us

57:                                               ; preds = %49
  %58 = load ptr, ptr %3, align 8, !tbaa !9
  call void @free(ptr noundef %58) #6
  %59 = add nuw i32 %.03038.us, 1
  %60 = load ptr, ptr %18, align 8, !tbaa !14
  %61 = getelementptr inbounds i32, ptr %60, i64 %13
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp ult i32 %59, %62
  br i1 %63, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !23

.lr.ph.split:                                     ; preds = %.lr.ph, %87
  %indvars.iv = phi i64 [ %indvars.iv.next, %87 ], [ 0, %.lr.ph ]
  %64 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = load ptr, ptr %36, align 8, !tbaa !17
  %67 = getelementptr inbounds ptr, ptr %66, i64 %13
  %68 = load ptr, ptr %67, align 8, !tbaa !9
  %69 = call ptr @hash_list_get(ptr noundef %68, i32 noundef %65) #6
  %70 = icmp eq ptr %69, null
  br i1 %70, label %.split.us, label %71

.split.us:                                        ; preds = %.lr.ph.split, %.lr.ph.split.us
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef nonnull @.str.10) #5
  unreachable

71:                                               ; preds = %.lr.ph.split
  %72 = getelementptr inbounds i8, ptr %69, i64 8
  %73 = load ptr, ptr %72, align 8, !tbaa !18
  %74 = icmp eq ptr %73, null
  br i1 %74, label %.split40.us, label %75

75:                                               ; preds = %71
  %76 = load ptr, ptr %73, align 8, !tbaa !20
  %77 = icmp eq ptr %76, null
  br i1 %77, label %.split40.us, label %78

.split40.us:                                      ; preds = %71, %75, %42, %46
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef nonnull @.str.11) #5
  unreachable

78:                                               ; preds = %75
  %79 = load ptr, ptr %69, align 8, !tbaa !22
  %80 = call i64 %76(ptr noundef %79, ptr noundef nonnull %3) #6
  %81 = load ptr, ptr %11, align 8, !tbaa !11
  %82 = getelementptr inbounds ptr, ptr %81, i64 %13
  %83 = load ptr, ptr %82, align 8, !tbaa !9
  %84 = load ptr, ptr %3, align 8, !tbaa !9
  %85 = call i32 @disk_store_append(ptr noundef %83, ptr noundef %84, i64 noundef %80) #6
  %86 = zext i32 %85 to i64
  %.not37 = icmp eq i64 %indvars.iv, %86
  br i1 %.not37, label %87, label %.split42.us

.split42.us:                                      ; preds = %78, %49
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef nonnull @.str.12) #5
  unreachable

87:                                               ; preds = %78
  %88 = load ptr, ptr %3, align 8, !tbaa !9
  call void @free(ptr noundef %88) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %89 = load ptr, ptr %18, align 8, !tbaa !14
  %90 = getelementptr inbounds i32, ptr %89, i64 %13
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = zext i32 %91 to i64
  %93 = icmp ult i64 %indvars.iv.next, %92
  br i1 %93, label %.lr.ph.split, label %._crit_edge, !llvm.loop !23

._crit_edge:                                      ; preds = %87, %57, %17
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret void
}

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

declare ptr @hash_list_get(ptr noundef, i32 noundef) local_unnamed_addr #4

declare ptr @disk_store_init(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @disk_store_append(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #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, !10, i64 64}
!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 32}
!15 = !{!12, !10, i64 48}
!16 = !{!12, !10, i64 56}
!17 = !{!12, !10, i64 8}
!18 = !{!19, !10, i64 8}
!19 = !{!"value_cache_handler_pair", !10, i64 0, !10, i64 8, !10, i64 16}
!20 = !{!21, !10, i64 0}
!21 = !{!"cache_handler", !10, i64 0, !10, i64 8, !10, i64 16}
!22 = !{!19, !10, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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