; LLVM IR from UBIC-repo/core :: Tools/Base64.ll/Z13base64_decodeRKNSt7 (cxx1112basic_stringIcSt11char_traitsIcESaIcEEE)

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

@_ZL12base64_charsB5cxx11 = 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 void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) 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 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 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 uwtable
define dso_local void @_Z13base64_decodeRKNSt7__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 i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %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 4, ptr %5) #5
  %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) #5
  %16 = trunc i64 %15 to i32
  store i32 %16, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 3, ptr %10) #5
  store i1 false, ptr %11, align 1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %17

17:                                               ; preds = %125, %2
  %18 = load i32, ptr %5, align 4, !tbaa !9
  %19 = add nsw i32 %18, -1
  store i32 %19, ptr %5, align 4, !tbaa !9
  %20 = icmp ne i32 %18, 0
  br i1 %20, label %21, label %37

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

29:                                               ; preds = %21
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %30, i64 noundef %32) #5
  %34 = load i8, ptr %33, align 1, !tbaa !11
  %35 = invoke noundef zeroext i1 @_ZL9is_base64h(i8 noundef zeroext %34)
          to label %36 unwind label %70

36:                                               ; preds = %29
  br label %37

37:                                               ; preds = %36, %21, %17
  %38 = phi i1 [ false, %21 ], [ false, %17 ], [ %35, %36 ]
  br i1 %38, label %39, label %126

39:                                               ; preds = %37
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %40, i64 noundef %42) #5
  %44 = load i8, ptr %43, align 1, !tbaa !11
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %6, align 4, !tbaa !9
  %47 = sext i32 %45 to i64
  %48 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 %47
  store i8 %44, ptr %48, align 1, !tbaa !11
  %49 = load i32, ptr %8, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %8, align 4, !tbaa !9
  %51 = load i32, ptr %6, align 4, !tbaa !9
  %52 = icmp eq i32 %51, 4
  br i1 %52, label %53, label %125

53:                                               ; preds = %39
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %67, %53
  %55 = load i32, ptr %6, align 4, !tbaa !9
  %56 = icmp slt i32 %55, 4
  br i1 %56, label %57, label %74

57:                                               ; preds = %54
  %58 = load i32, ptr %6, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 %59
  %61 = load i8, ptr %60, align 1, !tbaa !11
  %62 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL12base64_charsB5cxx11, i8 noundef signext %61, i64 noundef 0) #5
  %63 = trunc i64 %62 to i8
  %64 = load i32, ptr %6, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [4 x i8], ptr %9, i64 0, i64 %65
  store i8 %63, ptr %66, align 1, !tbaa !11
  br label %67

67:                                               ; preds = %57
  %68 = load i32, ptr %6, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %6, align 4, !tbaa !9
  br label %54, !llvm.loop !12

70:                                               ; preds = %178, %114, %29
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %12, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  call void @llvm.lifetime.end.p0(i64 3, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %193

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

111:                                              ; preds = %121, %74
  %112 = load i32, ptr %6, align 4, !tbaa !9
  %113 = icmp slt i32 %112, 3
  br i1 %113, label %114, label %124

114:                                              ; preds = %111
  %115 = load i32, ptr %6, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 %116
  %118 = load i8, ptr %117, align 1, !tbaa !11
  %119 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %118)
          to label %120 unwind label %70

120:                                              ; preds = %114
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %6, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %6, align 4, !tbaa !9
  br label %111, !llvm.loop !14

124:                                              ; preds = %111
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %125

125:                                              ; preds = %124, %39
  br label %17, !llvm.loop !15

126:                                              ; preds = %37
  %127 = load i32, ptr %6, align 4, !tbaa !9
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %189

129:                                              ; preds = %126
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %130

130:                                              ; preds = %144, %129
  %131 = load i32, ptr %7, align 4, !tbaa !9
  %132 = load i32, ptr %6, align 4, !tbaa !9
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %134, label %147

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

144:                                              ; preds = %134
  %145 = load i32, ptr %7, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %7, align 4, !tbaa !9
  br label %130, !llvm.loop !16

147:                                              ; preds = %130
  %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
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %173

173:                                              ; preds = %185, %147
  %174 = load i32, ptr %7, align 4, !tbaa !9
  %175 = load i32, ptr %6, align 4, !tbaa !9
  %176 = sub nsw i32 %175, 1
  %177 = icmp slt i32 %174, %176
  br i1 %177, label %178, label %188

178:                                              ; preds = %173
  %179 = load i32, ptr %7, align 4, !tbaa !9
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 %180
  %182 = load i8, ptr %181, align 1, !tbaa !11
  %183 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %182)
          to label %184 unwind label %70

184:                                              ; preds = %178
  br label %185

185:                                              ; preds = %184
  %186 = load i32, ptr %7, align 4, !tbaa !9
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %7, align 4, !tbaa !9
  br label %173, !llvm.loop !17

188:                                              ; preds = %173
  br label %189

189:                                              ; preds = %188, %126
  store i1 true, ptr %11, align 1
  %190 = load i1, ptr %11, align 1
  br i1 %190, label %192, label %191

191:                                              ; preds = %189
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %192

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

193:                                              ; preds = %70
  %194 = load ptr, ptr %12, align 8
  %195 = load i32, ptr %13, align 4
  %196 = insertvalue { ptr, i32 } poison, ptr %194, 0
  %197 = insertvalue { ptr, i32 } %196, i32 %195, 1
  resume { ptr, i32 } %197
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZL9is_base64h(i8 noundef zeroext) #3

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

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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = !{!"int", !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}


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

@_ZL12base64_charsB5cxx11 = 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 void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) 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 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 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 uwtable
define dso_local void @_Z13base64_decodeRKNSt7__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
  %6 = trunc i64 %5 to i32
  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
  %.not43 = icmp eq i32 %6, 0
  br i1 %.not43, label %.loopexit, label %.lr.ph

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

12:                                               ; preds = %.lr.ph, %.loopexit38
  %13 = phi i8 [ %.promoted70, %.lr.ph ], [ %58, %.loopexit38 ]
  %14 = phi i8 [ %.promoted68, %.lr.ph ], [ %59, %.loopexit38 ]
  %15 = phi i8 [ %.promoted, %.lr.ph ], [ %60, %.loopexit38 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %.loopexit38 ]
  %.in = phi i32 [ %6, %.lr.ph ], [ %16, %.loopexit38 ]
  %.03045 = phi i32 [ 0, %.lr.ph ], [ %.3, %.loopexit38 ]
  %16 = add nsw i32 %.in, -1
  %17 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv) #5
  %18 = load i8, ptr %17, align 1, !tbaa !5
  %.not35 = icmp eq i8 %18, 61
  br i1 %.not35, label %.critedge, label %19

19:                                               ; preds = %12
  %20 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv) #5
  %21 = load i8, ptr %20, align 1, !tbaa !5
  %22 = tail call noundef zeroext i1 @_ZL9is_base64h(i8 noundef zeroext %21)
  br i1 %22, label %23, label %.critedge

23:                                               ; preds = %19
  %24 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv) #5
  %25 = load i8, ptr %24, align 1, !tbaa !5
  %26 = add nsw i32 %.03045, 1
  %27 = sext i32 %.03045 to i64
  %28 = getelementptr inbounds [4 x i8], ptr %3, i64 0, i64 %27
  store i8 %25, ptr %28, align 1, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = icmp eq i32 %26, 4
  br i1 %29, label %.preheader39.preheader, label %.loopexit38

.preheader39.preheader:                           ; preds = %23
  %30 = load i8, ptr %3, align 1, !tbaa !5
  %31 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL12base64_charsB5cxx11, i8 noundef signext %30, i64 noundef 0) #5
  %32 = trunc i64 %31 to i8
  store i8 %32, ptr %3, align 1, !tbaa !5
  %33 = load i8, ptr %7, align 1, !tbaa !5
  %34 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL12base64_charsB5cxx11, i8 noundef signext %33, i64 noundef 0) #5
  %35 = trunc i64 %34 to i8
  store i8 %35, ptr %7, align 1, !tbaa !5
  %36 = load i8, ptr %8, align 1, !tbaa !5
  %37 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL12base64_charsB5cxx11, i8 noundef signext %36, i64 noundef 0) #5
  %38 = trunc i64 %37 to i8
  store i8 %38, ptr %8, align 1, !tbaa !5
  %39 = load i8, ptr %10, align 1, !tbaa !5
  %40 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL12base64_charsB5cxx11, i8 noundef signext %39, i64 noundef 0) #5
  %41 = trunc i64 %40 to i8
  store i8 %41, ptr %10, align 1, !tbaa !5
  %42 = shl i8 %32, 2
  %43 = lshr i8 %35, 4
  %44 = and i8 %43, 3
  %45 = or disjoint i8 %44, %42
  %46 = shl i8 %35, 4
  %47 = lshr i8 %38, 2
  %48 = and i8 %47, 15
  %49 = or disjoint i8 %48, %46
  %50 = shl i8 %38, 6
  %51 = add i8 %50, %41
  %52 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %45)
          to label %54 unwind label %.loopexit.split-lp

.loopexit37:                                      ; preds = %.lr.ph54
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %53

.loopexit.split-lp:                               ; preds = %56, %54, %.preheader39.preheader
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  store i8 %45, ptr %4, align 1, !tbaa !5
  store i8 %49, ptr %9, align 1, !tbaa !5
  store i8 %51, ptr %11, align 1, !tbaa !5
  br label %53

53:                                               ; preds = %.loopexit.split-lp, %.loopexit37
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit37 ], [ %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

54:                                               ; preds = %.preheader39.preheader
  %55 = 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 %56 unwind label %.loopexit.split-lp

56:                                               ; preds = %54
  %57 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %51)
          to label %.loopexit38 unwind label %.loopexit.split-lp

.loopexit38:                                      ; preds = %56, %23
  %58 = phi i8 [ %13, %23 ], [ %51, %56 ]
  %59 = phi i8 [ %14, %23 ], [ %49, %56 ]
  %60 = phi i8 [ %15, %23 ], [ %45, %56 ]
  %.3 = phi i32 [ %26, %23 ], [ 0, %56 ]
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %.critedge, label %12, !llvm.loop !8

.critedge:                                        ; preds = %19, %.loopexit38, %12
  %61 = phi i8 [ %13, %19 ], [ %58, %.loopexit38 ], [ %13, %12 ]
  %62 = phi i8 [ %14, %19 ], [ %59, %.loopexit38 ], [ %14, %12 ]
  %63 = phi i8 [ %15, %19 ], [ %60, %.loopexit38 ], [ %15, %12 ]
  %.030.lcssa = phi i32 [ %.03045, %19 ], [ %.3, %.loopexit38 ], [ %.03045, %12 ]
  store i8 %63, ptr %4, align 1, !tbaa !5
  store i8 %62, ptr %9, align 1, !tbaa !5
  store i8 %61, ptr %11, align 1, !tbaa !5
  %.not36 = icmp eq i32 %.030.lcssa, 0
  br i1 %.not36, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %.critedge
  %64 = icmp sgt i32 %.030.lcssa, 0
  br i1 %64, label %.lr.ph51.preheader, label %._crit_edge

.lr.ph51.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %.030.lcssa to i64
  br label %.lr.ph51

.lr.ph51:                                         ; preds = %.lr.ph51.preheader, %.lr.ph51
  %indvars.iv58 = phi i64 [ 0, %.lr.ph51.preheader ], [ %indvars.iv.next59, %.lr.ph51 ]
  %65 = getelementptr inbounds [4 x i8], ptr %3, i64 0, i64 %indvars.iv58
  %66 = load i8, ptr %65, align 1, !tbaa !5
  %67 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEcm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL12base64_charsB5cxx11, i8 noundef signext %66, i64 noundef 0) #5
  %68 = trunc i64 %67 to i8
  store i8 %68, ptr %65, align 1, !tbaa !5
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph51, !llvm.loop !10

._crit_edge:                                      ; preds = %.lr.ph51, %.preheader
  %69 = load i8, ptr %3, align 1, !tbaa !5
  %70 = shl i8 %69, 2
  %71 = getelementptr inbounds i8, ptr %3, i64 1
  %72 = load i8, ptr %71, align 1, !tbaa !5
  %73 = lshr i8 %72, 4
  %74 = and i8 %73, 3
  %75 = or disjoint i8 %74, %70
  store i8 %75, ptr %4, align 1, !tbaa !5
  %76 = shl i8 %72, 4
  %77 = getelementptr inbounds i8, ptr %3, i64 2
  %78 = load i8, ptr %77, align 1, !tbaa !5
  %79 = lshr i8 %78, 2
  %80 = and i8 %79, 15
  %81 = or disjoint i8 %80, %76
  %82 = getelementptr inbounds i8, ptr %4, i64 1
  store i8 %81, ptr %82, align 1, !tbaa !5
  %83 = icmp sgt i32 %.030.lcssa, 1
  br i1 %83, label %.lr.ph54.preheader, label %.loopexit

.lr.ph54.preheader:                               ; preds = %._crit_edge
  %84 = add nsw i32 %.030.lcssa, -1
  %wide.trip.count64 = zext nneg i32 %84 to i64
  br label %.lr.ph54

.lr.ph54:                                         ; preds = %.lr.ph54.preheader, %88
  %indvars.iv61 = phi i64 [ 0, %.lr.ph54.preheader ], [ %indvars.iv.next62, %88 ]
  %85 = getelementptr inbounds [3 x i8], ptr %4, i64 0, i64 %indvars.iv61
  %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 %.loopexit37

88:                                               ; preds = %.lr.ph54
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond65.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count64
  br i1 %exitcond65.not, label %.loopexit, label %.lr.ph54, !llvm.loop !11

.loopexit:                                        ; preds = %88, %2, %._crit_edge, %.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 noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZL9is_base64h(i8 noundef zeroext) local_unnamed_addr #3

; 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 #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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}
!11 = distinct !{!11, !9}


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