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

; Function Attrs: nounwind uwtable
define hidden void @ftc_inode_free(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %7, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.FTC_CacheRec_, ptr %8, i32 0, i32 6
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  store ptr %10, ptr %6, align 8, !tbaa !5
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.FTC_INodeRec_, ptr %11, i32 0, i32 1
  %13 = load ptr, ptr %12, align 8, !tbaa !14
  %14 = icmp ne ptr %13, null
  br i1 %14, label %15, label %21

15:                                               ; preds = %2
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.FTC_INodeRec_, ptr %16, i32 0, i32 1
  %18 = load ptr, ptr %17, align 8, !tbaa !14
  call void @FT_Done_Glyph(ptr noundef %18)
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.FTC_INodeRec_, ptr %19, i32 0, i32 1
  store ptr null, ptr %20, align 8, !tbaa !14
  br label %21

21:                                               ; preds = %15, %2
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  call void @FTC_GNode_Done(ptr noundef %22, ptr noundef %23)
  br label %24

24:                                               ; preds = %21
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  call void @ft_mem_free(ptr noundef %25, ptr noundef %26)
  store ptr null, ptr %5, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %24
  br label %28

28:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void
}

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

declare void @FT_Done_Glyph(ptr noundef) #2

declare hidden void @FTC_GNode_Done(ptr noundef, ptr noundef) #2

declare hidden void @ft_mem_free(ptr noundef, ptr noundef) #2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync 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 = { 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 = !{!15, !6, i64 56}
!15 = !{!"FTC_INodeRec_", !16, i64 0, !6, i64 56}
!16 = !{!"FTC_GNodeRec_", !17, i64 0, !6, i64 40, !11, i64 48}
!17 = !{!"FTC_NodeRec_", !18, i64 0, !6, i64 16, !12, i64 24, !19, i64 32, !19, i64 34}
!18 = !{!"FTC_MruNodeRec_", !6, i64 0, !6, i64 8}
!19 = !{!"short", !7, i64 0}


; 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: nounwind uwtable
define hidden void @ftc_inode_free(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 96
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 56
  %6 = load ptr, ptr %5, align 8, !tbaa !13
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %8, label %7

7:                                                ; preds = %2
  tail call void @FT_Done_Glyph(ptr noundef nonnull %6) #2
  store ptr null, ptr %5, align 8, !tbaa !13
  br label %8

8:                                                ; preds = %7, %2
  tail call void @FTC_GNode_Done(ptr noundef nonnull %0, ptr noundef nonnull %1) #2
  tail call void @ft_mem_free(ptr noundef %4, ptr noundef nonnull %0) #2
  ret void
}

declare void @FT_Done_Glyph(ptr noundef) local_unnamed_addr #1

declare hidden void @FTC_GNode_Done(ptr noundef, ptr noundef) local_unnamed_addr #1

declare hidden void @ft_mem_free(ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { 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 #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 }

!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 = !{!14, !11, i64 56}
!14 = !{!"FTC_INodeRec_", !15, i64 0, !11, i64 56}
!15 = !{!"FTC_GNodeRec_", !16, i64 0, !11, i64 40, !7, i64 48}
!16 = !{!"FTC_NodeRec_", !17, i64 0, !11, i64 16, !10, i64 24, !18, i64 32, !18, i64 34}
!17 = !{!"FTC_MruNodeRec_", !11, i64 0, !11, i64 8}
!18 = !{!"short", !8, i64 0}


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