; LLVM IR from DanEngelbrecht/longtail :: test (test)

; 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.Longtail_LogFieldFmt_Private = type { ptr, ptr, ptr }
%struct.Longtail_LogContextFmt_Private = type { ptr, ptr, i64 }
%struct.TestPutBlockRequest = type { i64, ptr, ptr }
%struct.Longtail_StoredBlock = type { ptr, ptr, ptr, i32 }
%struct.Longtail_BlockIndex = type { ptr, ptr, ptr, ptr, ptr, ptr }
%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.stbds_array_header = type { i64, i64, ptr, i64 }

@.str.3 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.586 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.587 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.588 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.590 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.591 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.592 = external hidden unnamed_addr constant [19 x i8], align 1
@__func__._ZN19TestAsyncBlockStore14PutStoredBlockEP22Longtail_BlockStoreAPIP20Longtail_StoredBlockP31Longtail_AsyncPutStoredBlockAPI = external hidden unnamed_addr constant [15 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: 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) #1

declare void @Longtail_CallLogger(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #2

declare void @Longtail_LockSpinLock(ptr noundef) #2

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

declare void @Longtail_UnlockSpinLock(ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN19TestAsyncBlockStore14PutStoredBlockEP22Longtail_BlockStoreAPIP20Longtail_StoredBlockP31Longtail_AsyncPutStoredBlockAPI(ptr noundef %0, ptr noundef %1, ptr noundef %2) #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [3 x %struct.Longtail_LogFieldFmt_Private], align 16
  %8 = alloca %struct.Longtail_LogContextFmt_Private, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %struct.TestPutBlockRequest, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 72, ptr %7) #4
  %12 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %7, i32 0, i32 0
  store ptr @.str.590, ptr %12, align 8, !tbaa !9
  %13 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %7, i32 0, i32 1
  store ptr @.str.586, ptr %13, align 8, !tbaa !11
  %14 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %7, i32 0, i32 2
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = ptrtoint ptr %15 to i64
  %17 = inttoptr i64 %16 to ptr
  store ptr %17, ptr %14, align 8, !tbaa !12
  %18 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %7, i64 1
  %19 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %18, i32 0, i32 0
  store ptr @.str.591, ptr %19, align 8, !tbaa !9
  %20 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %18, i32 0, i32 1
  store ptr @.str.586, ptr %20, align 8, !tbaa !11
  %21 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %18, i32 0, i32 2
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = ptrtoint ptr %22 to i64
  %24 = inttoptr i64 %23 to ptr
  store ptr %24, ptr %21, align 8, !tbaa !12
  %25 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %7, i64 2
  %26 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %25, i32 0, i32 0
  store ptr @.str.592, ptr %26, align 8, !tbaa !9
  %27 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %25, i32 0, i32 1
  store ptr @.str.586, ptr %27, align 8, !tbaa !11
  %28 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %25, i32 0, i32 2
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = ptrtoint ptr %29 to i64
  %31 = inttoptr i64 %30 to ptr
  store ptr %31, ptr %28, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #4
  %32 = getelementptr inbounds %struct.Longtail_LogContextFmt_Private, ptr %8, i32 0, i32 0
  store ptr null, ptr %32, align 8, !tbaa !13
  %33 = getelementptr inbounds %struct.Longtail_LogContextFmt_Private, ptr %8, i32 0, i32 1
  %34 = getelementptr inbounds [3 x %struct.Longtail_LogFieldFmt_Private], ptr %7, i64 0, i64 0
  store ptr %34, ptr %33, align 8, !tbaa !16
  %35 = getelementptr inbounds %struct.Longtail_LogContextFmt_Private, ptr %8, i32 0, i32 2
  store i64 3, ptr %35, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store ptr %8, ptr %9, align 8, !tbaa !5
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @Longtail_CallLogger(ptr noundef @.str.3, ptr noundef @__func__._ZN19TestAsyncBlockStore14PutStoredBlockEP22Longtail_BlockStoreAPIP20Longtail_StoredBlockP31Longtail_AsyncPutStoredBlockAPI, i32 noundef 4026, ptr noundef %36, i32 noundef 0, ptr noundef @.str.587, ptr noundef @.str.588)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %37, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #4
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.Longtail_StoredBlock, ptr %38, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !18
  %41 = getelementptr inbounds %struct.Longtail_BlockIndex, ptr %40, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8, !tbaa !21
  %43 = load i64, ptr %42, align 8, !tbaa !23
  %44 = getelementptr inbounds %struct.TestPutBlockRequest, ptr %11, i32 0, i32 0
  store i64 %43, ptr %44, align 8, !tbaa !24
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.TestPutBlockRequest, ptr %11, i32 0, i32 1
  store ptr %45, ptr %46, align 8, !tbaa !26
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.TestPutBlockRequest, ptr %11, i32 0, i32 2
  store ptr %47, ptr %48, align 8, !tbaa !27
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %49, i32 0, i32 8
  %51 = call i32 @Longtail_AtomicAdd32(ptr noundef %50, i32 noundef 1)
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %52, i32 0, i32 4
  %54 = load ptr, ptr %53, align 8, !tbaa !28
  call void @Longtail_LockSpinLock(ptr noundef %54)
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %55, i32 0, i32 11
  %57 = load ptr, ptr %56, align 8, !tbaa !32
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %74

59:                                               ; preds = %3
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %60, i32 0, i32 11
  %62 = load ptr, ptr %61, align 8, !tbaa !32
  %63 = getelementptr inbounds %struct.stbds_array_header, ptr %62, i64 -1
  %64 = getelementptr inbounds %struct.stbds_array_header, ptr %63, i32 0, i32 0
  %65 = load i64, ptr %64, align 8, !tbaa !33
  %66 = add i64 %65, 1
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  %68 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %67, i32 0, i32 11
  %69 = load ptr, ptr %68, align 8, !tbaa !32
  %70 = getelementptr inbounds %struct.stbds_array_header, ptr %69, i64 -1
  %71 = getelementptr inbounds %struct.stbds_array_header, ptr %70, i32 0, i32 1
  %72 = load i64, ptr %71, align 8, !tbaa !35
  %73 = icmp ugt i64 %66, %72
  br i1 %73, label %74, label %81

74:                                               ; preds = %59, %3
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %75, i32 0, i32 11
  %77 = load ptr, ptr %76, align 8, !tbaa !32
  %78 = call noundef ptr @_ZL22stbds_arrgrowf_wrapperI19TestPutBlockRequestEPT_S2_mmm(ptr noundef %77, i64 noundef 24, i64 noundef 1, i64 noundef 0)
  %79 = load ptr, ptr %10, align 8, !tbaa !5
  %80 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %79, i32 0, i32 11
  store ptr %78, ptr %80, align 8, !tbaa !32
  br label %82

81:                                               ; preds = %59
  br label %82

82:                                               ; preds = %81, %74
  %83 = phi i32 [ 0, %74 ], [ 0, %81 ]
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %84, i32 0, i32 11
  %86 = load ptr, ptr %85, align 8, !tbaa !32
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %87, i32 0, i32 11
  %89 = load ptr, ptr %88, align 8, !tbaa !32
  %90 = getelementptr inbounds %struct.stbds_array_header, ptr %89, i64 -1
  %91 = getelementptr inbounds %struct.stbds_array_header, ptr %90, i32 0, i32 0
  %92 = load i64, ptr %91, align 8, !tbaa !33
  %93 = add i64 %92, 1
  store i64 %93, ptr %91, align 8, !tbaa !33
  %94 = getelementptr inbounds %struct.TestPutBlockRequest, ptr %86, i64 %92
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %94, ptr align 8 %11, i64 24, i1 false), !tbaa.struct !36
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  %96 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %95, i32 0, i32 4
  %97 = load ptr, ptr %96, align 8, !tbaa !28
  call void @Longtail_UnlockSpinLock(ptr noundef %97)
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %98, i32 0, i32 6
  %100 = load ptr, ptr %99, align 8, !tbaa !37
  %101 = call i32 @Longtail_PostSema(ptr noundef %100, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr %7) #4
  ret i32 0
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 0}
!10 = !{!"_ZTS28Longtail_LogFieldFmt_Private", !6, i64 0, !6, i64 8, !6, i64 16}
!11 = !{!10, !6, i64 8}
!12 = !{!10, !6, i64 16}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS30Longtail_LogContextFmt_Private", !6, i64 0, !6, i64 8, !15, i64 16}
!15 = !{!"long", !7, i64 0}
!16 = !{!14, !6, i64 8}
!17 = !{!14, !15, i64 16}
!18 = !{!19, !6, i64 8}
!19 = !{!"_ZTS20Longtail_StoredBlock", !6, i64 0, !6, i64 8, !6, i64 16, !20, i64 24}
!20 = !{!"int", !7, i64 0}
!21 = !{!22, !6, i64 0}
!22 = !{!"_ZTS19Longtail_BlockIndex", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!23 = !{!15, !15, i64 0}
!24 = !{!25, !15, i64 0}
!25 = !{!"_ZTS19TestPutBlockRequest", !15, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!25, !6, i64 8}
!27 = !{!25, !6, i64 16}
!28 = !{!29, !6, i64 88}
!29 = !{!"_ZTS19TestAsyncBlockStore", !30, i64 0, !6, i64 64, !6, i64 72, !20, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !7, i64 112, !20, i64 176, !6, i64 184, !15, i64 192, !6, i64 200, !15, i64 208, !6, i64 216, !15, i64 224, !6, i64 232, !6, i64 240, !6, i64 248}
!30 = !{!"_ZTS22Longtail_BlockStoreAPI", !31, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!31 = !{!"_ZTS12Longtail_API", !6, i64 0}
!32 = !{!29, !6, i64 200}
!33 = !{!34, !15, i64 0}
!34 = !{!"_ZTS18stbds_array_header", !15, i64 0, !15, i64 8, !6, i64 16, !15, i64 24}
!35 = !{!34, !15, i64 8}
!36 = !{i64 0, i64 8, !23, i64 8, i64 8, !5, i64 16, i64 8, !5}
!37 = !{!29, !6, i64 104}


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

@.str.3 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.586 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.587 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.588 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.590 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.591 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.592 = external hidden unnamed_addr constant [19 x i8], align 1
@__func__._ZN19TestAsyncBlockStore14PutStoredBlockEP22Longtail_BlockStoreAPIP20Longtail_StoredBlockP31Longtail_AsyncPutStoredBlockAPI = external hidden unnamed_addr constant [15 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

declare void @Longtail_CallLogger(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

declare void @Longtail_LockSpinLock(ptr noundef) local_unnamed_addr #1

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

declare void @Longtail_UnlockSpinLock(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN19TestAsyncBlockStore14PutStoredBlockEP22Longtail_BlockStoreAPIP20Longtail_StoredBlockP31Longtail_AsyncPutStoredBlockAPI(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 align 2 {
  %4 = alloca [3 x %struct.Longtail_LogFieldFmt_Private], align 16
  %5 = alloca %struct.Longtail_LogContextFmt_Private, align 8
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %4) #3
  store ptr @.str.590, ptr %4, align 16, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr @.str.586, ptr %6, align 8, !tbaa !10
  %7 = getelementptr inbounds i8, ptr %4, i64 16
  store ptr %0, ptr %7, align 16, !tbaa !11
  %8 = getelementptr inbounds i8, ptr %4, i64 24
  store ptr @.str.591, ptr %8, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %4, i64 32
  store ptr @.str.586, ptr %9, align 16, !tbaa !10
  %10 = getelementptr inbounds i8, ptr %4, i64 40
  store ptr %1, ptr %10, align 8, !tbaa !11
  %11 = getelementptr inbounds i8, ptr %4, i64 48
  store ptr @.str.592, ptr %11, align 16, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %4, i64 56
  store ptr @.str.586, ptr %12, align 8, !tbaa !10
  %13 = getelementptr inbounds i8, ptr %4, i64 64
  store ptr %2, ptr %13, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #3
  store ptr null, ptr %5, align 8, !tbaa !12
  %14 = getelementptr inbounds i8, ptr %5, i64 8
  store ptr %4, ptr %14, align 8, !tbaa !15
  %15 = getelementptr inbounds i8, ptr %5, i64 16
  store i64 3, ptr %15, align 8, !tbaa !16
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @Longtail_CallLogger(ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__._ZN19TestAsyncBlockStore14PutStoredBlockEP22Longtail_BlockStoreAPIP20Longtail_StoredBlockP31Longtail_AsyncPutStoredBlockAPI, i32 noundef 4026, ptr noundef nonnull %5, i32 noundef 0, ptr noundef nonnull @.str.587, ptr noundef nonnull @.str.588)
  %16 = getelementptr inbounds i8, ptr %1, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !17
  %18 = load ptr, ptr %17, align 8, !tbaa !20
  %19 = load i64, ptr %18, align 8, !tbaa !22
  %20 = getelementptr inbounds i8, ptr %0, i64 176
  %21 = call i32 @Longtail_AtomicAdd32(ptr noundef nonnull %20, i32 noundef 1)
  %22 = getelementptr inbounds i8, ptr %0, i64 88
  %23 = load ptr, ptr %22, align 8, !tbaa !23
  call void @Longtail_LockSpinLock(ptr noundef %23)
  %24 = getelementptr inbounds i8, ptr %0, i64 200
  %25 = load ptr, ptr %24, align 8, !tbaa !27
  %.not = icmp eq ptr %25, null
  br i1 %.not, label %33, label %26

26:                                               ; preds = %3
  %27 = getelementptr inbounds i8, ptr %25, i64 -32
  %28 = load i64, ptr %27, align 8, !tbaa !28
  %29 = add i64 %28, 1
  %30 = getelementptr inbounds i8, ptr %25, i64 -24
  %31 = load i64, ptr %30, align 8, !tbaa !30
  %32 = icmp ugt i64 %29, %31
  br i1 %32, label %33, label %35

33:                                               ; preds = %26, %3
  %34 = call noundef ptr @_ZL22stbds_arrgrowf_wrapperI19TestPutBlockRequestEPT_S2_mmm(ptr noundef %25, i64 noundef 24, i64 noundef 1, i64 noundef 0)
  store ptr %34, ptr %24, align 8, !tbaa !27
  %.phi.trans.insert = getelementptr inbounds i8, ptr %34, i64 -32
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !28
  %.pre19 = add i64 %.pre, 1
  br label %35

35:                                               ; preds = %26, %33
  %.pre-phi = phi i64 [ %29, %26 ], [ %.pre19, %33 ]
  %36 = phi i64 [ %28, %26 ], [ %.pre, %33 ]
  %37 = phi ptr [ %25, %26 ], [ %34, %33 ]
  %38 = getelementptr inbounds i8, ptr %37, i64 -32
  store i64 %.pre-phi, ptr %38, align 8, !tbaa !28
  %39 = getelementptr inbounds %struct.TestPutBlockRequest, ptr %37, i64 %36
  store i64 %19, ptr %39, align 8, !tbaa !22
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %39, i64 8
  store ptr %1, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !31
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %39, i64 16
  store ptr %2, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !31
  %40 = load ptr, ptr %22, align 8, !tbaa !23
  call void @Longtail_UnlockSpinLock(ptr noundef %40)
  %41 = getelementptr inbounds i8, ptr %0, i64 104
  %42 = load ptr, ptr %41, align 8, !tbaa !32
  %43 = call i32 @Longtail_PostSema(ptr noundef %42, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %4) #3
  ret i32 0
}

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

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL22stbds_arrgrowf_wrapperI19TestPutBlockRequestEPT_S2_mmm(ptr noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!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, !7, i64 0}
!6 = !{!"_ZTS28Longtail_LogFieldFmt_Private", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!6, !7, i64 16}
!12 = !{!13, !7, i64 0}
!13 = !{!"_ZTS30Longtail_LogContextFmt_Private", !7, i64 0, !7, i64 8, !14, i64 16}
!14 = !{!"long", !8, i64 0}
!15 = !{!13, !7, i64 8}
!16 = !{!13, !14, i64 16}
!17 = !{!18, !7, i64 8}
!18 = !{!"_ZTS20Longtail_StoredBlock", !7, i64 0, !7, i64 8, !7, i64 16, !19, i64 24}
!19 = !{!"int", !8, i64 0}
!20 = !{!21, !7, i64 0}
!21 = !{!"_ZTS19Longtail_BlockIndex", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!22 = !{!14, !14, i64 0}
!23 = !{!24, !7, i64 88}
!24 = !{!"_ZTS19TestAsyncBlockStore", !25, i64 0, !7, i64 64, !7, i64 72, !19, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !8, i64 112, !19, i64 176, !7, i64 184, !14, i64 192, !7, i64 200, !14, i64 208, !7, i64 216, !14, i64 224, !7, i64 232, !7, i64 240, !7, i64 248}
!25 = !{!"_ZTS22Longtail_BlockStoreAPI", !26, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56}
!26 = !{!"_ZTS12Longtail_API", !7, i64 0}
!27 = !{!24, !7, i64 200}
!28 = !{!29, !14, i64 0}
!29 = !{!"_ZTS18stbds_array_header", !14, i64 0, !14, i64 8, !7, i64 16, !14, i64 24}
!30 = !{!29, !14, i64 8}
!31 = !{!7, !7, i64 0}
!32 = !{!24, !7, i64 104}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass