; LLVM IR from xboot/libcg :: src (xft)

; 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.XCG_FT_StrokerRec_ = type { i64, i64, %struct.XCG_FT_Vector_, i64, i8, i8, i64, %struct.XCG_FT_Vector_, i64, i8, i32, i32, i32, i64, i64, [2 x %struct.XCG_FT_StrokeBorderRec_] }
%struct.XCG_FT_Vector_ = type { i64, i64 }
%struct.XCG_FT_StrokeBorderRec_ = type { i32, i32, ptr, ptr, i8, i32, i8 }

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @XCG_FT_Stroker_BeginSubPath(ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i8 %2, ptr %6, align 1, !tbaa !9
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.XCG_FT_StrokerRec_, ptr %7, i32 0, i32 4
  store i8 1, ptr %8, align 8, !tbaa !10
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.XCG_FT_StrokerRec_, ptr %9, i32 0, i32 2
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %11, i64 16, i1 false), !tbaa.struct !15
  %12 = load i8, ptr %6, align 1, !tbaa !9
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.XCG_FT_StrokerRec_, ptr %13, i32 0, i32 5
  store i8 %12, ptr %14, align 1, !tbaa !17
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.XCG_FT_StrokerRec_, ptr %15, i32 0, i32 11
  %17 = load i32, ptr %16, align 8, !tbaa !18
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %32, label %19

19:                                               ; preds = %3
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.XCG_FT_StrokerRec_, ptr %20, i32 0, i32 5
  %22 = load i8, ptr %21, align 1, !tbaa !17
  %23 = zext i8 %22 to i32
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %30

25:                                               ; preds = %19
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.XCG_FT_StrokerRec_, ptr %26, i32 0, i32 10
  %28 = load i32, ptr %27, align 4, !tbaa !19
  %29 = icmp eq i32 %28, 0
  br label %30

30:                                               ; preds = %25, %19
  %31 = phi i1 [ false, %19 ], [ %29, %25 ]
  br label %32

32:                                               ; preds = %30, %3
  %33 = phi i1 [ true, %3 ], [ %31, %30 ]
  %34 = zext i1 %33 to i32
  %35 = trunc i32 %34 to i8
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.XCG_FT_StrokerRec_, ptr %36, i32 0, i32 9
  store i8 %35, ptr %37, align 8, !tbaa !20
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.XCG_FT_StrokerRec_, ptr %38, i32 0, i32 7
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %39, ptr align 8 %40, i64 16, i1 false), !tbaa.struct !15
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.XCG_FT_StrokerRec_, ptr %41, i32 0, i32 0
  store i64 0, ptr %42, align 8, !tbaa !21
  ret i32 0
}

attributes #0 = { nocallback nofree 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" }

!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 = !{!7, !7, i64 0}
!10 = !{!11, !7, i64 40}
!11 = !{!"XCG_FT_StrokerRec_", !12, i64 0, !12, i64 8, !13, i64 16, !12, i64 32, !7, i64 40, !7, i64 41, !12, i64 48, !13, i64 56, !12, i64 72, !7, i64 80, !14, i64 84, !14, i64 88, !14, i64 92, !12, i64 96, !12, i64 104, !7, i64 112}
!12 = !{!"long", !7, i64 0}
!13 = !{!"XCG_FT_Vector_", !12, i64 0, !12, i64 8}
!14 = !{!"int", !7, i64 0}
!15 = !{i64 0, i64 8, !16, i64 8, i64 8, !16}
!16 = !{!12, !12, i64 0}
!17 = !{!11, !7, i64 41}
!18 = !{!11, !14, i64 88}
!19 = !{!11, !14, i64 84}
!20 = !{!11, !7, i64 80}
!21 = !{!11, !12, i64 0}


; 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 nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local noundef i32 @XCG_FT_Stroker_BeginSubPath(ptr nocapture noundef %0, ptr nocapture noundef readonly %1, i8 noundef zeroext %2) local_unnamed_addr #1 {
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  store i8 1, ptr %4, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %1, i64 16, i1 false), !tbaa.struct !12
  %6 = getelementptr inbounds i8, ptr %0, i64 41
  store i8 %2, ptr %6, align 1, !tbaa !14
  %7 = getelementptr inbounds i8, ptr %0, i64 88
  %8 = load i32, ptr %7, align 8, !tbaa !15
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %9, label %15

9:                                                ; preds = %3
  %.not11 = icmp eq i8 %2, 0
  br i1 %.not11, label %15, label %10

10:                                               ; preds = %9
  %11 = getelementptr inbounds i8, ptr %0, i64 84
  %12 = load i32, ptr %11, align 4, !tbaa !16
  %13 = icmp eq i32 %12, 0
  %14 = zext i1 %13 to i8
  br label %15

15:                                               ; preds = %9, %10, %3
  %16 = phi i8 [ 1, %3 ], [ 0, %9 ], [ %14, %10 ]
  %17 = getelementptr inbounds i8, ptr %0, i64 80
  store i8 %16, ptr %17, align 8, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %0, i64 56
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(16) %1, i64 16, i1 false), !tbaa.struct !12
  store i64 0, ptr %0, align 8, !tbaa !18
  ret i32 0
}

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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, !8, i64 40}
!6 = !{!"XCG_FT_StrokerRec_", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 32, !8, i64 40, !8, i64 41, !7, i64 48, !10, i64 56, !7, i64 72, !8, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !7, i64 96, !7, i64 104, !8, i64 112}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"XCG_FT_Vector_", !7, i64 0, !7, i64 8}
!11 = !{!"int", !8, i64 0}
!12 = !{i64 0, i64 8, !13, i64 8, i64 8, !13}
!13 = !{!7, !7, i64 0}
!14 = !{!6, !8, i64 41}
!15 = !{!6, !11, i64 88}
!16 = !{!6, !11, i64 84}
!17 = !{!6, !8, i64 80}
!18 = !{!6, !7, i64 0}


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