; LLVM IR from gem5/gem5 :: src/systemc/tests/systemc/communication/sc_buffer/test02 (reset)

; 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.sc_core::sc_signal" = type <{ %"class.sc_core::sc_signal_inout_if", %"class.sc_core::sc_prim_channel", %"struct.sc_core::sc_writer_policy_check", ptr, i32, [4 x i8], i64, i32, [4 x i8] }>
%"class.sc_core::sc_signal_inout_if" = type { %"class.sc_core::sc_signal_in_if", %"class.sc_core::sc_signal_write_if" }
%"class.sc_core::sc_signal_in_if" = type { %"class.sc_core::sc_interface" }
%"class.sc_core::sc_interface" = type { ptr }
%"class.sc_core::sc_signal_write_if" = type { %"class.sc_core::sc_interface" }
%"class.sc_core::sc_prim_channel" = type { %"class.sc_core::sc_object", 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] }
%"struct.sc_core::sc_writer_policy_check" = type { %"struct.sc_core::sc_writer_policy_check_port", %"struct.sc_core::sc_writer_policy_check_write" }
%"struct.sc_core::sc_writer_policy_check_port" = type { ptr }
%"struct.sc_core::sc_writer_policy_check_write" = type { i8, ptr }
%"class.sc_core::sc_buffer" = type { %"class.sc_core::sc_signal.8" }
%"class.sc_core::sc_signal.8" = type { %"class.sc_core::sc_signal_inout_if.9", %"class.sc_core::sc_prim_channel", %"struct.sc_core::sc_writer_policy_check", ptr, i8, i64, ptr, i8, ptr, ptr }
%"class.sc_core::sc_signal_inout_if.9" = type { %"class.sc_core::sc_signal_in_if.10", %"class.sc_core::sc_signal_write_if.11" }
%"class.sc_core::sc_signal_in_if.10" = type { %"class.sc_core::sc_interface" }
%"class.sc_core::sc_signal_write_if.11" = type { %"class.sc_core::sc_interface" }
%struct.print_edge = type { %"class.sc_core::sc_module", %"class.sc_core::sc_in" }
%"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_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_in" = type { %"class.sc_core::sc_port", ptr, ptr, ptr, ptr }
%"class.sc_core::sc_port" = type { %"class.sc_core::sc_port_b" }
%"class.sc_core::sc_port_b" = type { %"class.sc_core::sc_port_base", ptr, %"class.std::vector.12" }
%"class.sc_core::sc_port_base" = type { %"class.sc_core::sc_object", ptr }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<sc_core::sc_signal_in_if<bool> *, std::allocator<sc_core::sc_signal_in_if<bool> *>>::_Vector_impl" }
%"struct.std::_Vector_base<sc_core::sc_signal_in_if<bool> *, std::allocator<sc_core::sc_signal_in_if<bool> *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sc_core::sc_signal_in_if<bool> *, std::allocator<sc_core::sc_signal_in_if<bool> *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sc_core::sc_signal_in_if<bool> *, std::allocator<sc_core::sc_signal_in_if<bool> *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.sc_core::sc_module_name" = type <{ ptr, ptr, ptr, ptr, i8, [7 x i8] }>

@.str = external hidden unnamed_addr constant [97 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = 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 %"class.sc_core::sc_signal", align 8
  %6 = alloca %"class.sc_core::sc_buffer", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.sc_core::sc_signal.8", align 8
  %10 = alloca %struct.print_edge, align 8
  %11 = alloca %"class.sc_core::sc_module_name", align 8
  %12 = alloca %struct.print_edge, align 8
  %13 = alloca %"class.sc_core::sc_module_name", align 8
  %14 = alloca i32, align 4
  %15 = alloca i8, align 1
  %16 = alloca i8, align 1
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  %17 = call noundef i32 @_ZN7sc_core17sc_report_handler11set_actionsEPKcj(ptr noundef @.str, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 200, ptr %5) #7
  call void @_ZN7sc_core9sc_signalIiLNS_16sc_writer_policyE0EEC1Ev(ptr noundef nonnull align 8 dereferenceable(196) %5)
  call void @llvm.lifetime.start.p0(i64 224, ptr %6) #7
  invoke void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EEC1Ev(ptr noundef nonnull align 8 dereferenceable(224) %6)
          to label %18 unwind label %32

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 224, ptr %9) #7
  invoke void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EEC1Ev(ptr noundef nonnull align 8 dereferenceable(224) %9)
          to label %19 unwind label %36

19:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 416, ptr %10) #7
  invoke void @_ZN7sc_core14sc_module_nameC1EPKc(ptr noundef nonnull align 8 dereferenceable(33) %11, ptr noundef @.str.2)
          to label %20 unwind label %40

20:                                               ; preds = %19
  invoke void @_ZN10print_edgeC2EN7sc_core14sc_module_nameE(ptr noundef nonnull align 8 dereferenceable(416) %10, ptr noundef %11)
          to label %21 unwind label %44

21:                                               ; preds = %20
  call void @_ZN7sc_core14sc_module_nameD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %11) #7
  %22 = getelementptr inbounds %struct.print_edge, ptr %10, i32 0, i32 1
  invoke void @_ZN7sc_core5sc_inIbEclERKNS_15sc_signal_in_ifIbEE(ptr noundef nonnull align 8 dereferenceable(184) %22, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %23 unwind label %48

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 416, ptr %12) #7
  invoke void @_ZN7sc_core14sc_module_nameC1EPKc(ptr noundef nonnull align 8 dereferenceable(33) %13, ptr noundef @.str.3)
          to label %24 unwind label %52

24:                                               ; preds = %23
  invoke void @_ZN10print_edgeC2EN7sc_core14sc_module_nameE(ptr noundef nonnull align 8 dereferenceable(416) %12, ptr noundef %13)
          to label %25 unwind label %56

25:                                               ; preds = %24
  call void @_ZN7sc_core14sc_module_nameD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %13) #7
  %26 = getelementptr inbounds %struct.print_edge, ptr %12, i32 0, i32 1
  invoke void @_ZN7sc_core5sc_inIbEclERKNS_15sc_signal_in_ifIbEE(ptr noundef nonnull align 8 dereferenceable(184) %26, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %27 unwind label %60

27:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %87, %27
  %29 = load i32, ptr %14, align 4, !tbaa !5
  %30 = icmp slt i32 %29, 4
  br i1 %30, label %64, label %31

31:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %103

32:                                               ; preds = %2
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %7, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %8, align 4
  br label %109

36:                                               ; preds = %18
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %7, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %8, align 4
  br label %108

40:                                               ; preds = %19
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %7, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %8, align 4
  br label %107

44:                                               ; preds = %20
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %7, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %8, align 4
  call void @_ZN7sc_core14sc_module_nameD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %11) #7
  br label %107

48:                                               ; preds = %21
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %7, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %8, align 4
  br label %106

52:                                               ; preds = %23
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %7, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %8, align 4
  br label %105

56:                                               ; preds = %24
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %7, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %8, align 4
  call void @_ZN7sc_core14sc_module_nameD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %13) #7
  br label %105

60:                                               ; preds = %25
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %7, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %8, align 4
  br label %104

64:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #7
  %65 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %6)
          to label %66 unwind label %90

66:                                               ; preds = %64
  %67 = load i8, ptr %65, align 1, !tbaa !11, !range !13, !noundef !14
  %68 = trunc i8 %67 to i1
  %69 = xor i1 %68, true
  %70 = zext i1 %69 to i8
  store i8 %70, ptr %15, align 1, !tbaa !11
  invoke void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %6, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %71 unwind label %90

71:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #7
  %72 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %9)
          to label %73 unwind label %94

73:                                               ; preds = %71
  %74 = load i8, ptr %72, align 1, !tbaa !11, !range !13, !noundef !14
  %75 = trunc i8 %74 to i1
  %76 = xor i1 %75, true
  %77 = zext i1 %76 to i8
  store i8 %77, ptr %16, align 1, !tbaa !11
  invoke void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %9, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %78 unwind label %94

78:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #7
  invoke void @_ZN7sc_core8sc_startEiNS_12sc_time_unitENS_20sc_starvation_policyE(i32 noundef 1, i32 noundef 2, i32 noundef 1)
          to label %79 unwind label %98

79:                                               ; preds = %78
  %80 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %6)
          to label %81 unwind label %98

81:                                               ; preds = %79
  invoke void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %6, ptr noundef nonnull align 1 dereferenceable(1) %80)
          to label %82 unwind label %98

82:                                               ; preds = %81
  %83 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %9)
          to label %84 unwind label %98

84:                                               ; preds = %82
  invoke void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %9, ptr noundef nonnull align 1 dereferenceable(1) %83)
          to label %85 unwind label %98

85:                                               ; preds = %84
  invoke void @_ZN7sc_core8sc_startEiNS_12sc_time_unitENS_20sc_starvation_policyE(i32 noundef 1, i32 noundef 2, i32 noundef 1)
          to label %86 unwind label %98

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %14, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %14, align 4, !tbaa !5
  br label %28, !llvm.loop !15

90:                                               ; preds = %66, %64
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %7, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  br label %102

94:                                               ; preds = %73, %71
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %7, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #7
  br label %102

98:                                               ; preds = %85, %84, %82, %81, %79, %78
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %7, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %8, align 4
  br label %102

102:                                              ; preds = %98, %94, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %104

103:                                              ; preds = %31
  call void @_ZN10print_edgeD2Ev(ptr noundef nonnull align 8 dereferenceable(416) %12) #7
  call void @llvm.lifetime.end.p0(i64 416, ptr %12) #7
  call void @_ZN10print_edgeD2Ev(ptr noundef nonnull align 8 dereferenceable(416) %10) #7
  call void @llvm.lifetime.end.p0(i64 416, ptr %10) #7
  call void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(224) %9) #7
  call void @llvm.lifetime.end.p0(i64 224, ptr %9) #7
  call void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(224) %6) #7
  call void @llvm.lifetime.end.p0(i64 224, ptr %6) #7
  call void @_ZN7sc_core9sc_signalIiLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(196) %5) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr %5) #7
  ret i32 0

104:                                              ; preds = %102, %60
  call void @_ZN10print_edgeD2Ev(ptr noundef nonnull align 8 dereferenceable(416) %12) #7
  br label %105

105:                                              ; preds = %104, %56, %52
  call void @llvm.lifetime.end.p0(i64 416, ptr %12) #7
  br label %106

106:                                              ; preds = %105, %48
  call void @_ZN10print_edgeD2Ev(ptr noundef nonnull align 8 dereferenceable(416) %10) #7
  br label %107

107:                                              ; preds = %106, %44, %40
  call void @llvm.lifetime.end.p0(i64 416, ptr %10) #7
  call void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(224) %9) #7
  br label %108

108:                                              ; preds = %107, %36
  call void @llvm.lifetime.end.p0(i64 224, ptr %9) #7
  call void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(224) %6) #7
  br label %109

109:                                              ; preds = %108, %32
  call void @llvm.lifetime.end.p0(i64 224, ptr %6) #7
  call void @_ZN7sc_core9sc_signalIiLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(196) %5) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr %5) #7
  br label %110

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

declare noundef i32 @_ZN7sc_core17sc_report_handler11set_actionsEPKcj(ptr noundef, i32 noundef) #1

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224)) unnamed_addr #5 align 2

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

declare void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7sc_core8sc_startEiNS_12sc_time_unitENS_20sc_starvation_policyE(i32 noundef, i32 noundef, i32 noundef) #4

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

; Function Attrs: nounwind
declare void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(224)) unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7sc_core9sc_signalIiLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(196)) unnamed_addr #5 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 = { "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 = { 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 #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!"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 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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

%"class.sc_core::sc_signal" = type <{ %"class.sc_core::sc_signal_inout_if", %"class.sc_core::sc_prim_channel", %"struct.sc_core::sc_writer_policy_check", ptr, i32, [4 x i8], i64, i32, [4 x i8] }>
%"class.sc_core::sc_signal_inout_if" = type { %"class.sc_core::sc_signal_in_if", %"class.sc_core::sc_signal_write_if" }
%"class.sc_core::sc_signal_in_if" = type { %"class.sc_core::sc_interface" }
%"class.sc_core::sc_interface" = type { ptr }
%"class.sc_core::sc_signal_write_if" = type { %"class.sc_core::sc_interface" }
%"class.sc_core::sc_prim_channel" = type { %"class.sc_core::sc_object", 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] }
%"struct.sc_core::sc_writer_policy_check" = type { %"struct.sc_core::sc_writer_policy_check_port", %"struct.sc_core::sc_writer_policy_check_write" }
%"struct.sc_core::sc_writer_policy_check_port" = type { ptr }
%"struct.sc_core::sc_writer_policy_check_write" = type { i8, ptr }
%"class.sc_core::sc_buffer" = type { %"class.sc_core::sc_signal.8" }
%"class.sc_core::sc_signal.8" = type { %"class.sc_core::sc_signal_inout_if.9", %"class.sc_core::sc_prim_channel", %"struct.sc_core::sc_writer_policy_check", ptr, i8, i64, ptr, i8, ptr, ptr }
%"class.sc_core::sc_signal_inout_if.9" = type { %"class.sc_core::sc_signal_in_if.10", %"class.sc_core::sc_signal_write_if.11" }
%"class.sc_core::sc_signal_in_if.10" = type { %"class.sc_core::sc_interface" }
%"class.sc_core::sc_signal_write_if.11" = type { %"class.sc_core::sc_interface" }
%struct.print_edge = type { %"class.sc_core::sc_module", %"class.sc_core::sc_in" }
%"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_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_in" = type { %"class.sc_core::sc_port", ptr, ptr, ptr, ptr }
%"class.sc_core::sc_port" = type { %"class.sc_core::sc_port_b" }
%"class.sc_core::sc_port_b" = type { %"class.sc_core::sc_port_base", ptr, %"class.std::vector.12" }
%"class.sc_core::sc_port_base" = type { %"class.sc_core::sc_object", ptr }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<sc_core::sc_signal_in_if<bool> *, std::allocator<sc_core::sc_signal_in_if<bool> *>>::_Vector_impl" }
%"struct.std::_Vector_base<sc_core::sc_signal_in_if<bool> *, std::allocator<sc_core::sc_signal_in_if<bool> *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sc_core::sc_signal_in_if<bool> *, std::allocator<sc_core::sc_signal_in_if<bool> *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sc_core::sc_signal_in_if<bool> *, std::allocator<sc_core::sc_signal_in_if<bool> *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.sc_core::sc_module_name" = type <{ ptr, ptr, ptr, ptr, i8, [7 x i8] }>

@.str = external hidden unnamed_addr constant [97 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = 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 %"class.sc_core::sc_signal", align 8
  %4 = alloca %"class.sc_core::sc_buffer", align 8
  %5 = alloca %"class.sc_core::sc_signal.8", align 8
  %6 = alloca %struct.print_edge, align 8
  %7 = alloca %"class.sc_core::sc_module_name", align 8
  %8 = alloca %struct.print_edge, align 8
  %9 = alloca %"class.sc_core::sc_module_name", align 8
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = tail call noundef i32 @_ZN7sc_core17sc_report_handler11set_actionsEPKcj(ptr noundef nonnull @.str, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %3) #7
  call void @_ZN7sc_core9sc_signalIiLNS_16sc_writer_policyE0EEC1Ev(ptr noundef nonnull align 8 dereferenceable(196) %3)
  call void @llvm.lifetime.start.p0(i64 224, ptr nonnull %4) #7
  invoke void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EEC1Ev(ptr noundef nonnull align 8 dereferenceable(224) %4)
          to label %13 unwind label %25

13:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 224, ptr nonnull %5) #7
  invoke void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EEC1Ev(ptr noundef nonnull align 8 dereferenceable(224) %5)
          to label %14 unwind label %27

14:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 416, ptr nonnull %6) #7
  invoke void @_ZN7sc_core14sc_module_nameC1EPKc(ptr noundef nonnull align 8 dereferenceable(33) %7, ptr noundef nonnull @.str.2)
          to label %15 unwind label %29

15:                                               ; preds = %14
  invoke void @_ZN10print_edgeC2EN7sc_core14sc_module_nameE(ptr noundef nonnull align 8 dereferenceable(416) %6, ptr noundef nonnull %7)
          to label %16 unwind label %31

16:                                               ; preds = %15
  call void @_ZN7sc_core14sc_module_nameD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %7) #7
  %17 = getelementptr inbounds i8, ptr %6, i64 232
  invoke void @_ZN7sc_core5sc_inIbEclERKNS_15sc_signal_in_ifIbEE(ptr noundef nonnull align 8 dereferenceable(184) %17, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %18 unwind label %33

18:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 416, ptr nonnull %8) #7
  invoke void @_ZN7sc_core14sc_module_nameC1EPKc(ptr noundef nonnull align 8 dereferenceable(33) %9, ptr noundef nonnull @.str.3)
          to label %19 unwind label %35

19:                                               ; preds = %18
  invoke void @_ZN10print_edgeC2EN7sc_core14sc_module_nameE(ptr noundef nonnull align 8 dereferenceable(416) %8, ptr noundef nonnull %9)
          to label %20 unwind label %37

20:                                               ; preds = %19
  call void @_ZN7sc_core14sc_module_nameD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %9) #7
  %21 = getelementptr inbounds i8, ptr %8, i64 232
  invoke void @_ZN7sc_core5sc_inIbEclERKNS_15sc_signal_in_ifIbEE(ptr noundef nonnull align 8 dereferenceable(184) %21, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %.preheader.preheader unwind label %39

.preheader.preheader:                             ; preds = %20
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #7
  %22 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %4)
  %23 = load i8, ptr %22, align 1, !tbaa !5, !range !9, !noundef !10
  %24 = xor i8 %23, 1
  store i8 %24, ptr %10, align 1, !tbaa !5
  invoke void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %4, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %41 unwind label %91

25:                                               ; preds = %2
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %102

27:                                               ; preds = %13
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %101

29:                                               ; preds = %14
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %100

31:                                               ; preds = %15
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7sc_core14sc_module_nameD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %7) #7
  br label %100

33:                                               ; preds = %16
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %99

35:                                               ; preds = %18
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %98

37:                                               ; preds = %19
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7sc_core14sc_module_nameD1Ev(ptr noundef nonnull align 8 dereferenceable(33) %9) #7
  br label %98

39:                                               ; preds = %20
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %97

41:                                               ; preds = %.preheader.preheader
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #7
  %42 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %5)
  %43 = load i8, ptr %42, align 1, !tbaa !5, !range !9, !noundef !10
  %44 = xor i8 %43, 1
  store i8 %44, ptr %11, align 1, !tbaa !5
  invoke void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %5, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %45 unwind label %93

45:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #7
  invoke void @_ZN7sc_core8sc_startEiNS_12sc_time_unitENS_20sc_starvation_policyE(i32 noundef 1, i32 noundef 2, i32 noundef 1)
          to label %46 unwind label %95

46:                                               ; preds = %45
  %47 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %4)
  invoke void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %4, ptr noundef nonnull align 1 dereferenceable(1) %47)
          to label %48 unwind label %95

48:                                               ; preds = %46
  %49 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %5)
  invoke void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %5, ptr noundef nonnull align 1 dereferenceable(1) %49)
          to label %50 unwind label %95

50:                                               ; preds = %48
  invoke void @_ZN7sc_core8sc_startEiNS_12sc_time_unitENS_20sc_starvation_policyE(i32 noundef 1, i32 noundef 2, i32 noundef 1)
          to label %.preheader.1 unwind label %95

.preheader.1:                                     ; preds = %50
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #7
  %51 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %4)
  %52 = load i8, ptr %51, align 1, !tbaa !5, !range !9, !noundef !10
  %53 = xor i8 %52, 1
  store i8 %53, ptr %10, align 1, !tbaa !5
  invoke void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %4, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %54 unwind label %91

54:                                               ; preds = %.preheader.1
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #7
  %55 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %5)
  %56 = load i8, ptr %55, align 1, !tbaa !5, !range !9, !noundef !10
  %57 = xor i8 %56, 1
  store i8 %57, ptr %11, align 1, !tbaa !5
  invoke void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %5, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %58 unwind label %93

58:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #7
  invoke void @_ZN7sc_core8sc_startEiNS_12sc_time_unitENS_20sc_starvation_policyE(i32 noundef 1, i32 noundef 2, i32 noundef 1)
          to label %59 unwind label %95

59:                                               ; preds = %58
  %60 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %4)
  invoke void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %4, ptr noundef nonnull align 1 dereferenceable(1) %60)
          to label %61 unwind label %95

61:                                               ; preds = %59
  %62 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %5)
  invoke void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %5, ptr noundef nonnull align 1 dereferenceable(1) %62)
          to label %63 unwind label %95

63:                                               ; preds = %61
  invoke void @_ZN7sc_core8sc_startEiNS_12sc_time_unitENS_20sc_starvation_policyE(i32 noundef 1, i32 noundef 2, i32 noundef 1)
          to label %.preheader.2 unwind label %95

.preheader.2:                                     ; preds = %63
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #7
  %64 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %4)
  %65 = load i8, ptr %64, align 1, !tbaa !5, !range !9, !noundef !10
  %66 = xor i8 %65, 1
  store i8 %66, ptr %10, align 1, !tbaa !5
  invoke void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %4, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %67 unwind label %91

67:                                               ; preds = %.preheader.2
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #7
  %68 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %5)
  %69 = load i8, ptr %68, align 1, !tbaa !5, !range !9, !noundef !10
  %70 = xor i8 %69, 1
  store i8 %70, ptr %11, align 1, !tbaa !5
  invoke void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %5, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %71 unwind label %93

71:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #7
  invoke void @_ZN7sc_core8sc_startEiNS_12sc_time_unitENS_20sc_starvation_policyE(i32 noundef 1, i32 noundef 2, i32 noundef 1)
          to label %72 unwind label %95

72:                                               ; preds = %71
  %73 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %4)
  invoke void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %4, ptr noundef nonnull align 1 dereferenceable(1) %73)
          to label %74 unwind label %95

74:                                               ; preds = %72
  %75 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %5)
  invoke void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %5, ptr noundef nonnull align 1 dereferenceable(1) %75)
          to label %76 unwind label %95

76:                                               ; preds = %74
  invoke void @_ZN7sc_core8sc_startEiNS_12sc_time_unitENS_20sc_starvation_policyE(i32 noundef 1, i32 noundef 2, i32 noundef 1)
          to label %.preheader.3 unwind label %95

.preheader.3:                                     ; preds = %76
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #7
  %77 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %4)
  %78 = load i8, ptr %77, align 1, !tbaa !5, !range !9, !noundef !10
  %79 = xor i8 %78, 1
  store i8 %79, ptr %10, align 1, !tbaa !5
  invoke void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %4, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %80 unwind label %91

80:                                               ; preds = %.preheader.3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #7
  %81 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %5)
  %82 = load i8, ptr %81, align 1, !tbaa !5, !range !9, !noundef !10
  %83 = xor i8 %82, 1
  store i8 %83, ptr %11, align 1, !tbaa !5
  invoke void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %5, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %84 unwind label %93

84:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #7
  invoke void @_ZN7sc_core8sc_startEiNS_12sc_time_unitENS_20sc_starvation_policyE(i32 noundef 1, i32 noundef 2, i32 noundef 1)
          to label %85 unwind label %95

85:                                               ; preds = %84
  %86 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %4)
  invoke void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %4, ptr noundef nonnull align 1 dereferenceable(1) %86)
          to label %87 unwind label %95

87:                                               ; preds = %85
  %88 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224) %5)
  invoke void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224) %5, ptr noundef nonnull align 1 dereferenceable(1) %88)
          to label %89 unwind label %95

89:                                               ; preds = %87
  invoke void @_ZN7sc_core8sc_startEiNS_12sc_time_unitENS_20sc_starvation_policyE(i32 noundef 1, i32 noundef 2, i32 noundef 1)
          to label %90 unwind label %95

90:                                               ; preds = %89
  call void @_ZN10print_edgeD2Ev(ptr noundef nonnull align 8 dereferenceable(416) %8) #7
  call void @llvm.lifetime.end.p0(i64 416, ptr nonnull %8) #7
  call void @_ZN10print_edgeD2Ev(ptr noundef nonnull align 8 dereferenceable(416) %6) #7
  call void @llvm.lifetime.end.p0(i64 416, ptr nonnull %6) #7
  call void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(224) %5) #7
  call void @llvm.lifetime.end.p0(i64 224, ptr nonnull %5) #7
  call void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(224) %4) #7
  call void @llvm.lifetime.end.p0(i64 224, ptr nonnull %4) #7
  call void @_ZN7sc_core9sc_signalIiLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(196) %3) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %3) #7
  ret i32 0

91:                                               ; preds = %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  %92 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  br label %97

93:                                               ; preds = %80, %67, %54, %41
  %94 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #7
  br label %97

95:                                               ; preds = %89, %87, %85, %84, %76, %74, %72, %71, %63, %61, %59, %58, %50, %48, %46, %45
  %96 = landingpad { ptr, i32 }
          cleanup
  br label %97

97:                                               ; preds = %91, %93, %95, %39
  %.pn.pn = phi { ptr, i32 } [ %40, %39 ], [ %96, %95 ], [ %94, %93 ], [ %92, %91 ]
  call void @_ZN10print_edgeD2Ev(ptr noundef nonnull align 8 dereferenceable(416) %8) #7
  br label %98

98:                                               ; preds = %97, %37, %35
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %97 ], [ %38, %37 ], [ %36, %35 ]
  call void @llvm.lifetime.end.p0(i64 416, ptr nonnull %8) #7
  br label %99

99:                                               ; preds = %98, %33
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %98 ], [ %34, %33 ]
  call void @_ZN10print_edgeD2Ev(ptr noundef nonnull align 8 dereferenceable(416) %6) #7
  br label %100

100:                                              ; preds = %99, %31, %29
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %99 ], [ %32, %31 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 416, ptr nonnull %6) #7
  call void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(224) %5) #7
  br label %101

101:                                              ; preds = %100, %27
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn, %100 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 224, ptr nonnull %5) #7
  call void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(224) %4) #7
  br label %102

102:                                              ; preds = %101, %25
  %.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn, %101 ], [ %26, %25 ]
  call void @llvm.lifetime.end.p0(i64 224, ptr nonnull %4) #7
  call void @_ZN7sc_core9sc_signalIiLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(196) %3) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn.pn
}

declare noundef i32 @_ZN7sc_core17sc_report_handler11set_actionsEPKcj(ptr noundef, i32 noundef) local_unnamed_addr #1

; 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 uwtable
declare dso_local void @_ZN7sc_core9sc_signalIiLNS_16sc_writer_policyE0EEC1Ev(ptr noundef nonnull align 8 dereferenceable(196)) unnamed_addr #0 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7sc_core9sc_bufferIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNK7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE4readEv(ptr noundef nonnull align 8 dereferenceable(224)) unnamed_addr #5 align 2

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

declare void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EE5writeERKb(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7sc_core8sc_startEiNS_12sc_time_unitENS_20sc_starvation_policyE(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind
declare void @_ZN7sc_core9sc_signalIbLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(224)) unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7sc_core9sc_signalIiLNS_16sc_writer_policyE0EED1Ev(ptr noundef nonnull align 8 dereferenceable(196)) unnamed_addr #5 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 = { "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 = { 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 #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass