; LLVM IR from goldest-star/seawave-animation :: src/vcl/base/error/error.ll (ZN3vcl9backtraceB5cxx11Ei)

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::__cxx11::basic_ostringstream" = type { %"class.std::basic_ostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%struct.Dl_info = type { ptr, ptr, ptr, ptr }

@.str.11 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vcl9backtraceB5cxx11Ei(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, i32 noundef %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca [128 x ptr], align 16
  %6 = alloca i32, align 4
  %7 = alloca [1024 x i8], align 16
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.std::__cxx11::basic_ostringstream", align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.Dl_info, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1024, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 128, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1024, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %17 = getelementptr inbounds [128 x ptr], ptr %5, i64 0, i64 0
  %18 = call i32 @backtrace(ptr noundef %17, i32 noundef 128)
  store i32 %18, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %19 = getelementptr inbounds [128 x ptr], ptr %5, i64 0, i64 0
  %20 = load i32, ptr %8, align 4, !tbaa !5
  %21 = call ptr @backtrace_symbols(ptr noundef %19, i32 noundef %20) #6
  store ptr %21, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 376, ptr %10) #6
  call void @_ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(112) %10)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %22 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %22, ptr %11, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %111, %2
  %24 = load i32, ptr %11, align 4, !tbaa !5
  %25 = load i32, ptr %8, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %119

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  %29 = load i32, ptr %11, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [128 x ptr], ptr %5, i64 0, i64 %30
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = call i32 @dladdr(ptr noundef %32, ptr noundef %12) #6
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %94

35:                                               ; preds = %28
  %36 = getelementptr inbounds %struct.Dl_info, ptr %12, i32 0, i32 2
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %94

39:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store ptr null, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 -1, ptr %14, align 4, !tbaa !5
  %40 = getelementptr inbounds %struct.Dl_info, ptr %12, i32 0, i32 2
  %41 = load ptr, ptr %40, align 8, !tbaa !11
  %42 = getelementptr inbounds i8, ptr %41, i64 0
  %43 = load i8, ptr %42, align 1, !tbaa !13
  %44 = sext i8 %43 to i32
  %45 = icmp eq i32 %44, 95
  br i1 %45, label %46, label %55

46:                                               ; preds = %39
  %47 = getelementptr inbounds %struct.Dl_info, ptr %12, i32 0, i32 2
  %48 = load ptr, ptr %47, align 8, !tbaa !11
  %49 = invoke ptr @__cxa_demangle(ptr noundef %48, ptr noundef null, ptr noundef null, ptr noundef %14)
          to label %50 unwind label %51

50:                                               ; preds = %46
  store ptr %49, ptr %13, align 8, !tbaa !9
  br label %55

51:                                               ; preds = %46
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %15, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %118

55:                                               ; preds = %50, %39
  %56 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  %57 = load i32, ptr %11, align 4, !tbaa !5
  %58 = load i32, ptr %11, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [128 x ptr], ptr %5, i64 0, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  %62 = load i32, ptr %14, align 4, !tbaa !5
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %66

64:                                               ; preds = %55
  %65 = load ptr, ptr %13, align 8, !tbaa !9
  br label %81

66:                                               ; preds = %55
  %67 = getelementptr inbounds %struct.Dl_info, ptr %12, i32 0, i32 2
  %68 = load ptr, ptr %67, align 8, !tbaa !11
  %69 = icmp eq ptr %68, null
  br i1 %69, label %70, label %76

70:                                               ; preds = %66
  %71 = load ptr, ptr %9, align 8, !tbaa !9
  %72 = load i32, ptr %11, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds ptr, ptr %71, i64 %73
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  br label %79

76:                                               ; preds = %66
  %77 = getelementptr inbounds %struct.Dl_info, ptr %12, i32 0, i32 2
  %78 = load ptr, ptr %77, align 8, !tbaa !11
  br label %79

79:                                               ; preds = %76, %70
  %80 = phi ptr [ %75, %70 ], [ %78, %76 ]
  br label %81

81:                                               ; preds = %79, %64
  %82 = phi ptr [ %65, %64 ], [ %80, %79 ]
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [128 x ptr], ptr %5, i64 0, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct.Dl_info, ptr %12, i32 0, i32 3
  %88 = load ptr, ptr %87, align 8, !tbaa !14
  %89 = ptrtoint ptr %86 to i64
  %90 = ptrtoint ptr %88 to i64
  %91 = sub i64 %89, %90
  %92 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %56, i64 noundef 1024, ptr noundef @.str.11, i32 noundef %57, i32 noundef 18, ptr noundef %61, ptr noundef %82, i64 noundef %91) #6
  %93 = load ptr, ptr %13, align 8, !tbaa !9
  call void @free(ptr noundef %93) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %107

94:                                               ; preds = %35, %28
  %95 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  %96 = load i32, ptr %11, align 4, !tbaa !5
  %97 = load i32, ptr %11, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [128 x ptr], ptr %5, i64 0, i64 %98
  %100 = load ptr, ptr %99, align 8, !tbaa !9
  %101 = load ptr, ptr %9, align 8, !tbaa !9
  %102 = load i32, ptr %11, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds ptr, ptr %101, i64 %103
  %105 = load ptr, ptr %104, align 8, !tbaa !9
  %106 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %95, i64 noundef 1024, ptr noundef @.str.12, i32 noundef %96, i32 noundef 18, ptr noundef %100, ptr noundef %105) #6
  br label %107

107:                                              ; preds = %94, %81
  %108 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  %109 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef %108)
          to label %110 unwind label %114

110:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %11, align 4, !tbaa !5
  br label %23, !llvm.loop !15

114:                                              ; preds = %107
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %15, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %16, align 4
  br label %118

118:                                              ; preds = %114, %51
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %132

119:                                              ; preds = %27
  %120 = load ptr, ptr %9, align 8, !tbaa !9
  call void @free(ptr noundef %120) #6
  %121 = load i32, ptr %8, align 4, !tbaa !5
  %122 = icmp eq i32 %121, 128
  br i1 %122, label %123, label %130

123:                                              ; preds = %119
  %124 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef @.str.13)
          to label %125 unwind label %126

125:                                              ; preds = %123
  br label %130

126:                                              ; preds = %130, %123
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %15, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %16, align 4
  br label %132

130:                                              ; preds = %125, %119
  invoke void @_ZNKSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(112) %10)
          to label %131 unwind label %126

131:                                              ; preds = %130
  call void @_ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(112) %10) #6
  call void @llvm.lifetime.end.p0(i64 376, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %5) #6
  ret void

132:                                              ; preds = %126, %118
  call void @_ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(112) %10) #6
  call void @llvm.lifetime.end.p0(i64 376, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %5) #6
  br label %133

133:                                              ; preds = %132
  %134 = load ptr, ptr %15, align 8
  %135 = load i32, ptr %16, align 4
  %136 = insertvalue { ptr, i32 } poison, ptr %134, 0
  %137 = insertvalue { ptr, i32 } %136, i32 %135, 1
  resume { ptr, i32 } %137
}

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

declare i32 @backtrace(ptr noundef, i32 noundef) #3

; Function Attrs: nounwind
declare ptr @backtrace_symbols(ptr noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #1 align 2

; Function Attrs: nounwind
declare i32 @dladdr(ptr noundef, ptr noundef) #4

declare ptr @__cxa_demangle(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #4

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

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

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(112)) #1 align 2

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

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { 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 #5 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"_ZTS7Dl_info", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!13 = !{!7, !7, i64 0}
!14 = !{!12, !10, i64 24}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::__cxx11::basic_ostringstream" = type { %"class.std::basic_ostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%struct.Dl_info = type { ptr, ptr, ptr, ptr }

@.str.11 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vcl9backtraceB5cxx11Ei(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, i32 noundef %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca [128 x ptr], align 16
  %4 = alloca [1024 x i8], align 16
  %5 = alloca %"class.std::__cxx11::basic_ostringstream", align 8
  %6 = alloca %struct.Dl_info, align 8
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %4) #8
  %8 = call i32 @backtrace(ptr noundef nonnull %3, i32 noundef 128)
  %9 = call ptr @backtrace_symbols(ptr noundef nonnull %3, i32 noundef %8) #8
  call void @llvm.lifetime.start.p0(i64 376, ptr nonnull %5) #8
  call void @_ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(112) %5)
  %10 = icmp sgt i32 %8, %1
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %11 = getelementptr inbounds i8, ptr %6, i64 16
  %12 = getelementptr inbounds i8, ptr %6, i64 24
  %13 = sext i32 %1 to i64
  br label %15

._crit_edge:                                      ; preds = %55, %2
  call void @free(ptr noundef %9) #8
  %14 = icmp eq i32 %8, 128
  br i1 %14, label %59, label %63

15:                                               ; preds = %.lr.ph, %55
  %indvars.iv = phi i64 [ %13, %.lr.ph ], [ %indvars.iv.next, %55 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #8
  %16 = getelementptr inbounds [128 x ptr], ptr %3, i64 0, i64 %indvars.iv
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  %18 = call i32 @dladdr(ptr noundef %17, ptr noundef nonnull %6) #8
  %19 = icmp ne i32 %18, 0
  %20 = load ptr, ptr %11, align 8
  %21 = icmp ne ptr %20, null
  %or.cond = select i1 %19, i1 %21, i1 false
  br i1 %or.cond, label %22, label %47

22:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  store i32 -1, ptr %7, align 4, !tbaa !9
  %23 = load i8, ptr %20, align 1, !tbaa !11
  %24 = icmp eq i8 %23, 95
  br i1 %24, label %26, label %.thread36

.thread36:                                        ; preds = %22
  %25 = load ptr, ptr %16, align 8, !tbaa !5
  br label %38

26:                                               ; preds = %22
  %27 = invoke ptr @__cxa_demangle(ptr noundef nonnull %20, ptr noundef null, ptr noundef null, ptr noundef nonnull %7)
          to label %30 unwind label %28

28:                                               ; preds = %26
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  br label %58

30:                                               ; preds = %26
  %.pr = load i32, ptr %7, align 4, !tbaa !9
  %31 = load ptr, ptr %16, align 8, !tbaa !5
  %32 = icmp eq i32 %.pr, 0
  br i1 %32, label %38, label %33

33:                                               ; preds = %30
  %.pre = load ptr, ptr %11, align 8, !tbaa !12
  %34 = icmp eq ptr %.pre, null
  br i1 %34, label %35, label %38

35:                                               ; preds = %33
  %36 = getelementptr inbounds ptr, ptr %9, i64 %indvars.iv
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %.thread36, %33, %30, %35
  %39 = phi ptr [ %31, %35 ], [ %31, %30 ], [ %31, %33 ], [ %25, %.thread36 ]
  %.02432 = phi ptr [ %27, %35 ], [ %27, %30 ], [ %27, %33 ], [ null, %.thread36 ]
  %40 = phi ptr [ %37, %35 ], [ %27, %30 ], [ %.pre, %33 ], [ %20, %.thread36 ]
  %41 = load ptr, ptr %12, align 8, !tbaa !14
  %42 = ptrtoint ptr %39 to i64
  %43 = ptrtoint ptr %41 to i64
  %44 = sub i64 %42, %43
  %45 = trunc nsw i64 %indvars.iv to i32
  %46 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %4, i64 noundef 1024, ptr noundef nonnull @.str.11, i32 noundef %45, i32 noundef 18, ptr noundef %39, ptr noundef %40, i64 noundef %44) #8
  call void @free(ptr noundef %.02432) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  br label %53

47:                                               ; preds = %15
  %48 = load ptr, ptr %16, align 8, !tbaa !5
  %49 = getelementptr inbounds ptr, ptr %9, i64 %indvars.iv
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = trunc nsw i64 %indvars.iv to i32
  %52 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %4, i64 noundef 1024, ptr noundef nonnull @.str.12, i32 noundef %51, i32 noundef 18, ptr noundef %48, ptr noundef %50) #8
  br label %53

53:                                               ; preds = %47, %38
  %54 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %4)
          to label %55 unwind label %56

55:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #8
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %8, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge, label %15, !llvm.loop !15

56:                                               ; preds = %53
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %58

58:                                               ; preds = %56, %28
  %.pn = phi { ptr, i32 } [ %57, %56 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #8
  br label %65

59:                                               ; preds = %._crit_edge
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull @.str.13)
          to label %63 unwind label %61

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

63:                                               ; preds = %59, %._crit_edge
  invoke void @_ZNKSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(112) %5)
          to label %64 unwind label %61

64:                                               ; preds = %63
  call void @_ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(112) %5) #8
  call void @llvm.lifetime.end.p0(i64 376, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #8
  ret void

65:                                               ; preds = %61, %58
  %.pn.pn = phi { ptr, i32 } [ %.pn, %58 ], [ %62, %61 ]
  call void @_ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(112) %5) #8
  call void @llvm.lifetime.end.p0(i64 376, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #8
  resume { ptr, i32 } %.pn.pn
}

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

declare i32 @backtrace(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare ptr @backtrace_symbols(ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #1 align 2

; Function Attrs: nounwind
declare i32 @dladdr(ptr noundef, ptr noundef) local_unnamed_addr #4

declare ptr @__cxa_demangle(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #1 align 2

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

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { 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 #5 = { nofree 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 #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #7 = { 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 #8 = { 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 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 16}
!13 = !{!"_ZTS7Dl_info", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!14 = !{!13, !6, i64 24}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass