; LLVM IR from vczh/herodb :: Kernel/Source (Vlpp)

; 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"

%"class.vl::ObjectString" = type { %"class.vl::Object", ptr, ptr, i64, i64, i64 }
%"class.vl::Object" = type { ptr }
%"class.vl::stream::FileStream" = type { %"class.vl::Object", i32, ptr, %"class.vl::stream::IStream" }
%"class.vl::stream::IStream" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { ptr }
%"class.vl::stream::EncoderStream" = type { %"class.vl::stream::IStream", ptr, ptr, i64 }
%"class.vl::stream::StreamWriter" = type { %"class.vl::stream::TextWriter", ptr }
%"class.vl::stream::TextWriter" = type { %"class.vl::Object" }
%"class.vl::filesystem::File" = type { %"class.vl::Object", %"class.vl::filesystem::FilePath" }
%"class.vl::filesystem::FilePath" = type { %"class.vl::Object", %"class.vl::ObjectString" }

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2vl10filesystem8FilePath11GetFullPathEv(ptr dead_on_unwind noalias writable sret(%"class.vl::ObjectString") align 8, ptr noundef nonnull align 8 dereferenceable(56)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl6stream10FileStreamC1ERKNS_12ObjectStringIwEENS1_11AccessRightE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK2vl6stream10FileStream11IsAvailableEv(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2vl10filesystem4File12WriteAllTextERKNS_12ObjectStringIwEEbNS_6stream10BomEncoder8EncodingE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, i1 noundef zeroext %2, i32 noundef %3) #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca %"class.vl::stream::FileStream", align 8
  %11 = alloca %"class.vl::ObjectString", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %"class.vl::stream::EncoderStream", align 8
  %17 = alloca %"class.vl::stream::StreamWriter", align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  %18 = zext i1 %2 to i8
  store i8 %18, ptr %8, align 1, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !11
  %19 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr %11) #6
  %20 = getelementptr inbounds %"class.vl::filesystem::File", ptr %19, i32 0, i32 1
  call void @_ZNK2vl10filesystem8FilePath11GetFullPathEv(ptr dead_on_unwind writable sret(%"class.vl::ObjectString") align 8 %11, ptr noundef nonnull align 8 dereferenceable(56) %20)
  invoke void @_ZN2vl6stream10FileStreamC1ERKNS_12ObjectStringIwEENS1_11AccessRightE(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(48) %11, i32 noundef 1)
          to label %21 unwind label %25

21:                                               ; preds = %4
  call void @_ZN2vl12ObjectStringIwED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #6
  %22 = invoke noundef zeroext i1 @_ZNK2vl6stream10FileStream11IsAvailableEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %23 unwind label %29

23:                                               ; preds = %21
  br i1 %22, label %33, label %24

24:                                               ; preds = %23
  store i1 false, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %145

25:                                               ; preds = %4
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %12, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %13, align 4
  call void @_ZN2vl12ObjectStringIwED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #6
  br label %148

29:                                               ; preds = %21
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %12, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %13, align 4
  br label %147

33:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store ptr null, ptr %15, align 8, !tbaa !5
  %34 = load i8, ptr %8, align 1, !tbaa !9, !range !13, !noundef !14
  %35 = trunc i8 %34 to i1
  br i1 %35, label %36, label %54

36:                                               ; preds = %33
  %37 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 32) #7
          to label %38 unwind label %46

38:                                               ; preds = %36
  %39 = load i32, ptr %9, align 4, !tbaa !11
  invoke void @_ZN2vl6stream10BomEncoderC1ENS1_8EncodingE(ptr noundef nonnull align 8 dereferenceable(32) %37, i32 noundef %39)
          to label %40 unwind label %50

40:                                               ; preds = %38
  %41 = icmp eq ptr %37, null
  br i1 %41, label %44, label %42

42:                                               ; preds = %40
  %43 = getelementptr inbounds i8, ptr %37, i64 8
  br label %44

44:                                               ; preds = %42, %40
  %45 = phi ptr [ %43, %42 ], [ null, %40 ]
  store ptr %45, ptr %15, align 8, !tbaa !5
  br label %109

46:                                               ; preds = %95, %82, %69, %56, %36
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %12, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %13, align 4
  br label %144

50:                                               ; preds = %38
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %12, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %13, align 4
  call void @_ZdlPvm(ptr noundef %37, i64 noundef 32) #8
  br label %144

54:                                               ; preds = %33
  %55 = load i32, ptr %9, align 4, !tbaa !11
  switch i32 %55, label %95 [
    i32 1, label %56
    i32 2, label %69
    i32 3, label %82
  ]

56:                                               ; preds = %54
  %57 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #7
          to label %58 unwind label %46

58:                                               ; preds = %56
  invoke void @_ZN2vl6stream11Utf8EncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %57)
          to label %59 unwind label %65

59:                                               ; preds = %58
  %60 = icmp eq ptr %57, null
  br i1 %60, label %63, label %61

61:                                               ; preds = %59
  %62 = getelementptr inbounds i8, ptr %57, i64 8
  br label %63

63:                                               ; preds = %61, %59
  %64 = phi ptr [ %62, %61 ], [ null, %59 ]
  store ptr %64, ptr %15, align 8, !tbaa !5
  br label %108

65:                                               ; preds = %58
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %12, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %13, align 4
  call void @_ZdlPvm(ptr noundef %57, i64 noundef 40) #8
  br label %144

69:                                               ; preds = %54
  %70 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #7
          to label %71 unwind label %46

71:                                               ; preds = %69
  invoke void @_ZN2vl6stream12Utf16EncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %70)
          to label %72 unwind label %78

72:                                               ; preds = %71
  %73 = icmp eq ptr %70, null
  br i1 %73, label %76, label %74

74:                                               ; preds = %72
  %75 = getelementptr inbounds i8, ptr %70, i64 8
  br label %76

76:                                               ; preds = %74, %72
  %77 = phi ptr [ %75, %74 ], [ null, %72 ]
  store ptr %77, ptr %15, align 8, !tbaa !5
  br label %108

78:                                               ; preds = %71
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %12, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %13, align 4
  call void @_ZdlPvm(ptr noundef %70, i64 noundef 40) #8
  br label %144

82:                                               ; preds = %54
  %83 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #7
          to label %84 unwind label %46

84:                                               ; preds = %82
  invoke void @_ZN2vl6stream14Utf16BEEncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %83)
          to label %85 unwind label %91

85:                                               ; preds = %84
  %86 = icmp eq ptr %83, null
  br i1 %86, label %89, label %87

87:                                               ; preds = %85
  %88 = getelementptr inbounds i8, ptr %83, i64 8
  br label %89

89:                                               ; preds = %87, %85
  %90 = phi ptr [ %88, %87 ], [ null, %85 ]
  store ptr %90, ptr %15, align 8, !tbaa !5
  br label %108

91:                                               ; preds = %84
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %12, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %13, align 4
  call void @_ZdlPvm(ptr noundef %83, i64 noundef 40) #8
  br label %144

95:                                               ; preds = %54
  %96 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #7
          to label %97 unwind label %46

97:                                               ; preds = %95
  invoke void @_ZN2vl6stream11MbcsEncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %96)
          to label %98 unwind label %104

98:                                               ; preds = %97
  %99 = icmp eq ptr %96, null
  br i1 %99, label %102, label %100

100:                                              ; preds = %98
  %101 = getelementptr inbounds i8, ptr %96, i64 8
  br label %102

102:                                              ; preds = %100, %98
  %103 = phi ptr [ %101, %100 ], [ null, %98 ]
  store ptr %103, ptr %15, align 8, !tbaa !5
  br label %108

104:                                              ; preds = %97
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %12, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %13, align 4
  call void @_ZdlPvm(ptr noundef %96, i64 noundef 40) #8
  br label %144

108:                                              ; preds = %102, %89, %76, %63
  br label %109

109:                                              ; preds = %108, %44
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #6
  %110 = load ptr, ptr %10, align 8, !tbaa !15
  %111 = getelementptr i8, ptr %110, i64 -24
  %112 = load i64, ptr %111, align 8
  %113 = getelementptr inbounds i8, ptr %10, i64 %112
  %114 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void @_ZN2vl6stream13EncoderStreamC1ERNS0_7IStreamERNS0_8IEncoderE(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 8 dereferenceable(8) %113, ptr noundef nonnull align 8 dereferenceable(8) %114)
          to label %115 unwind label %130

115:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  %116 = load ptr, ptr %16, align 8, !tbaa !15
  %117 = getelementptr i8, ptr %116, i64 -160
  %118 = load i64, ptr %117, align 8
  %119 = getelementptr inbounds i8, ptr %16, i64 %118
  invoke void @_ZN2vl6stream12StreamWriterC1ERNS0_7IStreamE(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) %119)
          to label %120 unwind label %134

120:                                              ; preds = %115
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZN2vl6stream10TextWriter11WriteStringERKNS_12ObjectStringIwEE(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(48) %121)
          to label %122 unwind label %138

122:                                              ; preds = %120
  call void @_ZN2vl6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  call void @_ZN2vl6stream13EncoderStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #6
  %123 = load ptr, ptr %15, align 8, !tbaa !5
  %124 = icmp eq ptr %123, null
  br i1 %124, label %129, label %125

125:                                              ; preds = %122
  %126 = load ptr, ptr %123, align 8, !tbaa !15
  %127 = getelementptr inbounds ptr, ptr %126, i64 1
  %128 = load ptr, ptr %127, align 8
  call void %128(ptr noundef nonnull align 8 dereferenceable(8) %123) #6
  br label %129

129:                                              ; preds = %125, %122
  store i1 true, ptr %5, align 1
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %145

130:                                              ; preds = %109
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %12, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %13, align 4
  br label %143

134:                                              ; preds = %115
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %12, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %13, align 4
  br label %142

138:                                              ; preds = %120
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %12, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %13, align 4
  call void @_ZN2vl6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #6
  br label %142

142:                                              ; preds = %138, %134
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  call void @_ZN2vl6stream13EncoderStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #6
  br label %143

143:                                              ; preds = %142, %130
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #6
  br label %144

144:                                              ; preds = %143, %104, %91, %78, %65, %50, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %147

145:                                              ; preds = %129, %24
  call void @_ZN2vl6stream10FileStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #6
  %146 = load i1, ptr %5, align 1
  ret i1 %146

147:                                              ; preds = %144, %29
  call void @_ZN2vl6stream10FileStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  br label %148

148:                                              ; preds = %147, %25
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #6
  br label %149

149:                                              ; preds = %148
  %150 = load ptr, ptr %12, align 8
  %151 = load i32, ptr %13, align 4
  %152 = insertvalue { ptr, i32 } poison, ptr %150, 0
  %153 = insertvalue { ptr, i32 } %152, i32 %151, 1
  resume { ptr, i32 } %153
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2vl6stream11Utf8EncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2vl6stream12Utf16EncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2vl6stream14Utf16BEEncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2vl6stream11MbcsEncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl6stream13EncoderStreamC1ERNS0_7IStreamERNS0_8IEncoderE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl6stream10TextWriter11WriteStringERKNS_12ObjectStringIwEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

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

declare void @_ZN2vl6stream12StreamWriterC1ERNS0_7IStreamE(ptr, ptr)

declare void @_ZN2vl6stream10BomEncoderC1ENS1_8EncodingE(ptr, i32)

attributes #0 = { nobuiltin nounwind "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 = { 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 = { 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 = { nobuiltin allocsize(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 = { 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN2vl6stream10BomEncoder8EncodingE", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, 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"

%"class.vl::ObjectString" = type { %"class.vl::Object", ptr, ptr, i64, i64, i64 }
%"class.vl::Object" = type { ptr }
%"class.vl::stream::FileStream" = type { %"class.vl::Object", i32, ptr, %"class.vl::stream::IStream" }
%"class.vl::stream::IStream" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { ptr }
%"class.vl::stream::EncoderStream" = type { %"class.vl::stream::IStream", ptr, ptr, i64 }
%"class.vl::stream::StreamWriter" = type { %"class.vl::stream::TextWriter", ptr }
%"class.vl::stream::TextWriter" = type { %"class.vl::Object" }

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2vl10filesystem8FilePath11GetFullPathEv(ptr dead_on_unwind noalias writable sret(%"class.vl::ObjectString") align 8, ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl6stream10FileStreamC1ERKNS_12ObjectStringIwEENS1_11AccessRightE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK2vl6stream10FileStream11IsAvailableEv(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2vl10filesystem4File12WriteAllTextERKNS_12ObjectStringIwEEbNS_6stream10BomEncoder8EncodingE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, i1 noundef zeroext %2, i32 noundef %3) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.vl::stream::FileStream", align 8
  %6 = alloca %"class.vl::ObjectString", align 8
  %7 = alloca %"class.vl::stream::EncoderStream", align 8
  %8 = alloca %"class.vl::stream::StreamWriter", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #6
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  call void @_ZNK2vl10filesystem8FilePath11GetFullPathEv(ptr dead_on_unwind nonnull writable sret(%"class.vl::ObjectString") align 8 %6, ptr noundef nonnull align 8 dereferenceable(56) %9)
  invoke void @_ZN2vl6stream10FileStreamC1ERKNS_12ObjectStringIwEENS1_11AccessRightE(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(48) %6, i32 noundef 1)
          to label %10 unwind label %12

10:                                               ; preds = %4
  call void @_ZN2vl12ObjectStringIwED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #6
  %11 = call noundef zeroext i1 @_ZNK2vl6stream10FileStream11IsAvailableEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  br i1 %11, label %14, label %68

12:                                               ; preds = %4
  %13 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2vl12ObjectStringIwED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #6
  br label %69

14:                                               ; preds = %10
  br i1 %2, label %15, label %22

15:                                               ; preds = %14
  %16 = invoke noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i64 noundef 32) #7
          to label %17 unwind label %18

17:                                               ; preds = %15
  invoke void @_ZN2vl6stream10BomEncoderC1ENS1_8EncodingE(ptr noundef nonnull align 8 dereferenceable(32) %16, i32 noundef %3)
          to label %43 unwind label %20

18:                                               ; preds = %38, %33, %28, %23, %15
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %67

20:                                               ; preds = %17
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %16, i64 noundef 32) #8
  br label %67

22:                                               ; preds = %14
  switch i32 %3, label %38 [
    i32 1, label %23
    i32 2, label %28
    i32 3, label %33
  ]

23:                                               ; preds = %22
  %24 = invoke noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #7
          to label %25 unwind label %18

25:                                               ; preds = %23
  invoke void @_ZN2vl6stream11Utf8EncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %24)
          to label %43 unwind label %26

26:                                               ; preds = %25
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %24, i64 noundef 40) #8
  br label %67

28:                                               ; preds = %22
  %29 = invoke noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #7
          to label %30 unwind label %18

30:                                               ; preds = %28
  invoke void @_ZN2vl6stream12Utf16EncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %29)
          to label %43 unwind label %31

31:                                               ; preds = %30
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %29, i64 noundef 40) #8
  br label %67

33:                                               ; preds = %22
  %34 = invoke noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #7
          to label %35 unwind label %18

35:                                               ; preds = %33
  invoke void @_ZN2vl6stream14Utf16BEEncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %34)
          to label %43 unwind label %36

36:                                               ; preds = %35
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %34, i64 noundef 40) #8
  br label %67

38:                                               ; preds = %22
  %39 = invoke noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #7
          to label %40 unwind label %18

40:                                               ; preds = %38
  invoke void @_ZN2vl6stream11MbcsEncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %39)
          to label %43 unwind label %41

41:                                               ; preds = %40
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %39, i64 noundef 40) #8
  br label %67

43:                                               ; preds = %40, %35, %30, %25, %17
  %.sink = phi ptr [ %16, %17 ], [ %24, %25 ], [ %29, %30 ], [ %34, %35 ], [ %39, %40 ]
  %44 = getelementptr inbounds i8, ptr %.sink, i64 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #6
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr i8, ptr %45, i64 -24
  %47 = load i64, ptr %46, align 8
  %48 = getelementptr inbounds i8, ptr %5, i64 %47
  invoke void @_ZN2vl6stream13EncoderStreamC1ERNS0_7IStreamERNS0_8IEncoderE(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull align 8 dereferenceable(8) %44)
          to label %49 unwind label %59

49:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr i8, ptr %50, i64 -160
  %52 = load i64, ptr %51, align 8
  %53 = getelementptr inbounds i8, ptr %7, i64 %52
  invoke void @_ZN2vl6stream12StreamWriterC1ERNS0_7IStreamE(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) %53)
          to label %54 unwind label %61

54:                                               ; preds = %49
  invoke void @_ZN2vl6stream10TextWriter11WriteStringERKNS_12ObjectStringIwEE(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %55 unwind label %63

55:                                               ; preds = %54
  call void @_ZN2vl6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @_ZN2vl6stream13EncoderStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  %56 = load ptr, ptr %44, align 8, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %56, i64 8
  %58 = load ptr, ptr %57, align 8
  call void %58(ptr noundef nonnull align 8 dereferenceable(8) %44) #6
  br label %68

59:                                               ; preds = %43
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %66

61:                                               ; preds = %49
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %65

63:                                               ; preds = %54
  %64 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2vl6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  br label %65

65:                                               ; preds = %63, %61
  %.pn = phi { ptr, i32 } [ %64, %63 ], [ %62, %61 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @_ZN2vl6stream13EncoderStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  br label %66

66:                                               ; preds = %65, %59
  %.pn.pn = phi { ptr, i32 } [ %.pn, %65 ], [ %60, %59 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  br label %67

67:                                               ; preds = %66, %41, %36, %31, %26, %20, %18
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %66 ], [ %21, %20 ], [ %19, %18 ], [ %42, %41 ], [ %37, %36 ], [ %32, %31 ], [ %27, %26 ]
  call void @_ZN2vl6stream10FileStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  br label %69

68:                                               ; preds = %10, %55
  call void @_ZN2vl6stream10FileStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  ret i1 %11

69:                                               ; preds = %67, %12
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %67 ], [ %13, %12 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  resume { ptr, i32 } %.pn.pn.pn.pn
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2vl6stream11Utf8EncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2vl6stream12Utf16EncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2vl6stream14Utf16BEEncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2vl6stream11MbcsEncoderC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl6stream13EncoderStreamC1ERNS0_7IStreamERNS0_8IEncoderE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl6stream10TextWriter11WriteStringERKNS_12ObjectStringIwEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

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

declare void @_ZN2vl6stream12StreamWriterC1ERNS0_7IStreamE(ptr, ptr) local_unnamed_addr

declare void @_ZN2vl6stream10BomEncoderC1ENS1_8EncodingE(ptr, i32) local_unnamed_addr

attributes #0 = { nobuiltin nounwind "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { 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 = { nobuiltin allocsize(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 = { 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


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