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

; 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_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.AF_LatinMetricsRec_ = type { %struct.AF_StyleMetricsRec_, i32, [2 x %struct.AF_LatinAxisRec_] }
%struct.AF_StyleMetricsRec_ = type { ptr, %struct.AF_ScalerRec_, i8, ptr }
%struct.AF_ScalerRec_ = type { ptr, i64, i64, i64, i64, i32, i32 }
%struct.AF_LatinAxisRec_ = type { i64, i64, i32, [16 x %struct.AF_WidthRec_], i64, i64, i8, i32, [266 x %struct.AF_LatinBlueRec_], i64, i64 }
%struct.AF_WidthRec_ = type { i64, i64, i64 }
%struct.AF_LatinBlueRec_ = type { %struct.AF_WidthRec_, %struct.AF_WidthRec_, i64, i64, i32 }

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

; 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

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

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

21:                                               ; preds = %2
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  call void @af_latin_metrics_init_widths(ptr noundef %22, ptr noundef %23)
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = call i32 @af_latin_metrics_init_blues(ptr noundef %24, ptr noundef %25)
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %21
  store i32 -1, ptr %6, align 4, !tbaa !9
  br label %33

29:                                               ; preds = %21
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  call void @af_latin_metrics_check_digits(ptr noundef %30, ptr noundef %31)
  br label %32

32:                                               ; preds = %29, %2
  br label %33

33:                                               ; preds = %32, %28
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.FT_FaceRec_, ptr %35, i32 0, i32 23
  store ptr %34, ptr %36, align 8, !tbaa !11
  %37 = load i32, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret i32 %37
}

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

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

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, !6, i64 168}
!12 = !{!"FT_FaceRec_", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !6, i64 64, !10, i64 72, !6, i64 80, !14, i64 88, !15, i64 104, !16, i64 136, !16, i64 138, !16, i64 140, !16, i64 142, !16, i64 144, !16, i64 146, !16, i64 148, !16, i64 150, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !17, i64 200, !14, i64 216, !6, i64 232, !6, i64 240}
!13 = !{!"long", !7, i64 0}
!14 = !{!"FT_Generic_", !6, i64 0, !6, i64 8}
!15 = !{!"FT_BBox_", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!16 = !{!"short", !7, i64 0}
!17 = !{!"FT_ListRec_", !6, i64 0, !6, i64 8}
!18 = !{!12, !16, i64 136}
!19 = !{!20, !10, i64 72}
!20 = !{!"AF_LatinMetricsRec_", !21, i64 0, !10, i64 72, !7, i64 80}
!21 = !{!"AF_StyleMetricsRec_", !6, i64 0, !22, i64 8, !7, i64 56, !6, i64 64}
!22 = !{!"AF_ScalerRec_", !6, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !10, i64 40, !10, i64 44}


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

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

; Function Attrs: nounwind uwtable
define hidden range(i32 -1, 1) i32 @af_latin_metrics_init(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 168
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 136
  %6 = load i16, ptr %5, align 8, !tbaa !16
  %7 = zext i16 %6 to i32
  %8 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 %7, ptr %8, align 8, !tbaa !17
  %9 = tail call i32 @FT_Select_Charmap(ptr noundef %1, i32 noundef 1970170211) #2
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %10, label %13

10:                                               ; preds = %2
  tail call void @af_latin_metrics_init_widths(ptr noundef nonnull %0, ptr noundef nonnull %1)
  %11 = tail call i32 @af_latin_metrics_init_blues(ptr noundef nonnull %0, ptr noundef nonnull %1)
  %.not13 = icmp eq i32 %11, 0
  br i1 %.not13, label %12, label %13

12:                                               ; preds = %10
  tail call void @af_latin_metrics_check_digits(ptr noundef nonnull %0, ptr noundef nonnull %1)
  br label %13

13:                                               ; preds = %10, %2, %12
  %.0 = phi i32 [ 0, %2 ], [ 0, %12 ], [ -1, %10 ]
  store ptr %4, ptr %3, align 8, !tbaa !5
  ret i32 %.0
}

declare i32 @FT_Select_Charmap(ptr noundef, i32 noundef) local_unnamed_addr #1

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

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, !10, i64 168}
!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 = !{!6, !14, i64 136}
!17 = !{!18, !11, i64 72}
!18 = !{!"AF_LatinMetricsRec_", !19, i64 0, !11, i64 72, !8, i64 80}
!19 = !{!"AF_StyleMetricsRec_", !10, i64 0, !20, i64 8, !8, i64 56, !10, i64 64}
!20 = !{!"AF_ScalerRec_", !10, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !11, i64 40, !11, i64 44}


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