; LLVM IR from ravireddy07/cpp-book :: src/Google-competitions/KickStart (2020-H-boring-numbers)

; 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"

@dp = external dso_local global [20 x [20 x [2 x i64]]], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(32) %3) #0 {
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  store i64 %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !9
  %14 = load i64, ptr %6, align 8, !tbaa !5
  %15 = load ptr, ptr %9, align 8, !tbaa !9
  %16 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %15) #3
  %17 = icmp eq i64 %14, %16
  br i1 %17, label %18, label %19

18:                                               ; preds = %4
  store i64 1, ptr %5, align 8
  br label %161

19:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %20 = load i64, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds [20 x [20 x [2 x i64]]], ptr @dp, i64 0, i64 %20
  %22 = load i64, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds [20 x [2 x i64]], ptr %21, i64 0, i64 %22
  %24 = load i64, ptr %8, align 8, !tbaa !5
  %25 = getelementptr inbounds [2 x i64], ptr %23, i64 0, i64 %24
  store ptr %25, ptr %10, align 8, !tbaa !9
  %26 = load ptr, ptr %10, align 8, !tbaa !9
  %27 = load i64, ptr %26, align 8, !tbaa !5
  %28 = icmp ne i64 %27, -1
  br i1 %28, label %29, label %32

29:                                               ; preds = %19
  %30 = load ptr, ptr %10, align 8, !tbaa !9
  %31 = load i64, ptr %30, align 8, !tbaa !5
  store i64 %31, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %160

32:                                               ; preds = %19
  %33 = load ptr, ptr %10, align 8, !tbaa !9
  store i64 0, ptr %33, align 8, !tbaa !5
  %34 = load i64, ptr %6, align 8, !tbaa !5
  %35 = load i64, ptr %7, align 8, !tbaa !5
  %36 = icmp eq i64 %34, %35
  br i1 %36, label %37, label %47

37:                                               ; preds = %32
  %38 = load i64, ptr %6, align 8, !tbaa !5
  %39 = add nsw i64 %38, 1
  %40 = load i64, ptr %7, align 8, !tbaa !5
  %41 = add nsw i64 %40, 1
  %42 = load ptr, ptr %9, align 8, !tbaa !9
  %43 = call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %39, i64 noundef %41, i64 noundef 1, ptr noundef nonnull align 8 dereferenceable(32) %42)
  %44 = load ptr, ptr %10, align 8, !tbaa !9
  %45 = load i64, ptr %44, align 8, !tbaa !5
  %46 = add nsw i64 %45, %43
  store i64 %46, ptr %44, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %37, %32
  %48 = load i64, ptr %6, align 8, !tbaa !5
  %49 = load i64, ptr %7, align 8, !tbaa !5
  %50 = sub nsw i64 %48, %49
  %51 = srem i64 %50, 2
  %52 = icmp eq i64 %51, 0
  br i1 %52, label %53, label %105

53:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  store i64 1, ptr %12, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %101, %53
  %55 = load i64, ptr %12, align 8, !tbaa !5
  %56 = icmp slt i64 %55, 10
  br i1 %56, label %58, label %57

57:                                               ; preds = %54
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %104

58:                                               ; preds = %54
  %59 = load i64, ptr %8, align 8, !tbaa !5
  %60 = icmp ne i64 %59, 0
  br i1 %60, label %71, label %61

61:                                               ; preds = %58
  %62 = load i64, ptr %12, align 8, !tbaa !5
  %63 = load ptr, ptr %9, align 8, !tbaa !9
  %64 = load i64, ptr %6, align 8, !tbaa !5
  %65 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %63, i64 noundef %64)
  %66 = load i8, ptr %65, align 1, !tbaa !11
  %67 = sext i8 %66 to i32
  %68 = sub nsw i32 %67, 48
  %69 = sext i32 %68 to i64
  %70 = icmp slt i64 %62, %69
  br i1 %70, label %71, label %80

71:                                               ; preds = %61, %58
  %72 = load i64, ptr %6, align 8, !tbaa !5
  %73 = add nsw i64 %72, 1
  %74 = load i64, ptr %7, align 8, !tbaa !5
  %75 = load ptr, ptr %9, align 8, !tbaa !9
  %76 = call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %73, i64 noundef %74, i64 noundef 1, ptr noundef nonnull align 8 dereferenceable(32) %75)
  %77 = load ptr, ptr %10, align 8, !tbaa !9
  %78 = load i64, ptr %77, align 8, !tbaa !5
  %79 = add nsw i64 %78, %76
  store i64 %79, ptr %77, align 8, !tbaa !5
  br label %100

80:                                               ; preds = %61
  %81 = load i64, ptr %12, align 8, !tbaa !5
  %82 = load ptr, ptr %9, align 8, !tbaa !9
  %83 = load i64, ptr %6, align 8, !tbaa !5
  %84 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %82, i64 noundef %83)
  %85 = load i8, ptr %84, align 1, !tbaa !11
  %86 = sext i8 %85 to i32
  %87 = sub nsw i32 %86, 48
  %88 = sext i32 %87 to i64
  %89 = icmp eq i64 %81, %88
  br i1 %89, label %90, label %99

90:                                               ; preds = %80
  %91 = load i64, ptr %6, align 8, !tbaa !5
  %92 = add nsw i64 %91, 1
  %93 = load i64, ptr %7, align 8, !tbaa !5
  %94 = load ptr, ptr %9, align 8, !tbaa !9
  %95 = call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %92, i64 noundef %93, i64 noundef 0, ptr noundef nonnull align 8 dereferenceable(32) %94)
  %96 = load ptr, ptr %10, align 8, !tbaa !9
  %97 = load i64, ptr %96, align 8, !tbaa !5
  %98 = add nsw i64 %97, %95
  store i64 %98, ptr %96, align 8, !tbaa !5
  br label %99

99:                                               ; preds = %90, %80
  br label %100

100:                                              ; preds = %99, %71
  br label %101

101:                                              ; preds = %100
  %102 = load i64, ptr %12, align 8, !tbaa !5
  %103 = add nsw i64 %102, 2
  store i64 %103, ptr %12, align 8, !tbaa !5
  br label %54, !llvm.loop !12

104:                                              ; preds = %57
  br label %157

105:                                              ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  store i64 0, ptr %13, align 8, !tbaa !5
  br label %106

106:                                              ; preds = %153, %105
  %107 = load i64, ptr %13, align 8, !tbaa !5
  %108 = icmp slt i64 %107, 10
  br i1 %108, label %110, label %109

109:                                              ; preds = %106
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %156

110:                                              ; preds = %106
  %111 = load i64, ptr %8, align 8, !tbaa !5
  %112 = icmp ne i64 %111, 0
  br i1 %112, label %123, label %113

113:                                              ; preds = %110
  %114 = load i64, ptr %13, align 8, !tbaa !5
  %115 = load ptr, ptr %9, align 8, !tbaa !9
  %116 = load i64, ptr %6, align 8, !tbaa !5
  %117 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %115, i64 noundef %116)
  %118 = load i8, ptr %117, align 1, !tbaa !11
  %119 = sext i8 %118 to i32
  %120 = sub nsw i32 %119, 48
  %121 = sext i32 %120 to i64
  %122 = icmp slt i64 %114, %121
  br i1 %122, label %123, label %132

123:                                              ; preds = %113, %110
  %124 = load i64, ptr %6, align 8, !tbaa !5
  %125 = add nsw i64 %124, 1
  %126 = load i64, ptr %7, align 8, !tbaa !5
  %127 = load ptr, ptr %9, align 8, !tbaa !9
  %128 = call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %125, i64 noundef %126, i64 noundef 1, ptr noundef nonnull align 8 dereferenceable(32) %127)
  %129 = load ptr, ptr %10, align 8, !tbaa !9
  %130 = load i64, ptr %129, align 8, !tbaa !5
  %131 = add nsw i64 %130, %128
  store i64 %131, ptr %129, align 8, !tbaa !5
  br label %152

132:                                              ; preds = %113
  %133 = load i64, ptr %13, align 8, !tbaa !5
  %134 = load ptr, ptr %9, align 8, !tbaa !9
  %135 = load i64, ptr %6, align 8, !tbaa !5
  %136 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %134, i64 noundef %135)
  %137 = load i8, ptr %136, align 1, !tbaa !11
  %138 = sext i8 %137 to i32
  %139 = sub nsw i32 %138, 48
  %140 = sext i32 %139 to i64
  %141 = icmp eq i64 %133, %140
  br i1 %141, label %142, label %151

142:                                              ; preds = %132
  %143 = load i64, ptr %6, align 8, !tbaa !5
  %144 = add nsw i64 %143, 1
  %145 = load i64, ptr %7, align 8, !tbaa !5
  %146 = load ptr, ptr %9, align 8, !tbaa !9
  %147 = call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %144, i64 noundef %145, i64 noundef 0, ptr noundef nonnull align 8 dereferenceable(32) %146)
  %148 = load ptr, ptr %10, align 8, !tbaa !9
  %149 = load i64, ptr %148, align 8, !tbaa !5
  %150 = add nsw i64 %149, %147
  store i64 %150, ptr %148, align 8, !tbaa !5
  br label %151

151:                                              ; preds = %142, %132
  br label %152

152:                                              ; preds = %151, %123
  br label %153

153:                                              ; preds = %152
  %154 = load i64, ptr %13, align 8, !tbaa !5
  %155 = add nsw i64 %154, 2
  store i64 %155, ptr %13, align 8, !tbaa !5
  br label %106, !llvm.loop !14

156:                                              ; preds = %109
  br label %157

157:                                              ; preds = %156, %104
  %158 = load ptr, ptr %10, align 8, !tbaa !9
  %159 = load i64, ptr %158, align 8, !tbaa !5
  store i64 %159, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %160

160:                                              ; preds = %157, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %161

161:                                              ; preds = %160, %18
  %162 = load i64, ptr %5, align 8
  ret i64 %162
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 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: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #1 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 = { 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 = !{!"long long", !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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


; 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"

@dp = external dso_local local_unnamed_addr global [20 x [20 x [2 x i64]]], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(32) %3) local_unnamed_addr #0 {
  %5 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #1
  %6 = icmp eq i64 %5, %0
  br i1 %6, label %132, label %7

7:                                                ; preds = %4
  %8 = getelementptr inbounds [20 x [20 x [2 x i64]]], ptr @dp, i64 0, i64 %0, i64 %1, i64 %2
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %.not = icmp eq i64 %9, -1
  br i1 %.not, label %10, label %132

10:                                               ; preds = %7
  store i64 0, ptr %8, align 8, !tbaa !5
  %11 = icmp eq i64 %0, %1
  br i1 %11, label %12, label %17

12:                                               ; preds = %10
  %13 = add nsw i64 %0, 1
  %14 = tail call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %13, i64 noundef %13, i64 noundef 1, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %15 = load i64, ptr %8, align 8, !tbaa !5
  %16 = add nsw i64 %15, %14
  store i64 %16, ptr %8, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %12, %10
  %18 = sub nsw i64 %0, %1
  %19 = and i64 %18, 1
  %20 = icmp eq i64 %19, 0
  %.not57 = icmp eq i64 %2, 0
  %21 = add nsw i64 %0, 1
  br i1 %20, label %.preheader, label %.preheader58

.preheader58:                                     ; preds = %17
  br i1 %.not57, label %.preheader58.split.us.preheader, label %.loopexit.sink.split.sink.split

.preheader58.split.us.preheader:                  ; preds = %.preheader58
  %22 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %23 = load i8, ptr %22, align 1, !tbaa !9
  %24 = icmp sgt i8 %23, 48
  br i1 %24, label %.preheader58.split.us.1.sink.split, label %25

25:                                               ; preds = %.preheader58.split.us.preheader
  %26 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %27 = load i8, ptr %26, align 1, !tbaa !9
  %28 = icmp eq i8 %27, 48
  br i1 %28, label %.preheader58.split.us.1.sink.split, label %.preheader58.split.us.1

.preheader58.split.us.1.sink.split:               ; preds = %.preheader58.split.us.preheader, %25
  %.sink = phi i64 [ 0, %25 ], [ 1, %.preheader58.split.us.preheader ]
  %29 = tail call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %21, i64 noundef %1, i64 noundef %.sink, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %30 = load i64, ptr %8, align 8, !tbaa !5
  %31 = add nsw i64 %30, %29
  store i64 %31, ptr %8, align 8, !tbaa !5
  br label %.preheader58.split.us.1

.preheader58.split.us.1:                          ; preds = %.preheader58.split.us.1.sink.split, %25
  %32 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %33 = load i8, ptr %32, align 1, !tbaa !9
  %34 = icmp sgt i8 %33, 50
  br i1 %34, label %.preheader58.split.us.2.sink.split, label %35

35:                                               ; preds = %.preheader58.split.us.1
  %36 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %37 = load i8, ptr %36, align 1, !tbaa !9
  %38 = icmp eq i8 %37, 50
  br i1 %38, label %.preheader58.split.us.2.sink.split, label %.preheader58.split.us.2

.preheader58.split.us.2.sink.split:               ; preds = %.preheader58.split.us.1, %35
  %.sink72 = phi i64 [ 0, %35 ], [ 1, %.preheader58.split.us.1 ]
  %39 = tail call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %21, i64 noundef %1, i64 noundef %.sink72, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %40 = load i64, ptr %8, align 8, !tbaa !5
  %41 = add nsw i64 %40, %39
  store i64 %41, ptr %8, align 8, !tbaa !5
  br label %.preheader58.split.us.2

.preheader58.split.us.2:                          ; preds = %.preheader58.split.us.2.sink.split, %35
  %42 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %43 = load i8, ptr %42, align 1, !tbaa !9
  %44 = icmp sgt i8 %43, 52
  br i1 %44, label %.preheader58.split.us.3.sink.split, label %45

45:                                               ; preds = %.preheader58.split.us.2
  %46 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %47 = load i8, ptr %46, align 1, !tbaa !9
  %48 = icmp eq i8 %47, 52
  br i1 %48, label %.preheader58.split.us.3.sink.split, label %.preheader58.split.us.3

.preheader58.split.us.3.sink.split:               ; preds = %.preheader58.split.us.2, %45
  %.sink76 = phi i64 [ 0, %45 ], [ 1, %.preheader58.split.us.2 ]
  %49 = tail call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %21, i64 noundef %1, i64 noundef %.sink76, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %50 = load i64, ptr %8, align 8, !tbaa !5
  %51 = add nsw i64 %50, %49
  store i64 %51, ptr %8, align 8, !tbaa !5
  br label %.preheader58.split.us.3

.preheader58.split.us.3:                          ; preds = %.preheader58.split.us.3.sink.split, %45
  %52 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %53 = load i8, ptr %52, align 1, !tbaa !9
  %54 = icmp sgt i8 %53, 54
  br i1 %54, label %.preheader58.split.us.4.sink.split, label %55

55:                                               ; preds = %.preheader58.split.us.3
  %56 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %57 = load i8, ptr %56, align 1, !tbaa !9
  %58 = icmp eq i8 %57, 54
  br i1 %58, label %.preheader58.split.us.4.sink.split, label %.preheader58.split.us.4

.preheader58.split.us.4.sink.split:               ; preds = %.preheader58.split.us.3, %55
  %.sink80 = phi i64 [ 0, %55 ], [ 1, %.preheader58.split.us.3 ]
  %59 = tail call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %21, i64 noundef %1, i64 noundef %.sink80, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %60 = load i64, ptr %8, align 8, !tbaa !5
  %61 = add nsw i64 %60, %59
  store i64 %61, ptr %8, align 8, !tbaa !5
  br label %.preheader58.split.us.4

.preheader58.split.us.4:                          ; preds = %.preheader58.split.us.4.sink.split, %55
  %62 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %63 = load i8, ptr %62, align 1, !tbaa !9
  %64 = icmp sgt i8 %63, 56
  br i1 %64, label %.loopexit.sink.split, label %65

65:                                               ; preds = %.preheader58.split.us.4
  %66 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %67 = load i8, ptr %66, align 1, !tbaa !9
  %68 = icmp eq i8 %67, 56
  br i1 %68, label %.loopexit.sink.split, label %.loopexit

.preheader:                                       ; preds = %17
  br i1 %.not57, label %.preheader.split.us.preheader, label %.loopexit.sink.split.sink.split

.preheader.split.us.preheader:                    ; preds = %.preheader
  %69 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %70 = load i8, ptr %69, align 1, !tbaa !9
  %71 = icmp sgt i8 %70, 49
  br i1 %71, label %.preheader.split.us.1.sink.split, label %72

72:                                               ; preds = %.preheader.split.us.preheader
  %73 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %74 = load i8, ptr %73, align 1, !tbaa !9
  %75 = icmp eq i8 %74, 49
  br i1 %75, label %.preheader.split.us.1.sink.split, label %.preheader.split.us.1

.preheader.split.us.1.sink.split:                 ; preds = %.preheader.split.us.preheader, %72
  %.sink84 = phi i64 [ 0, %72 ], [ 1, %.preheader.split.us.preheader ]
  %76 = tail call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %21, i64 noundef %1, i64 noundef %.sink84, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %77 = load i64, ptr %8, align 8, !tbaa !5
  %78 = add nsw i64 %77, %76
  store i64 %78, ptr %8, align 8, !tbaa !5
  br label %.preheader.split.us.1

.preheader.split.us.1:                            ; preds = %.preheader.split.us.1.sink.split, %72
  %79 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %80 = load i8, ptr %79, align 1, !tbaa !9
  %81 = icmp sgt i8 %80, 51
  br i1 %81, label %.preheader.split.us.2.sink.split, label %82

82:                                               ; preds = %.preheader.split.us.1
  %83 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %84 = load i8, ptr %83, align 1, !tbaa !9
  %85 = icmp eq i8 %84, 51
  br i1 %85, label %.preheader.split.us.2.sink.split, label %.preheader.split.us.2

.preheader.split.us.2.sink.split:                 ; preds = %.preheader.split.us.1, %82
  %.sink88 = phi i64 [ 0, %82 ], [ 1, %.preheader.split.us.1 ]
  %86 = tail call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %21, i64 noundef %1, i64 noundef %.sink88, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %87 = load i64, ptr %8, align 8, !tbaa !5
  %88 = add nsw i64 %87, %86
  store i64 %88, ptr %8, align 8, !tbaa !5
  br label %.preheader.split.us.2

.preheader.split.us.2:                            ; preds = %.preheader.split.us.2.sink.split, %82
  %89 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %90 = load i8, ptr %89, align 1, !tbaa !9
  %91 = icmp sgt i8 %90, 53
  br i1 %91, label %.preheader.split.us.3.sink.split, label %92

92:                                               ; preds = %.preheader.split.us.2
  %93 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %94 = load i8, ptr %93, align 1, !tbaa !9
  %95 = icmp eq i8 %94, 53
  br i1 %95, label %.preheader.split.us.3.sink.split, label %.preheader.split.us.3

.preheader.split.us.3.sink.split:                 ; preds = %.preheader.split.us.2, %92
  %.sink92 = phi i64 [ 0, %92 ], [ 1, %.preheader.split.us.2 ]
  %96 = tail call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %21, i64 noundef %1, i64 noundef %.sink92, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %97 = load i64, ptr %8, align 8, !tbaa !5
  %98 = add nsw i64 %97, %96
  store i64 %98, ptr %8, align 8, !tbaa !5
  br label %.preheader.split.us.3

.preheader.split.us.3:                            ; preds = %.preheader.split.us.3.sink.split, %92
  %99 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %100 = load i8, ptr %99, align 1, !tbaa !9
  %101 = icmp sgt i8 %100, 55
  br i1 %101, label %.preheader.split.us.4.sink.split, label %102

102:                                              ; preds = %.preheader.split.us.3
  %103 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %104 = load i8, ptr %103, align 1, !tbaa !9
  %105 = icmp eq i8 %104, 55
  br i1 %105, label %.preheader.split.us.4.sink.split, label %.preheader.split.us.4

.preheader.split.us.4.sink.split:                 ; preds = %.preheader.split.us.3, %102
  %.sink96 = phi i64 [ 0, %102 ], [ 1, %.preheader.split.us.3 ]
  %106 = tail call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %21, i64 noundef %1, i64 noundef %.sink96, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %107 = load i64, ptr %8, align 8, !tbaa !5
  %108 = add nsw i64 %107, %106
  store i64 %108, ptr %8, align 8, !tbaa !5
  br label %.preheader.split.us.4

.preheader.split.us.4:                            ; preds = %.preheader.split.us.4.sink.split, %102
  %109 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %110 = load i8, ptr %109, align 1, !tbaa !9
  %111 = icmp sgt i8 %110, 57
  br i1 %111, label %.loopexit.sink.split, label %112

112:                                              ; preds = %.preheader.split.us.4
  %113 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %0)
  %114 = load i8, ptr %113, align 1, !tbaa !9
  %115 = icmp eq i8 %114, 57
  br i1 %115, label %.loopexit.sink.split, label %.loopexit

.loopexit.sink.split.sink.split:                  ; preds = %.preheader, %.preheader58
  %116 = tail call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %21, i64 noundef %1, i64 noundef 1, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %117 = load i64, ptr %8, align 8, !tbaa !5
  %118 = add nsw i64 %117, %116
  store i64 %118, ptr %8, align 8, !tbaa !5
  %119 = tail call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %21, i64 noundef %1, i64 noundef 1, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %120 = load i64, ptr %8, align 8, !tbaa !5
  %121 = add nsw i64 %120, %119
  store i64 %121, ptr %8, align 8, !tbaa !5
  %122 = tail call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %21, i64 noundef %1, i64 noundef 1, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %123 = load i64, ptr %8, align 8, !tbaa !5
  %124 = add nsw i64 %123, %122
  store i64 %124, ptr %8, align 8, !tbaa !5
  %125 = tail call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %21, i64 noundef %1, i64 noundef 1, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %126 = load i64, ptr %8, align 8, !tbaa !5
  %127 = add nsw i64 %126, %125
  store i64 %127, ptr %8, align 8, !tbaa !5
  br label %.loopexit.sink.split

.loopexit.sink.split:                             ; preds = %.loopexit.sink.split.sink.split, %.preheader.split.us.4, %112, %.preheader58.split.us.4, %65
  %.sink100 = phi i64 [ 0, %65 ], [ 1, %.preheader58.split.us.4 ], [ 0, %112 ], [ 1, %.preheader.split.us.4 ], [ 1, %.loopexit.sink.split.sink.split ]
  %128 = tail call noundef i64 @_Z4calcxxxRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(i64 noundef %21, i64 noundef %1, i64 noundef %.sink100, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %129 = load i64, ptr %8, align 8, !tbaa !5
  %130 = add nsw i64 %129, %128
  store i64 %130, ptr %8, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.sink.split, %112, %65
  %131 = load i64, ptr %8, align 8, !tbaa !5
  br label %132

132:                                              ; preds = %.loopexit, %7, %4
  %.1 = phi i64 [ 1, %4 ], [ %131, %.loopexit ], [ %9, %7 ]
  ret i64 %.1
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass