; LLVM IR from DanEngelbrecht/longtail :: lib/fsblockstore (longtail_fsblockstore)

; 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.FSBlockStoreAPI = type { %struct.Longtail_BlockStoreAPI, ptr, ptr, ptr, [22 x i64], ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, [18 x i8] }
%struct.Longtail_BlockStoreAPI = type { %struct.Longtail_API, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.Longtail_API = type { ptr }
%struct.Longtail_StorageAPI = type { %struct.Longtail_API, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [98 x i8], align 1
@__func__.FSBlockStore_GetStoreIndexFromStorage = external hidden unnamed_addr constant [38 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 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 uwtable
define dso_local i32 @FSBlockStore_GetStoreIndexFromStorage(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [2 x %struct.Longtail_LogFieldFmt_Private], align 16
  %7 = alloca %struct.Longtail_LogContextFmt_Private, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %6) #3
  %19 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %6, i32 0, i32 0
  store ptr @.str, ptr %19, align 8, !tbaa !9
  %20 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %6, i32 0, i32 1
  store ptr @.str.1, ptr %20, align 8, !tbaa !11
  %21 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %6, i32 0, i32 2
  %22 = load ptr, ptr %4, 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 %6, i64 1
  %26 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %25, i32 0, i32 0
  store ptr @.str.2, ptr %26, align 8, !tbaa !9
  %27 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %25, i32 0, i32 1
  store ptr @.str.1, ptr %27, align 8, !tbaa !11
  %28 = getelementptr inbounds %struct.Longtail_LogFieldFmt_Private, ptr %25, i32 0, i32 2
  %29 = load ptr, ptr %5, 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 %7) #3
  %32 = getelementptr inbounds %struct.Longtail_LogContextFmt_Private, ptr %7, i32 0, i32 0
  store ptr null, ptr %32, align 8, !tbaa !13
  %33 = getelementptr inbounds %struct.Longtail_LogContextFmt_Private, ptr %7, i32 0, i32 1
  %34 = getelementptr inbounds [2 x %struct.Longtail_LogFieldFmt_Private], ptr %6, i64 0, i64 0
  store ptr %34, ptr %33, align 8, !tbaa !16
  %35 = getelementptr inbounds %struct.Longtail_LogContextFmt_Private, ptr %7, i32 0, i32 2
  store i64 2, ptr %35, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  store ptr %7, ptr %8, align 8, !tbaa !5
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @Longtail_CallLogger(ptr noundef @.str.3, ptr noundef @__func__.FSBlockStore_GetStoreIndexFromStorage, i32 noundef 614, ptr noundef %36, i32 noundef 0, ptr noundef @.str.4, ptr noundef @.str.5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.FSBlockStoreAPI, ptr %37, i32 0, i32 2
  %39 = load ptr, ptr %38, align 8, !tbaa !18
  store ptr %39, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.FSBlockStoreAPI, ptr %40, i32 0, i32 1
  %42 = load ptr, ptr %41, align 8, !tbaa !23
  store ptr %42, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.FSBlockStoreAPI, ptr %43, i32 0, i32 3
  %45 = load ptr, ptr %44, align 8, !tbaa !24
  store ptr %45, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.FSBlockStoreAPI, ptr %46, i32 0, i32 9
  %48 = load ptr, ptr %47, align 8, !tbaa !25
  store ptr %48, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.FSBlockStoreAPI, ptr %50, i32 0, i32 10
  %52 = load ptr, ptr %51, align 8, !tbaa !26
  %53 = call i32 @EnsureParentPathExists(ptr noundef %49, ptr noundef %52)
  store i32 %53, ptr %14, align 4, !tbaa !27
  %54 = load i32, ptr %14, align 4, !tbaa !27
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %60

56:                                               ; preds = %2
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = load i32, ptr %14, align 4, !tbaa !27
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @Longtail_CallLogger(ptr noundef @.str.3, ptr noundef @__func__.FSBlockStore_GetStoreIndexFromStorage, i32 noundef 626, ptr noundef %57, i32 noundef 3, ptr noundef @.str.6, i32 noundef %58)
  %59 = load i32, ptr %14, align 4, !tbaa !27
  store i32 %59, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %142

60:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.Longtail_StorageAPI, ptr %61, i32 0, i32 21
  %63 = load ptr, ptr %62, align 8, !tbaa !28
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.FSBlockStoreAPI, ptr %65, i32 0, i32 10
  %67 = load ptr, ptr %66, align 8, !tbaa !26
  %68 = call i32 %63(ptr noundef %64, ptr noundef %67, ptr noundef %16)
  store i32 %68, ptr %14, align 4, !tbaa !27
  %69 = load i32, ptr %14, align 4, !tbaa !27
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %75

71:                                               ; preds = %60
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = load i32, ptr %14, align 4, !tbaa !27
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @Longtail_CallLogger(ptr noundef @.str.3, ptr noundef @__func__.FSBlockStore_GetStoreIndexFromStorage, i32 noundef 633, ptr noundef %72, i32 noundef 3, ptr noundef @.str.7, i32 noundef %73)
  %74 = load i32, ptr %14, align 4, !tbaa !27
  store i32 %74, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %141

75:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.Longtail_StorageAPI, ptr %76, i32 0, i32 12
  %78 = load ptr, ptr %77, align 8, !tbaa !30
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = call ptr %78(ptr noundef %79, ptr noundef %80, ptr noundef @.str.8)
  store ptr %81, ptr %17, align 8, !tbaa !5
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.Longtail_StorageAPI, ptr %82, i32 0, i32 14
  %84 = load ptr, ptr %83, align 8, !tbaa !31
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = load ptr, ptr %17, align 8, !tbaa !5
  %87 = call i32 %84(ptr noundef %85, ptr noundef %86)
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %110

89:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = load ptr, ptr %17, align 8, !tbaa !5
  %92 = call i32 @Longtail_ReadStoreIndex(ptr noundef %90, ptr noundef %91, ptr noundef %13)
  store i32 %92, ptr %18, align 4, !tbaa !27
  %93 = load i32, ptr %18, align 4, !tbaa !27
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %106

95:                                               ; preds = %89
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = load i32, ptr %18, align 4, !tbaa !27
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @Longtail_CallLogger(ptr noundef @.str.3, ptr noundef @__func__.FSBlockStore_GetStoreIndexFromStorage, i32 noundef 644, ptr noundef %96, i32 noundef 3, ptr noundef @.str.9, i32 noundef %97)
  %98 = load ptr, ptr %17, align 8, !tbaa !5
  call void @Longtail_Free(ptr noundef %98)
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.Longtail_StorageAPI, ptr %99, i32 0, i32 22
  %101 = load ptr, ptr %100, align 8, !tbaa !32
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = load ptr, ptr %16, align 8, !tbaa !5
  %104 = call i32 %101(ptr noundef %102, ptr noundef %103)
  %105 = load i32, ptr %18, align 4, !tbaa !27
  store i32 %105, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %107

106:                                              ; preds = %89
  store i32 0, ptr %15, align 4
  br label %107

107:                                              ; preds = %106, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  %108 = load i32, ptr %15, align 4
  switch i32 %108, label %140 [
    i32 0, label %109
  ]

109:                                              ; preds = %107
  br label %110

110:                                              ; preds = %109, %75
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.Longtail_StorageAPI, ptr %111, i32 0, i32 22
  %113 = load ptr, ptr %112, align 8, !tbaa !32
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = load ptr, ptr %16, align 8, !tbaa !5
  %116 = call i32 %113(ptr noundef %114, ptr noundef %115)
  %117 = load ptr, ptr %17, align 8, !tbaa !5
  call void @Longtail_Free(ptr noundef %117)
  %118 = load ptr, ptr %13, align 8, !tbaa !5
  %119 = icmp ne ptr %118, null
  br i1 %119, label %120, label %123

120:                                              ; preds = %110
  %121 = load ptr, ptr %13, align 8, !tbaa !5
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %121, ptr %122, align 8, !tbaa !5
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %140

123:                                              ; preds = %110
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = load ptr, ptr %10, align 8, !tbaa !5
  %126 = load ptr, ptr %11, align 8, !tbaa !5
  %127 = load ptr, ptr %12, align 8, !tbaa !5
  %128 = call i32 @ReadContent(ptr noundef %124, ptr noundef %125, ptr noundef %126, ptr noundef %127, ptr noundef %13)
  store i32 %128, ptr %14, align 4, !tbaa !27
  %129 = load i32, ptr %14, align 4, !tbaa !27
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %135

131:                                              ; preds = %123
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  %133 = load i32, ptr %14, align 4, !tbaa !27
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @Longtail_CallLogger(ptr noundef @.str.3, ptr noundef @__func__.FSBlockStore_GetStoreIndexFromStorage, i32 noundef 666, ptr noundef %132, i32 noundef 3, ptr noundef @.str.10, i32 noundef %133)
  %134 = load i32, ptr %14, align 4, !tbaa !27
  store i32 %134, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %140

135:                                              ; preds = %123
  %136 = load ptr, ptr %13, align 8, !tbaa !5
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %136, ptr %137, align 8, !tbaa !5
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.FSBlockStoreAPI, ptr %138, i32 0, i32 11
  store i32 1, ptr %139, align 8, !tbaa !33
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %140

140:                                              ; preds = %135, %131, %120, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  br label %141

141:                                              ; preds = %140, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  br label %142

142:                                              ; preds = %141, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #3
  %143 = load i32, ptr %3, align 4
  ret i32 %143
}

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

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

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

declare void @Longtail_Free(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @ReadContent(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"Longtail_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 = !{!"Longtail_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 72}
!19 = !{!"FSBlockStoreAPI", !20, i64 0, !6, i64 64, !6, i64 72, !6, i64 80, !7, i64 88, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !22, i64 312, !22, i64 316, !7, i64 320}
!20 = !{!"Longtail_BlockStoreAPI", !21, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!21 = !{!"Longtail_API", !6, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = !{!19, !6, i64 64}
!24 = !{!19, !6, i64 80}
!25 = !{!19, !6, i64 296}
!26 = !{!19, !6, i64 304}
!27 = !{!22, !22, i64 0}
!28 = !{!29, !6, i64 168}
!29 = !{!"Longtail_StorageAPI", !21, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208}
!30 = !{!29, !6, i64 96}
!31 = !{!29, !6, i64 112}
!32 = !{!29, !6, i64 176}
!33 = !{!19, !22, i64 312}


; 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 }

@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [98 x i8], align 1
@__func__.FSBlockStore_GetStoreIndexFromStorage = external hidden unnamed_addr constant [38 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 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: nounwind uwtable
define dso_local i32 @FSBlockStore_GetStoreIndexFromStorage(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = alloca [2 x %struct.Longtail_LogFieldFmt_Private], align 16
  %4 = alloca %struct.Longtail_LogContextFmt_Private, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #3
  store ptr @.str, ptr %3, align 16, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr @.str.1, ptr %7, align 8, !tbaa !10
  %8 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr %0, ptr %8, align 16, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr @.str.2, ptr %9, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %3, i64 32
  store ptr @.str.1, ptr %10, align 16, !tbaa !10
  %11 = getelementptr inbounds i8, ptr %3, i64 40
  store ptr %1, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #3
  store ptr null, ptr %4, align 8, !tbaa !12
  %12 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr %3, ptr %12, align 8, !tbaa !15
  %13 = getelementptr inbounds i8, ptr %4, i64 16
  store i64 2, ptr %13, align 8, !tbaa !16
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @Longtail_CallLogger(ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.FSBlockStore_GetStoreIndexFromStorage, i32 noundef 614, ptr noundef nonnull %4, i32 noundef 0, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5) #3
  %14 = getelementptr inbounds i8, ptr %0, i64 72
  %15 = load ptr, ptr %14, align 8, !tbaa !17
  %16 = getelementptr inbounds i8, ptr %0, i64 64
  %17 = load ptr, ptr %16, align 8, !tbaa !22
  %18 = getelementptr inbounds i8, ptr %0, i64 80
  %19 = load ptr, ptr %18, align 8, !tbaa !23
  %20 = getelementptr inbounds i8, ptr %0, i64 296
  %21 = load ptr, ptr %20, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  store ptr null, ptr %5, align 8, !tbaa !25
  %22 = getelementptr inbounds i8, ptr %0, i64 304
  %23 = load ptr, ptr %22, align 8, !tbaa !26
  %24 = call i32 @EnsureParentPathExists(ptr noundef %15, ptr noundef %23) #3
  %.not = icmp eq i32 %24, 0
  br i1 %.not, label %26, label %25

25:                                               ; preds = %2
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @Longtail_CallLogger(ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.FSBlockStore_GetStoreIndexFromStorage, i32 noundef 626, ptr noundef nonnull %4, i32 noundef 3, ptr noundef nonnull @.str.6, i32 noundef %24) #3
  br label %59

26:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %27 = getelementptr inbounds i8, ptr %15, i64 168
  %28 = load ptr, ptr %27, align 8, !tbaa !27
  %29 = load ptr, ptr %22, align 8, !tbaa !26
  %30 = call i32 %28(ptr noundef %15, ptr noundef %29, ptr noundef nonnull %6) #3
  %.not55 = icmp eq i32 %30, 0
  br i1 %.not55, label %32, label %31

31:                                               ; preds = %26
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @Longtail_CallLogger(ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.FSBlockStore_GetStoreIndexFromStorage, i32 noundef 633, ptr noundef nonnull %4, i32 noundef 3, ptr noundef nonnull @.str.7, i32 noundef %30) #3
  br label %58

32:                                               ; preds = %26
  %33 = getelementptr inbounds i8, ptr %15, i64 96
  %34 = load ptr, ptr %33, align 8, !tbaa !29
  %35 = call ptr %34(ptr noundef nonnull %15, ptr noundef %19, ptr noundef nonnull @.str.8) #3
  %36 = getelementptr inbounds i8, ptr %15, i64 112
  %37 = load ptr, ptr %36, align 8, !tbaa !30
  %38 = call i32 %37(ptr noundef nonnull %15, ptr noundef %35) #3
  %.not56 = icmp eq i32 %38, 0
  br i1 %.not56, label %.critedge, label %39

39:                                               ; preds = %32
  %40 = call i32 @Longtail_ReadStoreIndex(ptr noundef nonnull %15, ptr noundef %35, ptr noundef nonnull %5) #3
  %.not57 = icmp eq i32 %40, 0
  br i1 %.not57, label %.critedge, label %41

41:                                               ; preds = %39
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @Longtail_CallLogger(ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.FSBlockStore_GetStoreIndexFromStorage, i32 noundef 644, ptr noundef nonnull %4, i32 noundef 3, ptr noundef nonnull @.str.9, i32 noundef %40) #3
  call void @Longtail_Free(ptr noundef %35) #3
  %42 = getelementptr inbounds i8, ptr %15, i64 176
  %43 = load ptr, ptr %42, align 8, !tbaa !31
  %44 = load ptr, ptr %6, align 8, !tbaa !25
  %45 = call i32 %43(ptr noundef nonnull %15, ptr noundef %44) #3
  br label %58

.critedge:                                        ; preds = %39, %32
  %46 = getelementptr inbounds i8, ptr %15, i64 176
  %47 = load ptr, ptr %46, align 8, !tbaa !31
  %48 = load ptr, ptr %6, align 8, !tbaa !25
  %49 = call i32 %47(ptr noundef nonnull %15, ptr noundef %48) #3
  call void @Longtail_Free(ptr noundef %35) #3
  %50 = load ptr, ptr %5, align 8, !tbaa !25
  %.not58 = icmp eq ptr %50, null
  br i1 %.not58, label %52, label %51

51:                                               ; preds = %.critedge
  store ptr %50, ptr %1, align 8, !tbaa !25
  br label %58

52:                                               ; preds = %.critedge
  %53 = call i32 @ReadContent(ptr noundef nonnull %15, ptr noundef %17, ptr noundef %19, ptr noundef %21, ptr noundef nonnull %5)
  %.not59 = icmp eq i32 %53, 0
  br i1 %.not59, label %55, label %54

54:                                               ; preds = %52
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @Longtail_CallLogger(ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.FSBlockStore_GetStoreIndexFromStorage, i32 noundef 666, ptr noundef nonnull %4, i32 noundef 3, ptr noundef nonnull @.str.10, i32 noundef %53) #3
  br label %58

55:                                               ; preds = %52
  %56 = load ptr, ptr %5, align 8, !tbaa !25
  store ptr %56, ptr %1, align 8, !tbaa !25
  %57 = getelementptr inbounds i8, ptr %0, i64 312
  store i32 1, ptr %57, align 8, !tbaa !32
  br label %58

58:                                               ; preds = %41, %51, %54, %55, %31
  %.2 = phi i32 [ %30, %31 ], [ 0, %51 ], [ %53, %54 ], [ 0, %55 ], [ %40, %41 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  br label %59

59:                                               ; preds = %58, %25
  %.3 = phi i32 [ %24, %25 ], [ %.2, %58 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #3
  ret i32 %.3
}

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

declare i32 @EnsureParentPathExists(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @Longtail_ReadStoreIndex(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @Longtail_Free(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @ReadContent(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{!"Longtail_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/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!6, !7, i64 16}
!12 = !{!13, !7, i64 0}
!13 = !{!"Longtail_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 72}
!18 = !{!"FSBlockStoreAPI", !19, i64 0, !7, i64 64, !7, i64 72, !7, i64 80, !8, i64 88, !7, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !21, i64 312, !21, i64 316, !8, i64 320}
!19 = !{!"Longtail_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 = !{!"Longtail_API", !7, i64 0}
!21 = !{!"int", !8, i64 0}
!22 = !{!18, !7, i64 64}
!23 = !{!18, !7, i64 80}
!24 = !{!18, !7, i64 296}
!25 = !{!7, !7, i64 0}
!26 = !{!18, !7, i64 304}
!27 = !{!28, !7, i64 168}
!28 = !{!"Longtail_StorageAPI", !20, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208}
!29 = !{!28, !7, i64 96}
!30 = !{!28, !7, i64 112}
!31 = !{!28, !7, i64 176}
!32 = !{!18, !21, i64 312}


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