; LLVM IR from dynexcoin/Dynex :: src/Common (StringTools)

; 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] }

@_ZN6Common12_GLOBAL__N_111base64charsB5cxx11E = external hidden global %"class.std::__cxx11::basic_string", align 8

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext) #2 align 2

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

; Function Attrs: nounwind
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext, i64 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Common12base64DecodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca [4 x i8], align 1
  %10 = alloca [3 x i8], align 1
  %11 = alloca i1, align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %14) #4
  store i64 %15, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store i64 0, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store i64 0, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store i64 0, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 3, ptr %10) #4
  store i1 false, ptr %11, align 1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  br label %16

16:                                               ; preds = %117, %2
  %17 = load i64, ptr %5, align 8, !tbaa !9
  %18 = add i64 %17, -1
  store i64 %18, ptr %5, align 8, !tbaa !9
  %19 = icmp ne i64 %17, 0
  br i1 %19, label %20, label %34

20:                                               ; preds = %16
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = load i64, ptr %8, align 8, !tbaa !9
  %23 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %21, i64 noundef %22) #4
  %24 = load i8, ptr %23, align 1, !tbaa !11
  %25 = sext i8 %24 to i32
  %26 = icmp ne i32 %25, 61
  br i1 %26, label %27, label %34

27:                                               ; preds = %20
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = load i64, ptr %8, align 8, !tbaa !9
  %30 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %28, i64 noundef %29) #4
  %31 = load i8, ptr %30, align 1, !tbaa !11
  %32 = invoke noundef zeroext i1 @_ZN6Common12_GLOBAL__N_19is_base64Eh(i8 noundef zeroext %31)
          to label %33 unwind label %63

33:                                               ; preds = %27
  br label %34

34:                                               ; preds = %33, %20, %16
  %35 = phi i1 [ false, %20 ], [ false, %16 ], [ %32, %33 ]
  br i1 %35, label %36, label %118

36:                                               ; preds = %34
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = load i64, ptr %8, align 8, !tbaa !9
  %39 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %37, i64 noundef %38) #4
  %40 = load i8, ptr %39, align 1, !tbaa !11
  %41 = load i64, ptr %6, align 8, !tbaa !9
  %42 = add i64 %41, 1
  store i64 %42, ptr %6, align 8, !tbaa !9
  %43 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 %41
  store i8 %40, ptr %43, align 1, !tbaa !11
  %44 = load i64, ptr %8, align 8, !tbaa !9
  %45 = add i64 %44, 1
  store i64 %45, ptr %8, align 8, !tbaa !9
  %46 = load i64, ptr %6, align 8, !tbaa !9
  %47 = icmp eq i64 %46, 4
  br i1 %47, label %48, label %117

48:                                               ; preds = %36
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %49

49:                                               ; preds = %60, %48
  %50 = load i64, ptr %6, align 8, !tbaa !9
  %51 = icmp ult i64 %50, 4
  br i1 %51, label %52, label %67

52:                                               ; preds = %49
  %53 = load i64, ptr %6, align 8, !tbaa !9
  %54 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !11
  %56 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN6Common12_GLOBAL__N_111base64charsB5cxx11E, i8 noundef signext %55, i64 noundef 0) #4
  %57 = trunc i64 %56 to i8
  %58 = load i64, ptr %6, align 8, !tbaa !9
  %59 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 %58
  store i8 %57, ptr %59, align 1, !tbaa !11
  br label %60

60:                                               ; preds = %52
  %61 = load i64, ptr %6, align 8, !tbaa !9
  %62 = add i64 %61, 1
  store i64 %62, ptr %6, align 8, !tbaa !9
  br label %49, !llvm.loop !12

63:                                               ; preds = %189, %107, %27
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %12, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  call void @llvm.lifetime.end.p0(i64 3, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %203

67:                                               ; preds = %49
  %68 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 0
  %69 = load i8, ptr %68, align 1, !tbaa !11
  %70 = zext i8 %69 to i32
  %71 = shl i32 %70, 2
  %72 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 1
  %73 = load i8, ptr %72, align 1, !tbaa !11
  %74 = zext i8 %73 to i32
  %75 = and i32 %74, 48
  %76 = ashr i32 %75, 4
  %77 = add nsw i32 %71, %76
  %78 = trunc i32 %77 to i8
  %79 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 0
  store i8 %78, ptr %79, align 1, !tbaa !11
  %80 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 1
  %81 = load i8, ptr %80, align 1, !tbaa !11
  %82 = zext i8 %81 to i32
  %83 = and i32 %82, 15
  %84 = shl i32 %83, 4
  %85 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 2
  %86 = load i8, ptr %85, align 1, !tbaa !11
  %87 = zext i8 %86 to i32
  %88 = and i32 %87, 60
  %89 = ashr i32 %88, 2
  %90 = add nsw i32 %84, %89
  %91 = trunc i32 %90 to i8
  %92 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 1
  store i8 %91, ptr %92, align 1, !tbaa !11
  %93 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 2
  %94 = load i8, ptr %93, align 1, !tbaa !11
  %95 = zext i8 %94 to i32
  %96 = and i32 %95, 3
  %97 = shl i32 %96, 6
  %98 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 3
  %99 = load i8, ptr %98, align 1, !tbaa !11
  %100 = zext i8 %99 to i32
  %101 = add nsw i32 %97, %100
  %102 = trunc i32 %101 to i8
  %103 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 2
  store i8 %102, ptr %103, align 1, !tbaa !11
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %104

104:                                              ; preds = %113, %67
  %105 = load i64, ptr %6, align 8, !tbaa !9
  %106 = icmp ult i64 %105, 3
  br i1 %106, label %107, label %116

107:                                              ; preds = %104
  %108 = load i64, ptr %6, align 8, !tbaa !9
  %109 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 %108
  %110 = load i8, ptr %109, align 1, !tbaa !11
  %111 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %110)
          to label %112 unwind label %63

112:                                              ; preds = %107
  br label %113

113:                                              ; preds = %112
  %114 = load i64, ptr %6, align 8, !tbaa !9
  %115 = add i64 %114, 1
  store i64 %115, ptr %6, align 8, !tbaa !9
  br label %104, !llvm.loop !14

116:                                              ; preds = %104
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %117

117:                                              ; preds = %116, %36
  br label %16, !llvm.loop !15

118:                                              ; preds = %34
  %119 = load i64, ptr %6, align 8, !tbaa !9
  %120 = icmp ne i64 %119, 0
  br i1 %120, label %121, label %199

121:                                              ; preds = %118
  %122 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %122, ptr %7, align 8, !tbaa !9
  br label %123

123:                                              ; preds = %129, %121
  %124 = load i64, ptr %7, align 8, !tbaa !9
  %125 = icmp ult i64 %124, 4
  br i1 %125, label %126, label %132

126:                                              ; preds = %123
  %127 = load i64, ptr %7, align 8, !tbaa !9
  %128 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 %127
  store i8 0, ptr %128, align 1, !tbaa !11
  br label %129

129:                                              ; preds = %126
  %130 = load i64, ptr %7, align 8, !tbaa !9
  %131 = add i64 %130, 1
  store i64 %131, ptr %7, align 8, !tbaa !9
  br label %123, !llvm.loop !16

132:                                              ; preds = %123
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %133

133:                                              ; preds = %144, %132
  %134 = load i64, ptr %7, align 8, !tbaa !9
  %135 = icmp ult i64 %134, 4
  br i1 %135, label %136, label %147

136:                                              ; preds = %133
  %137 = load i64, ptr %7, align 8, !tbaa !9
  %138 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 %137
  %139 = load i8, ptr %138, align 1, !tbaa !11
  %140 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN6Common12_GLOBAL__N_111base64charsB5cxx11E, i8 noundef signext %139, i64 noundef 0) #4
  %141 = trunc i64 %140 to i8
  %142 = load i64, ptr %7, align 8, !tbaa !9
  %143 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 %142
  store i8 %141, ptr %143, align 1, !tbaa !11
  br label %144

144:                                              ; preds = %136
  %145 = load i64, ptr %7, align 8, !tbaa !9
  %146 = add i64 %145, 1
  store i64 %146, ptr %7, align 8, !tbaa !9
  br label %133, !llvm.loop !17

147:                                              ; preds = %133
  %148 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 0
  %149 = load i8, ptr %148, align 1, !tbaa !11
  %150 = zext i8 %149 to i32
  %151 = shl i32 %150, 2
  %152 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 1
  %153 = load i8, ptr %152, align 1, !tbaa !11
  %154 = zext i8 %153 to i32
  %155 = and i32 %154, 48
  %156 = ashr i32 %155, 4
  %157 = add nsw i32 %151, %156
  %158 = trunc i32 %157 to i8
  %159 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 0
  store i8 %158, ptr %159, align 1, !tbaa !11
  %160 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 1
  %161 = load i8, ptr %160, align 1, !tbaa !11
  %162 = zext i8 %161 to i32
  %163 = and i32 %162, 15
  %164 = shl i32 %163, 4
  %165 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 2
  %166 = load i8, ptr %165, align 1, !tbaa !11
  %167 = zext i8 %166 to i32
  %168 = and i32 %167, 60
  %169 = ashr i32 %168, 2
  %170 = add nsw i32 %164, %169
  %171 = trunc i32 %170 to i8
  %172 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 1
  store i8 %171, ptr %172, align 1, !tbaa !11
  %173 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 2
  %174 = load i8, ptr %173, align 1, !tbaa !11
  %175 = zext i8 %174 to i32
  %176 = and i32 %175, 3
  %177 = shl i32 %176, 6
  %178 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 3
  %179 = load i8, ptr %178, align 1, !tbaa !11
  %180 = zext i8 %179 to i32
  %181 = add nsw i32 %177, %180
  %182 = trunc i32 %181 to i8
  %183 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 2
  store i8 %182, ptr %183, align 1, !tbaa !11
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %184

184:                                              ; preds = %195, %147
  %185 = load i64, ptr %7, align 8, !tbaa !9
  %186 = load i64, ptr %6, align 8, !tbaa !9
  %187 = sub i64 %186, 1
  %188 = icmp ult i64 %185, %187
  br i1 %188, label %189, label %198

189:                                              ; preds = %184
  %190 = load i64, ptr %7, align 8, !tbaa !9
  %191 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 %190
  %192 = load i8, ptr %191, align 1, !tbaa !11
  %193 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %192)
          to label %194 unwind label %63

194:                                              ; preds = %189
  br label %195

195:                                              ; preds = %194
  %196 = load i64, ptr %7, align 8, !tbaa !9
  %197 = add i64 %196, 1
  store i64 %197, ptr %7, align 8, !tbaa !9
  br label %184, !llvm.loop !18

198:                                              ; preds = %184
  br label %199

199:                                              ; preds = %198, %118
  store i1 true, ptr %11, align 1
  %200 = load i1, ptr %11, align 1
  br i1 %200, label %202, label %201

201:                                              ; preds = %199
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  br label %202

202:                                              ; preds = %201, %199
  call void @llvm.lifetime.end.p0(i64 3, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void

203:                                              ; preds = %63
  %204 = load ptr, ptr %12, align 8
  %205 = load i32, ptr %13, align 4
  %206 = insertvalue { ptr, i32 } poison, ptr %204, 0
  %207 = insertvalue { ptr, i32 } %206, i32 %205, 1
  resume { ptr, i32 } %207
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN6Common12_GLOBAL__N_19is_base64Eh(i8 noundef zeroext) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { 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 #4 = { 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 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !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"

%"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] }

@_ZN6Common12_GLOBAL__N_111base64charsB5cxx11E = external hidden global %"class.std::__cxx11::basic_string", align 8

; 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 nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext) local_unnamed_addr #2 align 2

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

; Function Attrs: nounwind
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Common12base64DecodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca [4 x i8], align 1
  %4 = alloca [3 x i8], align 1
  %5 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %4) #5
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %.not48 = icmp eq i64 %5, 0
  br i1 %.not48, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %6 = getelementptr inbounds i8, ptr %3, i64 1
  %7 = getelementptr inbounds i8, ptr %3, i64 2
  %8 = getelementptr inbounds i8, ptr %3, i64 3
  %.promoted = load i8, ptr %4, align 1, !tbaa !5
  br label %9

9:                                                ; preds = %.lr.ph, %.loopexit43
  %10 = phi i8 [ %.promoted, %.lr.ph ], [ %53, %.loopexit43 ]
  %.in = phi i64 [ %5, %.lr.ph ], [ %11, %.loopexit43 ]
  %.03350 = phi i64 [ 0, %.lr.ph ], [ %.3, %.loopexit43 ]
  %.03449 = phi i64 [ 0, %.lr.ph ], [ %23, %.loopexit43 ]
  %11 = add i64 %.in, -1
  %12 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.03449) #5
  %13 = load i8, ptr %12, align 1, !tbaa !5
  %.not39 = icmp eq i8 %13, 61
  br i1 %.not39, label %.critedge, label %14

14:                                               ; preds = %9
  %15 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.03449) #5
  %16 = load i8, ptr %15, align 1, !tbaa !5
  %17 = tail call noundef zeroext i1 @_ZN6Common12_GLOBAL__N_19is_base64Eh(i8 noundef zeroext %16)
  br i1 %17, label %18, label %.critedge

18:                                               ; preds = %14
  %19 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.03449) #5
  %20 = load i8, ptr %19, align 1, !tbaa !5
  %21 = add i64 %.03350, 1
  %22 = getelementptr inbounds [4 x i8], ptr %3, i64 0, i64 %.03350
  store i8 %20, ptr %22, align 1, !tbaa !5
  %23 = add nuw i64 %.03449, 1
  %24 = icmp eq i64 %21, 4
  br i1 %24, label %.preheader44.preheader, label %.loopexit43

.preheader44.preheader:                           ; preds = %18
  %25 = load i8, ptr %3, align 1, !tbaa !5
  %26 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN6Common12_GLOBAL__N_111base64charsB5cxx11E, i8 noundef signext %25, i64 noundef 0) #5
  %27 = trunc i64 %26 to i8
  store i8 %27, ptr %3, align 1, !tbaa !5
  %28 = load i8, ptr %6, align 1, !tbaa !5
  %29 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN6Common12_GLOBAL__N_111base64charsB5cxx11E, i8 noundef signext %28, i64 noundef 0) #5
  %30 = trunc i64 %29 to i8
  store i8 %30, ptr %6, align 1, !tbaa !5
  %31 = load i8, ptr %7, align 1, !tbaa !5
  %32 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN6Common12_GLOBAL__N_111base64charsB5cxx11E, i8 noundef signext %31, i64 noundef 0) #5
  %33 = trunc i64 %32 to i8
  store i8 %33, ptr %7, align 1, !tbaa !5
  %34 = load i8, ptr %8, align 1, !tbaa !5
  %35 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN6Common12_GLOBAL__N_111base64charsB5cxx11E, i8 noundef signext %34, i64 noundef 0) #5
  %36 = trunc i64 %35 to i8
  store i8 %36, ptr %8, align 1, !tbaa !5
  %37 = shl i8 %27, 2
  %38 = lshr i8 %30, 4
  %39 = and i8 %38, 3
  %40 = or disjoint i8 %39, %37
  %41 = shl i8 %33, 6
  %42 = add i8 %41, %36
  %43 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %40)
          to label %45 unwind label %.loopexit.split-lp

.loopexit41:                                      ; preds = %.lr.ph59
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %44

.loopexit.split-lp:                               ; preds = %51, %45, %.preheader44.preheader
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  store i8 %40, ptr %4, align 1, !tbaa !5
  br label %44

44:                                               ; preds = %.loopexit.split-lp, %.loopexit41
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit41 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  resume { ptr, i32 } %lpad.phi

45:                                               ; preds = %.preheader44.preheader
  %46 = lshr i8 %33, 2
  %47 = and i8 %46, 15
  %48 = shl i8 %30, 4
  %49 = or disjoint i8 %47, %48
  %50 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %49)
          to label %51 unwind label %.loopexit.split-lp

51:                                               ; preds = %45
  %52 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %42)
          to label %.loopexit43 unwind label %.loopexit.split-lp

.loopexit43:                                      ; preds = %51, %18
  %53 = phi i8 [ %10, %18 ], [ %40, %51 ]
  %.3 = phi i64 [ %21, %18 ], [ 0, %51 ]
  %.not = icmp eq i64 %11, 0
  br i1 %.not, label %.critedge, label %9, !llvm.loop !8

.critedge:                                        ; preds = %14, %.loopexit43, %9
  %54 = phi i8 [ %10, %14 ], [ %53, %.loopexit43 ], [ %10, %9 ]
  %.033.lcssa = phi i64 [ %.03350, %14 ], [ %.3, %.loopexit43 ], [ %.03350, %9 ]
  store i8 %54, ptr %4, align 1, !tbaa !5
  %.not40 = icmp eq i64 %.033.lcssa, 0
  br i1 %.not40, label %.loopexit, label %.preheader42

.preheader42:                                     ; preds = %.critedge
  %55 = icmp ult i64 %.033.lcssa, 4
  br i1 %55, label %.lr.ph56.preheader, label %.preheader

.lr.ph56.preheader:                               ; preds = %.preheader42
  %scevgep = getelementptr i8, ptr %3, i64 %.033.lcssa
  %56 = sub nuw nsw i64 4, %.033.lcssa
  call void @llvm.memset.p0.i64(ptr align 1 %scevgep, i8 0, i64 %56, i1 false), !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph56.preheader, %.preheader42
  %57 = load i8, ptr %3, align 1, !tbaa !5
  %58 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN6Common12_GLOBAL__N_111base64charsB5cxx11E, i8 noundef signext %57, i64 noundef 0) #5
  %59 = trunc i64 %58 to i8
  %60 = getelementptr inbounds i8, ptr %3, i64 1
  %61 = load i8, ptr %60, align 1, !tbaa !5
  %62 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN6Common12_GLOBAL__N_111base64charsB5cxx11E, i8 noundef signext %61, i64 noundef 0) #5
  %63 = trunc i64 %62 to i8
  %64 = getelementptr inbounds i8, ptr %3, i64 2
  %65 = load i8, ptr %64, align 1, !tbaa !5
  %66 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN6Common12_GLOBAL__N_111base64charsB5cxx11E, i8 noundef signext %65, i64 noundef 0) #5
  %67 = trunc i64 %66 to i8
  %68 = getelementptr inbounds i8, ptr %3, i64 3
  %69 = load i8, ptr %68, align 1, !tbaa !5
  %70 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN6Common12_GLOBAL__N_111base64charsB5cxx11E, i8 noundef signext %69, i64 noundef 0) #5
  %71 = trunc i64 %70 to i8
  %72 = shl i8 %59, 2
  %73 = lshr i8 %63, 4
  %74 = and i8 %73, 3
  %75 = or disjoint i8 %74, %72
  store i8 %75, ptr %4, align 1, !tbaa !5
  %76 = shl i8 %63, 4
  %77 = lshr i8 %67, 2
  %78 = and i8 %77, 15
  %79 = or disjoint i8 %78, %76
  %80 = getelementptr inbounds i8, ptr %4, i64 1
  store i8 %79, ptr %80, align 1, !tbaa !5
  %81 = shl i8 %67, 6
  %82 = add i8 %81, %71
  %83 = getelementptr inbounds i8, ptr %4, i64 2
  store i8 %82, ptr %83, align 1, !tbaa !5
  %84 = add i64 %.033.lcssa, -1
  %.not60 = icmp eq i64 %84, 0
  br i1 %.not60, label %.loopexit, label %.lr.ph59

.lr.ph59:                                         ; preds = %.preheader, %88
  %.23758 = phi i64 [ %89, %88 ], [ 0, %.preheader ]
  %85 = getelementptr inbounds [3 x i8], ptr %4, i64 0, i64 %.23758
  %86 = load i8, ptr %85, align 1, !tbaa !5
  %87 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %86)
          to label %88 unwind label %.loopexit41

88:                                               ; preds = %.lr.ph59
  %89 = add nuw i64 %.23758, 1
  %exitcond.not = icmp eq i64 %89, %84
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph59, !llvm.loop !10

.loopexit:                                        ; preds = %88, %2, %.preheader, %.critedge
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN6Common12_GLOBAL__N_19is_base64Eh(i8 noundef zeroext) local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { 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 #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}


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