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

; 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.PSH_GlobalsRec_ = type { ptr, [2 x %struct.PSH_DimensionRec_], %struct.PSH_BluesRec_ }
%struct.PSH_DimensionRec_ = type { %struct.PSH_WidthsRec_, i64, i64 }
%struct.PSH_WidthsRec_ = type { i32, [16 x %struct.PSH_WidthRec_] }
%struct.PSH_WidthRec_ = type { i32, i64, i64 }
%struct.PSH_BluesRec_ = type { %struct.PSH_Blue_TableRec_, %struct.PSH_Blue_TableRec_, %struct.PSH_Blue_TableRec_, %struct.PSH_Blue_TableRec_, i64, i32, i32, i32, i8 }
%struct.PSH_Blue_TableRec_ = type { i32, [16 x %struct.PSH_Blue_ZoneRec_] }
%struct.PSH_Blue_ZoneRec_ = type { i32, i32, i32, i32, i64, i64, i64, i64 }

; 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 void @psh_globals_set_scale(ptr noundef %0, i64 noundef %1, i64 noundef %2, i64 noundef %3, i64 noundef %4) #1 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store i64 %2, ptr %8, align 8, !tbaa !9
  store i64 %3, ptr %9, align 8, !tbaa !9
  store i64 %4, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #2
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.PSH_GlobalsRec_, ptr %12, i32 0, i32 1
  %14 = getelementptr inbounds [2 x %struct.PSH_DimensionRec_], ptr %13, i64 0, i64 0
  store ptr %14, ptr %11, align 8, !tbaa !5
  %15 = load i64, ptr %7, align 8, !tbaa !9
  %16 = load ptr, ptr %11, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.PSH_DimensionRec_, ptr %16, i32 0, i32 1
  %18 = load i64, ptr %17, align 8, !tbaa !11
  %19 = icmp ne i64 %15, %18
  br i1 %19, label %26, label %20

20:                                               ; preds = %5
  %21 = load i64, ptr %9, align 8, !tbaa !9
  %22 = load ptr, ptr %11, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.PSH_DimensionRec_, ptr %22, i32 0, i32 2
  %24 = load i64, ptr %23, align 8, !tbaa !15
  %25 = icmp ne i64 %21, %24
  br i1 %25, label %26, label %34

26:                                               ; preds = %20, %5
  %27 = load i64, ptr %7, align 8, !tbaa !9
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.PSH_DimensionRec_, ptr %28, i32 0, i32 1
  store i64 %27, ptr %29, align 8, !tbaa !11
  %30 = load i64, ptr %9, align 8, !tbaa !9
  %31 = load ptr, ptr %11, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.PSH_DimensionRec_, ptr %31, i32 0, i32 2
  store i64 %30, ptr %32, align 8, !tbaa !15
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  call void @psh_globals_scale_widths(ptr noundef %33, i32 noundef 0)
  br label %34

34:                                               ; preds = %26, %20
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.PSH_GlobalsRec_, ptr %35, i32 0, i32 1
  %37 = getelementptr inbounds [2 x %struct.PSH_DimensionRec_], ptr %36, i64 0, i64 1
  store ptr %37, ptr %11, align 8, !tbaa !5
  %38 = load i64, ptr %8, align 8, !tbaa !9
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.PSH_DimensionRec_, ptr %39, i32 0, i32 1
  %41 = load i64, ptr %40, align 8, !tbaa !11
  %42 = icmp ne i64 %38, %41
  br i1 %42, label %49, label %43

43:                                               ; preds = %34
  %44 = load i64, ptr %10, align 8, !tbaa !9
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.PSH_DimensionRec_, ptr %45, i32 0, i32 2
  %47 = load i64, ptr %46, align 8, !tbaa !15
  %48 = icmp ne i64 %44, %47
  br i1 %48, label %49, label %61

49:                                               ; preds = %43, %34
  %50 = load i64, ptr %8, align 8, !tbaa !9
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.PSH_DimensionRec_, ptr %51, i32 0, i32 1
  store i64 %50, ptr %52, align 8, !tbaa !11
  %53 = load i64, ptr %10, align 8, !tbaa !9
  %54 = load ptr, ptr %11, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.PSH_DimensionRec_, ptr %54, i32 0, i32 2
  store i64 %53, ptr %55, align 8, !tbaa !15
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  call void @psh_globals_scale_widths(ptr noundef %56, i32 noundef 1)
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.PSH_GlobalsRec_, ptr %57, i32 0, i32 2
  %59 = load i64, ptr %8, align 8, !tbaa !9
  %60 = load i64, ptr %10, align 8, !tbaa !9
  call void @psh_blues_scale_zones(ptr noundef %58, i64 noundef %59, i64 noundef %60)
  br label %61

61:                                               ; preds = %49, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #2
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @psh_globals_scale_widths(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @psh_blues_scale_zones(ptr noundef, i64 noundef, i64 noundef) #1

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, !10, i64 392}
!12 = !{!"PSH_DimensionRec_", !13, i64 0, !10, i64 392, !10, i64 400}
!13 = !{!"PSH_WidthsRec_", !14, i64 0, !7, i64 8}
!14 = !{!"int", !7, i64 0}
!15 = !{!12, !10, i64 400}


; 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 @psh_globals_set_scale(ptr noundef %0, i64 noundef %1, i64 noundef %2, i64 noundef %3, i64 noundef %4) local_unnamed_addr #0 {
  %6 = getelementptr inbounds i8, ptr %0, i64 400
  %7 = load i64, ptr %6, align 8, !tbaa !5
  %.not = icmp eq i64 %7, %1
  br i1 %.not, label %8, label %11

8:                                                ; preds = %5
  %9 = getelementptr inbounds i8, ptr %0, i64 408
  %10 = load i64, ptr %9, align 8, !tbaa !12
  %.not22 = icmp eq i64 %10, %3
  br i1 %.not22, label %13, label %11

11:                                               ; preds = %8, %5
  store i64 %1, ptr %6, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 408
  store i64 %3, ptr %12, align 8, !tbaa !12
  tail call void @psh_globals_scale_widths(ptr noundef nonnull %0, i32 noundef 0)
  br label %13

13:                                               ; preds = %11, %8
  %14 = getelementptr inbounds i8, ptr %0, i64 808
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %.not23 = icmp eq i64 %15, %2
  br i1 %.not23, label %16, label %19

16:                                               ; preds = %13
  %17 = getelementptr inbounds i8, ptr %0, i64 816
  %18 = load i64, ptr %17, align 8, !tbaa !12
  %.not24 = icmp eq i64 %18, %4
  br i1 %.not24, label %22, label %19

19:                                               ; preds = %16, %13
  store i64 %2, ptr %14, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %0, i64 816
  store i64 %4, ptr %20, align 8, !tbaa !12
  tail call void @psh_globals_scale_widths(ptr noundef nonnull %0, i32 noundef 1)
  %21 = getelementptr inbounds i8, ptr %0, i64 824
  tail call void @psh_blues_scale_zones(ptr noundef nonnull %21, i64 noundef %2, i64 noundef %4)
  br label %22

22:                                               ; preds = %19, %16
  ret void
}

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

; Function Attrs: nounwind uwtable
declare hidden void @psh_blues_scale_zones(ptr noundef, i64 noundef, i64 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" }

!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 392}
!6 = !{!"PSH_DimensionRec_", !7, i64 0, !11, i64 392, !11, i64 400}
!7 = !{!"PSH_WidthsRec_", !8, i64 0, !9, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"long", !9, i64 0}
!12 = !{!6, !11, i64 400}


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