; 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.TestGetExistingContentRequest = type { ptr, i32, 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.110 = external hidden unnamed_addr constant [12 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.592 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.594 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.595 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.596 = external hidden unnamed_addr constant [24 x i8], align 1
@__func__._ZN19TestAsyncBlockStore18GetExistingContentEP22Longtail_BlockStoreAPIjPKmjP35Longtail_AsyncGetExistingContentAPI = external hidden unnamed_addr constant [19 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

declare ptr @Longtail_Alloc(ptr noundef, i64 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: 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) #2

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

declare void @Longtail_LockSpinLock(ptr noundef) #1

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

declare void @Longtail_UnlockSpinLock(ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN19TestAsyncBlockStore18GetExistingContentEP22Longtail_BlockStoreAPIjPKmjP35Longtail_AsyncGetExistingContentAPI(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) #3 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca [5 x %struct.Longtail_LogFieldFmt_Private], align 16
  %12 = alloca %struct.Longtail_LogContextFmt_Private, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %struct.TestGetExistingContentRequest, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 120, ptr %11) #4
  %16 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %11, i32 0, i32 0
  store ptr @.str.590, ptr %16, align 8, !tbaa !11
  %17 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %11, i32 0, i32 1
  store ptr @.str.586, ptr %17, align 8, !tbaa !13
  %18 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %11, i32 0, i32 2
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = ptrtoint ptr %19 to i64
  %21 = inttoptr i64 %20 to ptr
  store ptr %21, ptr %18, align 8, !tbaa !14
  %22 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %11, i64 1
  %23 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %22, i32 0, i32 0
  store ptr @.str.110, ptr %23, align 8, !tbaa !11
  %24 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %22, i32 0, i32 1
  store ptr @.str.594, ptr %24, align 8, !tbaa !13
  %25 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %22, i32 0, i32 2
  %26 = load i32, ptr %7, align 4, !tbaa !9
  %27 = zext i32 %26 to i64
  %28 = inttoptr i64 %27 to ptr
  store ptr %28, ptr %25, align 8, !tbaa !14
  %29 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %11, i64 2
  %30 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %29, i32 0, i32 0
  store ptr @.str.595, ptr %30, align 8, !tbaa !11
  %31 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %29, i32 0, i32 1
  store ptr @.str.586, ptr %31, align 8, !tbaa !13
  %32 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %29, i32 0, i32 2
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = ptrtoint ptr %33 to i64
  %35 = inttoptr i64 %34 to ptr
  store ptr %35, ptr %32, align 8, !tbaa !14
  %36 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %11, i64 3
  %37 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %36, i32 0, i32 0
  store ptr @.str.596, ptr %37, align 8, !tbaa !11
  %38 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %36, i32 0, i32 1
  store ptr @.str.594, ptr %38, align 8, !tbaa !13
  %39 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %36, i32 0, i32 2
  %40 = load i32, ptr %9, align 4, !tbaa !9
  %41 = zext i32 %40 to i64
  %42 = inttoptr i64 %41 to ptr
  store ptr %42, ptr %39, align 8, !tbaa !14
  %43 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %11, i64 4
  %44 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %43, i32 0, i32 0
  store ptr @.str.592, ptr %44, align 8, !tbaa !11
  %45 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %43, i32 0, i32 1
  store ptr @.str.586, ptr %45, align 8, !tbaa !13
  %46 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %43, i32 0, i32 2
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = ptrtoint ptr %47 to i64
  %49 = inttoptr i64 %48 to ptr
  store ptr %49, ptr %46, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #4
  %50 = getelementptr inbounds %struct.Longtail_LogContextFmt_Private, ptr %12, i32 0, i32 0
  store ptr null, ptr %50, align 8, !tbaa !15
  %51 = getelementptr inbounds %struct.Longtail_LogContextFmt_Private, ptr %12, i32 0, i32 1
  %52 = getelementptr inbounds [5 x %struct.Longtail_LogFieldFmt_Private], ptr %11, i64 0, i64 0
  store ptr %52, ptr %51, align 8, !tbaa !18
  %53 = getelementptr inbounds %struct.Longtail_LogContextFmt_Private, ptr %12, i32 0, i32 2
  store i64 5, ptr %53, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store ptr %12, ptr %13, align 8, !tbaa !5
  %54 = load ptr, ptr %13, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @Longtail_CallLogger(ptr noundef @.str.3, ptr noundef @__func__._ZN19TestAsyncBlockStore18GetExistingContentEP22Longtail_BlockStoreAPIjPKmjP35Longtail_AsyncGetExistingContentAPI, i32 noundef 4086, ptr noundef %54, i32 noundef 0, ptr noundef @.str.587, ptr noundef @.str.588)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %55, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #4
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.TestGetExistingContentRequest, ptr %15, i32 0, i32 0
  store ptr %56, ptr %57, align 8, !tbaa !20
  %58 = load i32, ptr %7, align 4, !tbaa !9
  %59 = getelementptr inbounds %struct.TestGetExistingContentRequest, ptr %15, i32 0, i32 1
  store i32 %58, ptr %59, align 8, !tbaa !22
  %60 = load i32, ptr %7, align 4, !tbaa !9
  %61 = zext i32 %60 to i64
  %62 = mul i64 8, %61
  %63 = call ptr @Longtail_Alloc(ptr noundef null, i64 noundef %62)
  %64 = getelementptr inbounds %struct.TestGetExistingContentRequest, ptr %15, i32 0, i32 2
  store ptr %63, ptr %64, align 8, !tbaa !23
  %65 = getelementptr inbounds %struct.TestGetExistingContentRequest, ptr %15, i32 0, i32 2
  %66 = load ptr, ptr %65, align 8, !tbaa !23
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = load i32, ptr %7, align 4, !tbaa !9
  %69 = zext i32 %68 to i64
  %70 = mul i64 8, %69
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %66, ptr align 8 %67, i64 %70, i1 false)
  %71 = load ptr, ptr %14, align 8, !tbaa !5
  %72 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %71, i32 0, i32 8
  %73 = call i32 @Longtail_AtomicAdd32(ptr noundef %72, i32 noundef 1)
  %74 = load ptr, ptr %14, align 8, !tbaa !5
  %75 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %74, i32 0, i32 4
  %76 = load ptr, ptr %75, align 8, !tbaa !24
  call void @Longtail_LockSpinLock(ptr noundef %76)
  %77 = load ptr, ptr %14, align 8, !tbaa !5
  %78 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %77, i32 0, i32 15
  %79 = load ptr, ptr %78, align 8, !tbaa !28
  %80 = icmp ne ptr %79, null
  br i1 %80, label %81, label %96

81:                                               ; preds = %5
  %82 = load ptr, ptr %14, align 8, !tbaa !5
  %83 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %82, i32 0, i32 15
  %84 = load ptr, ptr %83, align 8, !tbaa !28
  %85 = getelementptr inbounds %struct.stbds_array_header, ptr %84, i64 -1
  %86 = getelementptr inbounds %struct.stbds_array_header, ptr %85, i32 0, i32 0
  %87 = load i64, ptr %86, align 8, !tbaa !29
  %88 = add i64 %87, 1
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %89, i32 0, i32 15
  %91 = load ptr, ptr %90, align 8, !tbaa !28
  %92 = getelementptr inbounds %struct.stbds_array_header, ptr %91, i64 -1
  %93 = getelementptr inbounds %struct.stbds_array_header, ptr %92, i32 0, i32 1
  %94 = load i64, ptr %93, align 8, !tbaa !31
  %95 = icmp ugt i64 %88, %94
  br i1 %95, label %96, label %103

96:                                               ; preds = %81, %5
  %97 = load ptr, ptr %14, align 8, !tbaa !5
  %98 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %97, i32 0, i32 15
  %99 = load ptr, ptr %98, align 8, !tbaa !28
  %100 = call noundef ptr @_ZL22stbds_arrgrowf_wrapperI29TestGetExistingContentRequestEPT_S2_mmm(ptr noundef %99, i64 noundef 24, i64 noundef 1, i64 noundef 0)
  %101 = load ptr, ptr %14, align 8, !tbaa !5
  %102 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %101, i32 0, i32 15
  store ptr %100, ptr %102, align 8, !tbaa !28
  br label %104

103:                                              ; preds = %81
  br label %104

104:                                              ; preds = %103, %96
  %105 = phi i32 [ 0, %96 ], [ 0, %103 ]
  %106 = load ptr, ptr %14, align 8, !tbaa !5
  %107 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %106, i32 0, i32 15
  %108 = load ptr, ptr %107, align 8, !tbaa !28
  %109 = load ptr, ptr %14, align 8, !tbaa !5
  %110 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %109, i32 0, i32 15
  %111 = load ptr, ptr %110, align 8, !tbaa !28
  %112 = getelementptr inbounds %struct.stbds_array_header, ptr %111, i64 -1
  %113 = getelementptr inbounds %struct.stbds_array_header, ptr %112, i32 0, i32 0
  %114 = load i64, ptr %113, align 8, !tbaa !29
  %115 = add i64 %114, 1
  store i64 %115, ptr %113, align 8, !tbaa !29
  %116 = getelementptr inbounds %struct.TestGetExistingContentRequest, ptr %108, i64 %114
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %116, ptr align 8 %15, i64 24, i1 false), !tbaa.struct !32
  %117 = load ptr, ptr %14, align 8, !tbaa !5
  %118 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %117, i32 0, i32 4
  %119 = load ptr, ptr %118, align 8, !tbaa !24
  call void @Longtail_UnlockSpinLock(ptr noundef %119)
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  %121 = getelementptr inbounds %class.TestAsyncBlockStore, ptr %120, i32 0, i32 6
  %122 = load ptr, ptr %121, align 8, !tbaa !33
  %123 = call i32 @Longtail_PostSema(ptr noundef %122, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 120, ptr %11) #4
  ret i32 0
}

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

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

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

@.str.3 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [12 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.592 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.594 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.595 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.596 = external hidden unnamed_addr constant [24 x i8], align 1
@__func__._ZN19TestAsyncBlockStore18GetExistingContentEP22Longtail_BlockStoreAPIjPKmjP35Longtail_AsyncGetExistingContentAPI = external hidden unnamed_addr constant [19 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

declare ptr @Longtail_Alloc(ptr noundef, i64 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 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) #2

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 @_ZN19TestAsyncBlockStore18GetExistingContentEP22Longtail_BlockStoreAPIjPKmjP35Longtail_AsyncGetExistingContentAPI(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) local_unnamed_addr #3 align 2 {
  %6 = alloca [5 x %struct.Longtail_LogFieldFmt_Private], align 16
  %7 = alloca %struct.Longtail_LogContextFmt_Private, align 8
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %6) #4
  store ptr @.str.590, ptr %6, align 16, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr @.str.586, ptr %8, align 8, !tbaa !10
  %9 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %0, ptr %9, align 16, !tbaa !11
  %10 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr @.str.110, ptr %10, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %6, i64 32
  store ptr @.str.594, ptr %11, align 16, !tbaa !10
  %12 = getelementptr inbounds i8, ptr %6, i64 40
  %13 = zext i32 %1 to i64
  %14 = inttoptr i64 %13 to ptr
  store ptr %14, ptr %12, align 8, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %6, i64 48
  store ptr @.str.595, ptr %15, align 16, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %6, i64 56
  store ptr @.str.586, ptr %16, align 8, !tbaa !10
  %17 = getelementptr inbounds i8, ptr %6, i64 64
  store ptr %2, ptr %17, align 16, !tbaa !11
  %18 = getelementptr inbounds i8, ptr %6, i64 72
  store ptr @.str.596, ptr %18, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %6, i64 80
  store ptr @.str.594, ptr %19, align 16, !tbaa !10
  %20 = getelementptr inbounds i8, ptr %6, i64 88
  %21 = zext i32 %3 to i64
  %22 = inttoptr i64 %21 to ptr
  store ptr %22, ptr %20, align 8, !tbaa !11
  %23 = getelementptr inbounds i8, ptr %6, i64 96
  store ptr @.str.592, ptr %23, align 16, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %6, i64 104
  store ptr @.str.586, ptr %24, align 8, !tbaa !10
  %25 = getelementptr inbounds i8, ptr %6, i64 112
  store ptr %4, ptr %25, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  store ptr null, ptr %7, align 8, !tbaa !12
  %26 = getelementptr inbounds i8, ptr %7, i64 8
  store ptr %6, ptr %26, align 8, !tbaa !15
  %27 = getelementptr inbounds i8, ptr %7, i64 16
  store i64 5, ptr %27, align 8, !tbaa !16
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @Longtail_CallLogger(ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__._ZN19TestAsyncBlockStore18GetExistingContentEP22Longtail_BlockStoreAPIjPKmjP35Longtail_AsyncGetExistingContentAPI, i32 noundef 4086, ptr noundef nonnull %7, i32 noundef 0, ptr noundef nonnull @.str.587, ptr noundef nonnull @.str.588)
  %28 = shl nuw nsw i64 %13, 3
  %29 = call ptr @Longtail_Alloc(ptr noundef null, i64 noundef %28)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %2, i64 %28, i1 false)
  %30 = getelementptr inbounds i8, ptr %0, i64 176
  %31 = call i32 @Longtail_AtomicAdd32(ptr noundef nonnull %30, i32 noundef 1)
  %32 = getelementptr inbounds i8, ptr %0, i64 88
  %33 = load ptr, ptr %32, align 8, !tbaa !17
  call void @Longtail_LockSpinLock(ptr noundef %33)
  %34 = getelementptr inbounds i8, ptr %0, i64 232
  %35 = load ptr, ptr %34, align 8, !tbaa !22
  %.not = icmp eq ptr %35, null
  br i1 %.not, label %43, label %36

36:                                               ; preds = %5
  %37 = getelementptr inbounds i8, ptr %35, i64 -32
  %38 = load i64, ptr %37, align 8, !tbaa !23
  %39 = add i64 %38, 1
  %40 = getelementptr inbounds i8, ptr %35, i64 -24
  %41 = load i64, ptr %40, align 8, !tbaa !25
  %42 = icmp ugt i64 %39, %41
  br i1 %42, label %43, label %45

43:                                               ; preds = %36, %5
  %44 = call noundef ptr @_ZL22stbds_arrgrowf_wrapperI29TestGetExistingContentRequestEPT_S2_mmm(ptr noundef %35, i64 noundef 24, i64 noundef 1, i64 noundef 0)
  store ptr %44, ptr %34, align 8, !tbaa !22
  %.phi.trans.insert = getelementptr inbounds i8, ptr %44, i64 -32
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !23
  %.pre23 = add i64 %.pre, 1
  br label %45

45:                                               ; preds = %36, %43
  %.pre-phi = phi i64 [ %39, %36 ], [ %.pre23, %43 ]
  %46 = phi i64 [ %38, %36 ], [ %.pre, %43 ]
  %47 = phi ptr [ %35, %36 ], [ %44, %43 ]
  %48 = getelementptr inbounds i8, ptr %47, i64 -32
  store i64 %.pre-phi, ptr %48, align 8, !tbaa !23
  %49 = getelementptr inbounds %struct.TestGetExistingContentRequest, ptr %47, i64 %46
  store ptr %4, ptr %49, align 8, !tbaa !26
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %49, i64 8
  store i32 %1, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !27
  %.sroa.51.0..sroa_idx = getelementptr inbounds i8, ptr %49, i64 16
  store ptr %29, ptr %.sroa.51.0..sroa_idx, align 8, !tbaa !26
  %50 = load ptr, ptr %32, align 8, !tbaa !17
  call void @Longtail_UnlockSpinLock(ptr noundef %50)
  %51 = getelementptr inbounds i8, ptr %0, i64 104
  %52 = load ptr, ptr %51, align 8, !tbaa !28
  %53 = call i32 @Longtail_PostSema(ptr noundef %52, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %6) #4
  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_wrapperI29TestGetExistingContentRequestEPT_S2_mmm(ptr noundef, i64 noundef, i64 noundef, i64 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !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 88}
!18 = !{!"_ZTS19TestAsyncBlockStore", !19, i64 0, !7, i64 64, !7, i64 72, !21, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !8, i64 112, !21, 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}
!19 = !{!"_ZTS22Longtail_BlockStoreAPI", !20, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56}
!20 = !{!"_ZTS12Longtail_API", !7, i64 0}
!21 = !{!"int", !8, i64 0}
!22 = !{!18, !7, i64 232}
!23 = !{!24, !14, i64 0}
!24 = !{!"_ZTS18stbds_array_header", !14, i64 0, !14, i64 8, !7, i64 16, !14, i64 24}
!25 = !{!24, !14, i64 8}
!26 = !{!7, !7, i64 0}
!27 = !{!21, !21, i64 0}
!28 = !{!18, !7, i64 104}


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