; LLVM IR from gem5/gem5 :: ext/systemc/src/sysc/datatypes/int (sc_signed)

; 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::sc_length_param" = type { i32 }

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt8vec_zeroEiPj(i32 noundef, ptr noundef) #1

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5sc_dt17mod_signed_friendEiiiPKjiiS1_(ptr dead_on_unwind noalias writable sret(%"class.sc_dt::sc_signed") align 8 %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, i32 noundef %5, i32 noundef %6, ptr noundef %7) #3 {
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %"class.sc_dt::sc_length_param", align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"class.sc_dt::sc_length_param", align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca %"class.sc_dt::sc_length_param", align 4
  store ptr %0, ptr %9, align 8
  store i32 %1, ptr %10, align 4, !tbaa !5
  store i32 %2, ptr %11, align 4, !tbaa !5
  store i32 %3, ptr %12, align 4, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !9
  store i32 %5, ptr %14, align 4, !tbaa !5
  store i32 %6, ptr %15, align 4, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !9
  %25 = load i32, ptr %12, align 4, !tbaa !5
  %26 = load ptr, ptr %13, align 8, !tbaa !9
  %27 = call noundef i32 @_ZN5sc_dt22vec_skip_leading_zerosEiPKj(i32 noundef %25, ptr noundef %26)
  store i32 %27, ptr %12, align 4, !tbaa !5
  %28 = load i32, ptr %15, align 4, !tbaa !5
  %29 = load ptr, ptr %16, align 8, !tbaa !9
  %30 = call noundef i32 @_ZN5sc_dt22vec_skip_leading_zerosEiPKj(i32 noundef %28, ptr noundef %29)
  store i32 %30, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %31 = load i32, ptr %12, align 4, !tbaa !5
  %32 = load ptr, ptr %13, align 8, !tbaa !9
  %33 = load i32, ptr %15, align 4, !tbaa !5
  %34 = load ptr, ptr %16, align 8, !tbaa !9
  %35 = call noundef i32 @_ZN5sc_dt7vec_cmpEiPKjiS1_(i32 noundef %31, ptr noundef %32, i32 noundef %33, ptr noundef %34)
  store i32 %35, ptr %17, align 4, !tbaa !5
  %36 = load i32, ptr %17, align 4, !tbaa !5
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %40

38:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  call void @_ZN5sc_dt15sc_length_paramC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %18)
  %39 = call noundef i32 @_ZNK5sc_dt15sc_length_param3lenEv(ptr noundef nonnull align 4 dereferenceable(4) %18)
  call void @_ZN5sc_dt9sc_signedC1Ei(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %39)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  store i32 1, ptr %19, align 4
  br label %128

40:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %41 = load ptr, ptr %16, align 8, !tbaa !9
  %42 = load i32, ptr %41, align 4, !tbaa !5
  store i32 %42, ptr %20, align 4, !tbaa !5
  %43 = load i32, ptr %17, align 4, !tbaa !5
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %45, label %53

45:                                               ; preds = %40
  %46 = load i32, ptr %15, align 4, !tbaa !5
  %47 = icmp eq i32 %46, 1
  br i1 %47, label %48, label %53

48:                                               ; preds = %45
  %49 = load i32, ptr %20, align 4, !tbaa !5
  %50 = icmp eq i32 %49, 1
  br i1 %50, label %51, label %53

51:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  call void @_ZN5sc_dt15sc_length_paramC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %21)
  %52 = call noundef i32 @_ZNK5sc_dt15sc_length_param3lenEv(ptr noundef nonnull align 4 dereferenceable(4) %21)
  call void @_ZN5sc_dt9sc_signedC1Ei(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %52)
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  store i32 1, ptr %19, align 4
  br label %127

53:                                               ; preds = %48, %45, %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %54 = call noundef i32 @_ZN5sc_dt6sc_maxIiEEKT_RS2_S3_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %56 = load i32, ptr %22, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %57, i64 4)
  %59 = extractvalue { i64, i1 } %58, 1
  %60 = extractvalue { i64, i1 } %58, 0
  %61 = select i1 %59, i64 -1, i64 %60
  %62 = call noalias noundef nonnull ptr @_Znam(i64 noundef %61) #9
  store ptr %62, ptr %23, align 8, !tbaa !9
  %63 = load i32, ptr %22, align 4, !tbaa !5
  %64 = load ptr, ptr %23, align 8, !tbaa !9
  call void @_ZN5sc_dt8vec_zeroEiPj(i32 noundef %63, ptr noundef %64)
  %65 = load i32, ptr %17, align 4, !tbaa !5
  %66 = icmp slt i32 %65, 0
  br i1 %66, label %67, label %71

67:                                               ; preds = %53
  %68 = load i32, ptr %12, align 4, !tbaa !5
  %69 = load ptr, ptr %23, align 8, !tbaa !9
  %70 = load ptr, ptr %13, align 8, !tbaa !9
  call void @_ZN5sc_dt8vec_copyEiPjPKj(i32 noundef %68, ptr noundef %69, ptr noundef %70)
  br label %106

71:                                               ; preds = %53
  %72 = load i32, ptr %15, align 4, !tbaa !5
  %73 = icmp eq i32 %72, 1
  br i1 %73, label %74, label %84

74:                                               ; preds = %71
  %75 = load i32, ptr %12, align 4, !tbaa !5
  %76 = icmp eq i32 %75, 1
  br i1 %76, label %77, label %84

77:                                               ; preds = %74
  %78 = load ptr, ptr %13, align 8, !tbaa !9
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = load i32, ptr %20, align 4, !tbaa !5
  %81 = urem i32 %79, %80
  %82 = load ptr, ptr %23, align 8, !tbaa !9
  %83 = getelementptr inbounds i32, ptr %82, i64 0
  store i32 %81, ptr %83, align 4, !tbaa !5
  br label %105

84:                                               ; preds = %74, %71
  %85 = load i32, ptr %15, align 4, !tbaa !5
  %86 = icmp eq i32 %85, 1
  br i1 %86, label %87, label %98

87:                                               ; preds = %84
  %88 = load i32, ptr %20, align 4, !tbaa !5
  %89 = zext i32 %88 to i64
  %90 = icmp ult i64 %89, 32768
  br i1 %90, label %91, label %98

91:                                               ; preds = %87
  %92 = load i32, ptr %12, align 4, !tbaa !5
  %93 = load ptr, ptr %13, align 8, !tbaa !9
  %94 = load i32, ptr %20, align 4, !tbaa !5
  %95 = call noundef i32 @_ZN5sc_dt13vec_rem_smallEiPKjj(i32 noundef %92, ptr noundef %93, i32 noundef %94)
  %96 = load ptr, ptr %23, align 8, !tbaa !9
  %97 = getelementptr inbounds i32, ptr %96, i64 0
  store i32 %95, ptr %97, align 4, !tbaa !5
  br label %104

98:                                               ; preds = %87, %84
  %99 = load i32, ptr %12, align 4, !tbaa !5
  %100 = load ptr, ptr %13, align 8, !tbaa !9
  %101 = load i32, ptr %15, align 4, !tbaa !5
  %102 = load ptr, ptr %16, align 8, !tbaa !9
  %103 = load ptr, ptr %23, align 8, !tbaa !9
  call void @_ZN5sc_dt13vec_rem_largeEiPKjiS1_Pj(i32 noundef %99, ptr noundef %100, i32 noundef %101, ptr noundef %102, ptr noundef %103)
  br label %104

104:                                              ; preds = %98, %91
  br label %105

105:                                              ; preds = %104, %77
  br label %106

106:                                              ; preds = %105, %67
  %107 = load i32, ptr %10, align 4, !tbaa !5
  %108 = load i32, ptr %22, align 4, !tbaa !5
  %109 = sub nsw i32 %108, 1
  %110 = load ptr, ptr %23, align 8, !tbaa !9
  %111 = call noundef i32 @_ZN5sc_dt14check_for_zeroEiiPKj(i32 noundef %107, i32 noundef %109, ptr noundef %110)
  store i32 %111, ptr %10, align 4, !tbaa !5
  %112 = load i32, ptr %10, align 4, !tbaa !5
  %113 = icmp eq i32 %112, 0
  br i1 %113, label %114, label %120

114:                                              ; preds = %106
  %115 = load ptr, ptr %23, align 8, !tbaa !9
  %116 = icmp eq ptr %115, null
  br i1 %116, label %118, label %117

117:                                              ; preds = %114
  call void @_ZdaPv(ptr noundef %115) #10
  br label %118

118:                                              ; preds = %117, %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  call void @_ZN5sc_dt15sc_length_paramC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %24)
  %119 = call noundef i32 @_ZNK5sc_dt15sc_length_param3lenEv(ptr noundef nonnull align 4 dereferenceable(4) %24)
  call void @_ZN5sc_dt9sc_signedC1Ei(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %119)
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  store i32 1, ptr %19, align 4
  br label %126

120:                                              ; preds = %106
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = call noundef i32 @_ZN5sc_dt6sc_minIiEEKT_RS2_S3_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %123 = load i32, ptr %22, align 4, !tbaa !5
  %124 = sub nsw i32 %123, 1
  %125 = load ptr, ptr %23, align 8, !tbaa !9
  call void @_ZN5sc_dt9sc_signedC1EiiiPjb(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %121, i32 noundef %122, i32 noundef %124, ptr noundef %125, i1 noundef zeroext true)
  store i32 1, ptr %19, align 4
  br label %126

126:                                              ; preds = %120, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %127

127:                                              ; preds = %126, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %128

128:                                              ; preds = %127, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN5sc_dt22vec_skip_leading_zerosEiPKj(i32 noundef, ptr noundef) #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN5sc_dt7vec_cmpEiPKjiS1_(i32 noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5sc_dt8vec_copyEiPjPKj(i32 noundef, ptr noundef, ptr noundef) #2

declare noundef i32 @_ZN5sc_dt13vec_rem_smallEiPKjj(i32 noundef, ptr noundef, i32 noundef) #7

declare void @_ZN5sc_dt13vec_rem_largeEiPKjiS1_Pj(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN5sc_dt14check_for_zeroEiiPKj(i32 noundef, i32 noundef, ptr noundef) #2

declare void @_ZN5sc_dt9sc_signedC1Ei(ptr, i32)

declare void @_ZN5sc_dt9sc_signedC1EiiiPjb(ptr, i32, i32, i32, ptr, i1)

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


; 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::sc_length_param" = type { i32 }

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt8vec_zeroEiPj(i32 noundef, ptr noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5sc_dt17mod_signed_friendEiiiPKjiiS1_(ptr dead_on_unwind noalias writable sret(%"class.sc_dt::sc_signed") align 8 %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, i32 noundef %5, i32 noundef %6, ptr noundef %7) local_unnamed_addr #3 {
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.sc_dt::sc_length_param", align 4
  %14 = alloca %"class.sc_dt::sc_length_param", align 4
  %15 = alloca %"class.sc_dt::sc_length_param", align 4
  store i32 %2, ptr %9, align 4, !tbaa !5
  store i32 %5, ptr %11, align 4, !tbaa !5
  %16 = tail call noundef i32 @_ZN5sc_dt22vec_skip_leading_zerosEiPKj(i32 noundef %3, ptr noundef %4)
  store i32 %16, ptr %10, align 4, !tbaa !5
  %17 = tail call noundef i32 @_ZN5sc_dt22vec_skip_leading_zerosEiPKj(i32 noundef %6, ptr noundef %7)
  store i32 %17, ptr %12, align 4, !tbaa !5
  %18 = tail call noundef i32 @_ZN5sc_dt7vec_cmpEiPKjiS1_(i32 noundef %16, ptr noundef %4, i32 noundef %17, ptr noundef %7)
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %20, label %22

20:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  call void @_ZN5sc_dt15sc_length_paramC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %13)
  %21 = call noundef i32 @_ZNK5sc_dt15sc_length_param3lenEv(ptr noundef nonnull align 4 dereferenceable(4) %13)
  call void @_ZN5sc_dt9sc_signedC1Ei(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %21)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  br label %60

22:                                               ; preds = %8
  %23 = load i32, ptr %7, align 4, !tbaa !5
  %24 = icmp sgt i32 %18, 0
  %25 = icmp eq i32 %17, 1
  %or.cond = and i1 %24, %25
  %26 = icmp eq i32 %23, 1
  %or.cond3 = select i1 %or.cond, i1 %26, i1 false
  br i1 %or.cond3, label %27, label %29

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  call void @_ZN5sc_dt15sc_length_paramC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %14)
  %28 = call noundef i32 @_ZNK5sc_dt15sc_length_param3lenEv(ptr noundef nonnull align 4 dereferenceable(4) %14)
  call void @_ZN5sc_dt9sc_signedC1Ei(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %28)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  br label %60

29:                                               ; preds = %22
  %30 = call noundef i32 @_ZN5sc_dt6sc_maxIiEEKT_RS2_S3_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %31 = add nsw i32 %30, 1
  %32 = zext nneg i32 %31 to i64
  %33 = icmp slt i32 %30, -1
  %34 = shl nuw nsw i64 %32, 2
  %35 = select i1 %33, i64 -1, i64 %34
  %36 = call noalias noundef nonnull ptr @_Znam(i64 noundef %35) #8
  call void @_ZN5sc_dt8vec_zeroEiPj(i32 noundef %31, ptr noundef nonnull %36)
  %37 = icmp slt i32 %18, 0
  br i1 %37, label %38, label %40

38:                                               ; preds = %29
  %39 = load i32, ptr %10, align 4, !tbaa !5
  call void @_ZN5sc_dt8vec_copyEiPjPKj(i32 noundef %39, ptr noundef nonnull %36, ptr noundef %4)
  br label %53

40:                                               ; preds = %29
  %41 = load i32, ptr %12, align 4, !tbaa !5
  %42 = icmp eq i32 %41, 1
  %43 = load i32, ptr %10, align 4
  %44 = icmp eq i32 %43, 1
  %or.cond5 = select i1 %42, i1 %44, i1 false
  br i1 %or.cond5, label %45, label %48

45:                                               ; preds = %40
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = urem i32 %46, %23
  store i32 %47, ptr %36, align 4, !tbaa !5
  br label %53

48:                                               ; preds = %40
  %49 = icmp ult i32 %23, 32768
  %or.cond8 = select i1 %42, i1 %49, i1 false
  br i1 %or.cond8, label %50, label %52

50:                                               ; preds = %48
  %51 = call noundef i32 @_ZN5sc_dt13vec_rem_smallEiPKjj(i32 noundef %43, ptr noundef %4, i32 noundef %23)
  store i32 %51, ptr %36, align 4, !tbaa !5
  br label %53

52:                                               ; preds = %48
  call void @_ZN5sc_dt13vec_rem_largeEiPKjiS1_Pj(i32 noundef %43, ptr noundef %4, i32 noundef %41, ptr noundef nonnull %7, ptr noundef nonnull %36)
  br label %53

53:                                               ; preds = %45, %52, %50, %38
  %54 = call noundef i32 @_ZN5sc_dt14check_for_zeroEiiPKj(i32 noundef %1, i32 noundef %30, ptr noundef nonnull %36)
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %58

56:                                               ; preds = %53
  call void @_ZdaPv(ptr noundef nonnull %36) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #7
  call void @_ZN5sc_dt15sc_length_paramC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %15)
  %57 = call noundef i32 @_ZNK5sc_dt15sc_length_param3lenEv(ptr noundef nonnull align 4 dereferenceable(4) %15)
  call void @_ZN5sc_dt9sc_signedC1Ei(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %57)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  br label %60

58:                                               ; preds = %53
  %59 = call noundef i32 @_ZN5sc_dt6sc_minIiEEKT_RS2_S3_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @_ZN5sc_dt9sc_signedC1EiiiPjb(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %54, i32 noundef %59, i32 noundef %30, ptr noundef nonnull %36, i1 noundef zeroext true)
  br label %60

60:                                               ; preds = %27, %58, %56, %20
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN5sc_dt22vec_skip_leading_zerosEiPKj(i32 noundef, ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN5sc_dt7vec_cmpEiPKjiS1_(i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5sc_dt8vec_copyEiPjPKj(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare noundef i32 @_ZN5sc_dt13vec_rem_smallEiPKjj(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #6

declare void @_ZN5sc_dt13vec_rem_largeEiPKjiS1_Pj(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN5sc_dt14check_for_zeroEiiPKj(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN5sc_dt9sc_signedC1Ei(ptr, i32) local_unnamed_addr

declare void @_ZN5sc_dt9sc_signedC1EiiiPjb(ptr, i32, i32, i32, ptr, i1) local_unnamed_addr

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


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