; LLVM IR from ASDAlexander77/TypeScriptCompiler :: tsc/tsc-new-parser (node_factory)

; 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.ptr = type { %"class.std::shared_ptr" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%struct.ptr.17 = type { %"class.std::shared_ptr.18" }
%"class.std::shared_ptr.18" = type { %"class.std::__shared_ptr.19" }
%"class.std::__shared_ptr.19" = type { ptr, %"class.std::__shared_count" }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN2ts11NodeFactory28propagateIdentifierNameFlagsE3ptrINS_4data10IdentifierEE(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN2ts11NodeFactory19propagateChildFlagsE3ptrINS_4data4NodeEE(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3ptrIN2ts4data10IdentifierEED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2ts11NodeFactory18propagateNameFlagsE3ptrINS_4data4NodeEE(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef %1) #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.ptr, align 8
  %7 = alloca %struct.ptr.17, align 8
  %8 = alloca i1, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i1, align 1
  %12 = alloca %struct.ptr.17, align 8
  %13 = alloca i1, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  %15 = call noundef zeroext i1 @_ZN3ptrIN2ts4data4NodeEEntEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  store i1 false, ptr %8, align 1
  store i1 false, ptr %11, align 1
  store i1 false, ptr %13, align 1
  br i1 %15, label %23, label %16

16:                                               ; preds = %2
  %17 = call noundef i32 @_ZN3ptrIN2ts4data4NodeEEcv10SyntaxKindEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %18 = call noundef zeroext i1 @_ZN2ts12isIdentifierE10SyntaxKind(i32 noundef %17)
  br i1 %18, label %19, label %23

19:                                               ; preds = %16
  call void @_ZN3ptrIN2ts4data4NodeEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %1) #3
  store i1 true, ptr %8, align 1
  invoke void @_ZN3ptrIN2ts4data10IdentifierEEC2INS1_4NodeEEES_IT_E(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef %7)
          to label %20 unwind label %38

20:                                               ; preds = %19
  store i1 true, ptr %11, align 1
  %21 = invoke noundef i32 @_ZN2ts11NodeFactory28propagateIdentifierNameFlagsE3ptrINS_4data10IdentifierEE(ptr noundef nonnull align 8 dereferenceable(232) %14, ptr noundef %6)
          to label %22 unwind label %42

22:                                               ; preds = %20
  br label %26

23:                                               ; preds = %16, %2
  call void @_ZN3ptrIN2ts4data4NodeEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %1) #3
  store i1 true, ptr %13, align 1
  %24 = invoke noundef i32 @_ZN2ts11NodeFactory19propagateChildFlagsE3ptrINS_4data4NodeEE(ptr noundef nonnull align 8 dereferenceable(232) %14, ptr noundef %12)
          to label %25 unwind label %46

25:                                               ; preds = %23
  br label %26

26:                                               ; preds = %25, %22
  %27 = phi i32 [ %21, %22 ], [ %24, %25 ]
  store i32 %27, ptr %3, align 4
  %28 = load i1, ptr %13, align 1
  br i1 %28, label %29, label %30

29:                                               ; preds = %26
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #3
  br label %30

30:                                               ; preds = %29, %26
  %31 = load i1, ptr %11, align 1
  br i1 %31, label %32, label %33

32:                                               ; preds = %30
  call void @_ZN3ptrIN2ts4data10IdentifierEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  br label %33

33:                                               ; preds = %32, %30
  %34 = load i1, ptr %8, align 1
  br i1 %34, label %35, label %36

35:                                               ; preds = %33
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #3
  br label %36

36:                                               ; preds = %35, %33
  %37 = load i32, ptr %3, align 4
  ret i32 %37

38:                                               ; preds = %19
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %9, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %10, align 4
  br label %57

42:                                               ; preds = %20
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %9, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %10, align 4
  br label %53

46:                                               ; preds = %23
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %9, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %10, align 4
  %50 = load i1, ptr %13, align 1
  br i1 %50, label %51, label %52

51:                                               ; preds = %46
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #3
  br label %52

52:                                               ; preds = %51, %46
  br label %53

53:                                               ; preds = %52, %42
  %54 = load i1, ptr %11, align 1
  br i1 %54, label %55, label %56

55:                                               ; preds = %53
  call void @_ZN3ptrIN2ts4data10IdentifierEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  br label %56

56:                                               ; preds = %55, %53
  br label %57

57:                                               ; preds = %56, %38
  %58 = load i1, ptr %8, align 1
  br i1 %58, label %59, label %60

59:                                               ; preds = %57
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #3
  br label %60

60:                                               ; preds = %59, %57
  br label %61

61:                                               ; preds = %60
  %62 = load ptr, ptr %9, align 8
  %63 = load i32, ptr %10, align 4
  %64 = insertvalue { ptr, i32 } poison, ptr %62, 0
  %65 = insertvalue { ptr, i32 } %64, i32 %63, 1
  resume { ptr, i32 } %65
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3ptrIN2ts4data4NodeEEntEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN2ts12isIdentifierE10SyntaxKind(i32 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3ptrIN2ts4data4NodeEEcv10SyntaxKindEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3ptrIN2ts4data4NodeEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3ptrIN2ts4data10IdentifierEEC2INS1_4NodeEEES_IT_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #1 align 2

attributes #0 = { mustprogress 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 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 = { inlinehint mustprogress 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 #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++ TBAA"}


; 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.ptr = type { %"class.std::shared_ptr" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%struct.ptr.17 = type { %"class.std::shared_ptr.18" }
%"class.std::shared_ptr.18" = type { %"class.std::__shared_ptr.19" }
%"class.std::__shared_ptr.19" = type { ptr, %"class.std::__shared_count" }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN2ts11NodeFactory28propagateIdentifierNameFlagsE3ptrINS_4data10IdentifierEE(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN2ts11NodeFactory19propagateChildFlagsE3ptrINS_4data4NodeEE(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3ptrIN2ts4data10IdentifierEED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2ts11NodeFactory18propagateNameFlagsE3ptrINS_4data4NodeEE(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %struct.ptr, align 8
  %4 = alloca %struct.ptr.17, align 8
  %5 = alloca %struct.ptr.17, align 8
  %6 = tail call noundef zeroext i1 @_ZN3ptrIN2ts4data4NodeEEntEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  br i1 %6, label %12, label %7

7:                                                ; preds = %2
  %8 = tail call noundef i32 @_ZN3ptrIN2ts4data4NodeEEcv10SyntaxKindEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %9 = tail call noundef zeroext i1 @_ZN2ts12isIdentifierE10SyntaxKind(i32 noundef %8)
  br i1 %9, label %10, label %12

10:                                               ; preds = %7
  call void @_ZN3ptrIN2ts4data4NodeEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %1) #3
  call void @_ZN3ptrIN2ts4data10IdentifierEEC2INS1_4NodeEEES_IT_E(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull %4)
  %11 = invoke noundef i32 @_ZN2ts11NodeFactory28propagateIdentifierNameFlagsE3ptrINS_4data10IdentifierEE(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull %3)
          to label %14 unwind label %18

12:                                               ; preds = %7, %2
  call void @_ZN3ptrIN2ts4data4NodeEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %1) #3
  %13 = invoke noundef i32 @_ZN2ts11NodeFactory19propagateChildFlagsE3ptrINS_4data4NodeEE(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull %5)
          to label %.critedge unwind label %16

14:                                               ; preds = %10
  call void @_ZN3ptrIN2ts4data10IdentifierEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #3
  br label %.critedge

.critedge:                                        ; preds = %12, %14
  %.sink = phi ptr [ %4, %14 ], [ %5, %12 ]
  %15 = phi i32 [ %11, %14 ], [ %13, %12 ]
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.sink) #3
  ret i32 %15

16:                                               ; preds = %12
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %.critedge16

18:                                               ; preds = %10
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3ptrIN2ts4data10IdentifierEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #3
  br label %.critedge16

.critedge16:                                      ; preds = %16, %18
  %.sink28 = phi ptr [ %5, %16 ], [ %4, %18 ]
  %.pn26 = phi { ptr, i32 } [ %17, %16 ], [ %19, %18 ]
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.sink28) #3
  resume { ptr, i32 } %.pn26
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3ptrIN2ts4data4NodeEEntEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN2ts12isIdentifierE10SyntaxKind(i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3ptrIN2ts4data4NodeEEcv10SyntaxKindEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3ptrIN2ts4data4NodeEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3ptrIN2ts4data10IdentifierEEC2INS1_4NodeEEES_IT_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #1 align 2

attributes #0 = { mustprogress 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 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 = { inlinehint mustprogress 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 #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)"}


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