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

; 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.PS_FontExtraRec_ = type { i16 }
%struct.FT_FaceRec_ = type { i64, i64, i64, i64, i64, ptr, ptr, i32, ptr, i32, ptr, %struct.FT_Generic_, %struct.FT_BBox_, i16, i16, i16, i16, i16, i16, i16, i16, ptr, ptr, ptr, ptr, ptr, ptr, %struct.FT_ListRec_, %struct.FT_Generic_, ptr, ptr }
%struct.FT_BBox_ = type { i64, i64, i64, i64 }
%struct.FT_ListRec_ = type { ptr, ptr }
%struct.FT_Generic_ = type { ptr, ptr }
%struct.FT_ModuleRec_ = type { ptr, ptr, ptr }
%struct.FT_Module_Class_ = type { i64, i64, ptr, i64, i64, ptr, ptr, ptr, ptr }
%struct.FT_Service_PsInfoRec_ = type { ptr, ptr, ptr, ptr, ptr }
%struct.TT_OS2_ = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, [10 x i8], i64, i64, i64, i64, [4 x i8], i16, i16, i16, i16, i16, i16, i16, i16, i64, i64, i16, i16, i16, i16, i16, i16, i16 }

@.str = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local zeroext i16 @FT_Get_FSType_Flags(ptr noundef %0) #0 {
  %2 = alloca i16, align 2
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %struct.PS_FontExtraRec_, align 2
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = icmp ne ptr %10, null
  br i1 %11, label %12, label %65

12:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  store ptr null, ptr %5, align 8, !tbaa !5
  br label %13

13:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.FT_FaceRec_, ptr %14, i32 0, i32 24
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %16, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store ptr null, ptr %7, align 8, !tbaa !5
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.FT_ModuleRec_, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !17
  %20 = getelementptr inbounds %struct.FT_Module_Class_, ptr %19, i32 0, i32 8
  %21 = load ptr, ptr %20, align 8, !tbaa !19
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %31

23:                                               ; preds = %13
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.FT_ModuleRec_, ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !17
  %27 = getelementptr inbounds %struct.FT_Module_Class_, ptr %26, i32 0, i32 8
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = call ptr %28(ptr noundef %29, ptr noundef @.str)
  store ptr %30, ptr %7, align 8, !tbaa !5
  br label %31

31:                                               ; preds = %23, %13
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %32, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %33

33:                                               ; preds = %31
  br label %34

34:                                               ; preds = %33
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %61

37:                                               ; preds = %34
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.FT_Service_PsInfoRec_, ptr %38, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !21
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %61

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #3
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.FT_Service_PsInfoRec_, ptr %43, i32 0, i32 1
  %45 = load ptr, ptr %44, align 8, !tbaa !21
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = call i32 %45(ptr noundef %46, ptr noundef %8)
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %57, label %49

49:                                               ; preds = %42
  %50 = getelementptr inbounds %struct.PS_FontExtraRec_, ptr %8, i32 0, i32 0
  %51 = load i16, ptr %50, align 2, !tbaa !23
  %52 = zext i16 %51 to i32
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %57

54:                                               ; preds = %49
  %55 = getelementptr inbounds %struct.PS_FontExtraRec_, ptr %8, i32 0, i32 0
  %56 = load i16, ptr %55, align 2, !tbaa !23
  store i16 %56, ptr %2, align 2
  store i32 1, ptr %9, align 4
  br label %58

57:                                               ; preds = %49, %42
  store i32 0, ptr %9, align 4
  br label %58

58:                                               ; preds = %57, %54
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #3
  %59 = load i32, ptr %9, align 4
  switch i32 %59, label %62 [
    i32 0, label %60
  ]

60:                                               ; preds = %58
  br label %61

61:                                               ; preds = %60, %37, %34
  store i32 0, ptr %9, align 4
  br label %62

62:                                               ; preds = %61, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  %63 = load i32, ptr %9, align 4
  switch i32 %63, label %80 [
    i32 0, label %64
  ]

64:                                               ; preds = %62
  br label %65

65:                                               ; preds = %64, %1
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = call ptr @FT_Get_Sfnt_Table(ptr noundef %66, i32 noundef 2)
  store ptr %67, ptr %4, align 8, !tbaa !5
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %79

69:                                               ; preds = %65
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.TT_OS2_, ptr %70, i32 0, i32 0
  %72 = load i16, ptr %71, align 8, !tbaa !25
  %73 = zext i16 %72 to i32
  %74 = icmp ne i32 %73, 65535
  br i1 %74, label %75, label %79

75:                                               ; preds = %69
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.TT_OS2_, ptr %76, i32 0, i32 4
  %78 = load i16, ptr %77, align 8, !tbaa !27
  store i16 %78, ptr %2, align 2
  store i32 1, ptr %9, align 4
  br label %80

79:                                               ; preds = %69, %65
  store i16 0, ptr %2, align 2
  store i32 1, ptr %9, align 4
  br label %80

80:                                               ; preds = %79, %75, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %81 = load i16, ptr %2, align 2
  ret i16 %81
}

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

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

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

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 176}
!10 = !{!"FT_FaceRec_", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !6, i64 40, !6, i64 48, !12, i64 56, !6, i64 64, !12, i64 72, !6, i64 80, !13, i64 88, !14, i64 104, !15, i64 136, !15, i64 138, !15, i64 140, !15, i64 142, !15, i64 144, !15, i64 146, !15, i64 148, !15, i64 150, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !16, i64 200, !13, i64 216, !6, i64 232, !6, i64 240}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"FT_Generic_", !6, i64 0, !6, i64 8}
!14 = !{!"FT_BBox_", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!15 = !{!"short", !7, i64 0}
!16 = !{!"FT_ListRec_", !6, i64 0, !6, i64 8}
!17 = !{!18, !6, i64 0}
!18 = !{!"FT_ModuleRec_", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!20, !6, i64 64}
!20 = !{!"FT_Module_Class_", !11, i64 0, !11, i64 8, !6, i64 16, !11, i64 24, !11, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!21 = !{!22, !6, i64 8}
!22 = !{!"FT_Service_PsInfoRec_", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!23 = !{!24, !15, i64 0}
!24 = !{!"PS_FontExtraRec_", !15, i64 0}
!25 = !{!26, !15, i64 0}
!26 = !{!"TT_OS2_", !15, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, i64 8, !15, i64 10, !15, i64 12, !15, i64 14, !15, i64 16, !15, i64 18, !15, i64 20, !15, i64 22, !15, i64 24, !15, i64 26, !15, i64 28, !15, i64 30, !7, i64 32, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !7, i64 80, !15, i64 84, !15, i64 86, !15, i64 88, !15, i64 90, !15, i64 92, !15, i64 94, !15, i64 96, !15, i64 98, !11, i64 104, !11, i64 112, !15, i64 120, !15, i64 122, !15, i64 124, !15, i64 126, !15, i64 128, !15, i64 130, !15, i64 132}
!27 = !{!26, !15, i64 8}


; 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.PS_FontExtraRec_ = type { i16 }

@.str = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local zeroext i16 @FT_Get_FSType_Flags(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca %struct.PS_FontExtraRec_, align 2
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %.thread34, label %3

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 176
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = load ptr, ptr %5, align 8, !tbaa !16
  %7 = getelementptr inbounds i8, ptr %6, i64 64
  %8 = load ptr, ptr %7, align 8, !tbaa !18
  %.not25 = icmp eq ptr %8, null
  br i1 %.not25, label %.thread34, label %9

9:                                                ; preds = %3
  %10 = tail call ptr %8(ptr noundef nonnull %5, ptr noundef nonnull @.str) #3
  %.not26 = icmp eq ptr %10, null
  br i1 %.not26, label %.thread34, label %11

11:                                               ; preds = %9
  %12 = getelementptr inbounds i8, ptr %10, i64 8
  %13 = load ptr, ptr %12, align 8, !tbaa !20
  %.not27 = icmp eq ptr %13, null
  br i1 %.not27, label %.thread34, label %14

14:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %2) #3
  %15 = call i32 %13(ptr noundef nonnull %0, ptr noundef nonnull %2) #3
  %16 = icmp ne i32 %15, 0
  %17 = load i16, ptr %2, align 2
  %18 = icmp eq i16 %17, 0
  %or.cond.not = select i1 %16, i1 true, i1 %18
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %2) #3
  br i1 %or.cond.not, label %.thread34, label %25

.thread34:                                        ; preds = %3, %9, %11, %14, %1
  %19 = call ptr @FT_Get_Sfnt_Table(ptr noundef %0, i32 noundef 2) #3
  %.not30 = icmp eq ptr %19, null
  br i1 %.not30, label %25, label %20

20:                                               ; preds = %.thread34
  %21 = load i16, ptr %19, align 8, !tbaa !22
  %.not31 = icmp eq i16 %21, -1
  br i1 %.not31, label %25, label %22

22:                                               ; preds = %20
  %23 = getelementptr inbounds i8, ptr %19, i64 8
  %24 = load i16, ptr %23, align 8, !tbaa !24
  br label %25

25:                                               ; preds = %.thread34, %20, %14, %22
  %.3 = phi i16 [ %24, %22 ], [ %17, %14 ], [ 0, %20 ], [ 0, %.thread34 ]
  ret i16 %.3
}

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

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

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

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 = { mustprogress 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, !10, i64 176}
!6 = !{!"FT_FaceRec_", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 48, !11, i64 56, !10, i64 64, !11, i64 72, !10, i64 80, !12, i64 88, !13, i64 104, !14, i64 136, !14, i64 138, !14, i64 140, !14, i64 142, !14, i64 144, !14, i64 146, !14, i64 148, !14, i64 150, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !15, i64 200, !12, i64 216, !10, i64 232, !10, i64 240}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"FT_Generic_", !10, i64 0, !10, i64 8}
!13 = !{!"FT_BBox_", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!14 = !{!"short", !8, i64 0}
!15 = !{!"FT_ListRec_", !10, i64 0, !10, i64 8}
!16 = !{!17, !10, i64 0}
!17 = !{!"FT_ModuleRec_", !10, i64 0, !10, i64 8, !10, i64 16}
!18 = !{!19, !10, i64 64}
!19 = !{!"FT_Module_Class_", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64}
!20 = !{!21, !10, i64 8}
!21 = !{!"FT_Service_PsInfoRec_", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!22 = !{!23, !14, i64 0}
!23 = !{!"TT_OS2_", !14, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8, !14, i64 10, !14, i64 12, !14, i64 14, !14, i64 16, !14, i64 18, !14, i64 20, !14, i64 22, !14, i64 24, !14, i64 26, !14, i64 28, !14, i64 30, !8, i64 32, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !8, i64 80, !14, i64 84, !14, i64 86, !14, i64 88, !14, i64 90, !14, i64 92, !14, i64 94, !14, i64 96, !14, i64 98, !7, i64 104, !7, i64 112, !14, i64 120, !14, i64 122, !14, i64 124, !14, i64 126, !14, i64 128, !14, i64 130, !14, i64 132}
!24 = !{!23, !14, i64 8}


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