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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZN5sc_dt15NB_DEFAULT_BASEE = external constant i32, align 4
@.str.13 = external hidden unnamed_addr constant [93 x i8], align 1
@_ZN7sc_core24SC_ID_CONVERSION_FAILED_E = external constant [0 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [109 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [104 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5sc_dt9to_stringB5cxx11ENS_9sc_numrepE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5sc_dt17get_base_and_signEPKcRiS2_(ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5sc_dt12vec_from_strEiiPjPKcNS_9sc_numrepE(i32 noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4) #0 {
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca [8192 x i8], align 16
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca i8, align 1
  %16 = alloca i32, align 4
  %17 = alloca [8192 x i8], align 16
  %18 = alloca [8192 x i8], align 16
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !11
  %19 = load i32, ptr %10, align 4, !tbaa !11
  call void @_ZN5sc_dt13is_valid_baseENS_9sc_numrepE(i32 noundef %19)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %20 = load ptr, ptr %9, align 8, !tbaa !9
  %21 = call noundef ptr @_ZN5sc_dt17get_base_and_signEPKcRiS2_(ptr noundef %20, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store ptr %21, ptr %9, align 8, !tbaa !9
  %22 = load i32, ptr %10, align 4, !tbaa !11
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %37

24:                                               ; preds = %5
  %25 = load i32, ptr %11, align 4, !tbaa !5
  %26 = load i32, ptr @_ZN5sc_dt15NB_DEFAULT_BASEE, align 4, !tbaa !5
  %27 = icmp eq i32 %25, %26
  br i1 %27, label %28, label %30

28:                                               ; preds = %24
  %29 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %29, ptr %11, align 4, !tbaa !5
  br label %36

30:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8192, ptr %13) #7
  %31 = getelementptr inbounds [8192 x i8], ptr %13, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #7
  %32 = load i32, ptr %10, align 4, !tbaa !11
  call void @_ZN5sc_dt9to_stringB5cxx11ENS_9sc_numrepE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %14, i32 noundef %32)
  %33 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  %34 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %31, ptr noundef @.str.18, ptr noundef %33) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #7
  %35 = getelementptr inbounds [8192 x i8], ptr %13, i64 0, i64 0
  call void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 2, ptr noundef @_ZN7sc_core24SC_ID_CONVERSION_FAILED_E, ptr noundef %35, ptr noundef @.str.13, i32 noundef 572)
  call void @llvm.lifetime.end.p0(i64 8192, ptr %13) #7
  br label %36

36:                                               ; preds = %30, %28
  br label %37

37:                                               ; preds = %36, %5
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = load ptr, ptr %8, align 8, !tbaa !9
  call void @_ZN5sc_dt8vec_zeroEiPj(i32 noundef %38, ptr noundef %39)
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #7
  br label %40

40:                                               ; preds = %96, %37
  %41 = load ptr, ptr %9, align 8, !tbaa !9
  %42 = load i8, ptr %41, align 1, !tbaa !13
  store i8 %42, ptr %15, align 1, !tbaa !13
  %43 = icmp ne i8 %42, 0
  br i1 %43, label %44, label %99

44:                                               ; preds = %40
  %45 = load i8, ptr %15, align 1, !tbaa !13
  %46 = sext i8 %45 to i32
  %47 = call i32 @isalnum(i32 noundef %46) #8
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %87

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %50 = load i8, ptr %15, align 1, !tbaa !13
  %51 = sext i8 %50 to i32
  %52 = call i32 @isalpha(i32 noundef %51) #8
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %60

54:                                               ; preds = %49
  %55 = load i8, ptr %15, align 1, !tbaa !13
  %56 = sext i8 %55 to i32
  %57 = call i32 @toupper(i32 noundef %56) #8
  %58 = sub nsw i32 %57, 65
  %59 = add nsw i32 %58, 10
  store i32 %59, ptr %16, align 4, !tbaa !5
  br label %64

60:                                               ; preds = %49
  %61 = load i8, ptr %15, align 1, !tbaa !13
  %62 = sext i8 %61 to i32
  %63 = sub nsw i32 %62, 48
  store i32 %63, ptr %16, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %60, %54
  %65 = load i32, ptr %16, align 4, !tbaa !5
  %66 = load i32, ptr %11, align 4, !tbaa !5
  %67 = icmp sge i32 %65, %66
  br i1 %67, label %68, label %76

68:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8192, ptr %17) #7
  %69 = getelementptr inbounds [8192 x i8], ptr %17, i64 0, i64 0
  %70 = load ptr, ptr %9, align 8, !tbaa !9
  %71 = load i8, ptr %70, align 1, !tbaa !13
  %72 = sext i8 %71 to i32
  %73 = load i32, ptr %11, align 4, !tbaa !5
  %74 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %69, ptr noundef @.str.19, i32 noundef %72, i32 noundef %73) #7
  %75 = getelementptr inbounds [8192 x i8], ptr %17, i64 0, i64 0
  call void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 2, ptr noundef @_ZN7sc_core24SC_ID_CONVERSION_FAILED_E, ptr noundef %75, ptr noundef @.str.13, i32 noundef 597)
  call void @llvm.lifetime.end.p0(i64 8192, ptr %17) #7
  br label %76

76:                                               ; preds = %68, %64
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = load ptr, ptr %8, align 8, !tbaa !9
  %79 = load i32, ptr %11, align 4, !tbaa !5
  call void @_ZN5sc_dt16vec_mul_small_onEiPjj(i32 noundef %77, ptr noundef %78, i32 noundef %79)
  %80 = load i32, ptr %16, align 4, !tbaa !5
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %86

82:                                               ; preds = %76
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = load ptr, ptr %8, align 8, !tbaa !9
  %85 = load i32, ptr %16, align 4, !tbaa !5
  call void @_ZN5sc_dt16vec_add_small_onEiPjj(i32 noundef %83, ptr noundef %84, i32 noundef %85)
  br label %86

86:                                               ; preds = %82, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %95

87:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8192, ptr %18) #7
  %88 = getelementptr inbounds [8192 x i8], ptr %18, i64 0, i64 0
  %89 = load ptr, ptr %9, align 8, !tbaa !9
  %90 = load i8, ptr %89, align 1, !tbaa !13
  %91 = sext i8 %90 to i32
  %92 = load i32, ptr %11, align 4, !tbaa !5
  %93 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %88, ptr noundef @.str.19, i32 noundef %91, i32 noundef %92) #7
  %94 = getelementptr inbounds [8192 x i8], ptr %18, i64 0, i64 0
  call void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 2, ptr noundef @_ZN7sc_core24SC_ID_CONVERSION_FAILED_E, ptr noundef %94, ptr noundef @.str.13, i32 noundef 613)
  call void @llvm.lifetime.end.p0(i64 8192, ptr %18) #7
  br label %95

95:                                               ; preds = %87, %86
  br label %96

96:                                               ; preds = %95
  %97 = load ptr, ptr %9, align 8, !tbaa !9
  %98 = getelementptr inbounds i8, ptr %97, i32 1
  store ptr %98, ptr %9, align 8, !tbaa !9
  br label %40, !llvm.loop !14

99:                                               ; preds = %40
  %100 = load i32, ptr %12, align 4, !tbaa !5
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = load ptr, ptr %8, align 8, !tbaa !9
  %104 = call noundef i32 @_ZN5sc_dt29convert_signed_SM_to_2C_to_SMEiiiPj(i32 noundef %100, i32 noundef %101, i32 noundef %102, ptr noundef %103)
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  ret i32 %104
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(read) uwtable
declare i32 @isalnum(i32 noundef) #6

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(read) uwtable
declare i32 @isalpha(i32 noundef) #6

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(read) uwtable
declare i32 @toupper(i32 noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5sc_dt16vec_mul_small_onEiPjj(i32 noundef, ptr noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5sc_dt16vec_add_small_onEiPjj(i32 noundef, ptr noundef, i32 noundef) #5

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 willreturn memory(read) 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 }
attributes #8 = { nounwind willreturn memory(read) }

!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 = !{!"_ZTSN5sc_dt9sc_numrepE", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"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.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] }

@_ZN5sc_dt15NB_DEFAULT_BASEE = external local_unnamed_addr constant i32, align 4
@.str.13 = external hidden unnamed_addr constant [93 x i8], align 1
@_ZN7sc_core24SC_ID_CONVERSION_FAILED_E = external constant [0 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [109 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [104 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5sc_dt9to_stringB5cxx11ENS_9sc_numrepE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5sc_dt17get_base_and_signEPKcRiS2_(ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5sc_dt12vec_from_strEiiPjPKcNS_9sc_numrepE(i32 noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca [8192 x i8], align 16
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca [8192 x i8], align 16
  %11 = alloca [8192 x i8], align 16
  tail call void @_ZN5sc_dt13is_valid_baseENS_9sc_numrepE(i32 noundef %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %12 = call noundef ptr @_ZN5sc_dt17get_base_and_signEPKcRiS2_(ptr noundef %3, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %21, label %13

13:                                               ; preds = %5
  %14 = load i32, ptr %6, align 4, !tbaa !5
  %15 = load i32, ptr @_ZN5sc_dt15NB_DEFAULT_BASEE, align 4, !tbaa !5
  %16 = icmp eq i32 %14, %15
  br i1 %16, label %17, label %18

17:                                               ; preds = %13
  store i32 %4, ptr %6, align 4, !tbaa !5
  br label %21

18:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8192, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #7
  call void @_ZN5sc_dt9to_stringB5cxx11ENS_9sc_numrepE(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %9, i32 noundef %4)
  %19 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  %20 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.18, ptr noundef %19) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  call void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 2, ptr noundef nonnull @_ZN7sc_core24SC_ID_CONVERSION_FAILED_E, ptr noundef nonnull %8, ptr noundef nonnull @.str.13, i32 noundef 572)
  call void @llvm.lifetime.end.p0(i64 8192, ptr nonnull %8) #7
  br label %21

21:                                               ; preds = %17, %18, %5
  call void @_ZN5sc_dt8vec_zeroEiPj(i32 noundef %1, ptr noundef %2)
  %22 = load i8, ptr %12, align 1, !tbaa !9
  %.not2732 = icmp eq i8 %22, 0
  br i1 %.not2732, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %21, %43
  %23 = phi i8 [ %45, %43 ], [ %22, %21 ]
  %.02433 = phi ptr [ %44, %43 ], [ %12, %21 ]
  %24 = sext i8 %23 to i32
  %25 = call i32 @isalnum(i32 noundef %24) #8
  %.not28 = icmp eq i32 %25, 0
  br i1 %.not28, label %40, label %26

26:                                               ; preds = %.lr.ph
  %27 = call i32 @isalpha(i32 noundef %24) #8
  %.not29 = icmp eq i32 %27, 0
  br i1 %.not29, label %31, label %28

28:                                               ; preds = %26
  %29 = call i32 @toupper(i32 noundef %24) #8
  %30 = add nsw i32 %29, -55
  br label %33

31:                                               ; preds = %26
  %32 = add nsw i32 %24, -48
  br label %33

33:                                               ; preds = %31, %28
  %.0 = phi i32 [ %30, %28 ], [ %32, %31 ]
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %.not30 = icmp slt i32 %.0, %34
  br i1 %.not30, label %37, label %35

35:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8192, ptr nonnull %10) #7
  %36 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %24, i32 noundef %34) #7
  call void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 2, ptr noundef nonnull @_ZN7sc_core24SC_ID_CONVERSION_FAILED_E, ptr noundef nonnull %10, ptr noundef nonnull @.str.13, i32 noundef 597)
  call void @llvm.lifetime.end.p0(i64 8192, ptr nonnull %10) #7
  %.pre = load i32, ptr %6, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %35, %33
  %38 = phi i32 [ %.pre, %35 ], [ %34, %33 ]
  call void @_ZN5sc_dt16vec_mul_small_onEiPjj(i32 noundef %1, ptr noundef %2, i32 noundef %38)
  %.not31 = icmp eq i32 %.0, 0
  br i1 %.not31, label %43, label %39

39:                                               ; preds = %37
  call void @_ZN5sc_dt16vec_add_small_onEiPjj(i32 noundef %1, ptr noundef %2, i32 noundef %.0)
  br label %43

40:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8192, ptr nonnull %11) #7
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %24, i32 noundef %41) #7
  call void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 2, ptr noundef nonnull @_ZN7sc_core24SC_ID_CONVERSION_FAILED_E, ptr noundef nonnull %11, ptr noundef nonnull @.str.13, i32 noundef 613)
  call void @llvm.lifetime.end.p0(i64 8192, ptr nonnull %11) #7
  br label %43

43:                                               ; preds = %37, %39, %40
  %44 = getelementptr inbounds i8, ptr %.02433, i64 1
  %45 = load i8, ptr %44, align 1, !tbaa !9
  %.not27 = icmp eq i8 %45, 0
  br i1 %.not27, label %._crit_edge, label %.lr.ph, !llvm.loop !10

._crit_edge:                                      ; preds = %43, %21
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = call noundef i32 @_ZN5sc_dt29convert_signed_SM_to_2C_to_SMEiiiPj(i32 noundef %46, i32 noundef %0, i32 noundef %1, ptr noundef %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  ret i32 %47
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @isalnum(i32 noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @isalpha(i32 noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @toupper(i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5sc_dt16vec_mul_small_onEiPjj(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5sc_dt16vec_add_small_onEiPjj(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

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

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

!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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


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