; LLVM IR from gem5/gem5 :: src/systemc/tests/systemc/compliance_1666/test220 (test220)

; 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 }
%struct.Top = type { %"class.sc_core::sc_module", ptr }
%"class.sc_core::sc_module" = type { %"class.sc_core::sc_object", %"class.sc_core::sc_process_host", %"class.sc_core::sc_sensitive", %"class.sc_core::sc_sensitive_pos", %"class.sc_core::sc_sensitive_neg", i8, ptr, i32, ptr, ptr }
%"class.sc_core::sc_object" = type { ptr, ptr, %"class.std::vector", %"class.std::vector.0", %"class.std::__cxx11::basic_string", ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl" }
%"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl" }
%"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl_data" = type { ptr, ptr, 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] }
%"class.sc_core::sc_process_host" = type { ptr }
%"class.sc_core::sc_sensitive" = type { ptr, i32, ptr }
%"class.sc_core::sc_sensitive_pos" = type { ptr, i32, ptr }
%"class.sc_core::sc_sensitive_neg" = type { ptr, i32, ptr }
%"class.sc_core::sc_module_name" = type <{ ptr, ptr, ptr, ptr, i8, [7 x i8] }>

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [46 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@_ZL13global_flag_1 = external hidden global i8, align 1
@_ZN7sc_core23SC_ID_ASSERTION_FAILED_E = external constant [0 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [105 x i8], align 1
@_ZL13global_flag_2 = external hidden global i8, align 1
@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@_ZL13global_flag_3 = external hidden global i8, align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local i32 @sc_main(i32 noundef %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca %struct.Top, align 8
  %6 = alloca %"class.sc_core::sc_module_name", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  %9 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %10 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %11 = call noundef i32 @_ZN7sc_core17sc_report_handler11set_actionsENS_11sc_severityEj(i32 noundef 3, i32 noundef 8)
  call void @llvm.lifetime.start.p0(i64 240, ptr %5) #5
  call void @_ZN7sc_core14sc_module_nameC1EPKc(ptr noundef nonnull align 8 dereferenceable(33) %6, ptr noundef @.str.2)
  invoke void @_ZN3TopC2EN7sc_core14sc_module_nameE(ptr noundef nonnull align 8 dereferenceable(240) %5, ptr noundef %6)
          to label %12 unwind label %73

12:                                               ; preds = %2
  call void @_ZN7sc_core14sc_module_nameD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %6) #5
  invoke void @_ZN7sc_core8sc_startEv()
          to label %13 unwind label %77

13:                                               ; preds = %12
  %14 = load i8, ptr @_ZL13global_flag_1, align 1, !tbaa !11, !range !13, !noundef !14
  %15 = trunc i8 %14 to i1
  br i1 %15, label %16, label %17

16:                                               ; preds = %13
  br label %19

17:                                               ; preds = %13
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 58)
          to label %18 unwind label %77

18:                                               ; preds = %17
  br label %19

19:                                               ; preds = %18, %16
  %20 = phi i32 [ 0, %16 ], [ 0, %18 ]
  %21 = load i8, ptr @_ZL13global_flag_2, align 1, !tbaa !11, !range !13, !noundef !14
  %22 = trunc i8 %21 to i1
  br i1 %22, label %23, label %24

23:                                               ; preds = %19
  br label %26

24:                                               ; preds = %19
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef @.str.5, ptr noundef @.str.4, i32 noundef 59)
          to label %25 unwind label %77

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %25, %23
  %27 = phi i32 [ 0, %23 ], [ 0, %25 ]
  %28 = load i8, ptr @_ZL13global_flag_3, align 1, !tbaa !11, !range !13, !noundef !14
  %29 = trunc i8 %28 to i1
  br i1 %29, label %30, label %31

30:                                               ; preds = %26
  br label %33

31:                                               ; preds = %26
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef @.str.6, ptr noundef @.str.4, i32 noundef 60)
          to label %32 unwind label %77

32:                                               ; preds = %31
  br label %33

33:                                               ; preds = %32, %30
  %34 = phi i32 [ 0, %30 ], [ 0, %32 ]
  %35 = invoke noundef i32 @_ZN7sc_core17sc_report_handler9get_countENS_11sc_severityE(i32 noundef 0)
          to label %36 unwind label %77

36:                                               ; preds = %33
  %37 = icmp eq i32 %35, 0
  br i1 %37, label %38, label %39

38:                                               ; preds = %36
  br label %41

39:                                               ; preds = %36
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef @.str.7, ptr noundef @.str.4, i32 noundef 61)
          to label %40 unwind label %77

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40, %38
  %42 = phi i32 [ 0, %38 ], [ 0, %40 ]
  %43 = invoke noundef i32 @_ZN7sc_core17sc_report_handler9get_countENS_11sc_severityE(i32 noundef 1)
          to label %44 unwind label %77

44:                                               ; preds = %41
  %45 = icmp eq i32 %43, 0
  br i1 %45, label %46, label %47

46:                                               ; preds = %44
  br label %49

47:                                               ; preds = %44
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef @.str.8, ptr noundef @.str.4, i32 noundef 62)
          to label %48 unwind label %77

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48, %46
  %50 = phi i32 [ 0, %46 ], [ 0, %48 ]
  %51 = invoke noundef i32 @_ZN7sc_core17sc_report_handler9get_countENS_11sc_severityE(i32 noundef 2)
          to label %52 unwind label %77

52:                                               ; preds = %49
  %53 = icmp eq i32 %51, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %52
  br label %57

55:                                               ; preds = %52
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef @.str.9, ptr noundef @.str.4, i32 noundef 63)
          to label %56 unwind label %77

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56, %54
  %58 = phi i32 [ 0, %54 ], [ 0, %56 ]
  %59 = invoke noundef i32 @_ZN7sc_core17sc_report_handler9get_countENS_11sc_severityE(i32 noundef 3)
          to label %60 unwind label %77

60:                                               ; preds = %57
  %61 = icmp eq i32 %59, 3
  br i1 %61, label %62, label %63

62:                                               ; preds = %60
  br label %65

63:                                               ; preds = %60
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef @.str.10, ptr noundef @.str.4, i32 noundef 64)
          to label %64 unwind label %77

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64, %62
  %66 = phi i32 [ 0, %62 ], [ 0, %64 ]
  %67 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %68 unwind label %77

68:                                               ; preds = %65
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef @.str.11)
          to label %70 unwind label %77

70:                                               ; preds = %68
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %72 unwind label %77

72:                                               ; preds = %70
  call void @_ZN7sc_core9sc_moduleD2Ev(ptr noundef nonnull align 8 dereferenceable(240) %5) #5
  call void @llvm.lifetime.end.p0(i64 240, ptr %5) #5
  ret i32 0

73:                                               ; preds = %2
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %7, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %8, align 4
  call void @_ZN7sc_core14sc_module_nameD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %6) #5
  br label %81

77:                                               ; preds = %70, %68, %65, %63, %57, %55, %49, %47, %41, %39, %33, %31, %24, %17, %12
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %7, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %8, align 4
  call void @_ZN7sc_core9sc_moduleD2Ev(ptr noundef nonnull align 8 dereferenceable(240) %5) #5
  br label %81

81:                                               ; preds = %77, %73
  call void @llvm.lifetime.end.p0(i64 240, ptr %5) #5
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %7, align 8
  %84 = load i32, ptr %8, align 4
  %85 = insertvalue { ptr, i32 } poison, ptr %83, 0
  %86 = insertvalue { ptr, i32 } %85, i32 %84, 1
  resume { ptr, i32 } %86
}

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

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

declare noundef i32 @_ZN7sc_core17sc_report_handler11set_actionsENS_11sc_severityEj(i32 noundef, i32 noundef) #2

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

declare void @_ZN7sc_core14sc_module_nameC1EPKc(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef) unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3TopC2EN7sc_core14sc_module_nameE(ptr noundef nonnull align 8 dereferenceable(240), ptr noundef) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN7sc_core14sc_module_nameD1Ev(ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #4

declare void @_ZN7sc_core8sc_startEv() #2

declare void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare noundef i32 @_ZN7sc_core17sc_report_handler9get_countENS_11sc_severityE(i32 noundef) #2

; Function Attrs: nounwind
declare void @_ZN7sc_core9sc_moduleD2Ev(ptr noundef nonnull align 8 dereferenceable(232)) unnamed_addr #4

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

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 = { 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 #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 = { 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, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"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 }
%struct.Top = type { %"class.sc_core::sc_module", ptr }
%"class.sc_core::sc_module" = type { %"class.sc_core::sc_object", %"class.sc_core::sc_process_host", %"class.sc_core::sc_sensitive", %"class.sc_core::sc_sensitive_pos", %"class.sc_core::sc_sensitive_neg", i8, ptr, i32, ptr, ptr }
%"class.sc_core::sc_object" = type { ptr, ptr, %"class.std::vector", %"class.std::vector.0", %"class.std::__cxx11::basic_string", ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl" }
%"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl" }
%"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl_data" = type { ptr, ptr, 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] }
%"class.sc_core::sc_process_host" = type { ptr }
%"class.sc_core::sc_sensitive" = type { ptr, i32, ptr }
%"class.sc_core::sc_sensitive_pos" = type { ptr, i32, ptr }
%"class.sc_core::sc_sensitive_neg" = type { ptr, i32, ptr }
%"class.sc_core::sc_module_name" = type <{ ptr, ptr, ptr, ptr, i8, [7 x i8] }>

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [46 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@_ZL13global_flag_1 = external hidden local_unnamed_addr global i8, align 1
@_ZN7sc_core23SC_ID_ASSERTION_FAILED_E = external constant [0 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [105 x i8], align 1
@_ZL13global_flag_2 = external hidden local_unnamed_addr global i8, align 1
@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@_ZL13global_flag_3 = external hidden local_unnamed_addr global i8, align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @sc_main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %struct.Top, align 8
  %4 = alloca %"class.sc_core::sc_module_name", align 8
  %5 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %6 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %7 = tail call noundef i32 @_ZN7sc_core17sc_report_handler11set_actionsENS_11sc_severityEj(i32 noundef 3, i32 noundef 8)
  call void @llvm.lifetime.start.p0(i64 240, ptr nonnull %3) #5
  call void @_ZN7sc_core14sc_module_nameC1EPKc(ptr noundef nonnull align 8 dereferenceable(33) %4, ptr noundef nonnull @.str.2)
  invoke void @_ZN3TopC2EN7sc_core14sc_module_nameE(ptr noundef nonnull align 8 dereferenceable(240) %3, ptr noundef nonnull %4)
          to label %8 unwind label %48

8:                                                ; preds = %2
  call void @_ZN7sc_core14sc_module_nameD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %4) #5
  invoke void @_ZN7sc_core8sc_startEv()
          to label %9 unwind label %50

9:                                                ; preds = %8
  %10 = load i8, ptr @_ZL13global_flag_1, align 1, !tbaa !5, !range !9, !noundef !10
  %11 = trunc nuw i8 %10 to i1
  br i1 %11, label %13, label %12

12:                                               ; preds = %9
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef nonnull @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 58)
          to label %13 unwind label %50

13:                                               ; preds = %12, %9
  %14 = load i8, ptr @_ZL13global_flag_2, align 1, !tbaa !5, !range !9, !noundef !10
  %15 = trunc nuw i8 %14 to i1
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef nonnull @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.4, i32 noundef 59)
          to label %17 unwind label %50

17:                                               ; preds = %16, %13
  %18 = load i8, ptr @_ZL13global_flag_3, align 1, !tbaa !5, !range !9, !noundef !10
  %19 = trunc nuw i8 %18 to i1
  br i1 %19, label %21, label %20

20:                                               ; preds = %17
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef nonnull @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.4, i32 noundef 60)
          to label %21 unwind label %50

21:                                               ; preds = %20, %17
  %22 = invoke noundef i32 @_ZN7sc_core17sc_report_handler9get_countENS_11sc_severityE(i32 noundef 0)
          to label %23 unwind label %50

23:                                               ; preds = %21
  %24 = icmp eq i32 %22, 0
  br i1 %24, label %26, label %25

25:                                               ; preds = %23
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef nonnull @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.4, i32 noundef 61)
          to label %26 unwind label %50

26:                                               ; preds = %25, %23
  %27 = invoke noundef i32 @_ZN7sc_core17sc_report_handler9get_countENS_11sc_severityE(i32 noundef 1)
          to label %28 unwind label %50

28:                                               ; preds = %26
  %29 = icmp eq i32 %27, 0
  br i1 %29, label %31, label %30

30:                                               ; preds = %28
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef nonnull @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.4, i32 noundef 62)
          to label %31 unwind label %50

31:                                               ; preds = %30, %28
  %32 = invoke noundef i32 @_ZN7sc_core17sc_report_handler9get_countENS_11sc_severityE(i32 noundef 2)
          to label %33 unwind label %50

33:                                               ; preds = %31
  %34 = icmp eq i32 %32, 0
  br i1 %34, label %36, label %35

35:                                               ; preds = %33
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef nonnull @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.4, i32 noundef 63)
          to label %36 unwind label %50

36:                                               ; preds = %35, %33
  %37 = invoke noundef i32 @_ZN7sc_core17sc_report_handler9get_countENS_11sc_severityE(i32 noundef 3)
          to label %38 unwind label %50

38:                                               ; preds = %36
  %39 = icmp eq i32 %37, 3
  br i1 %39, label %41, label %40

40:                                               ; preds = %38
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef nonnull @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.4, i32 noundef 64)
          to label %41 unwind label %50

41:                                               ; preds = %40, %38
  %42 = invoke 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_)
          to label %43 unwind label %50

43:                                               ; preds = %41
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull @.str.11)
          to label %45 unwind label %50

45:                                               ; preds = %43
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %47 unwind label %50

47:                                               ; preds = %45
  call void @_ZN7sc_core9sc_moduleD2Ev(ptr noundef nonnull align 8 dereferenceable(240) %3) #5
  call void @llvm.lifetime.end.p0(i64 240, ptr nonnull %3) #5
  ret i32 0

48:                                               ; preds = %2
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7sc_core14sc_module_nameD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %4) #5
  br label %52

50:                                               ; preds = %45, %43, %41, %40, %36, %35, %31, %30, %26, %25, %21, %20, %16, %12, %8
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7sc_core9sc_moduleD2Ev(ptr noundef nonnull align 8 dereferenceable(240) %3) #5
  br label %52

52:                                               ; preds = %50, %48
  %.pn = phi { ptr, i32 } [ %51, %50 ], [ %49, %48 ]
  call void @llvm.lifetime.end.p0(i64 240, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn
}

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

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

declare noundef i32 @_ZN7sc_core17sc_report_handler11set_actionsENS_11sc_severityEj(i32 noundef, i32 noundef) 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

declare void @_ZN7sc_core14sc_module_nameC1EPKc(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef) unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3TopC2EN7sc_core14sc_module_nameE(ptr noundef nonnull align 8 dereferenceable(240), ptr noundef) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN7sc_core14sc_module_nameD1Ev(ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #4

declare void @_ZN7sc_core8sc_startEv() local_unnamed_addr #2

declare void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare noundef i32 @_ZN7sc_core17sc_report_handler9get_countENS_11sc_severityE(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN7sc_core9sc_moduleD2Ev(ptr noundef nonnull align 8 dereferenceable(232)) 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

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 = { 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 #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 = { 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 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}


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