; 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::__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] }

@_ZZN7sc_core25sc_report_compose_messageB5cxx11ERKNS_9sc_reportEE14severity_names = external hidden global [4 x ptr], align 16
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7sc_core25sc_report_compose_messageB5cxx11ERKNS_9sc_reportE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(80) %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca [64 x i8], align 16
  %9 = alloca [16 x i8], align 16
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  store i1 false, ptr %5, align 1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #7
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = invoke noundef i32 @_ZNK7sc_core9sc_report12get_severityEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
          to label %15 unwind label %43

15:                                               ; preds = %2
  %16 = zext i32 %14 to i64
  %17 = getelementptr inbounds [4 x ptr], ptr @_ZZN7sc_core25sc_report_compose_messageB5cxx11ERKNS_9sc_reportEE14severity_names, i64 0, i64 %16
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %18)
          to label %20 unwind label %43

20:                                               ; preds = %15
  %21 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef @.str.4)
          to label %22 unwind label %43

22:                                               ; preds = %20
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = invoke noundef i32 @_ZNK7sc_core9sc_report6get_idEv(ptr noundef nonnull align 8 dereferenceable(80) %23)
          to label %25 unwind label %43

25:                                               ; preds = %22
  %26 = icmp sge i32 %24, 0
  br i1 %26, label %27, label %51

27:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 64, ptr %8) #7
  %28 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = invoke noundef i32 @_ZNK7sc_core9sc_report12get_severityEv(ptr noundef nonnull align 8 dereferenceable(80) %29)
          to label %31 unwind label %47

31:                                               ; preds = %27
  %32 = zext i32 %30 to i64
  %33 = getelementptr inbounds [5 x i8], ptr @.str.6, i64 0, i64 %32
  %34 = load i8, ptr %33, align 1, !tbaa !9
  %35 = sext i8 %34 to i32
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = invoke noundef i32 @_ZNK7sc_core9sc_report6get_idEv(ptr noundef nonnull align 8 dereferenceable(80) %36)
          to label %38 unwind label %47

38:                                               ; preds = %31
  %39 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %28, ptr noundef @.str.5, i32 noundef %35, i32 noundef %37) #7
  %40 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  %41 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %40)
          to label %42 unwind label %47

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #7
  br label %51

43:                                               ; preds = %70, %67, %64, %62, %56, %54, %51, %22, %20, %15, %2
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %6, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %7, align 4
  br label %152

47:                                               ; preds = %38, %31, %27
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %6, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #7
  br label %152

51:                                               ; preds = %42, %25
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = invoke noundef ptr @_ZNK7sc_core9sc_report12get_msg_typeEv(ptr noundef nonnull align 8 dereferenceable(80) %52)
          to label %54 unwind label %43

54:                                               ; preds = %51
  %55 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %53)
          to label %56 unwind label %43

56:                                               ; preds = %54
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = invoke noundef ptr @_ZNK7sc_core9sc_report7get_msgEv(ptr noundef nonnull align 8 dereferenceable(80) %57)
          to label %59 unwind label %43

59:                                               ; preds = %56
  %60 = load i8, ptr %58, align 1, !tbaa !9
  %61 = icmp ne i8 %60, 0
  br i1 %61, label %62, label %70

62:                                               ; preds = %59
  %63 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef @.str.4)
          to label %64 unwind label %43

64:                                               ; preds = %62
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = invoke noundef ptr @_ZNK7sc_core9sc_report7get_msgEv(ptr noundef nonnull align 8 dereferenceable(80) %65)
          to label %67 unwind label %43

67:                                               ; preds = %64
  %68 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %66)
          to label %69 unwind label %43

69:                                               ; preds = %67
  br label %70

70:                                               ; preds = %69, %59
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = invoke noundef i32 @_ZNK7sc_core9sc_report12get_severityEv(ptr noundef nonnull align 8 dereferenceable(80) %71)
          to label %73 unwind label %43

73:                                               ; preds = %70
  %74 = icmp sgt i32 %72, 0
  br i1 %74, label %75, label %148

75:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #7
  %76 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef @.str.7)
          to label %77 unwind label %122

77:                                               ; preds = %75
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = invoke noundef ptr @_ZNK7sc_core9sc_report13get_file_nameEv(ptr noundef nonnull align 8 dereferenceable(80) %78)
          to label %80 unwind label %122

80:                                               ; preds = %77
  %81 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %79)
          to label %82 unwind label %122

82:                                               ; preds = %80
  %83 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef @.str.8)
          to label %84 unwind label %122

84:                                               ; preds = %82
  %85 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 0
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = invoke noundef i32 @_ZNK7sc_core9sc_report15get_line_numberEv(ptr noundef nonnull align 8 dereferenceable(80) %86)
          to label %88 unwind label %122

88:                                               ; preds = %84
  %89 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %85, ptr noundef @.str.9, i32 noundef %87) #7
  %90 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 0
  %91 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %90)
          to label %92 unwind label %122

92:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %93 = invoke noundef ptr @_ZN7sc_core22sc_get_curr_simcontextEv()
          to label %94 unwind label %126

94:                                               ; preds = %92
  store ptr %93, ptr %10, align 8, !tbaa !5
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  %96 = icmp ne ptr %95, null
  br i1 %96, label %97, label %145

97:                                               ; preds = %94
  %98 = invoke noundef ptr @_ZN7sc_core22sc_get_curr_simcontextEv()
          to label %99 unwind label %126

99:                                               ; preds = %97
  %100 = invoke noundef zeroext i1 @_ZN7sc_core13sc_is_runningEPKNS_13sc_simcontextE(ptr noundef %98)
          to label %101 unwind label %126

101:                                              ; preds = %99
  br i1 %100, label %102, label %145

102:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = invoke noundef ptr @_ZNK7sc_core9sc_report16get_process_nameEv(ptr noundef nonnull align 8 dereferenceable(80) %103)
          to label %105 unwind label %130

105:                                              ; preds = %102
  store ptr %104, ptr %11, align 8, !tbaa !5
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = icmp ne ptr %106, null
  br i1 %107, label %108, label %143

108:                                              ; preds = %105
  %109 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef @.str.10)
          to label %110 unwind label %130

110:                                              ; preds = %108
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %111)
          to label %113 unwind label %130

113:                                              ; preds = %110
  %114 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef @.str.11)
          to label %115 unwind label %130

115:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #7
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7sc_core9sc_report8get_timeEv(ptr noundef nonnull align 8 dereferenceable(80) %116)
          to label %118 unwind label %134

118:                                              ; preds = %115
  invoke void @_ZNK7sc_core7sc_time9to_stringB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %12, ptr noundef nonnull align 8 dereferenceable(8) %117)
          to label %119 unwind label %134

119:                                              ; preds = %118
  %120 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %121 unwind label %138

121:                                              ; preds = %119
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  br label %143

122:                                              ; preds = %88, %84, %82, %80, %77, %75
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %6, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %7, align 4
  br label %147

126:                                              ; preds = %99, %97, %92
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %6, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %7, align 4
  br label %146

130:                                              ; preds = %113, %110, %108, %102
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %6, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %7, align 4
  br label %144

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

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

142:                                              ; preds = %138, %134
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  br label %144

143:                                              ; preds = %121, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %145

144:                                              ; preds = %142, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %146

145:                                              ; preds = %143, %101, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  br label %148

146:                                              ; preds = %144, %126
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %147

147:                                              ; preds = %146, %122
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  br label %152

148:                                              ; preds = %145, %73
  store i1 true, ptr %5, align 1
  %149 = load i1, ptr %5, align 1
  br i1 %149, label %151, label %150

150:                                              ; preds = %148
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #7
  br label %151

151:                                              ; preds = %150, %148
  ret void

152:                                              ; preds = %147, %47, %43
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #7
  br label %153

153:                                              ; preds = %152
  %154 = load ptr, ptr %6, align 8
  %155 = load i32, ptr %7, align 4
  %156 = insertvalue { ptr, i32 } poison, ptr %154, 0
  %157 = insertvalue { ptr, i32 } %156, i32 %155, 1
  resume { ptr, i32 } %157
}

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

; 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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #0 align 2

declare noundef i32 @_ZNK7sc_core9sc_report6get_idEv(ptr noundef nonnull align 8 dereferenceable(80)) #2

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN7sc_core22sc_get_curr_simcontextEv() #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7sc_core13sc_is_runningEPKNS_13sc_simcontextE(ptr noundef) #6

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

; 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

declare void @_ZNK7sc_core7sc_time9to_stringB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #0 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

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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #7 = { 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 = !{!7, !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::__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] }

@_ZZN7sc_core25sc_report_compose_messageB5cxx11ERKNS_9sc_reportEE14severity_names = external hidden local_unnamed_addr global [4 x ptr], align 16
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7sc_core25sc_report_compose_messageB5cxx11ERKNS_9sc_reportE(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(80) %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca [64 x i8], align 16
  %4 = alloca [16 x i8], align 16
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #7
  %6 = tail call noundef i32 @_ZNK7sc_core9sc_report12get_severityEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %7 = zext i32 %6 to i64
  %8 = getelementptr inbounds [4 x ptr], ptr @_ZZN7sc_core25sc_report_compose_messageB5cxx11ERKNS_9sc_reportEE14severity_names, i64 0, i64 %7
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %9)
          to label %11 unwind label %28

11:                                               ; preds = %2
  %12 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.4)
          to label %13 unwind label %28

13:                                               ; preds = %11
  %14 = invoke noundef i32 @_ZNK7sc_core9sc_report6get_idEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %15 unwind label %28

15:                                               ; preds = %13
  %16 = icmp sgt i32 %14, -1
  br i1 %16, label %17, label %32

17:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #7
  %18 = tail call noundef i32 @_ZNK7sc_core9sc_report12get_severityEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %19 = zext i32 %18 to i64
  %20 = getelementptr inbounds [5 x i8], ptr @.str.6, i64 0, i64 %19
  %21 = load i8, ptr %20, align 1, !tbaa !9
  %22 = invoke noundef i32 @_ZNK7sc_core9sc_report6get_idEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %23 unwind label %30

23:                                               ; preds = %17
  %24 = sext i8 %21 to i32
  %25 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %24, i32 noundef %22) #7
  %26 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %3)
          to label %27 unwind label %30

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #7
  br label %32

28:                                               ; preds = %41, %39, %34, %32, %13, %11, %2
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %93

30:                                               ; preds = %23, %17
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #7
  br label %93

32:                                               ; preds = %27, %15
  %33 = invoke noundef ptr @_ZNK7sc_core9sc_report12get_msg_typeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %34 unwind label %28

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

36:                                               ; preds = %34
  %37 = call noundef ptr @_ZNK7sc_core9sc_report7get_msgEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %38 = load i8, ptr %37, align 1, !tbaa !9
  %.not = icmp eq i8 %38, 0
  br i1 %.not, label %44, label %39

39:                                               ; preds = %36
  %40 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.4)
          to label %41 unwind label %28

41:                                               ; preds = %39
  %42 = call noundef ptr @_ZNK7sc_core9sc_report7get_msgEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %43 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %42)
          to label %44 unwind label %28

44:                                               ; preds = %41, %36
  %45 = call noundef i32 @_ZNK7sc_core9sc_report12get_severityEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %47, label %92

47:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  %48 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.7)
          to label %49 unwind label %79

49:                                               ; preds = %47
  %50 = call noundef ptr @_ZNK7sc_core9sc_report13get_file_nameEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %51 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %50)
          to label %52 unwind label %79

52:                                               ; preds = %49
  %53 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.8)
          to label %54 unwind label %79

54:                                               ; preds = %52
  %55 = call noundef i32 @_ZNK7sc_core9sc_report15get_line_numberEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %56 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %55) #7
  %57 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %4)
          to label %58 unwind label %79

58:                                               ; preds = %54
  %59 = invoke noundef ptr @_ZN7sc_core22sc_get_curr_simcontextEv()
          to label %60 unwind label %81

60:                                               ; preds = %58
  %.not23 = icmp eq ptr %59, null
  br i1 %.not23, label %90, label %61

61:                                               ; preds = %60
  %62 = invoke noundef ptr @_ZN7sc_core22sc_get_curr_simcontextEv()
          to label %63 unwind label %81

63:                                               ; preds = %61
  %64 = call noundef zeroext i1 @_ZN7sc_core13sc_is_runningEPKNS_13sc_simcontextE(ptr noundef %62)
  br i1 %64, label %65, label %90

65:                                               ; preds = %63
  %66 = invoke noundef ptr @_ZNK7sc_core9sc_report16get_process_nameEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %67 unwind label %83

67:                                               ; preds = %65
  %.not24 = icmp eq ptr %66, null
  br i1 %.not24, label %90, label %68

68:                                               ; preds = %67
  %69 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.10)
          to label %70 unwind label %83

70:                                               ; preds = %68
  %71 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %66)
          to label %72 unwind label %83

72:                                               ; preds = %70
  %73 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.11)
          to label %74 unwind label %83

74:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7sc_core9sc_report8get_timeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  invoke void @_ZNK7sc_core7sc_time9to_stringB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull align 8 dereferenceable(8) %75)
          to label %76 unwind label %85

76:                                               ; preds = %74
  %77 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %78 unwind label %87

78:                                               ; preds = %76
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  br label %90

79:                                               ; preds = %54, %52, %49, %47
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %91

81:                                               ; preds = %61, %58
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %91

83:                                               ; preds = %72, %70, %68, %65
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %91

85:                                               ; preds = %74
  %86 = landingpad { ptr, i32 }
          cleanup
  br label %89

87:                                               ; preds = %76
  %88 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  br label %89

89:                                               ; preds = %87, %85
  %.pn = phi { ptr, i32 } [ %88, %87 ], [ %86, %85 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  br label %91

90:                                               ; preds = %67, %78, %63, %60
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  br label %92

91:                                               ; preds = %81, %89, %83, %79
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %80, %79 ], [ %82, %81 ], [ %.pn, %89 ], [ %84, %83 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  br label %93

92:                                               ; preds = %44, %90
  ret void

93:                                               ; preds = %91, %30, %28
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %91 ], [ %29, %28 ], [ %31, %30 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #7
  resume { ptr, i32 } %.pn.pn.pn.pn.pn
}

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

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #0 align 2

declare noundef i32 @_ZNK7sc_core9sc_report6get_idEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7sc_core13sc_is_runningEPKNS_13sc_simcontextE(ptr noundef) local_unnamed_addr #6

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

; 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

declare void @_ZNK7sc_core7sc_time9to_stringB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 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

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 = { "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = { 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 #7 = { 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 = !{!7, !7, i64 0}


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