; LLVM IR from reworks-org/galaxy :: deps/sfml_deps/freetype-src/src/cache (ftcimage)

; 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.FTC_CacheRec_ = type { i32, i32, i64, ptr, %struct.FTC_CacheClassRec_, ptr, ptr, i32, ptr }
%struct.FTC_CacheClassRec_ = type { ptr, ptr, ptr, ptr, ptr, i64, ptr, ptr }
%struct.FTC_GQueryRec_ = type { i32, ptr }
%struct.FTC_GCacheClassRec_ = type { %struct.FTC_CacheClassRec_, ptr }
%struct.FTC_INodeRec_ = type { %struct.FTC_GNodeRec_, ptr }
%struct.FTC_GNodeRec_ = type { %struct.FTC_NodeRec_, ptr, i32 }
%struct.FTC_NodeRec_ = type { %struct.FTC_MruNodeRec_, ptr, i64, i16, i16 }
%struct.FTC_MruNodeRec_ = type { ptr, ptr }
%struct.FTC_IFamilyClassRec_ = type { %struct.FTC_MruListClassRec_, ptr }
%struct.FTC_MruListClassRec_ = type { i64, ptr, ptr, ptr, ptr }

; 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
declare hidden void @FTC_INode_Free(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define hidden i32 @FTC_INode_New(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, 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 8, ptr %7) #3
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.FTC_CacheRec_, ptr %14, i32 0, i32 6
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %16, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store ptr null, ptr %9, align 8, !tbaa !5
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = call ptr @ft_mem_qalloc(ptr noundef %17, i64 noundef 64, ptr noundef %8)
  store ptr %18, ptr %9, align 8, !tbaa !5
  %19 = load i32, ptr %8, align 4, !tbaa !14
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %54, label %21

21:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %22, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.FTC_GQueryRec_, ptr %23, i32 0, i32 1
  %25 = load ptr, ptr %24, align 8, !tbaa !15
  store ptr %25, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.FTC_GQueryRec_, ptr %26, i32 0, i32 0
  %28 = load i32, ptr %27, align 8, !tbaa !17
  store i32 %28, ptr %12, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.FTC_CacheRec_, ptr %29, i32 0, i32 8
  %31 = load ptr, ptr %30, align 8, !tbaa !18
  %32 = getelementptr inbounds %struct.FTC_GCacheClassRec_, ptr %31, i32 0, i32 1
  %33 = load ptr, ptr %32, align 8, !tbaa !19
  store ptr %33, ptr %13, align 8, !tbaa !5
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = load i32, ptr %12, align 4, !tbaa !14
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  call void @FTC_GNode_Init(ptr noundef %34, i32 noundef %35, ptr noundef %36)
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.FTC_INodeRec_, ptr %37, i32 0, i32 1
  store ptr null, ptr %38, align 8, !tbaa !21
  %39 = load ptr, ptr %13, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.FTC_IFamilyClassRec_, ptr %39, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !27
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = load i32, ptr %12, align 4, !tbaa !14
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.FTC_INodeRec_, ptr %45, i32 0, i32 1
  %47 = call i32 %41(ptr noundef %42, i32 noundef %43, ptr noundef %44, ptr noundef %46)
  store i32 %47, ptr %8, align 4, !tbaa !14
  %48 = load i32, ptr %8, align 4, !tbaa !14
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %53

50:                                               ; preds = %21
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  call void @FTC_INode_Free(ptr noundef %51, ptr noundef %52)
  store ptr null, ptr %9, align 8, !tbaa !5
  br label %53

53:                                               ; preds = %50, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  br label %54

54:                                               ; preds = %53, %3
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %55, ptr %56, align 8, !tbaa !5
  %57 = load i32, ptr %8, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret i32 %57
}

declare hidden ptr @ft_mem_qalloc(ptr noundef, i64 noundef, ptr noundef) #2

declare hidden void @FTC_GNode_Init(ptr noundef, i32 noundef, ptr noundef) #2

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 96}
!10 = !{!"FTC_CacheRec_", !11, i64 0, !11, i64 4, !12, i64 8, !6, i64 16, !13, i64 24, !6, i64 88, !6, i64 96, !11, i64 104, !6, i64 112}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"FTC_CacheClassRec_", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !6, i64 48, !6, i64 56}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !6, i64 8}
!16 = !{!"FTC_GQueryRec_", !11, i64 0, !6, i64 8}
!17 = !{!16, !11, i64 0}
!18 = !{!10, !6, i64 112}
!19 = !{!20, !6, i64 64}
!20 = !{!"FTC_GCacheClassRec_", !13, i64 0, !6, i64 64}
!21 = !{!22, !6, i64 56}
!22 = !{!"FTC_INodeRec_", !23, i64 0, !6, i64 56}
!23 = !{!"FTC_GNodeRec_", !24, i64 0, !6, i64 40, !11, i64 48}
!24 = !{!"FTC_NodeRec_", !25, i64 0, !6, i64 16, !12, i64 24, !26, i64 32, !26, i64 34}
!25 = !{!"FTC_MruNodeRec_", !6, i64 0, !6, i64 8}
!26 = !{!"short", !7, i64 0}
!27 = !{!28, !6, i64 40}
!28 = !{!"FTC_IFamilyClassRec_", !29, i64 0, !6, i64 40}
!29 = !{!"FTC_MruListClassRec_", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}


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

; 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
declare hidden void @FTC_INode_Free(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define hidden i32 @FTC_INode_New(ptr nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = alloca i32, align 4
  %5 = getelementptr inbounds i8, ptr %2, i64 96
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %7 = call ptr @ft_mem_qalloc(ptr noundef %6, i64 noundef 64, ptr noundef nonnull %4) #3
  %8 = load i32, ptr %4, align 4, !tbaa !13
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %9, label %22

9:                                                ; preds = %3
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !14
  %12 = load i32, ptr %1, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %2, i64 112
  %14 = load ptr, ptr %13, align 8, !tbaa !17
  %15 = getelementptr inbounds i8, ptr %14, i64 64
  %16 = load ptr, ptr %15, align 8, !tbaa !18
  call void @FTC_GNode_Init(ptr noundef %7, i32 noundef %12, ptr noundef %11) #3
  %17 = getelementptr inbounds i8, ptr %7, i64 56
  store ptr null, ptr %17, align 8, !tbaa !20
  %18 = getelementptr inbounds i8, ptr %16, i64 40
  %19 = load ptr, ptr %18, align 8, !tbaa !26
  %20 = call i32 %19(ptr noundef %11, i32 noundef %12, ptr noundef nonnull %2, ptr noundef nonnull %17) #3
  store i32 %20, ptr %4, align 4, !tbaa !13
  %.not18 = icmp eq i32 %20, 0
  br i1 %.not18, label %22, label %21

21:                                               ; preds = %9
  call void @FTC_INode_Free(ptr noundef nonnull %7, ptr noundef nonnull %2)
  %.pre = load i32, ptr %4, align 4, !tbaa !13
  br label %22

22:                                               ; preds = %9, %21, %3
  %23 = phi i32 [ %8, %3 ], [ %.pre, %21 ], [ 0, %9 ]
  %.1 = phi ptr [ %7, %3 ], [ null, %21 ], [ %7, %9 ]
  store ptr %.1, ptr %0, align 8, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  ret i32 %23
}

declare hidden ptr @ft_mem_qalloc(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare hidden void @FTC_GNode_Init(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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, !11, i64 96}
!6 = !{!"FTC_CacheRec_", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 16, !12, i64 24, !11, i64 88, !11, i64 96, !7, i64 104, !11, i64 112}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"FTC_CacheClassRec_", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !10, i64 40, !11, i64 48, !11, i64 56}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !11, i64 8}
!15 = !{!"FTC_GQueryRec_", !7, i64 0, !11, i64 8}
!16 = !{!15, !7, i64 0}
!17 = !{!6, !11, i64 112}
!18 = !{!19, !11, i64 64}
!19 = !{!"FTC_GCacheClassRec_", !12, i64 0, !11, i64 64}
!20 = !{!21, !11, i64 56}
!21 = !{!"FTC_INodeRec_", !22, i64 0, !11, i64 56}
!22 = !{!"FTC_GNodeRec_", !23, i64 0, !11, i64 40, !7, i64 48}
!23 = !{!"FTC_NodeRec_", !24, i64 0, !11, i64 16, !10, i64 24, !25, i64 32, !25, i64 34}
!24 = !{!"FTC_MruNodeRec_", !11, i64 0, !11, i64 8}
!25 = !{!"short", !8, i64 0}
!26 = !{!27, !11, i64 40}
!27 = !{!"FTC_IFamilyClassRec_", !28, i64 0, !11, i64 40}
!28 = !{!"FTC_MruListClassRec_", !10, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!29 = !{!11, !11, i64 0}


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