; LLVM IR from Waqar144/simplecrypto-cxx :: simplecrypto-cxx/base58.ll (Z6b58encPcPmPKhm)

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

%"struct.std::array.6" = type { [59 x i8] }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.2" = type { i8 }
%"class.__gnu_cxx::__normal_iterator.5" = type { ptr }

@_ZL17b58digits_ordered = external hidden constant %"struct.std::array.6", align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z6b58encPcPmPKhm(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca %"class.std::vector.0", align 8
  %18 = alloca %"class.std::allocator.2", align 1
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i64 %3, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %25, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  br label %26

26:                                               ; preds = %39, %4
  %27 = load i64, ptr %15, align 8, !tbaa !9
  %28 = load i64, ptr %9, align 8, !tbaa !9
  %29 = icmp slt i64 %27, %28
  br i1 %29, label %30, label %37

30:                                               ; preds = %26
  %31 = load ptr, ptr %10, align 8, !tbaa !5
  %32 = load i64, ptr %15, align 8, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %31, i64 %32
  %34 = load i8, ptr %33, align 1, !tbaa !11
  %35 = icmp ne i8 %34, 0
  %36 = xor i1 %35, true
  br label %37

37:                                               ; preds = %30, %26
  %38 = phi i1 [ false, %26 ], [ %36, %30 ]
  br i1 %38, label %39, label %42

39:                                               ; preds = %37
  %40 = load i64, ptr %15, align 8, !tbaa !9
  %41 = add nsw i64 %40, 1
  store i64 %41, ptr %15, align 8, !tbaa !9
  br label %26, !llvm.loop !12

42:                                               ; preds = %37
  %43 = load i64, ptr %9, align 8, !tbaa !9
  %44 = load i64, ptr %15, align 8, !tbaa !9
  %45 = sub i64 %43, %44
  %46 = mul i64 %45, 138
  %47 = udiv i64 %46, 100
  %48 = add i64 %47, 1
  store i64 %48, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #5
  %49 = load i64, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #5
  call void @_ZNSaIhEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #5
  invoke void @_ZNSt6vectorIhSaIhEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %49, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %50 unwind label %102

50:                                               ; preds = %42
  call void @_ZNSt15__new_allocatorIhED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  %51 = call ptr @_ZNSt6vectorIhSaIhEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  %52 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.5", ptr %21, i32 0, i32 0
  store ptr %51, ptr %52, align 8
  %53 = call ptr @_ZNSt6vectorIhSaIhEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  %54 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.5", ptr %22, i32 0, i32 0
  store ptr %53, ptr %54, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !14
  %55 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.5", ptr %21, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8
  %57 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.5", ptr %22, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8
  invoke void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEEiEvT_S7_RKT0_(ptr %56, ptr %58, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %59 unwind label %106

59:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  %60 = load i64, ptr %15, align 8, !tbaa !9
  store i64 %60, ptr %12, align 8, !tbaa !9
  %61 = load i64, ptr %16, align 8, !tbaa !9
  %62 = sub i64 %61, 1
  store i64 %62, ptr %14, align 8, !tbaa !9
  br label %63

63:                                               ; preds = %111, %59
  %64 = load i64, ptr %12, align 8, !tbaa !9
  %65 = load i64, ptr %9, align 8, !tbaa !9
  %66 = icmp slt i64 %64, %65
  br i1 %66, label %67, label %115

67:                                               ; preds = %63
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = load i64, ptr %12, align 8, !tbaa !9
  %70 = getelementptr inbounds i8, ptr %68, i64 %69
  %71 = load i8, ptr %70, align 1, !tbaa !11
  %72 = zext i8 %71 to i32
  store i32 %72, ptr %11, align 4, !tbaa !14
  %73 = load i64, ptr %16, align 8, !tbaa !9
  %74 = sub i64 %73, 1
  store i64 %74, ptr %13, align 8, !tbaa !9
  br label %75

75:                                               ; preds = %99, %67
  %76 = load i64, ptr %13, align 8, !tbaa !9
  %77 = load i64, ptr %14, align 8, !tbaa !9
  %78 = icmp sgt i64 %76, %77
  br i1 %78, label %82, label %79

79:                                               ; preds = %75
  %80 = load i32, ptr %11, align 4, !tbaa !14
  %81 = icmp ne i32 %80, 0
  br label %82

82:                                               ; preds = %79, %75
  %83 = phi i1 [ true, %75 ], [ %81, %79 ]
  br i1 %83, label %84, label %110

84:                                               ; preds = %82
  %85 = load i64, ptr %13, align 8, !tbaa !9
  %86 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %85) #5
  %87 = load i8, ptr %86, align 1, !tbaa !11
  %88 = zext i8 %87 to i32
  %89 = mul nsw i32 256, %88
  %90 = load i32, ptr %11, align 4, !tbaa !14
  %91 = add nsw i32 %90, %89
  store i32 %91, ptr %11, align 4, !tbaa !14
  %92 = load i32, ptr %11, align 4, !tbaa !14
  %93 = srem i32 %92, 58
  %94 = trunc i32 %93 to i8
  %95 = load i64, ptr %13, align 8, !tbaa !9
  %96 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %95) #5
  store i8 %94, ptr %96, align 1, !tbaa !11
  %97 = load i32, ptr %11, align 4, !tbaa !14
  %98 = sdiv i32 %97, 58
  store i32 %98, ptr %11, align 4, !tbaa !14
  br label %99

99:                                               ; preds = %84
  %100 = load i64, ptr %13, align 8, !tbaa !9
  %101 = add nsw i64 %100, -1
  store i64 %101, ptr %13, align 8, !tbaa !9
  br label %75, !llvm.loop !16

102:                                              ; preds = %42
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %19, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %20, align 4
  call void @_ZNSt15__new_allocatorIhED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  br label %185

106:                                              ; preds = %50
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %19, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  br label %185

110:                                              ; preds = %82
  br label %111

111:                                              ; preds = %110
  %112 = load i64, ptr %12, align 8, !tbaa !9
  %113 = add nsw i64 %112, 1
  store i64 %113, ptr %12, align 8, !tbaa !9
  %114 = load i64, ptr %13, align 8, !tbaa !9
  store i64 %114, ptr %14, align 8, !tbaa !9
  br label %63, !llvm.loop !17

115:                                              ; preds = %63
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %116

116:                                              ; preds = %129, %115
  %117 = load i64, ptr %13, align 8, !tbaa !9
  %118 = load i64, ptr %16, align 8, !tbaa !9
  %119 = icmp slt i64 %117, %118
  br i1 %119, label %120, label %126

120:                                              ; preds = %116
  %121 = load i64, ptr %13, align 8, !tbaa !9
  %122 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %121) #5
  %123 = load i8, ptr %122, align 1, !tbaa !11
  %124 = icmp ne i8 %123, 0
  %125 = xor i1 %124, true
  br label %126

126:                                              ; preds = %120, %116
  %127 = phi i1 [ false, %116 ], [ %125, %120 ]
  br i1 %127, label %128, label %132

128:                                              ; preds = %126
  br label %129

129:                                              ; preds = %128
  %130 = load i64, ptr %13, align 8, !tbaa !9
  %131 = add nsw i64 %130, 1
  store i64 %131, ptr %13, align 8, !tbaa !9
  br label %116, !llvm.loop !18

132:                                              ; preds = %126
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = load i64, ptr %133, align 8, !tbaa !9
  %135 = load i64, ptr %15, align 8, !tbaa !9
  %136 = load i64, ptr %16, align 8, !tbaa !9
  %137 = add i64 %135, %136
  %138 = load i64, ptr %13, align 8, !tbaa !9
  %139 = sub i64 %137, %138
  %140 = icmp ule i64 %134, %139
  br i1 %140, label %141, label %149

141:                                              ; preds = %132
  %142 = load i64, ptr %15, align 8, !tbaa !9
  %143 = load i64, ptr %16, align 8, !tbaa !9
  %144 = add i64 %142, %143
  %145 = load i64, ptr %13, align 8, !tbaa !9
  %146 = sub i64 %144, %145
  %147 = add i64 %146, 1
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %147, ptr %148, align 8, !tbaa !9
  store i1 false, ptr %5, align 1
  store i32 1, ptr %24, align 4
  br label %183

149:                                              ; preds = %132
  %150 = load i64, ptr %15, align 8, !tbaa !9
  %151 = icmp ne i64 %150, 0
  br i1 %151, label %152, label %155

152:                                              ; preds = %149
  %153 = load ptr, ptr %6, align 8, !tbaa !5
  %154 = load i64, ptr %15, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 1 %153, i8 49, i64 %154, i1 false)
  br label %155

155:                                              ; preds = %152, %149
  %156 = load i64, ptr %15, align 8, !tbaa !9
  store i64 %156, ptr %12, align 8, !tbaa !9
  br label %157

157:                                              ; preds = %171, %155
  %158 = load i64, ptr %13, align 8, !tbaa !9
  %159 = load i64, ptr %16, align 8, !tbaa !9
  %160 = icmp slt i64 %158, %159
  br i1 %160, label %161, label %176

161:                                              ; preds = %157
  %162 = load i64, ptr %13, align 8, !tbaa !9
  %163 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %162) #5
  %164 = load i8, ptr %163, align 1, !tbaa !11
  %165 = zext i8 %164 to i64
  %166 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt5arrayIcLm59EEixEm(ptr noundef nonnull align 1 dereferenceable(59) @_ZL17b58digits_ordered, i64 noundef %165) #5
  %167 = load i8, ptr %166, align 1, !tbaa !11
  %168 = load ptr, ptr %6, align 8, !tbaa !5
  %169 = load i64, ptr %12, align 8, !tbaa !9
  %170 = getelementptr inbounds i8, ptr %168, i64 %169
  store i8 %167, ptr %170, align 1, !tbaa !11
  br label %171

171:                                              ; preds = %161
  %172 = load i64, ptr %12, align 8, !tbaa !9
  %173 = add nsw i64 %172, 1
  store i64 %173, ptr %12, align 8, !tbaa !9
  %174 = load i64, ptr %13, align 8, !tbaa !9
  %175 = add nsw i64 %174, 1
  store i64 %175, ptr %13, align 8, !tbaa !9
  br label %157, !llvm.loop !19

176:                                              ; preds = %157
  %177 = load ptr, ptr %6, align 8, !tbaa !5
  %178 = load i64, ptr %12, align 8, !tbaa !9
  %179 = getelementptr inbounds i8, ptr %177, i64 %178
  store i8 0, ptr %179, align 1, !tbaa !11
  %180 = load i64, ptr %12, align 8, !tbaa !9
  %181 = add nsw i64 %180, 1
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %181, ptr %182, align 8, !tbaa !9
  store i1 true, ptr %5, align 1
  store i32 1, ptr %24, align 4
  br label %183

183:                                              ; preds = %176, %141
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %184 = load i1, ptr %5, align 1
  ret i1 %184

185:                                              ; preds = %106, %102
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %186

186:                                              ; preds = %185
  %187 = load ptr, ptr %19, align 8
  %188 = load i32, ptr %20, align 4
  %189 = insertvalue { ptr, i32 } poison, ptr %187, 0
  %190 = insertvalue { ptr, i32 } %189, i32 %188, 1
  resume { ptr, i32 } %190
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEEiEvT_S7_RKT0_(ptr, ptr, ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIhSaIhEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIhSaIhEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt5arrayIcLm59EEixEm(ptr noundef nonnull align 1 dereferenceable(59), i64 noundef) #2 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !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"

%"struct.std::array.6" = type { [59 x i8] }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.2" = type { i8 }

@_ZL17b58digits_ordered = external hidden constant %"struct.std::array.6", align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z6b58encPcPmPKhm(ptr nocapture noundef writeonly %0, ptr nocapture noundef %1, ptr nocapture noundef readonly %2, i64 noundef %3) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::vector.0", align 8
  %6 = alloca %"class.std::allocator.2", align 1
  %7 = alloca i32, align 4
  %8 = icmp sgt i64 %3, 0
  br i1 %8, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %4, %11
  %.06374 = phi i64 [ %12, %11 ], [ 0, %4 ]
  %9 = getelementptr inbounds i8, ptr %2, i64 %.06374
  %10 = load i8, ptr %9, align 1, !tbaa !5
  %.not = icmp eq i8 %10, 0
  br i1 %.not, label %11, label %.critedge

11:                                               ; preds = %.lr.ph
  %12 = add nuw nsw i64 %.06374, 1
  %exitcond.not = icmp eq i64 %12, %3
  br i1 %exitcond.not, label %.critedge, label %.lr.ph, !llvm.loop !8

.critedge:                                        ; preds = %.lr.ph, %11, %4
  %.063.lcssa = phi i64 [ 0, %4 ], [ %3, %11 ], [ %.06374, %.lr.ph ]
  %13 = sub i64 %3, %.063.lcssa
  %14 = mul i64 %13, 138
  %15 = udiv i64 %14, 100
  %16 = add nuw nsw i64 %15, 1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #5
  call void @_ZNSaIhEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  invoke void @_ZNSt6vectorIhSaIhEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %16, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %17 unwind label %42

17:                                               ; preds = %.critedge
  call void @_ZNSt15__new_allocatorIhED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  %18 = call ptr @_ZNSt6vectorIhSaIhEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %19 = call ptr @_ZNSt6vectorIhSaIhEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  store i32 0, ptr %7, align 4, !tbaa !10
  invoke void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEEiEvT_S7_RKT0_(ptr %18, ptr %19, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %20 unwind label %44

20:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  %21 = icmp slt i64 %.063.lcssa, %3
  br i1 %21, label %.lr.ph84, label %.preheader.preheader

.lr.ph84:                                         ; preds = %20, %._crit_edge
  %.06282 = phi i64 [ %46, %._crit_edge ], [ %.063.lcssa, %20 ]
  %.06481 = phi i64 [ %.065.lcssa, %._crit_edge ], [ %15, %20 ]
  %22 = getelementptr inbounds i8, ptr %2, i64 %.06282
  %23 = load i8, ptr %22, align 1, !tbaa !5
  %24 = icmp sgt i64 %15, %.06481
  %25 = icmp ne i8 %23, 0
  %26 = select i1 %24, i1 true, i1 %25
  br i1 %26, label %.lr.ph79.preheader, label %._crit_edge

.lr.ph79.preheader:                               ; preds = %.lr.ph84
  %27 = zext i8 %23 to i32
  br label %.lr.ph79

.lr.ph79:                                         ; preds = %.lr.ph79.preheader, %.lr.ph79
  %.05978 = phi i32 [ %36, %.lr.ph79 ], [ %27, %.lr.ph79.preheader ]
  %.06577 = phi i64 [ %37, %.lr.ph79 ], [ %15, %.lr.ph79.preheader ]
  %28 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.06577) #5
  %29 = load i8, ptr %28, align 1, !tbaa !5
  %30 = zext i8 %29 to i32
  %31 = shl nuw nsw i32 %30, 8
  %32 = add nsw i32 %31, %.05978
  %33 = srem i32 %32, 58
  %34 = trunc nsw i32 %33 to i8
  %35 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.06577) #5
  store i8 %34, ptr %35, align 1, !tbaa !5
  %36 = sdiv i32 %32, 58
  %37 = add nsw i64 %.06577, -1
  %38 = icmp sgt i64 %37, %.06481
  %39 = add nsw i32 %32, -58
  %40 = icmp ult i32 %39, -115
  %41 = select i1 %38, i1 true, i1 %40
  br i1 %41, label %.lr.ph79, label %._crit_edge, !llvm.loop !12

42:                                               ; preds = %.critedge
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIhED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  br label %67

44:                                               ; preds = %17
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %67

._crit_edge:                                      ; preds = %.lr.ph79, %.lr.ph84
  %.065.lcssa = phi i64 [ %15, %.lr.ph84 ], [ %37, %.lr.ph79 ]
  %46 = add i64 %.06282, 1
  %exitcond94.not = icmp eq i64 %46, %3
  br i1 %exitcond94.not, label %.preheader.preheader, label %.lr.ph84, !llvm.loop !13

.preheader.preheader:                             ; preds = %._crit_edge, %20
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %49
  %.16685 = phi i64 [ %50, %49 ], [ 0, %.preheader.preheader ]
  %47 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.16685) #5
  %48 = load i8, ptr %47, align 1, !tbaa !5
  %.not70 = icmp eq i8 %48, 0
  br i1 %.not70, label %49, label %.critedge2

49:                                               ; preds = %.preheader
  %50 = add nuw nsw i64 %.16685, 1
  %exitcond95.not = icmp eq i64 %.16685, %15
  br i1 %exitcond95.not, label %.critedge2, label %.preheader, !llvm.loop !14

.critedge2:                                       ; preds = %49, %.preheader
  %.166.lcssa = phi i64 [ %16, %49 ], [ %.16685, %.preheader ]
  %51 = load i64, ptr %1, align 8, !tbaa !15
  %52 = add nuw i64 %16, %.063.lcssa
  %53 = sub i64 %52, %.166.lcssa
  %.not71 = icmp ugt i64 %51, %53
  br i1 %.not71, label %54, label %66

54:                                               ; preds = %.critedge2
  %.not72 = icmp eq i64 %.063.lcssa, 0
  br i1 %.not72, label %56, label %55

55:                                               ; preds = %54
  call void @llvm.memset.p0.i64(ptr align 1 %0, i8 49, i64 %.063.lcssa, i1 false)
  br label %56

56:                                               ; preds = %55, %54
  %.not7386 = icmp ugt i64 %.166.lcssa, %15
  br i1 %.not7386, label %._crit_edge91, label %.lr.ph90

.lr.ph90:                                         ; preds = %56, %.lr.ph90
  %.188 = phi i64 [ %63, %.lr.ph90 ], [ %.063.lcssa, %56 ]
  %.287 = phi i64 [ %64, %.lr.ph90 ], [ %.166.lcssa, %56 ]
  %57 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.287) #5
  %58 = load i8, ptr %57, align 1, !tbaa !5
  %59 = zext i8 %58 to i64
  %60 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt5arrayIcLm59EEixEm(ptr noundef nonnull align 1 dereferenceable(59) @_ZL17b58digits_ordered, i64 noundef %59) #5
  %61 = load i8, ptr %60, align 1, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %0, i64 %.188
  store i8 %61, ptr %62, align 1, !tbaa !5
  %63 = add nuw nsw i64 %.188, 1
  %64 = add nuw nsw i64 %.287, 1
  %exitcond96.not = icmp eq i64 %.287, %15
  br i1 %exitcond96.not, label %._crit_edge91, label %.lr.ph90, !llvm.loop !17

._crit_edge91:                                    ; preds = %.lr.ph90, %56
  %.1.lcssa = phi i64 [ %.063.lcssa, %56 ], [ %63, %.lr.ph90 ]
  %65 = getelementptr inbounds i8, ptr %0, i64 %.1.lcssa
  store i8 0, ptr %65, align 1, !tbaa !5
  br label %66

66:                                               ; preds = %.critedge2, %._crit_edge91
  %storemerge.in = phi i64 [ %.1.lcssa, %._crit_edge91 ], [ %53, %.critedge2 ]
  %storemerge = add i64 %storemerge.in, 1
  store i64 %storemerge, ptr %1, align 8, !tbaa !15
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  ret i1 %.not71

67:                                               ; preds = %44, %42
  %.pn = phi { ptr, i32 } [ %45, %44 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPhSt6vectorIhSaIhEEEEiEvT_S7_RKT0_(ptr, ptr, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIhSaIhEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIhSaIhEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt5arrayIcLm59EEixEm(ptr noundef nonnull align 1 dereferenceable(59), i64 noundef) local_unnamed_addr #2 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = distinct !{!12, !9}
!13 = distinct !{!13, !9}
!14 = distinct !{!14, !9}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !6, i64 0}
!17 = distinct !{!17, !9}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass