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

; 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.FT_Vector_ = type { i64, i64 }
%struct.CF2_Matrix_ = type { i32, i32, i32, i32, i32, i32 }
%struct.CF2_FontRec_ = type { ptr, i32, i8, i8, i32, %struct.CF2_Matrix_, %struct.CF2_Matrix_, %struct.CF2_Matrix_, i32, %struct.CFF_BlendRec_, i32, i32, ptr, i32, i32, i32, %struct.CF2_OutlineRec_, ptr, ptr, i8, i8, i8, [8 x i32], i32, i32, i32, i32, i8, %struct.CF2_BluesRec_, ptr }
%struct.CFF_BlendRec_ = type { i8, i8, ptr, i32, i32, ptr, i32, ptr }
%struct.CF2_OutlineRec_ = type { %struct.CF2_OutlineCallbacksRec_, ptr }
%struct.CF2_OutlineCallbacksRec_ = type { ptr, ptr, ptr, ptr, i32, ptr, ptr }
%struct.CF2_BluesRec_ = type { i32, i32, i8, i8, i32, i32, i32, i32, %struct.CF2_HintRec_, %struct.CF2_HintRec_, [12 x %struct.CF2_BlueRec_] }
%struct.CF2_HintRec_ = type { i32, i64, i32, i32, i32 }
%struct.CF2_BlueRec_ = type { i32, i32, i32, i32, i8 }

; Function Attrs: nounwind uwtable
define hidden i32 @cf2_getGlyphOutline(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %struct.FT_Vector_, align 8
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #3
  %13 = load ptr, ptr %7, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.CF2_Matrix_, ptr %13, i32 0, i32 4
  %15 = load i32, ptr %14, align 4, !tbaa !11
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds %struct.FT_Vector_, ptr %10, i32 0, i32 0
  store i64 %16, ptr %17, align 8, !tbaa !13
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.CF2_Matrix_, ptr %18, i32 0, i32 5
  %20 = load i32, ptr %19, align 4, !tbaa !16
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds %struct.FT_Vector_, ptr %10, i32 0, i32 1
  store i64 %21, ptr %22, align 8, !tbaa !17
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  call void @cf2_font_setup(ptr noundef %23, ptr noundef %24)
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.CF2_FontRec_, ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 8, !tbaa !18
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %4
  br label %67

30:                                               ; preds = %4
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.CF2_FontRec_, ptr %31, i32 0, i32 27
  store i8 0, ptr %32, align 4, !tbaa !25
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.CF2_FontRec_, ptr %33, i32 0, i32 20
  %35 = load i8, ptr %34, align 1, !tbaa !26
  store i8 %35, ptr %12, align 1, !tbaa !27
  br label %36

36:                                               ; preds = %61, %30
  br label %37

37:                                               ; preds = %36
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.CF2_FontRec_, ptr %38, i32 0, i32 16
  call void @cf2_outline_reset(ptr noundef %39)
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.CF2_FontRec_, ptr %42, i32 0, i32 16
  call void @cf2_interpT2CharString(ptr noundef %40, ptr noundef %41, ptr noundef %43, ptr noundef %10, i8 noundef zeroext 0, i32 noundef 0, i32 noundef 0, ptr noundef %11)
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.CF2_FontRec_, ptr %44, i32 0, i32 1
  %46 = load i32, ptr %45, align 8, !tbaa !18
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %49

48:                                               ; preds = %37
  br label %67

49:                                               ; preds = %37
  %50 = load i8, ptr %12, align 1, !tbaa !27
  %51 = icmp ne i8 %50, 0
  br i1 %51, label %53, label %52

52:                                               ; preds = %49
  br label %64

53:                                               ; preds = %49
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.CF2_FontRec_, ptr %54, i32 0, i32 16
  %56 = getelementptr inbounds %struct.CF2_OutlineRec_, ptr %55, i32 0, i32 0
  %57 = getelementptr inbounds %struct.CF2_OutlineCallbacksRec_, ptr %56, i32 0, i32 4
  %58 = load i32, ptr %57, align 8, !tbaa !28
  %59 = icmp sge i32 %58, 0
  br i1 %59, label %60, label %61

60:                                               ; preds = %53
  br label %64

61:                                               ; preds = %53
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.CF2_FontRec_, ptr %62, i32 0, i32 27
  store i8 1, ptr %63, align 4, !tbaa !25
  store i8 0, ptr %12, align 1, !tbaa !27
  br label %36

64:                                               ; preds = %60, %52
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.CF2_FontRec_, ptr %65, i32 0, i32 16
  call void @cf2_outline_close(ptr noundef %66)
  br label %67

67:                                               ; preds = %64, %48, %29
  %68 = load i32, ptr %11, align 4, !tbaa !9
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %68, ptr %69, align 4, !tbaa !9
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.CF2_FontRec_, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %9, align 4, !tbaa !9
  call void @cf2_setError(ptr noundef %71, i32 noundef %72)
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.CF2_FontRec_, ptr %73, i32 0, i32 1
  %75 = load i32, ptr %74, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret i32 %75
}

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

; Function Attrs: nounwind uwtable
declare hidden void @cf2_font_setup(ptr noundef, ptr noundef) #0

declare hidden void @cf2_outline_reset(ptr noundef) #2

declare hidden void @cf2_interpT2CharString(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext, i32 noundef, i32 noundef, ptr noundef) #2

declare hidden void @cf2_outline_close(ptr noundef) #2

declare hidden void @cf2_setError(ptr noundef, i32 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"CF2_Matrix_", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!13 = !{!14, !15, i64 0}
!14 = !{!"FT_Vector_", !15, i64 0, !15, i64 8}
!15 = !{!"long", !7, i64 0}
!16 = !{!12, !10, i64 20}
!17 = !{!14, !15, i64 8}
!18 = !{!19, !10, i64 8}
!19 = !{!"CF2_FontRec_", !6, i64 0, !10, i64 8, !7, i64 12, !7, i64 13, !10, i64 16, !12, i64 20, !12, i64 44, !12, i64 68, !10, i64 92, !20, i64 96, !10, i64 144, !10, i64 148, !6, i64 152, !10, i64 160, !10, i64 164, !10, i64 168, !21, i64 176, !6, i64 240, !6, i64 248, !7, i64 256, !7, i64 257, !7, i64 258, !7, i64 260, !10, i64 292, !10, i64 296, !10, i64 300, !10, i64 304, !7, i64 308, !23, i64 312, !6, i64 648}
!20 = !{!"CFF_BlendRec_", !7, i64 0, !7, i64 1, !6, i64 8, !10, i64 16, !10, i64 20, !6, i64 24, !10, i64 32, !6, i64 40}
!21 = !{!"CF2_OutlineRec_", !22, i64 0, !6, i64 56}
!22 = !{!"CF2_OutlineCallbacksRec_", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !6, i64 40, !6, i64 48}
!23 = !{!"CF2_BluesRec_", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 9, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !24, i64 32, !24, i64 64, !7, i64 96}
!24 = !{!"CF2_HintRec_", !10, i64 0, !15, i64 8, !10, i64 16, !10, i64 20, !10, i64 24}
!25 = !{!19, !7, i64 308}
!26 = !{!19, !7, i64 257}
!27 = !{!7, !7, i64 0}
!28 = !{!19, !10, i64 208}


; 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.FT_Vector_ = type { i64, i64 }

; Function Attrs: nounwind uwtable
define hidden i32 @cf2_getGlyphOutline(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #0 {
  %5 = alloca %struct.FT_Vector_, align 8
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  store i32 0, ptr %6, align 4, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %2, i64 16
  %8 = load i32, ptr %7, align 4, !tbaa !9
  %9 = sext i32 %8 to i64
  store i64 %9, ptr %5, align 8, !tbaa !11
  %10 = getelementptr inbounds i8, ptr %2, i64 20
  %11 = load i32, ptr %10, align 4, !tbaa !14
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds i8, ptr %5, i64 8
  store i64 %12, ptr %13, align 8, !tbaa !15
  tail call void @cf2_font_setup(ptr noundef %0, ptr noundef %2)
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = load i32, ptr %14, align 8, !tbaa !16
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %16, label %.loopexit

16:                                               ; preds = %4
  %17 = getelementptr inbounds i8, ptr %0, i64 308
  store i8 0, ptr %17, align 4, !tbaa !24
  %18 = getelementptr inbounds i8, ptr %0, i64 257
  %19 = load i8, ptr %18, align 1, !tbaa !25
  %20 = getelementptr inbounds i8, ptr %0, i64 176
  tail call void @cf2_outline_reset(ptr noundef nonnull %20) #3
  call void @cf2_interpT2CharString(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %20, ptr noundef nonnull %5, i8 noundef zeroext 0, i32 noundef 0, i32 noundef 0, ptr noundef nonnull %6) #3
  %21 = load i32, ptr %14, align 8, !tbaa !16
  %.not1922 = icmp eq i32 %21, 0
  br i1 %.not1922, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %16
  %22 = icmp eq i8 %19, 0
  br i1 %22, label %.critedge, label %23

23:                                               ; preds = %.lr.ph
  %24 = getelementptr inbounds i8, ptr %0, i64 208
  %25 = load i32, ptr %24, align 8, !tbaa !26
  %26 = icmp sgt i32 %25, -1
  br i1 %26, label %.critedge, label %27

27:                                               ; preds = %23
  store i8 1, ptr %17, align 4, !tbaa !24
  call void @cf2_outline_reset(ptr noundef nonnull %20) #3
  call void @cf2_interpT2CharString(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %20, ptr noundef nonnull %5, i8 noundef zeroext 0, i32 noundef 0, i32 noundef 0, ptr noundef nonnull %6) #3
  %28 = load i32, ptr %14, align 8, !tbaa !16
  %.not19 = icmp eq i32 %28, 0
  br i1 %.not19, label %.critedge, label %.loopexit

.critedge:                                        ; preds = %27, %23, %.lr.ph
  call void @cf2_outline_close(ptr noundef nonnull %20) #3
  br label %.loopexit

.loopexit:                                        ; preds = %16, %27, %4, %.critedge
  %29 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %29, ptr %3, align 4, !tbaa !5
  call void @cf2_setError(ptr noundef nonnull %14, i32 noundef 0) #3
  %30 = load i32, ptr %14, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  ret i32 %30
}

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

; Function Attrs: nounwind uwtable
declare hidden void @cf2_font_setup(ptr noundef, ptr noundef) local_unnamed_addr #0

declare hidden void @cf2_outline_reset(ptr noundef) local_unnamed_addr #2

declare hidden void @cf2_interpT2CharString(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare hidden void @cf2_outline_close(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress 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 = { 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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"CF2_Matrix_", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20}
!11 = !{!12, !13, i64 0}
!12 = !{!"FT_Vector_", !13, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !6, i64 20}
!15 = !{!12, !13, i64 8}
!16 = !{!17, !6, i64 8}
!17 = !{!"CF2_FontRec_", !18, i64 0, !6, i64 8, !7, i64 12, !7, i64 13, !6, i64 16, !10, i64 20, !10, i64 44, !10, i64 68, !6, i64 92, !19, i64 96, !6, i64 144, !6, i64 148, !18, i64 152, !6, i64 160, !6, i64 164, !6, i64 168, !20, i64 176, !18, i64 240, !18, i64 248, !7, i64 256, !7, i64 257, !7, i64 258, !7, i64 260, !6, i64 292, !6, i64 296, !6, i64 300, !6, i64 304, !7, i64 308, !22, i64 312, !18, i64 648}
!18 = !{!"any pointer", !7, i64 0}
!19 = !{!"CFF_BlendRec_", !7, i64 0, !7, i64 1, !18, i64 8, !6, i64 16, !6, i64 20, !18, i64 24, !6, i64 32, !18, i64 40}
!20 = !{!"CF2_OutlineRec_", !21, i64 0, !18, i64 56}
!21 = !{!"CF2_OutlineCallbacksRec_", !18, i64 0, !18, i64 8, !18, i64 16, !18, i64 24, !6, i64 32, !18, i64 40, !18, i64 48}
!22 = !{!"CF2_BluesRec_", !6, i64 0, !6, i64 4, !7, i64 8, !7, i64 9, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !23, i64 32, !23, i64 64, !7, i64 96}
!23 = !{!"CF2_HintRec_", !6, i64 0, !13, i64 8, !6, i64 16, !6, i64 20, !6, i64 24}
!24 = !{!17, !7, i64 308}
!25 = !{!17, !7, i64 257}
!26 = !{!17, !6, i64 208}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass