; LLVM IR from gem5/gem5 :: ext/systemc/src/sysc/datatypes/fx/scfx_rep.ll (ZN5sc_dt8scfx_repC2ERKNS_9sc_signedE)

; 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_dt::sc_signed" = type { %"class.sc_dt::sc_value_base", i32, i32, i32, ptr }
%"class.sc_dt::sc_value_base" = type { ptr }
%"class.sc_dt::scfx_index" = type { i32, i32 }
%"class.sc_dt::scfx_rep" = type <{ %"class.sc_dt::scfx_mant", i32, i32, i32, i32, i32, i8, [3 x i8] }>
%"class.sc_dt::scfx_mant" = type <{ ptr, i32, [4 x i8] }>

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt9scfx_mantC2Em(ptr noundef nonnull align 8 dereferenceable(12), i64 noundef) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt8scfx_rep8set_zeroEi(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef) #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5sc_dt9scfx_mantD2Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt9scfx_mant5clearEv(ptr noundef nonnull align 8 dereferenceable(12)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5sc_dt9scfx_mantixEi(ptr noundef nonnull align 8 dereferenceable(12), i32 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt8scfx_rep7find_swEv(ptr noundef nonnull align 8 dereferenceable(37)) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5sc_dt8scfx_repC2ERKNS_9sc_signedE(ptr noundef nonnull align 8 dereferenceable(37) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.sc_dt::sc_signed", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.sc_dt::scfx_index", align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.sc_dt::scfx_index", align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8
  %14 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i32 0, i32 0
  call void @_ZN5sc_dt9scfx_mantC2Em(ptr noundef nonnull align 8 dereferenceable(12) %14, i64 noundef 4)
  %15 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i32 0, i32 1
  store i32 0, ptr %15, align 8, !tbaa !9
  %16 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i32 0, i32 2
  store i32 0, ptr %16, align 4, !tbaa !15
  %17 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i32 0, i32 3
  store i32 0, ptr %17, align 8, !tbaa !16
  %18 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i32 0, i32 4
  store i32 0, ptr %18, align 4, !tbaa !17
  %19 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i32 0, i32 5
  store i32 0, ptr %19, align 8, !tbaa !18
  %20 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i32 0, i32 6
  store i8 0, ptr %20, align 4, !tbaa !19
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = invoke noundef zeroext i1 @_ZNK5sc_dt9sc_signed6iszeroEv(ptr noundef nonnull align 8 dereferenceable(32) %21)
          to label %23 unwind label %26

23:                                               ; preds = %2
  br i1 %22, label %24, label %30

24:                                               ; preds = %23
  invoke void @_ZN5sc_dt8scfx_rep8set_zeroEi(ptr noundef nonnull align 8 dereferenceable(37) %13, i32 noundef 1)
          to label %25 unwind label %26

25:                                               ; preds = %24
  br label %153

26:                                               ; preds = %24, %2
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %5, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %6, align 4
  br label %154

30:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = invoke noundef i32 @_ZNK5sc_dt9sc_signed6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %31)
          to label %33 unwind label %43

33:                                               ; preds = %30
  %34 = invoke noundef i32 @_ZN5sc_dtL6n_wordEi(i32 noundef %32)
          to label %35 unwind label %43

35:                                               ; preds = %33
  store i32 %34, ptr %7, align 4, !tbaa !20
  %36 = load i32, ptr %7, align 4, !tbaa !20
  %37 = invoke noundef i32 @_ZNK5sc_dt8scfx_rep4sizeEv(ptr noundef nonnull align 8 dereferenceable(37) %13)
          to label %38 unwind label %43

38:                                               ; preds = %35
  %39 = icmp sgt i32 %36, %37
  br i1 %39, label %40, label %47

40:                                               ; preds = %38
  %41 = load i32, ptr %7, align 4, !tbaa !20
  invoke void @_ZN5sc_dt8scfx_rep9resize_toEii(ptr noundef nonnull align 8 dereferenceable(37) %13, i32 noundef %41, i32 noundef 0)
          to label %42 unwind label %43

42:                                               ; preds = %40
  br label %47

43:                                               ; preds = %150, %49, %47, %40, %35, %33, %30
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %5, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %6, align 4
  br label %152

47:                                               ; preds = %42, %38
  %48 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i32 0, i32 0
  invoke void @_ZN5sc_dt9scfx_mant5clearEv(ptr noundef nonnull align 8 dereferenceable(12) %48)
          to label %49 unwind label %43

49:                                               ; preds = %47
  %50 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i32 0, i32 1
  store i32 0, ptr %50, align 8, !tbaa !9
  %51 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i32 0, i32 3
  store i32 0, ptr %51, align 8, !tbaa !16
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = invoke noundef zeroext i1 @_ZNK5sc_dt9sc_signed4signEv(ptr noundef nonnull align 8 dereferenceable(32) %52)
          to label %54 unwind label %43

54:                                               ; preds = %49
  br i1 %53, label %55, label %105

55:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #6
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN5sc_dtngERKNS_9sc_signedE(ptr dead_on_unwind writable sret(%"class.sc_dt::sc_signed") align 8 %8, ptr noundef nonnull align 8 dereferenceable(32) %56)
          to label %57 unwind label %64

57:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !20
  br label %58

58:                                               ; preds = %98, %57
  %59 = load i32, ptr %9, align 4, !tbaa !20
  %60 = invoke noundef i32 @_ZNK5sc_dt9sc_signed6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %61 unwind label %68

61:                                               ; preds = %58
  %62 = icmp slt i32 %59, %60
  br i1 %62, label %72, label %63

63:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %102

64:                                               ; preds = %55
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %5, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %6, align 4
  br label %104

68:                                               ; preds = %75, %72, %58
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %5, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %6, align 4
  br label %101

72:                                               ; preds = %61
  %73 = load i32, ptr %9, align 4, !tbaa !20
  %74 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5sc_dt9sc_signedixEi(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %73)
          to label %75 unwind label %68

75:                                               ; preds = %72
  %76 = invoke noundef i64 @_ZNK5sc_dt18sc_signed_bitref_rcvyEv(ptr noundef nonnull align 8 dereferenceable(24) %74)
          to label %77 unwind label %68

77:                                               ; preds = %75
  %78 = icmp ne i64 %76, 0
  br i1 %78, label %79, label %97

79:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %80 = load i32, ptr %9, align 4, !tbaa !20
  %81 = invoke i64 @_ZNK5sc_dt8scfx_rep12calc_indicesEi(ptr noundef nonnull align 8 dereferenceable(37) %13, i32 noundef %80)
          to label %82 unwind label %93

82:                                               ; preds = %79
  store i64 %81, ptr %10, align 4
  %83 = invoke noundef i32 @_ZNK5sc_dt10scfx_index2biEv(ptr noundef nonnull align 4 dereferenceable(8) %10)
          to label %84 unwind label %93

84:                                               ; preds = %82
  %85 = shl i32 1, %83
  %86 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i32 0, i32 0
  %87 = invoke noundef i32 @_ZNK5sc_dt10scfx_index2wiEv(ptr noundef nonnull align 4 dereferenceable(8) %10)
          to label %88 unwind label %93

88:                                               ; preds = %84
  %89 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN5sc_dt9scfx_mantixEi(ptr noundef nonnull align 8 dereferenceable(12) %86, i32 noundef %87)
          to label %90 unwind label %93

90:                                               ; preds = %88
  %91 = load i32, ptr %89, align 4, !tbaa !20
  %92 = or i32 %91, %85
  store i32 %92, ptr %89, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %97

93:                                               ; preds = %88, %84, %82, %79
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %5, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %101

97:                                               ; preds = %90, %77
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %9, align 4, !tbaa !20
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %9, align 4, !tbaa !20
  br label %58, !llvm.loop !21

101:                                              ; preds = %93, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @_ZN5sc_dt9sc_signedD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  br label %104

102:                                              ; preds = %63
  %103 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i32 0, i32 2
  store i32 -1, ptr %103, align 4, !tbaa !15
  call void @_ZN5sc_dt9sc_signedD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  br label %150

104:                                              ; preds = %101, %64
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  br label %152

105:                                              ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !20
  br label %106

106:                                              ; preds = %144, %105
  %107 = load i32, ptr %11, align 4, !tbaa !20
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = invoke noundef i32 @_ZNK5sc_dt9sc_signed6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %108)
          to label %110 unwind label %113

110:                                              ; preds = %106
  %111 = icmp slt i32 %107, %109
  br i1 %111, label %117, label %112

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

113:                                              ; preds = %121, %117, %106
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %5, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %6, align 4
  br label %147

117:                                              ; preds = %110
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = load i32, ptr %11, align 4, !tbaa !20
  %120 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5sc_dt9sc_signedixEi(ptr noundef nonnull align 8 dereferenceable(32) %118, i32 noundef %119)
          to label %121 unwind label %113

121:                                              ; preds = %117
  %122 = invoke noundef i64 @_ZNK5sc_dt18sc_signed_bitref_rcvyEv(ptr noundef nonnull align 8 dereferenceable(24) %120)
          to label %123 unwind label %113

123:                                              ; preds = %121
  %124 = icmp ne i64 %122, 0
  br i1 %124, label %125, label %143

125:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %126 = load i32, ptr %11, align 4, !tbaa !20
  %127 = invoke i64 @_ZNK5sc_dt8scfx_rep12calc_indicesEi(ptr noundef nonnull align 8 dereferenceable(37) %13, i32 noundef %126)
          to label %128 unwind label %139

128:                                              ; preds = %125
  store i64 %127, ptr %12, align 4
  %129 = invoke noundef i32 @_ZNK5sc_dt10scfx_index2biEv(ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %130 unwind label %139

130:                                              ; preds = %128
  %131 = shl i32 1, %129
  %132 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i32 0, i32 0
  %133 = invoke noundef i32 @_ZNK5sc_dt10scfx_index2wiEv(ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %134 unwind label %139

134:                                              ; preds = %130
  %135 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN5sc_dt9scfx_mantixEi(ptr noundef nonnull align 8 dereferenceable(12) %132, i32 noundef %133)
          to label %136 unwind label %139

136:                                              ; preds = %134
  %137 = load i32, ptr %135, align 4, !tbaa !20
  %138 = or i32 %137, %131
  store i32 %138, ptr %135, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %143

139:                                              ; preds = %134, %130, %128, %125
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %5, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %147

143:                                              ; preds = %136, %123
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %11, align 4, !tbaa !20
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %11, align 4, !tbaa !20
  br label %106, !llvm.loop !23

147:                                              ; preds = %139, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %152

148:                                              ; preds = %112
  %149 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %13, i32 0, i32 2
  store i32 1, ptr %149, align 4, !tbaa !15
  br label %150

150:                                              ; preds = %148, %102
  invoke void @_ZN5sc_dt8scfx_rep7find_swEv(ptr noundef nonnull align 8 dereferenceable(37) %13)
          to label %151 unwind label %43

151:                                              ; preds = %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %153

152:                                              ; preds = %147, %104, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %154

153:                                              ; preds = %151, %25
  ret void

154:                                              ; preds = %152, %26
  call void @_ZN5sc_dt9scfx_mantD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %14) #6
  br label %155

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

declare noundef zeroext i1 @_ZNK5sc_dt9sc_signed6iszeroEv(ptr noundef nonnull align 8 dereferenceable(32)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN5sc_dtL6n_wordEi(i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5sc_dt9sc_signed6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK5sc_dt8scfx_rep4sizeEv(ptr noundef nonnull align 8 dereferenceable(37)) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt8scfx_rep9resize_toEii(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef, i32 noundef) #0 align 2

declare noundef zeroext i1 @_ZNK5sc_dt9sc_signed4signEv(ptr noundef nonnull align 8 dereferenceable(32)) #4

declare void @_ZN5sc_dtngERKNS_9sc_signedE(ptr dead_on_unwind writable sret(%"class.sc_dt::sc_signed") align 8, ptr noundef nonnull align 8 dereferenceable(32)) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5sc_dt9sc_signedixEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #3 align 2

declare noundef i64 @_ZNK5sc_dt18sc_signed_bitref_rcvyEv(ptr noundef nonnull align 8 dereferenceable(24)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i64 @_ZNK5sc_dt8scfx_rep12calc_indicesEi(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5sc_dt10scfx_index2biEv(ptr noundef nonnull align 4 dereferenceable(8)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5sc_dt10scfx_index2wiEv(ptr noundef nonnull align 4 dereferenceable(8)) #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5sc_dt9sc_signedixEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #3 align 2

attributes #0 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 16}
!10 = !{!"_ZTSN5sc_dt8scfx_repE", !11, i64 0, !12, i64 16, !12, i64 20, !13, i64 24, !12, i64 28, !12, i64 32, !14, i64 36}
!11 = !{!"_ZTSN5sc_dt9scfx_mantE", !6, i64 0, !12, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTSN5sc_dt8scfx_rep5stateE", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!10, !12, i64 20}
!16 = !{!10, !13, i64 24}
!17 = !{!10, !12, i64 28}
!18 = !{!10, !12, i64 32}
!19 = !{!10, !14, i64 36}
!20 = !{!12, !12, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


; 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_dt::sc_signed" = type { %"class.sc_dt::sc_value_base", i32, i32, i32, ptr }
%"class.sc_dt::sc_value_base" = type { ptr }
%"class.sc_dt::scfx_index" = type { i32, i32 }

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt9scfx_mantC2Em(ptr noundef nonnull align 8 dereferenceable(12), i64 noundef) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt8scfx_rep8set_zeroEi(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5sc_dt9scfx_mantD2Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt9scfx_mant5clearEv(ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5sc_dt9scfx_mantixEi(ptr noundef nonnull align 8 dereferenceable(12), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt8scfx_rep7find_swEv(ptr noundef nonnull align 8 dereferenceable(37)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5sc_dt8scfx_repC2ERKNS_9sc_signedE(ptr noundef nonnull align 8 dereferenceable(37) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.sc_dt::sc_signed", align 8
  %4 = alloca %"class.sc_dt::scfx_index", align 8
  %5 = alloca %"class.sc_dt::scfx_index", align 8
  tail call void @_ZN5sc_dt9scfx_mantC2Em(ptr noundef nonnull align 8 dereferenceable(12) %0, i64 noundef 4)
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = getelementptr inbounds i8, ptr %0, i64 20
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(21) %6, i8 0, i64 21, i1 false)
  %9 = invoke noundef zeroext i1 @_ZNK5sc_dt9sc_signed6iszeroEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %10 unwind label %12

10:                                               ; preds = %2
  br i1 %9, label %11, label %14

11:                                               ; preds = %10
  invoke void @_ZN5sc_dt8scfx_rep8set_zeroEi(ptr noundef nonnull align 8 dereferenceable(37) %0, i32 noundef 1)
          to label %79 unwind label %12

12:                                               ; preds = %11, %2
  %13 = landingpad { ptr, i32 }
          cleanup
  br label %80

14:                                               ; preds = %10
  %15 = tail call noundef i32 @_ZNK5sc_dt9sc_signed6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %16 = tail call noundef i32 @_ZN5sc_dtL6n_wordEi(i32 noundef %15)
  %17 = invoke noundef i32 @_ZNK5sc_dt8scfx_rep4sizeEv(ptr noundef nonnull align 8 dereferenceable(37) %0)
          to label %18 unwind label %21

18:                                               ; preds = %14
  %19 = icmp sgt i32 %16, %17
  br i1 %19, label %20, label %23

20:                                               ; preds = %18
  invoke void @_ZN5sc_dt8scfx_rep9resize_toEii(ptr noundef nonnull align 8 dereferenceable(37) %0, i32 noundef %16, i32 noundef 0)
          to label %23 unwind label %21

21:                                               ; preds = %78, %24, %23, %20, %14
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %80

23:                                               ; preds = %20, %18
  invoke void @_ZN5sc_dt9scfx_mant5clearEv(ptr noundef nonnull align 8 dereferenceable(12) %0)
          to label %24 unwind label %21

24:                                               ; preds = %23
  store i32 0, ptr %6, align 8, !tbaa !5
  store i32 0, ptr %8, align 8, !tbaa !14
  %25 = invoke noundef zeroext i1 @_ZNK5sc_dt9sc_signed4signEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %26 unwind label %21

26:                                               ; preds = %24
  br i1 %25, label %29, label %.preheader34

.preheader34:                                     ; preds = %26
  %27 = tail call noundef i32 @_ZNK5sc_dt9sc_signed6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph, label %._crit_edge

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  invoke void @_ZN5sc_dtngERKNS_9sc_signedE(ptr dead_on_unwind nonnull writable sret(%"class.sc_dt::sc_signed") align 8 %3, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %.preheader unwind label %32

.preheader:                                       ; preds = %29
  %30 = call noundef i32 @_ZNK5sc_dt9sc_signed6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph37, label %._crit_edge38

._crit_edge38:                                    ; preds = %51, %.preheader
  store i32 -1, ptr %7, align 4, !tbaa !15
  call void @_ZN5sc_dt9sc_signedD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  br label %78

32:                                               ; preds = %29
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %56

34:                                               ; preds = %37, %.lr.ph37
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %55

.lr.ph37:                                         ; preds = %.preheader, %51
  %.01836 = phi i32 [ %52, %51 ], [ 0, %.preheader ]
  %36 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5sc_dt9sc_signedixEi(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %.01836)
          to label %37 unwind label %34

37:                                               ; preds = %.lr.ph37
  %38 = invoke noundef i64 @_ZNK5sc_dt18sc_signed_bitref_rcvyEv(ptr noundef nonnull align 8 dereferenceable(24) %36)
          to label %39 unwind label %34

39:                                               ; preds = %37
  %.not27 = icmp eq i64 %38, 0
  br i1 %.not27, label %51, label %40

40:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %41 = invoke i64 @_ZNK5sc_dt8scfx_rep12calc_indicesEi(ptr noundef nonnull align 8 dereferenceable(37) %0, i32 noundef %.01836)
          to label %42 unwind label %49

42:                                               ; preds = %40
  store i64 %41, ptr %4, align 8
  %43 = call noundef i32 @_ZNK5sc_dt10scfx_index2biEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  %44 = shl nuw i32 1, %43
  %45 = call noundef i32 @_ZNK5sc_dt10scfx_index2wiEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5sc_dt9scfx_mantixEi(ptr noundef nonnull align 8 dereferenceable(12) %0, i32 noundef %45)
  %47 = load i32, ptr %46, align 4, !tbaa !16
  %48 = or i32 %47, %44
  store i32 %48, ptr %46, align 4, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %51

49:                                               ; preds = %40
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %55

51:                                               ; preds = %39, %42
  %52 = add nuw nsw i32 %.01836, 1
  %53 = call noundef i32 @_ZNK5sc_dt9sc_signed6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %.lr.ph37, label %._crit_edge38, !llvm.loop !17

55:                                               ; preds = %49, %34
  %.pn28 = phi { ptr, i32 } [ %50, %49 ], [ %35, %34 ]
  call void @_ZN5sc_dt9sc_signedD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  br label %56

56:                                               ; preds = %55, %32
  %.pn28.pn = phi { ptr, i32 } [ %.pn28, %55 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  br label %80

._crit_edge:                                      ; preds = %74, %.preheader34
  store i32 1, ptr %7, align 4, !tbaa !15
  br label %78

57:                                               ; preds = %60, %.lr.ph
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %80

.lr.ph:                                           ; preds = %.preheader34, %74
  %.035 = phi i32 [ %75, %74 ], [ 0, %.preheader34 ]
  %59 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5sc_dt9sc_signedixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.035)
          to label %60 unwind label %57

60:                                               ; preds = %.lr.ph
  %61 = invoke noundef i64 @_ZNK5sc_dt18sc_signed_bitref_rcvyEv(ptr noundef nonnull align 8 dereferenceable(24) %59)
          to label %62 unwind label %57

62:                                               ; preds = %60
  %.not = icmp eq i64 %61, 0
  br i1 %.not, label %74, label %63

63:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %64 = invoke i64 @_ZNK5sc_dt8scfx_rep12calc_indicesEi(ptr noundef nonnull align 8 dereferenceable(37) %0, i32 noundef %.035)
          to label %65 unwind label %72

65:                                               ; preds = %63
  store i64 %64, ptr %5, align 8
  %66 = call noundef i32 @_ZNK5sc_dt10scfx_index2biEv(ptr noundef nonnull align 4 dereferenceable(8) %5)
  %67 = shl nuw i32 1, %66
  %68 = call noundef i32 @_ZNK5sc_dt10scfx_index2wiEv(ptr noundef nonnull align 4 dereferenceable(8) %5)
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5sc_dt9scfx_mantixEi(ptr noundef nonnull align 8 dereferenceable(12) %0, i32 noundef %68)
  %70 = load i32, ptr %69, align 4, !tbaa !16
  %71 = or i32 %70, %67
  store i32 %71, ptr %69, align 4, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %74

72:                                               ; preds = %63
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %80

74:                                               ; preds = %62, %65
  %75 = add nuw nsw i32 %.035, 1
  %76 = call noundef i32 @_ZNK5sc_dt9sc_signed6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %.lr.ph, label %._crit_edge, !llvm.loop !19

78:                                               ; preds = %._crit_edge, %._crit_edge38
  invoke void @_ZN5sc_dt8scfx_rep7find_swEv(ptr noundef nonnull align 8 dereferenceable(37) %0)
          to label %79 unwind label %21

79:                                               ; preds = %78, %11
  ret void

80:                                               ; preds = %21, %56, %72, %57, %12
  %.pn32 = phi { ptr, i32 } [ %13, %12 ], [ %.pn28.pn, %56 ], [ %22, %21 ], [ %73, %72 ], [ %58, %57 ]
  call void @_ZN5sc_dt9scfx_mantD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %0) #7
  resume { ptr, i32 } %.pn32
}

declare noundef zeroext i1 @_ZNK5sc_dt9sc_signed6iszeroEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN5sc_dtL6n_wordEi(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5sc_dt9sc_signed6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK5sc_dt8scfx_rep4sizeEv(ptr noundef nonnull align 8 dereferenceable(37)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt8scfx_rep9resize_toEii(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

declare noundef zeroext i1 @_ZNK5sc_dt9sc_signed4signEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

declare void @_ZN5sc_dtngERKNS_9sc_signedE(ptr dead_on_unwind writable sret(%"class.sc_dt::sc_signed") align 8, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5sc_dt9sc_signedixEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #3 align 2

declare noundef i64 @_ZNK5sc_dt18sc_signed_bitref_rcvyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i64 @_ZNK5sc_dt8scfx_rep12calc_indicesEi(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5sc_dt10scfx_index2biEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5sc_dt10scfx_index2wiEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5sc_dt9sc_signedixEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

attributes #0 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !11, i64 16}
!6 = !{!"_ZTSN5sc_dt8scfx_repE", !7, i64 0, !11, i64 16, !11, i64 20, !12, i64 24, !11, i64 28, !11, i64 32, !13, i64 36}
!7 = !{!"_ZTSN5sc_dt9scfx_mantE", !8, i64 0, !11, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"_ZTSN5sc_dt8scfx_rep5stateE", !9, i64 0}
!13 = !{!"bool", !9, i64 0}
!14 = !{!6, !12, i64 24}
!15 = !{!6, !11, i64 20}
!16 = !{!11, !11, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass