; 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_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.FT_GlyphRec_ = type { ptr, ptr, i32, %struct.FT_Vector_ }
%struct.FT_Vector_ = type { i64, i64 }
%struct.FT_BitmapGlyphRec_ = type { %struct.FT_GlyphRec_, i32, i32, %struct.FT_Bitmap_ }
%struct.FT_Bitmap_ = type { i32, i32, i32, ptr, i16, i8, i8, ptr }
%struct.FT_OutlineGlyphRec_ = type { %struct.FT_GlyphRec_, %struct.FT_Outline_ }
%struct.FT_Outline_ = type { i16, i16, ptr, ptr, ptr, i32 }

; 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 hidden i64 @ftc_inode_weight(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = 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) #2
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %10, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  store i64 0, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  %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 !11
  store ptr %13, ptr %7, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %14, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.FT_GlyphRec_, ptr %15, i32 0, i32 2
  %17 = load i32, ptr %16, align 8, !tbaa !18
  switch i32 %17, label %62 [
    i32 1651078259, label %18
    i32 1869968492, label %46
  ]

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %19, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.FT_BitmapGlyphRec_, ptr %20, i32 0, i32 3
  %22 = getelementptr inbounds %struct.FT_Bitmap_, ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !21
  %24 = zext i32 %23 to i64
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.FT_BitmapGlyphRec_, ptr %25, i32 0, i32 3
  %27 = getelementptr inbounds %struct.FT_Bitmap_, ptr %26, i32 0, i32 2
  %28 = load i32, ptr %27, align 8, !tbaa !24
  %29 = icmp slt i32 %28, 0
  br i1 %29, label %30, label %36

30:                                               ; preds = %18
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.FT_BitmapGlyphRec_, ptr %31, i32 0, i32 3
  %33 = getelementptr inbounds %struct.FT_Bitmap_, ptr %32, i32 0, i32 2
  %34 = load i32, ptr %33, align 8, !tbaa !24
  %35 = sub nsw i32 0, %34
  br label %41

36:                                               ; preds = %18
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.FT_BitmapGlyphRec_, ptr %37, i32 0, i32 3
  %39 = getelementptr inbounds %struct.FT_Bitmap_, ptr %38, i32 0, i32 2
  %40 = load i32, ptr %39, align 8, !tbaa !24
  br label %41

41:                                               ; preds = %36, %30
  %42 = phi i32 [ %35, %30 ], [ %40, %36 ]
  %43 = sext i32 %42 to i64
  %44 = mul i64 %24, %43
  %45 = add i64 %44, 88
  store i64 %45, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  br label %63

46:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %47, ptr %9, align 8, !tbaa !5
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.FT_OutlineGlyphRec_, ptr %48, i32 0, i32 1
  %50 = getelementptr inbounds %struct.FT_Outline_, ptr %49, i32 0, i32 1
  %51 = load i16, ptr %50, align 2, !tbaa !25
  %52 = sext i16 %51 to i64
  %53 = mul i64 %52, 17
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.FT_OutlineGlyphRec_, ptr %54, i32 0, i32 1
  %56 = getelementptr inbounds %struct.FT_Outline_, ptr %55, i32 0, i32 0
  %57 = load i16, ptr %56, align 8, !tbaa !28
  %58 = sext i16 %57 to i64
  %59 = mul i64 %58, 2
  %60 = add i64 %53, %59
  %61 = add i64 %60, 80
  store i64 %61, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  br label %63

62:                                               ; preds = %2
  br label %63

63:                                               ; preds = %62, %46, %41
  %64 = load i64, ptr %6, align 8, !tbaa !9
  %65 = add i64 %64, 64
  store i64 %65, ptr %6, align 8, !tbaa !9
  %66 = load i64, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  ret i64 %66
}

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 = { 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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 56}
!12 = !{!"FTC_INodeRec_", !13, i64 0, !6, i64 56}
!13 = !{!"FTC_GNodeRec_", !14, i64 0, !6, i64 40, !17, i64 48}
!14 = !{!"FTC_NodeRec_", !15, i64 0, !6, i64 16, !10, i64 24, !16, i64 32, !16, i64 34}
!15 = !{!"FTC_MruNodeRec_", !6, i64 0, !6, i64 8}
!16 = !{!"short", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!19, !17, i64 16}
!19 = !{!"FT_GlyphRec_", !6, i64 0, !6, i64 8, !17, i64 16, !20, i64 24}
!20 = !{!"FT_Vector_", !10, i64 0, !10, i64 8}
!21 = !{!22, !17, i64 48}
!22 = !{!"FT_BitmapGlyphRec_", !19, i64 0, !17, i64 40, !17, i64 44, !23, i64 48}
!23 = !{!"FT_Bitmap_", !17, i64 0, !17, i64 4, !17, i64 8, !6, i64 16, !16, i64 24, !7, i64 26, !7, i64 27, !6, i64 32}
!24 = !{!22, !17, i64 56}
!25 = !{!26, !16, i64 42}
!26 = !{!"FT_OutlineGlyphRec_", !19, i64 0, !27, i64 40}
!27 = !{!"FT_Outline_", !16, i64 0, !16, i64 2, !6, i64 8, !6, i64 16, !6, i64 24, !17, i64 32}
!28 = !{!26, !16, i64 40}


; 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 nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define hidden range(i64 -622448, 9223372030412325018) i64 @ftc_inode_weight(ptr nocapture noundef readonly %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 56
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 16
  %6 = load i32, ptr %5, align 8, !tbaa !16
  switch i32 %6, label %28 [
    i32 1651078259, label %7
    i32 1869968492, label %17
  ]

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %4, i64 48
  %9 = load i32, ptr %8, align 8, !tbaa !19
  %10 = zext i32 %9 to i64
  %11 = getelementptr inbounds i8, ptr %4, i64 56
  %12 = load i32, ptr %11, align 8, !tbaa !22
  %13 = tail call i32 @llvm.abs.i32(i32 %12, i1 true)
  %14 = zext nneg i32 %13 to i64
  %15 = mul nuw nsw i64 %14, %10
  %16 = add nuw nsw i64 %15, 88
  br label %28

17:                                               ; preds = %2
  %18 = getelementptr inbounds i8, ptr %4, i64 40
  %19 = getelementptr inbounds i8, ptr %4, i64 42
  %20 = load i16, ptr %19, align 2, !tbaa !23
  %21 = sext i16 %20 to i64
  %22 = mul nsw i64 %21, 17
  %23 = load i16, ptr %18, align 8, !tbaa !26
  %24 = sext i16 %23 to i64
  %25 = shl nsw i64 %24, 1
  %26 = add nsw i64 %22, 80
  %27 = add nsw i64 %26, %25
  br label %28

28:                                               ; preds = %2, %17, %7
  %.0 = phi i64 [ 0, %2 ], [ %27, %17 ], [ %16, %7 ]
  %29 = add nsw i64 %.0, 64
  ret i64 %29
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #1

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) 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 speculatable willreturn memory(none) }

!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, !10, i64 56}
!6 = !{!"FTC_INodeRec_", !7, i64 0, !10, i64 56}
!7 = !{!"FTC_GNodeRec_", !8, i64 0, !10, i64 40, !15, i64 48}
!8 = !{!"FTC_NodeRec_", !9, i64 0, !10, i64 16, !13, i64 24, !14, i64 32, !14, i64 34}
!9 = !{!"FTC_MruNodeRec_", !10, i64 0, !10, i64 8}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C/C++ TBAA"}
!13 = !{!"long", !11, i64 0}
!14 = !{!"short", !11, i64 0}
!15 = !{!"int", !11, i64 0}
!16 = !{!17, !15, i64 16}
!17 = !{!"FT_GlyphRec_", !10, i64 0, !10, i64 8, !15, i64 16, !18, i64 24}
!18 = !{!"FT_Vector_", !13, i64 0, !13, i64 8}
!19 = !{!20, !15, i64 48}
!20 = !{!"FT_BitmapGlyphRec_", !17, i64 0, !15, i64 40, !15, i64 44, !21, i64 48}
!21 = !{!"FT_Bitmap_", !15, i64 0, !15, i64 4, !15, i64 8, !10, i64 16, !14, i64 24, !11, i64 26, !11, i64 27, !10, i64 32}
!22 = !{!20, !15, i64 56}
!23 = !{!24, !14, i64 42}
!24 = !{!"FT_OutlineGlyphRec_", !17, i64 0, !25, i64 40}
!25 = !{!"FT_Outline_", !14, i64 0, !14, i64 2, !10, i64 8, !10, i64 16, !10, i64 24, !15, i64 32}
!26 = !{!24, !14, i64 40}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass