; LLVM IR from DanEngelbrecht/longtail :: test/test.ll (ZN19TestAsyncBlockStore7DisposeEP12Longtail_API)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.TestAsyncBlockStore = type { %struct.Longtail_BlockStoreAPI, ptr, ptr, i32, ptr, ptr, ptr, [8 x ptr], i32, ptr, i64, ptr, i64, ptr, i64, ptr, ptr, ptr }
%struct.Longtail_BlockStoreAPI = type { %struct.Longtail_API, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.Longtail_API = type { ptr }
%struct.TestPutBlockRequest = type { i64, ptr, ptr }
%struct.TestStoredBlockLookup = type { i64, ptr }
%struct.stbds_array_header = type { i64, i64, ptr, i64 }

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

declare void @Longtail_Free(ptr noundef) #1

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN19TestAsyncBlockStore7DisposeEP12Longtail_API(ptr noundef %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %10, ptr %3, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %11, i32 0, i32 3
  %13 = call i32 @Longtail_AtomicAdd32(ptr noundef %12, i32 noundef 1)
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %14, i32 0, i32 6
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = call i32 @Longtail_PostSema(ptr noundef %16, i32 noundef 8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !15
  br label %18

18:                                               ; preds = %42, %1
  %19 = load i32, ptr %4, align 4, !tbaa !15
  %20 = icmp ult i32 %19, 8
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %45

22:                                               ; preds = %18
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %23, i32 0, i32 7
  %25 = load i32, ptr %4, align 4, !tbaa !15
  %26 = zext i32 %25 to i64
  %27 = getelementptr inbounds [8 x ptr], ptr %24, i64 0, i64 %26
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = call i32 @Longtail_JoinThread(ptr noundef %28, i64 noundef -1)
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %30, i32 0, i32 7
  %32 = load i32, ptr %4, align 4, !tbaa !15
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds [8 x ptr], ptr %31, i64 0, i64 %33
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  call void @Longtail_DeleteThread(ptr noundef %35)
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %36, i32 0, i32 7
  %38 = load i32, ptr %4, align 4, !tbaa !15
  %39 = zext i32 %38 to i64
  %40 = getelementptr inbounds [8 x ptr], ptr %37, i64 0, i64 %39
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  call void @Longtail_Free(ptr noundef %41)
  br label %42

42:                                               ; preds = %22
  %43 = load i32, ptr %4, align 4, !tbaa !15
  %44 = add i32 %43, 1
  store i32 %44, ptr %4, align 4, !tbaa !15
  br label %18, !llvm.loop !16

45:                                               ; preds = %21
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %46, i32 0, i32 6
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  call void @Longtail_DeleteSema(ptr noundef %48)
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %49, i32 0, i32 6
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  call void @Longtail_Free(ptr noundef %51)
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %52, i32 0, i32 5
  %54 = load ptr, ptr %53, align 8, !tbaa !18
  call void @Longtail_DeleteSpinLock(ptr noundef %54)
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %55, i32 0, i32 5
  %57 = load ptr, ptr %56, align 8, !tbaa !18
  call void @Longtail_Free(ptr noundef %57)
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %58, i32 0, i32 4
  %60 = load ptr, ptr %59, align 8, !tbaa !19
  call void @Longtail_DeleteSpinLock(ptr noundef %60)
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %61, i32 0, i32 4
  %63 = load ptr, ptr %62, align 8, !tbaa !19
  call void @Longtail_Free(ptr noundef %63)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store i64 0, ptr %5, align 8, !tbaa !20
  br label %64

64:                                               ; preds = %113, %45
  %65 = load i64, ptr %5, align 8, !tbaa !20
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %66, i32 0, i32 10
  %68 = load i64, ptr %67, align 8, !tbaa !21
  %69 = icmp slt i64 %65, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %64
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %116

71:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %72, i32 0, i32 11
  %74 = load ptr, ptr %73, align 8, !tbaa !22
  %75 = load i64, ptr %5, align 8, !tbaa !20
  %76 = getelementptr inbounds %struct.TestPutBlockRequest, ptr %74, i64 %75
  %77 = getelementptr inbounds %struct.TestPutBlockRequest, ptr %76, i32 0, i32 0
  %78 = load i64, ptr %77, align 8, !tbaa !23
  store i64 %78, ptr %7, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %79, i32 0, i32 17
  %81 = load ptr, ptr %80, align 8, !tbaa !25
  %82 = call noundef ptr @_ZL23stbds_hmget_key_wrapperI21TestStoredBlockLookupEPT_S2_mPvmi(ptr noundef %81, i64 noundef 16, ptr noundef %7, i64 noundef 8, i32 noundef 0)
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %83, i32 0, i32 17
  store ptr %82, ptr %84, align 8, !tbaa !25
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %85, i32 0, i32 17
  %87 = load ptr, ptr %86, align 8, !tbaa !25
  %88 = getelementptr inbounds %struct.TestStoredBlockLookup, ptr %87, i64 -1
  %89 = getelementptr inbounds %struct.stbds_array_header, ptr %88, i64 -1
  %90 = getelementptr inbounds %struct.stbds_array_header, ptr %89, i32 0, i32 3
  %91 = load i64, ptr %90, align 8, !tbaa !26
  store i64 %91, ptr %8, align 8, !tbaa !20
  %92 = load i64, ptr %8, align 8, !tbaa !20
  %93 = icmp eq i64 %92, -1
  br i1 %93, label %94, label %95

94:                                               ; preds = %71
  store i32 7, ptr %6, align 4
  br label %110

95:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %96, i32 0, i32 17
  %98 = load ptr, ptr %97, align 8, !tbaa !25
  %99 = load i64, ptr %8, align 8, !tbaa !20
  %100 = getelementptr inbounds %struct.TestStoredBlockLookup, ptr %98, i64 %99
  %101 = getelementptr inbounds %struct.TestStoredBlockLookup, ptr %100, i32 0, i32 1
  %102 = load ptr, ptr %101, align 8, !tbaa !28
  store ptr %102, ptr %9, align 8, !tbaa !5
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  %104 = icmp ne ptr %103, null
  br i1 %104, label %105, label %108

105:                                              ; preds = %95
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.stbds_array_header, ptr %106, i64 -1
  call void @free(ptr noundef %107) #4
  br label %109

108:                                              ; preds = %95
  br label %109

109:                                              ; preds = %108, %105
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  store i32 0, ptr %6, align 4
  br label %110

110:                                              ; preds = %109, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %111 = load i32, ptr %6, align 4
  switch i32 %111, label %186 [
    i32 0, label %112
    i32 7, label %113
  ]

112:                                              ; preds = %110
  br label %113

113:                                              ; preds = %112, %110
  %114 = load i64, ptr %5, align 8, !tbaa !20
  %115 = add nsw i64 %114, 1
  store i64 %115, ptr %5, align 8, !tbaa !20
  br label %64, !llvm.loop !30

116:                                              ; preds = %70
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %117, i32 0, i32 9
  %119 = load ptr, ptr %118, align 8, !tbaa !31
  %120 = icmp ne ptr %119, null
  br i1 %120, label %121, label %126

121:                                              ; preds = %116
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %122, i32 0, i32 9
  %124 = load ptr, ptr %123, align 8, !tbaa !31
  %125 = getelementptr inbounds %struct.stbds_array_header, ptr %124, i64 -1
  call void @free(ptr noundef %125) #4
  br label %127

126:                                              ; preds = %116
  br label %127

127:                                              ; preds = %126, %121
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %128, i32 0, i32 9
  store ptr null, ptr %129, align 8, !tbaa !31
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %130, i32 0, i32 17
  %132 = load ptr, ptr %131, align 8, !tbaa !25
  %133 = icmp ne ptr %132, null
  br i1 %133, label %134, label %139

134:                                              ; preds = %127
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %135, i32 0, i32 17
  %137 = load ptr, ptr %136, align 8, !tbaa !25
  %138 = getelementptr inbounds %struct.TestStoredBlockLookup, ptr %137, i64 -1
  call void @stbds_hmfree_func(ptr noundef %138, i64 noundef 16)
  br label %140

139:                                              ; preds = %127
  br label %140

140:                                              ; preds = %139, %134
  %141 = phi i32 [ 0, %134 ], [ 0, %139 ]
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %142, i32 0, i32 17
  store ptr null, ptr %143, align 8, !tbaa !25
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %145 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %144, i32 0, i32 11
  %146 = load ptr, ptr %145, align 8, !tbaa !22
  %147 = icmp ne ptr %146, null
  br i1 %147, label %148, label %153

148:                                              ; preds = %140
  %149 = load ptr, ptr %3, align 8, !tbaa !5
  %150 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %149, i32 0, i32 11
  %151 = load ptr, ptr %150, align 8, !tbaa !22
  %152 = getelementptr inbounds %struct.stbds_array_header, ptr %151, i64 -1
  call void @free(ptr noundef %152) #4
  br label %154

153:                                              ; preds = %140
  br label %154

154:                                              ; preds = %153, %148
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %155, i32 0, i32 11
  store ptr null, ptr %156, align 8, !tbaa !22
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  %158 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %157, i32 0, i32 13
  %159 = load ptr, ptr %158, align 8, !tbaa !32
  %160 = icmp ne ptr %159, null
  br i1 %160, label %161, label %166

161:                                              ; preds = %154
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %162, i32 0, i32 13
  %164 = load ptr, ptr %163, align 8, !tbaa !32
  %165 = getelementptr inbounds %struct.stbds_array_header, ptr %164, i64 -1
  call void @free(ptr noundef %165) #4
  br label %167

166:                                              ; preds = %154
  br label %167

167:                                              ; preds = %166, %161
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %168, i32 0, i32 13
  store ptr null, ptr %169, align 8, !tbaa !32
  %170 = load ptr, ptr %3, align 8, !tbaa !5
  %171 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %170, i32 0, i32 15
  %172 = load ptr, ptr %171, align 8, !tbaa !33
  %173 = icmp ne ptr %172, null
  br i1 %173, label %174, label %179

174:                                              ; preds = %167
  %175 = load ptr, ptr %3, align 8, !tbaa !5
  %176 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %175, i32 0, i32 15
  %177 = load ptr, ptr %176, align 8, !tbaa !33
  %178 = getelementptr inbounds %struct.stbds_array_header, ptr %177, i64 -1
  call void @free(ptr noundef %178) #4
  br label %180

179:                                              ; preds = %167
  br label %180

180:                                              ; preds = %179, %174
  %181 = load ptr, ptr %3, align 8, !tbaa !5
  %182 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %181, i32 0, i32 15
  store ptr null, ptr %182, align 8, !tbaa !33
  %183 = load ptr, ptr %3, align 8, !tbaa !5
  %184 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %183, i32 0, i32 16
  %185 = load ptr, ptr %184, align 8, !tbaa !34
  call void @Longtail_Free(ptr noundef %185)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret void

186:                                              ; preds = %110
  unreachable
}

declare void @Longtail_DeleteSpinLock(ptr noundef) #1

declare i32 @Longtail_JoinThread(ptr noundef, i64 noundef) #1

declare void @Longtail_DeleteThread(ptr noundef) #1

declare void @Longtail_DeleteSema(ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL23stbds_hmget_key_wrapperI21TestStoredBlockLookupEPT_S2_mPvmi(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef) #3

declare void @stbds_hmfree_func(ptr noundef, i64 noundef) #1

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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 104}
!10 = !{!"_ZTS19TestAsyncBlockStore", !11, i64 0, !6, i64 64, !6, i64 72, !13, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !7, i64 112, !13, i64 176, !6, i64 184, !14, i64 192, !6, i64 200, !14, i64 208, !6, i64 216, !14, i64 224, !6, i64 232, !6, i64 240, !6, i64 248}
!11 = !{!"_ZTS22Longtail_BlockStoreAPI", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!12 = !{!"_ZTS12Longtail_API", !6, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!13, !13, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!10, !6, i64 96}
!19 = !{!10, !6, i64 88}
!20 = !{!14, !14, i64 0}
!21 = !{!10, !14, i64 192}
!22 = !{!10, !6, i64 200}
!23 = !{!24, !14, i64 0}
!24 = !{!"_ZTS19TestPutBlockRequest", !14, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!10, !6, i64 248}
!26 = !{!27, !14, i64 24}
!27 = !{!"_ZTS18stbds_array_header", !14, i64 0, !14, i64 8, !6, i64 16, !14, i64 24}
!28 = !{!29, !6, i64 8}
!29 = !{!"_ZTS21TestStoredBlockLookup", !14, i64 0, !6, i64 8}
!30 = distinct !{!30, !17}
!31 = !{!10, !6, i64 184}
!32 = !{!10, !6, i64 216}
!33 = !{!10, !6, i64 232}
!34 = !{!10, !6, i64 240}


; 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.TestPutBlockRequest = type { i64, ptr, ptr }
%struct.TestStoredBlockLookup = type { i64, ptr }

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

declare void @Longtail_Free(ptr 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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN19TestAsyncBlockStore7DisposeEP12Longtail_API(ptr noundef %0) local_unnamed_addr #3 align 2 {
  %2 = alloca i64, align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 80
  %4 = tail call i32 @Longtail_AtomicAdd32(ptr noundef nonnull %3, i32 noundef 1)
  %5 = getelementptr inbounds i8, ptr %0, i64 104
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call i32 @Longtail_PostSema(ptr noundef %6, i32 noundef 8)
  %8 = getelementptr inbounds i8, ptr %0, i64 112
  %9 = load ptr, ptr %8, align 8, !tbaa !14
  %10 = tail call i32 @Longtail_JoinThread(ptr noundef %9, i64 noundef -1)
  %11 = load ptr, ptr %8, align 8, !tbaa !14
  tail call void @Longtail_DeleteThread(ptr noundef %11)
  %12 = load ptr, ptr %8, align 8, !tbaa !14
  tail call void @Longtail_Free(ptr noundef %12)
  %13 = getelementptr inbounds i8, ptr %0, i64 120
  %14 = load ptr, ptr %13, align 8, !tbaa !14
  %15 = tail call i32 @Longtail_JoinThread(ptr noundef %14, i64 noundef -1)
  %16 = load ptr, ptr %13, align 8, !tbaa !14
  tail call void @Longtail_DeleteThread(ptr noundef %16)
  %17 = load ptr, ptr %13, align 8, !tbaa !14
  tail call void @Longtail_Free(ptr noundef %17)
  %18 = getelementptr inbounds i8, ptr %0, i64 128
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  %20 = tail call i32 @Longtail_JoinThread(ptr noundef %19, i64 noundef -1)
  %21 = load ptr, ptr %18, align 8, !tbaa !14
  tail call void @Longtail_DeleteThread(ptr noundef %21)
  %22 = load ptr, ptr %18, align 8, !tbaa !14
  tail call void @Longtail_Free(ptr noundef %22)
  %23 = getelementptr inbounds i8, ptr %0, i64 136
  %24 = load ptr, ptr %23, align 8, !tbaa !14
  %25 = tail call i32 @Longtail_JoinThread(ptr noundef %24, i64 noundef -1)
  %26 = load ptr, ptr %23, align 8, !tbaa !14
  tail call void @Longtail_DeleteThread(ptr noundef %26)
  %27 = load ptr, ptr %23, align 8, !tbaa !14
  tail call void @Longtail_Free(ptr noundef %27)
  %28 = getelementptr inbounds i8, ptr %0, i64 144
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  %30 = tail call i32 @Longtail_JoinThread(ptr noundef %29, i64 noundef -1)
  %31 = load ptr, ptr %28, align 8, !tbaa !14
  tail call void @Longtail_DeleteThread(ptr noundef %31)
  %32 = load ptr, ptr %28, align 8, !tbaa !14
  tail call void @Longtail_Free(ptr noundef %32)
  %33 = getelementptr inbounds i8, ptr %0, i64 152
  %34 = load ptr, ptr %33, align 8, !tbaa !14
  %35 = tail call i32 @Longtail_JoinThread(ptr noundef %34, i64 noundef -1)
  %36 = load ptr, ptr %33, align 8, !tbaa !14
  tail call void @Longtail_DeleteThread(ptr noundef %36)
  %37 = load ptr, ptr %33, align 8, !tbaa !14
  tail call void @Longtail_Free(ptr noundef %37)
  %38 = getelementptr inbounds i8, ptr %0, i64 160
  %39 = load ptr, ptr %38, align 8, !tbaa !14
  %40 = tail call i32 @Longtail_JoinThread(ptr noundef %39, i64 noundef -1)
  %41 = load ptr, ptr %38, align 8, !tbaa !14
  tail call void @Longtail_DeleteThread(ptr noundef %41)
  %42 = load ptr, ptr %38, align 8, !tbaa !14
  tail call void @Longtail_Free(ptr noundef %42)
  %43 = getelementptr inbounds i8, ptr %0, i64 168
  %44 = load ptr, ptr %43, align 8, !tbaa !14
  %45 = tail call i32 @Longtail_JoinThread(ptr noundef %44, i64 noundef -1)
  %46 = load ptr, ptr %43, align 8, !tbaa !14
  tail call void @Longtail_DeleteThread(ptr noundef %46)
  %47 = load ptr, ptr %43, align 8, !tbaa !14
  tail call void @Longtail_Free(ptr noundef %47)
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  tail call void @Longtail_DeleteSema(ptr noundef %48)
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  tail call void @Longtail_Free(ptr noundef %49)
  %50 = getelementptr inbounds i8, ptr %0, i64 96
  %51 = load ptr, ptr %50, align 8, !tbaa !15
  tail call void @Longtail_DeleteSpinLock(ptr noundef %51)
  %52 = load ptr, ptr %50, align 8, !tbaa !15
  tail call void @Longtail_Free(ptr noundef %52)
  %53 = getelementptr inbounds i8, ptr %0, i64 88
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  tail call void @Longtail_DeleteSpinLock(ptr noundef %54)
  %55 = load ptr, ptr %53, align 8, !tbaa !16
  tail call void @Longtail_Free(ptr noundef %55)
  %56 = getelementptr inbounds i8, ptr %0, i64 192
  %57 = load i64, ptr %56, align 8, !tbaa !17
  %58 = icmp sgt i64 %57, 0
  br i1 %58, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %59 = getelementptr inbounds i8, ptr %0, i64 200
  %60 = getelementptr inbounds i8, ptr %0, i64 248
  br label %63

._crit_edge:                                      ; preds = %77, %1
  %61 = getelementptr inbounds i8, ptr %0, i64 184
  %62 = load ptr, ptr %61, align 8, !tbaa !18
  %.not = icmp eq ptr %62, null
  br i1 %.not, label %83, label %81

63:                                               ; preds = %.lr.ph, %77
  %.04559 = phi i64 [ 0, %.lr.ph ], [ %78, %77 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %64 = load ptr, ptr %59, align 8, !tbaa !19
  %65 = getelementptr inbounds %struct.TestPutBlockRequest, ptr %64, i64 %.04559
  %66 = load i64, ptr %65, align 8, !tbaa !20
  store i64 %66, ptr %2, align 8, !tbaa !22
  %67 = load ptr, ptr %60, align 8, !tbaa !23
  %68 = call noundef ptr @_ZL23stbds_hmget_key_wrapperI21TestStoredBlockLookupEPT_S2_mPvmi(ptr noundef %67, i64 noundef 16, ptr noundef nonnull %2, i64 noundef 8, i32 noundef 0)
  store ptr %68, ptr %60, align 8, !tbaa !23
  %69 = getelementptr inbounds i8, ptr %68, i64 -24
  %70 = load i64, ptr %69, align 8, !tbaa !24
  %71 = icmp eq i64 %70, -1
  br i1 %71, label %77, label %72

72:                                               ; preds = %63
  %73 = getelementptr inbounds %struct.TestStoredBlockLookup, ptr %68, i64 %70, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !26
  %.not57 = icmp eq ptr %74, null
  br i1 %.not57, label %77, label %75

75:                                               ; preds = %72
  %76 = getelementptr inbounds i8, ptr %74, i64 -32
  call void @free(ptr noundef nonnull %76) #4
  br label %77

77:                                               ; preds = %75, %72, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  %78 = add nuw nsw i64 %.04559, 1
  %79 = load i64, ptr %56, align 8, !tbaa !17
  %80 = icmp slt i64 %78, %79
  br i1 %80, label %63, label %._crit_edge, !llvm.loop !28

81:                                               ; preds = %._crit_edge
  %82 = getelementptr inbounds i8, ptr %62, i64 -32
  call void @free(ptr noundef nonnull %82) #4
  br label %83

83:                                               ; preds = %._crit_edge, %81
  store ptr null, ptr %61, align 8, !tbaa !18
  %84 = getelementptr inbounds i8, ptr %0, i64 248
  %85 = load ptr, ptr %84, align 8, !tbaa !23
  %.not53 = icmp eq ptr %85, null
  br i1 %.not53, label %88, label %86

86:                                               ; preds = %83
  %87 = getelementptr inbounds i8, ptr %85, i64 -16
  call void @stbds_hmfree_func(ptr noundef nonnull %87, i64 noundef 16)
  br label %88

88:                                               ; preds = %83, %86
  store ptr null, ptr %84, align 8, !tbaa !23
  %89 = getelementptr inbounds i8, ptr %0, i64 200
  %90 = load ptr, ptr %89, align 8, !tbaa !19
  %.not54 = icmp eq ptr %90, null
  br i1 %.not54, label %93, label %91

91:                                               ; preds = %88
  %92 = getelementptr inbounds i8, ptr %90, i64 -32
  call void @free(ptr noundef nonnull %92) #4
  br label %93

93:                                               ; preds = %88, %91
  store ptr null, ptr %89, align 8, !tbaa !19
  %94 = getelementptr inbounds i8, ptr %0, i64 216
  %95 = load ptr, ptr %94, align 8, !tbaa !30
  %.not55 = icmp eq ptr %95, null
  br i1 %.not55, label %98, label %96

96:                                               ; preds = %93
  %97 = getelementptr inbounds i8, ptr %95, i64 -32
  call void @free(ptr noundef nonnull %97) #4
  br label %98

98:                                               ; preds = %93, %96
  store ptr null, ptr %94, align 8, !tbaa !30
  %99 = getelementptr inbounds i8, ptr %0, i64 232
  %100 = load ptr, ptr %99, align 8, !tbaa !31
  %.not56 = icmp eq ptr %100, null
  br i1 %.not56, label %103, label %101

101:                                              ; preds = %98
  %102 = getelementptr inbounds i8, ptr %100, i64 -32
  call void @free(ptr noundef nonnull %102) #4
  br label %103

103:                                              ; preds = %98, %101
  store ptr null, ptr %99, align 8, !tbaa !31
  %104 = getelementptr inbounds i8, ptr %0, i64 240
  %105 = load ptr, ptr %104, align 8, !tbaa !32
  call void @Longtail_Free(ptr noundef %105)
  ret void
}

declare void @Longtail_DeleteSpinLock(ptr noundef) local_unnamed_addr #1

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

declare void @Longtail_DeleteThread(ptr noundef) local_unnamed_addr #1

declare void @Longtail_DeleteSema(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL23stbds_hmget_key_wrapperI21TestStoredBlockLookupEPT_S2_mPvmi(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #3

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

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 = { 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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, !9, i64 104}
!6 = !{!"_ZTS19TestAsyncBlockStore", !7, i64 0, !9, i64 64, !9, i64 72, !12, i64 80, !9, i64 88, !9, i64 96, !9, i64 104, !10, i64 112, !12, i64 176, !9, i64 184, !13, i64 192, !9, i64 200, !13, i64 208, !9, i64 216, !13, i64 224, !9, i64 232, !9, i64 240, !9, i64 248}
!7 = !{!"_ZTS22Longtail_BlockStoreAPI", !8, i64 0, !9, i64 8, !9, i64 16, !9, i64 24, !9, i64 32, !9, i64 40, !9, i64 48, !9, i64 56}
!8 = !{!"_ZTS12Longtail_API", !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"int", !10, i64 0}
!13 = !{!"long", !10, i64 0}
!14 = !{!9, !9, i64 0}
!15 = !{!6, !9, i64 96}
!16 = !{!6, !9, i64 88}
!17 = !{!6, !13, i64 192}
!18 = !{!6, !9, i64 184}
!19 = !{!6, !9, i64 200}
!20 = !{!21, !13, i64 0}
!21 = !{!"_ZTS19TestPutBlockRequest", !13, i64 0, !9, i64 8, !9, i64 16}
!22 = !{!13, !13, i64 0}
!23 = !{!6, !9, i64 248}
!24 = !{!25, !13, i64 24}
!25 = !{!"_ZTS18stbds_array_header", !13, i64 0, !13, i64 8, !9, i64 16, !13, i64 24}
!26 = !{!27, !9, i64 8}
!27 = !{!"_ZTS21TestStoredBlockLookup", !13, i64 0, !9, i64 8}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!6, !9, i64 216}
!31 = !{!6, !9, i64 232}
!32 = !{!6, !9, i64 240}


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