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

; 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.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" }
%"class.std::__shared_count" = type { ptr }
%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" }
%struct.ptr.35 = type { %"class.std::shared_ptr.36" }
%"class.std::shared_ptr.36" = type { %"class.std::__shared_ptr.37" }
%"class.std::__shared_ptr.37" = type { ptr, %"class.std::__shared_count" }
%"struct.ts::ParenthesizerRules" = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

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

declare noundef zeroext i1 @_ZN2ts11NodeFactory20NoParenthesizerRulesEv(ptr noundef nonnull align 8 dereferenceable(232)) #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN2tsL15isCommaSequenceE3ptrINS_4data10ExpressionEE(ptr noundef) #3

declare void @_ZN2ts11NodeFactory29createParenthesizedExpressionE3ptrINS_4data10ExpressionEE(ptr dead_on_unwind writable sret(%struct.ptr.17) align 8, ptr noundef nonnull align 8 dereferenceable(232), ptr noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3ptrIN2ts4data23ParenthesizedExpressionEE2asIS_INS1_10ExpressionEEEET_v(ptr dead_on_unwind noalias writable sret(%struct.ptr) align 8, ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2ts31skipPartiallyEmittedExpressionsE3ptrINS_4data4NodeEE(ptr dead_on_unwind noalias writable sret(%struct.ptr.35) align 8, ptr noundef) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4 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 @_ZN3ptrIN2ts4data10ExpressionEEC2INS1_4NodeEEES_IT_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZN2tsL21getLeftmostExpressionE3ptrINS_4data10ExpressionEEb(ptr dead_on_unwind noalias writable sret(%struct.ptr.35) align 8, ptr noundef, i1 noundef zeroext) #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2ts18ParenthesizerRules37parenthesizeExpressionOfExportDefaultE3ptrINS_4data10ExpressionEE(ptr dead_on_unwind noalias writable sret(%struct.ptr) align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2) #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.ptr.35, align 8
  %8 = alloca %struct.ptr.35, align 8
  %9 = alloca %struct.ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca %struct.ptr, align 8
  %14 = alloca %struct.ptr.35, align 8
  %15 = alloca %struct.ptr.35, align 8
  %16 = alloca %struct.ptr, align 8
  %17 = alloca %struct.ptr.35, align 8
  %18 = alloca %struct.ptr.17, align 8
  %19 = alloca i1, align 1
  %20 = alloca %struct.ptr, align 8
  %21 = alloca i1, align 1
  %22 = alloca i1, align 1
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %5, align 8
  %24 = getelementptr inbounds %"struct.ts::ParenthesizerRules", ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = call noundef zeroext i1 @_ZN2ts11NodeFactory20NoParenthesizerRulesEv(ptr noundef nonnull align 8 dereferenceable(232) %25)
  br i1 %26, label %27, label %28

27:                                               ; preds = %3
  call void @_ZN3ptrIN2ts4data10ExpressionEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  br label %115

28:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  call void @_ZN3ptrIN2ts4data10ExpressionEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  invoke void @_ZN3ptrIN2ts4data4NodeEEC2INS1_10ExpressionEEES_IT_E(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef %9)
          to label %29 unwind label %42

29:                                               ; preds = %28
  invoke void @_ZN2ts31skipPartiallyEmittedExpressionsE3ptrINS_4data4NodeEE(ptr dead_on_unwind writable sret(%struct.ptr.35) align 8 %7, ptr noundef %8)
          to label %30 unwind label %46

30:                                               ; preds = %29
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  call void @_ZN3ptrIN2ts4data4NodeEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  invoke void @_ZN3ptrIN2ts4data10ExpressionEEC2INS1_4NodeEEES_IT_E(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef %14)
          to label %31 unwind label %51

31:                                               ; preds = %30
  %32 = invoke noundef zeroext i1 @_ZN2tsL15isCommaSequenceE3ptrINS_4data10ExpressionEE(ptr noundef %13)
          to label %33 unwind label %55

33:                                               ; preds = %31
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  %34 = zext i1 %32 to i8
  store i8 %34, ptr %12, align 1, !tbaa !11
  %35 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %36 = trunc i8 %35 to i1
  br i1 %36, label %76, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  call void @_ZN3ptrIN2ts4data4NodeEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  invoke void @_ZN3ptrIN2ts4data10ExpressionEEC2INS1_4NodeEEES_IT_E(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef %17)
          to label %38 unwind label %60

38:                                               ; preds = %37
  invoke void @_ZN2tsL21getLeftmostExpressionE3ptrINS_4data10ExpressionEEb(ptr dead_on_unwind writable sret(%struct.ptr.35) align 8 %15, ptr noundef %16, i1 noundef zeroext false)
          to label %39 unwind label %64

39:                                               ; preds = %38
  %40 = invoke noundef i32 @_ZN3ptrIN2ts4data4NodeEEcv10SyntaxKindEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %41 unwind label %68

41:                                               ; preds = %39
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #6
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  switch i32 %40, label %75 [
    i32 231, label %74
    i32 218, label %74
  ]

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

46:                                               ; preds = %29
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %10, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %11, align 4
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  br label %50

50:                                               ; preds = %46, %42
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  br label %114

51:                                               ; preds = %30
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %10, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %11, align 4
  br label %59

55:                                               ; preds = %31
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %10, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %11, align 4
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  br label %59

59:                                               ; preds = %55, %51
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  br label %113

60:                                               ; preds = %37
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %10, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %11, align 4
  br label %73

64:                                               ; preds = %38
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %10, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %11, align 4
  br label %72

68:                                               ; preds = %39
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %10, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %11, align 4
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  br label %72

72:                                               ; preds = %68, %64
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #6
  br label %73

73:                                               ; preds = %72, %60
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  br label %113

74:                                               ; preds = %41, %41
  store i8 1, ptr %12, align 1, !tbaa !11
  br label %75

75:                                               ; preds = %74, %41
  br label %76

76:                                               ; preds = %75, %33
  %77 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %78 = trunc i8 %77 to i1
  store i1 false, ptr %19, align 1
  store i1 false, ptr %21, align 1
  store i1 false, ptr %22, align 1
  br i1 %78, label %79, label %84

79:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  store i1 true, ptr %19, align 1
  %80 = getelementptr inbounds %"struct.ts::ParenthesizerRules", ptr %23, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !9
  call void @_ZN3ptrIN2ts4data10ExpressionEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  store i1 true, ptr %21, align 1
  invoke void @_ZN2ts11NodeFactory29createParenthesizedExpressionE3ptrINS_4data10ExpressionEE(ptr dead_on_unwind writable sret(%struct.ptr.17) align 8 %18, ptr noundef nonnull align 8 dereferenceable(232) %81, ptr noundef %20)
          to label %82 unwind label %95

82:                                               ; preds = %79
  store i1 true, ptr %22, align 1
  invoke void @_ZN3ptrIN2ts4data23ParenthesizedExpressionEE2asIS_INS1_10ExpressionEEEET_v(ptr dead_on_unwind writable sret(%struct.ptr) align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %83 unwind label %99

83:                                               ; preds = %82
  br label %85

84:                                               ; preds = %76
  call void @_ZN3ptrIN2ts4data10ExpressionEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  br label %85

85:                                               ; preds = %84, %83
  %86 = load i1, ptr %22, align 1
  br i1 %86, label %87, label %88

87:                                               ; preds = %85
  call void @_ZN3ptrIN2ts4data23ParenthesizedExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #6
  br label %88

88:                                               ; preds = %87, %85
  %89 = load i1, ptr %21, align 1
  br i1 %89, label %90, label %91

90:                                               ; preds = %88
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #6
  br label %91

91:                                               ; preds = %90, %88
  %92 = load i1, ptr %19, align 1
  br i1 %92, label %93, label %94

93:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %94

94:                                               ; preds = %93, %91
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  br label %115

95:                                               ; preds = %79
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %10, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %11, align 4
  br label %106

99:                                               ; preds = %82
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %10, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %11, align 4
  %103 = load i1, ptr %22, align 1
  br i1 %103, label %104, label %105

104:                                              ; preds = %99
  call void @_ZN3ptrIN2ts4data23ParenthesizedExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #6
  br label %105

105:                                              ; preds = %104, %99
  br label %106

106:                                              ; preds = %105, %95
  %107 = load i1, ptr %21, align 1
  br i1 %107, label %108, label %109

108:                                              ; preds = %106
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #6
  br label %109

109:                                              ; preds = %108, %106
  %110 = load i1, ptr %19, align 1
  br i1 %110, label %111, label %112

111:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %112

112:                                              ; preds = %111, %109
  br label %113

113:                                              ; preds = %112, %73, %59
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  br label %114

114:                                              ; preds = %113, %50
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  br label %116

115:                                              ; preds = %94, %27
  ret void

116:                                              ; preds = %114
  %117 = load ptr, ptr %10, align 8
  %118 = load i32, ptr %11, align 4
  %119 = insertvalue { ptr, i32 } poison, ptr %117, 0
  %120 = insertvalue { ptr, i32 } %119, i32 %118, 1
  resume { ptr, i32 } %120
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { inlinehint 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 #4 = { 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 #5 = { 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 #6 = { 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"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN2ts18ParenthesizerRulesE", !6, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


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

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

declare i32 @__gxx_personality_v0(...)

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

declare noundef zeroext i1 @_ZN2ts11NodeFactory20NoParenthesizerRulesEv(ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN2tsL15isCommaSequenceE3ptrINS_4data10ExpressionEE(ptr noundef) local_unnamed_addr #3

declare void @_ZN2ts11NodeFactory29createParenthesizedExpressionE3ptrINS_4data10ExpressionEE(ptr dead_on_unwind writable sret(%struct.ptr.17) align 8, ptr noundef nonnull align 8 dereferenceable(232), ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3ptrIN2ts4data23ParenthesizedExpressionEE2asIS_INS1_10ExpressionEEEET_v(ptr dead_on_unwind noalias writable sret(%struct.ptr) align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2ts31skipPartiallyEmittedExpressionsE3ptrINS_4data4NodeEE(ptr dead_on_unwind noalias writable sret(%struct.ptr.35) align 8, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4 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 @_ZN3ptrIN2ts4data10ExpressionEEC2INS1_4NodeEEES_IT_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZN2tsL21getLeftmostExpressionE3ptrINS_4data10ExpressionEEb(ptr dead_on_unwind noalias writable sret(%struct.ptr.35) align 8, ptr noundef, i1 noundef zeroext) local_unnamed_addr #3

; 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: mustprogress uwtable
define dso_local void @_ZN2ts18ParenthesizerRules37parenthesizeExpressionOfExportDefaultE3ptrINS_4data10ExpressionEE(ptr dead_on_unwind noalias writable sret(%struct.ptr) align 8 %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %1, ptr noundef %2) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct.ptr.35, align 8
  %5 = alloca %struct.ptr.35, align 8
  %6 = alloca %struct.ptr, align 8
  %7 = alloca %struct.ptr, align 8
  %8 = alloca %struct.ptr.35, align 8
  %9 = alloca %struct.ptr.35, align 8
  %10 = alloca %struct.ptr, align 8
  %11 = alloca %struct.ptr.35, align 8
  %12 = alloca %struct.ptr.17, align 8
  %13 = alloca %struct.ptr, align 8
  %14 = load ptr, ptr %1, align 8, !tbaa !5
  %15 = tail call noundef zeroext i1 @_ZN2ts11NodeFactory20NoParenthesizerRulesEv(ptr noundef nonnull align 8 dereferenceable(232) %14)
  br i1 %15, label %16, label %17

16:                                               ; preds = %3
  tail call void @_ZN3ptrIN2ts4data10ExpressionEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  br label %41

17:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  call void @_ZN3ptrIN2ts4data10ExpressionEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  call void @_ZN3ptrIN2ts4data4NodeEEC2INS1_10ExpressionEEES_IT_E(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull %6)
  invoke void @_ZN2ts31skipPartiallyEmittedExpressionsE3ptrINS_4data4NodeEE(ptr dead_on_unwind nonnull writable sret(%struct.ptr.35) align 8 %4, ptr noundef nonnull %5)
          to label %18 unwind label %24

18:                                               ; preds = %17
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @_ZN3ptrIN2ts4data4NodeEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @_ZN3ptrIN2ts4data10ExpressionEEC2INS1_4NodeEEES_IT_E(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull %8)
  %19 = invoke noundef zeroext i1 @_ZN2tsL15isCommaSequenceE3ptrINS_4data10ExpressionEE(ptr noundef nonnull %7)
          to label %20 unwind label %26

20:                                               ; preds = %18
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  br i1 %19, label %30, label %21

21:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  call void @_ZN3ptrIN2ts4data4NodeEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @_ZN3ptrIN2ts4data10ExpressionEEC2INS1_4NodeEEES_IT_E(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull %11)
  invoke void @_ZN2tsL21getLeftmostExpressionE3ptrINS_4data10ExpressionEEb(ptr dead_on_unwind nonnull writable sret(%struct.ptr.35) align 8 %9, ptr noundef nonnull %10, i1 noundef zeroext false)
          to label %22 unwind label %28

22:                                               ; preds = %21
  %23 = call noundef i32 @_ZN3ptrIN2ts4data4NodeEEcv10SyntaxKindEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  switch i32 %23, label %33 [
    i32 231, label %30
    i32 218, label %30
  ]

24:                                               ; preds = %17
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  br label %40

26:                                               ; preds = %18
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  br label %39

28:                                               ; preds = %21
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  br label %39

30:                                               ; preds = %22, %22, %20
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  %31 = load ptr, ptr %1, align 8, !tbaa !5
  call void @_ZN3ptrIN2ts4data10ExpressionEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  invoke void @_ZN2ts11NodeFactory29createParenthesizedExpressionE3ptrINS_4data10ExpressionEE(ptr dead_on_unwind nonnull writable sret(%struct.ptr.17) align 8 %12, ptr noundef nonnull align 8 dereferenceable(232) %31, ptr noundef nonnull %13)
          to label %32 unwind label %34

32:                                               ; preds = %30
  invoke void @_ZN3ptrIN2ts4data23ParenthesizedExpressionEE2asIS_INS1_10ExpressionEEEET_v(ptr dead_on_unwind writable sret(%struct.ptr) align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %.critedge unwind label %36

33:                                               ; preds = %22
  call void @_ZN3ptrIN2ts4data10ExpressionEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  br label %.critedge20

.critedge:                                        ; preds = %32
  call void @_ZN3ptrIN2ts4data23ParenthesizedExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  br label %.critedge20

.critedge20:                                      ; preds = %33, %.critedge
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  br label %41

34:                                               ; preds = %30
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %38

36:                                               ; preds = %32
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3ptrIN2ts4data23ParenthesizedExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  br label %38

38:                                               ; preds = %34, %36
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @_ZN3ptrIN2ts4data10ExpressionEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  br label %39

39:                                               ; preds = %38, %28, %26
  %.pn.pn = phi { ptr, i32 } [ %.pn, %38 ], [ %29, %28 ], [ %27, %26 ]
  call void @_ZN3ptrIN2ts4data4NodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  br label %40

40:                                               ; preds = %39, %24
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %39 ], [ %25, %24 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn.pn.pn

41:                                               ; preds = %.critedge20, %16
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { inlinehint 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 #4 = { 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 #5 = { 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 #6 = { 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, !7, i64 0}
!6 = !{!"_ZTSN2ts18ParenthesizerRulesE", !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}


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