; LLVM IR from gem5/gem5 :: ext/systemc/src/sysc/utils (sc_report_handler)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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 }
%"class.std::locale" = type { ptr }
%"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] }

@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZN7sc_coreL10log_streamE = external hidden global ptr, align 8
@_ZTIN7sc_core9sc_reportE = external constant ptr

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7sc_core25sc_report_compose_messageB5cxx11ERKNS_9sc_reportE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(80)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7sc_core9sc_report12get_severityEv(ptr noundef nonnull align 8 dereferenceable(80)) #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

declare noundef ptr @_ZNK7sc_core9sc_report12get_msg_typeEv(ptr noundef nonnull align 8 dereferenceable(80)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7sc_core9sc_report8get_timeEv(ptr noundef nonnull align 8 dereferenceable(80)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7sc_core17sc_report_handler15default_handlerERKNS_9sc_reportERKj(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %12 = and i32 %11, 8
  %13 = icmp ne i32 %12, 0
  br i1 %13, label %14, label %25

14:                                               ; preds = %2
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #10
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN7sc_core25sc_report_compose_messageB5cxx11ERKNS_9sc_reportE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull align 8 dereferenceable(80) %16)
  %17 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %18 unwind label %21

18:                                               ; preds = %14
  %19 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %20 unwind label %21

20:                                               ; preds = %18
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #10
  br label %25

21:                                               ; preds = %18, %14
  %22 = landingpad { ptr, i32 }
          cleanup
  %23 = extractvalue { ptr, i32 } %22, 0
  store ptr %23, ptr %6, align 8
  %24 = extractvalue { ptr, i32 } %22, 1
  store i32 %24, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #10
  br label %110

25:                                               ; preds = %20, %2
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = load i32, ptr %26, align 4, !tbaa !9
  %28 = and i32 %27, 4
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %60

30:                                               ; preds = %25
  %31 = call noundef ptr @_ZN7sc_core17sc_report_handler17get_log_file_nameEv()
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %60

33:                                               ; preds = %30
  %34 = load ptr, ptr @_ZN7sc_coreL10log_streamE, align 8, !tbaa !5
  %35 = icmp ne ptr %34, null
  br i1 %35, label %45, label %36

36:                                               ; preds = %33
  %37 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 512) #11
  %38 = invoke noundef ptr @_ZN7sc_core17sc_report_handler17get_log_file_nameEv()
          to label %39 unwind label %41

39:                                               ; preds = %36
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %37, ptr noundef %38, i32 noundef 16)
          to label %40 unwind label %41

40:                                               ; preds = %39
  store ptr %37, ptr @_ZN7sc_coreL10log_streamE, align 8, !tbaa !5
  br label %45

41:                                               ; preds = %39, %36
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %6, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %37, i64 noundef 512) #12
  br label %110

45:                                               ; preds = %40, %33
  %46 = load ptr, ptr @_ZN7sc_coreL10log_streamE, align 8, !tbaa !5
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7sc_core9sc_report8get_timeEv(ptr noundef nonnull align 8 dereferenceable(80) %47)
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7sc_corelsERSoRKNS_7sc_timeE(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 8 dereferenceable(8) %48)
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef @.str.4)
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #10
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN7sc_core25sc_report_compose_messageB5cxx11ERKNS_9sc_reportE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %8, ptr noundef nonnull align 8 dereferenceable(80) %51)
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %53 unwind label %56

53:                                               ; preds = %45
  %54 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %55 unwind label %56

55:                                               ; preds = %53
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #10
  br label %60

56:                                               ; preds = %53, %45
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %6, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #10
  br label %110

60:                                               ; preds = %55, %30, %25
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = and i32 %62, 64
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %70

65:                                               ; preds = %60
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = call noundef ptr @_ZNK7sc_core9sc_report12get_msg_typeEv(ptr noundef nonnull align 8 dereferenceable(80) %66)
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = call noundef i32 @_ZNK7sc_core9sc_report12get_severityEv(ptr noundef nonnull align 8 dereferenceable(80) %68)
  call void @_ZN7sc_core12sc_stop_hereEPKcNS_11sc_severityE(ptr noundef %67, i32 noundef %69)
  call void @_ZN7sc_core7sc_stopEv()
  br label %70

70:                                               ; preds = %65, %60
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = and i32 %72, 32
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %80

75:                                               ; preds = %70
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = call noundef ptr @_ZNK7sc_core9sc_report12get_msg_typeEv(ptr noundef nonnull align 8 dereferenceable(80) %76)
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = call noundef i32 @_ZNK7sc_core9sc_report12get_severityEv(ptr noundef nonnull align 8 dereferenceable(80) %78)
  call void @_ZN7sc_core17sc_interrupt_hereEPKcNS_11sc_severityE(ptr noundef %77, i32 noundef %79)
  br label %80

80:                                               ; preds = %75, %70
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = and i32 %82, 128
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %80
  call void @abort() #13
  unreachable

86:                                               ; preds = %80
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = load i32, ptr %87, align 4, !tbaa !9
  %89 = and i32 %88, 2
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %109

91:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #10
  %92 = call noundef ptr @_ZN7sc_core24sc_get_current_process_bEv()
  store ptr %92, ptr %9, align 8, !tbaa !5
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = icmp ne ptr %93, null
  br i1 %94, label %95, label %101

95:                                               ; preds = %91
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = call noundef zeroext i1 @_ZNK7sc_core12sc_process_b12is_unwindingEv(ptr noundef nonnull align 8 dereferenceable(357) %96)
  br i1 %97, label %98, label %101

98:                                               ; preds = %95
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  %100 = call noundef zeroext i1 @_ZN7sc_core12sc_process_b15clear_unwindingEv(ptr noundef nonnull align 8 dereferenceable(357) %99)
  br label %101

101:                                              ; preds = %98, %95, %91
  %102 = call ptr @__cxa_allocate_exception(i64 80) #10
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN7sc_core9sc_reportC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %102, ptr noundef nonnull align 8 dereferenceable(80) %103)
          to label %104 unwind label %105

104:                                              ; preds = %101
  call void @__cxa_throw(ptr %102, ptr @_ZTIN7sc_core9sc_reportE, ptr @_ZN7sc_core9sc_reportD1Ev) #14
  unreachable

105:                                              ; preds = %101
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %6, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %7, align 4
  call void @__cxa_free_exception(ptr %102) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #10
  br label %110

109:                                              ; preds = %86
  ret void

110:                                              ; preds = %105, %56, %41, %21
  %111 = load ptr, ptr %6, align 8
  %112 = load i32, ptr %7, align 4
  %113 = insertvalue { ptr, i32 } poison, ptr %111, 0
  %114 = insertvalue { ptr, i32 } %113, i32 %112, 1
  resume { ptr, i32 } %114
}

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7sc_core17sc_report_handler17get_log_file_nameEv() #1 align 2

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #0 align 2

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

; 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) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7sc_corelsERSoRKNS_7sc_timeE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

declare void @_ZN7sc_core12sc_stop_hereEPKcNS_11sc_severityE(ptr noundef, i32 noundef) #3

declare void @_ZN7sc_core7sc_stopEv() #3

declare void @_ZN7sc_core17sc_interrupt_hereEPKcNS_11sc_severityE(ptr noundef, i32 noundef) #3

; Function Attrs: noreturn nounwind
declare void @abort() #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN7sc_core24sc_get_current_process_bEv() #4

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

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

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZN7sc_core9sc_reportC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZN7sc_core9sc_reportD1Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #9

declare void @__cxa_throw(ptr, ptr, ptr)

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 #5 = { 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 #6 = { 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 #7 = { noreturn 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 #8 = { 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 #9 = { 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 #10 = { nounwind }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { builtin nounwind }
attributes #13 = { noreturn nounwind }
attributes #14 = { noreturn }

!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}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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 }
%"class.std::locale" = type { ptr }
%"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] }

@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZN7sc_coreL10log_streamE = external hidden local_unnamed_addr global ptr, align 8
@_ZTIN7sc_core9sc_reportE = external constant ptr

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7sc_core25sc_report_compose_messageB5cxx11ERKNS_9sc_reportE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7sc_core9sc_report12get_severityEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

declare noundef ptr @_ZNK7sc_core9sc_report12get_msg_typeEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7sc_core9sc_report8get_timeEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7sc_core17sc_report_handler15default_handlerERKNS_9sc_reportERKj(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(4) %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = and i32 %5, 8
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %15, label %7

7:                                                ; preds = %2
  %8 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #10
  call void @_ZN7sc_core25sc_report_compose_messageB5cxx11ERKNS_9sc_reportE(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %3, ptr noundef nonnull align 8 dereferenceable(80) %0)
  %9 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %10 unwind label %13

10:                                               ; preds = %7
  %11 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %12 unwind label %13

12:                                               ; preds = %10
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #10
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %15

13:                                               ; preds = %10, %7
  %14 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #10
  br label %69

15:                                               ; preds = %12, %2
  %16 = phi i32 [ %.pre, %12 ], [ %5, %2 ]
  %17 = and i32 %16, 4
  %.not20 = icmp eq i32 %17, 0
  br i1 %.not20, label %39, label %18

18:                                               ; preds = %15
  %19 = call noundef ptr @_ZN7sc_core17sc_report_handler17get_log_file_nameEv()
  %.not21 = icmp eq ptr %19, null
  br i1 %.not21, label %39, label %20

20:                                               ; preds = %18
  %21 = load ptr, ptr @_ZN7sc_coreL10log_streamE, align 8, !tbaa !9
  %.not22 = icmp eq ptr %21, null
  br i1 %.not22, label %22, label %28

22:                                               ; preds = %20
  %23 = call noalias noundef nonnull dereferenceable(512) ptr @_Znwm(i64 noundef 512) #11
  %24 = call noundef ptr @_ZN7sc_core17sc_report_handler17get_log_file_nameEv()
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %23, ptr noundef %24, i32 noundef 16)
          to label %25 unwind label %26

25:                                               ; preds = %22
  store ptr %23, ptr @_ZN7sc_coreL10log_streamE, align 8, !tbaa !9
  br label %28

26:                                               ; preds = %22
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %23, i64 noundef 512) #12
  br label %69

28:                                               ; preds = %25, %20
  %29 = phi ptr [ %23, %25 ], [ %21, %20 ]
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7sc_core9sc_report8get_timeEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7sc_corelsERSoRKNS_7sc_timeE(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull @.str.4)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #10
  call void @_ZN7sc_core25sc_report_compose_messageB5cxx11ERKNS_9sc_reportE(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef nonnull align 8 dereferenceable(80) %0)
  %33 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %34 unwind label %37

34:                                               ; preds = %28
  %35 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %36 unwind label %37

36:                                               ; preds = %34
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #10
  br label %39

37:                                               ; preds = %34, %28
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #10
  br label %69

39:                                               ; preds = %36, %18, %15
  %40 = load i32, ptr %1, align 4, !tbaa !5
  %41 = and i32 %40, 64
  %.not23 = icmp eq i32 %41, 0
  br i1 %.not23, label %45, label %42

42:                                               ; preds = %39
  %43 = call noundef ptr @_ZNK7sc_core9sc_report12get_msg_typeEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %44 = call noundef i32 @_ZNK7sc_core9sc_report12get_severityEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  call void @_ZN7sc_core12sc_stop_hereEPKcNS_11sc_severityE(ptr noundef %43, i32 noundef %44)
  call void @_ZN7sc_core7sc_stopEv()
  %.pre29 = load i32, ptr %1, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %42, %39
  %46 = phi i32 [ %.pre29, %42 ], [ %40, %39 ]
  %47 = and i32 %46, 32
  %.not24 = icmp eq i32 %47, 0
  br i1 %.not24, label %51, label %48

48:                                               ; preds = %45
  %49 = call noundef ptr @_ZNK7sc_core9sc_report12get_msg_typeEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %50 = call noundef i32 @_ZNK7sc_core9sc_report12get_severityEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  call void @_ZN7sc_core17sc_interrupt_hereEPKcNS_11sc_severityE(ptr noundef %49, i32 noundef %50)
  %.pre30 = load i32, ptr %1, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %48, %45
  %52 = phi i32 [ %.pre30, %48 ], [ %46, %45 ]
  %53 = and i32 %52, 128
  %.not25 = icmp eq i32 %53, 0
  br i1 %.not25, label %55, label %54

54:                                               ; preds = %51
  call void @abort() #13
  unreachable

55:                                               ; preds = %51
  %56 = and i32 %52, 2
  %.not26 = icmp eq i32 %56, 0
  br i1 %.not26, label %68, label %57

57:                                               ; preds = %55
  %58 = call noundef ptr @_ZN7sc_core24sc_get_current_process_bEv()
  %.not27 = icmp eq ptr %58, null
  br i1 %.not27, label %63, label %59

59:                                               ; preds = %57
  %60 = call noundef zeroext i1 @_ZNK7sc_core12sc_process_b12is_unwindingEv(ptr noundef nonnull align 8 dereferenceable(357) %58)
  br i1 %60, label %61, label %63

61:                                               ; preds = %59
  %62 = call noundef zeroext i1 @_ZN7sc_core12sc_process_b15clear_unwindingEv(ptr noundef nonnull align 8 dereferenceable(357) %58)
  br label %63

63:                                               ; preds = %61, %59, %57
  %64 = call ptr @__cxa_allocate_exception(i64 80) #10
  invoke void @_ZN7sc_core9sc_reportC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %64, ptr noundef nonnull align 8 dereferenceable(80) %0)
          to label %65 unwind label %66

65:                                               ; preds = %63
  call void @__cxa_throw(ptr nonnull %64, ptr nonnull @_ZTIN7sc_core9sc_reportE, ptr nonnull @_ZN7sc_core9sc_reportD1Ev) #14
  unreachable

66:                                               ; preds = %63
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %64) #10
  br label %69

68:                                               ; preds = %55
  ret void

69:                                               ; preds = %66, %37, %26, %13
  %.pn = phi { ptr, i32 } [ %67, %66 ], [ %38, %37 ], [ %27, %26 ], [ %14, %13 ]
  resume { ptr, i32 } %.pn
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7sc_core17sc_report_handler17get_log_file_nameEv() local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #0 align 2

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

; 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 #4

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

declare void @_ZN7sc_core12sc_stop_hereEPKcNS_11sc_severityE(ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @_ZN7sc_core7sc_stopEv() local_unnamed_addr #3

declare void @_ZN7sc_core17sc_interrupt_hereEPKcNS_11sc_severityE(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN7sc_core24sc_get_current_process_bEv() local_unnamed_addr #4

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

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZN7sc_core9sc_reportC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZN7sc_core9sc_reportD1Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #9

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 #5 = { 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 #6 = { 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 #7 = { noreturn 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 #8 = { 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 #9 = { 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 #10 = { nounwind }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { builtin nounwind }
attributes #13 = { noreturn nounwind }
attributes #14 = { noreturn }

!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}


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