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

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

14:                                               ; preds = %89, %3
  %15 = load i32, ptr %6, align 4, !tbaa !9
  %16 = add i32 %15, -1
  store i32 %16, ptr %6, align 4, !tbaa !9
  %17 = icmp ne i32 %15, 0
  br i1 %17, label %18, label %90

18:                                               ; preds = %14
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i32 1
  store ptr %20, ptr %5, align 8, !tbaa !5
  %21 = load i8, ptr %19, align 1, !tbaa !11
  %22 = load i32, ptr %8, align 4, !tbaa !9
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %8, align 4, !tbaa !9
  %24 = sext i32 %22 to i64
  %25 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 %24
  store i8 %21, ptr %25, align 1, !tbaa !11
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %27 = icmp eq i32 %26, 3
  br i1 %27, label %28, label %89

28:                                               ; preds = %18
  %29 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 0
  %30 = load i8, ptr %29, align 1, !tbaa !11
  %31 = zext i8 %30 to i32
  %32 = and i32 %31, 252
  %33 = ashr i32 %32, 2
  %34 = trunc i32 %33 to i8
  %35 = getelementptr inbounds [4 x i8], ptr %11, i64 0, i64 0
  store i8 %34, ptr %35, align 1, !tbaa !11
  %36 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 0
  %37 = load i8, ptr %36, align 1, !tbaa !11
  %38 = zext i8 %37 to i32
  %39 = and i32 %38, 3
  %40 = shl i32 %39, 4
  %41 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 1
  %42 = load i8, ptr %41, align 1, !tbaa !11
  %43 = zext i8 %42 to i32
  %44 = and i32 %43, 240
  %45 = ashr i32 %44, 4
  %46 = add nsw i32 %40, %45
  %47 = trunc i32 %46 to i8
  %48 = getelementptr inbounds [4 x i8], ptr %11, i64 0, i64 1
  store i8 %47, ptr %48, align 1, !tbaa !11
  %49 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 1
  %50 = load i8, ptr %49, align 1, !tbaa !11
  %51 = zext i8 %50 to i32
  %52 = and i32 %51, 15
  %53 = shl i32 %52, 2
  %54 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 2
  %55 = load i8, ptr %54, align 1, !tbaa !11
  %56 = zext i8 %55 to i32
  %57 = and i32 %56, 192
  %58 = ashr i32 %57, 6
  %59 = add nsw i32 %53, %58
  %60 = trunc i32 %59 to i8
  %61 = getelementptr inbounds [4 x i8], ptr %11, i64 0, i64 2
  store i8 %60, ptr %61, align 1, !tbaa !11
  %62 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 2
  %63 = load i8, ptr %62, align 1, !tbaa !11
  %64 = zext i8 %63 to i32
  %65 = and i32 %64, 63
  %66 = trunc i32 %65 to i8
  %67 = getelementptr inbounds [4 x i8], ptr %11, i64 0, i64 3
  store i8 %66, ptr %67, align 1, !tbaa !11
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %81, %28
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = icmp slt i32 %69, 4
  br i1 %70, label %71, label %88

71:                                               ; preds = %68
  %72 = load i32, ptr %8, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [4 x i8], ptr %11, i64 0, i64 %73
  %75 = load i8, ptr %74, align 1, !tbaa !11
  %76 = zext i8 %75 to i64
  %77 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL12base64_charsB5cxx11, i64 noundef %76) #3
  %78 = load i8, ptr %77, align 1, !tbaa !11
  %79 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %78)
          to label %80 unwind label %84

80:                                               ; preds = %71
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %8, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %8, align 4, !tbaa !9
  br label %68, !llvm.loop !12

84:                                               ; preds = %162, %144, %71
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %12, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 3, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  br label %170

88:                                               ; preds = %68
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %88, %18
  br label %14, !llvm.loop !14

90:                                               ; preds = %14
  %91 = load i32, ptr %8, align 4, !tbaa !9
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %166

93:                                               ; preds = %90
  %94 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %94, ptr %9, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %102, %93
  %96 = load i32, ptr %9, align 4, !tbaa !9
  %97 = icmp slt i32 %96, 3
  br i1 %97, label %98, label %105

98:                                               ; preds = %95
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 %100
  store i8 0, ptr %101, align 1, !tbaa !11
  br label %102

102:                                              ; preds = %98
  %103 = load i32, ptr %9, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %9, align 4, !tbaa !9
  br label %95, !llvm.loop !15

105:                                              ; preds = %95
  %106 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 0
  %107 = load i8, ptr %106, align 1, !tbaa !11
  %108 = zext i8 %107 to i32
  %109 = and i32 %108, 252
  %110 = ashr i32 %109, 2
  %111 = trunc i32 %110 to i8
  %112 = getelementptr inbounds [4 x i8], ptr %11, i64 0, i64 0
  store i8 %111, ptr %112, align 1, !tbaa !11
  %113 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 0
  %114 = load i8, ptr %113, align 1, !tbaa !11
  %115 = zext i8 %114 to i32
  %116 = and i32 %115, 3
  %117 = shl i32 %116, 4
  %118 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 1
  %119 = load i8, ptr %118, align 1, !tbaa !11
  %120 = zext i8 %119 to i32
  %121 = and i32 %120, 240
  %122 = ashr i32 %121, 4
  %123 = add nsw i32 %117, %122
  %124 = trunc i32 %123 to i8
  %125 = getelementptr inbounds [4 x i8], ptr %11, i64 0, i64 1
  store i8 %124, ptr %125, align 1, !tbaa !11
  %126 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 1
  %127 = load i8, ptr %126, align 1, !tbaa !11
  %128 = zext i8 %127 to i32
  %129 = and i32 %128, 15
  %130 = shl i32 %129, 2
  %131 = getelementptr inbounds [3 x i8], ptr %10, i64 0, i64 2
  %132 = load i8, ptr %131, align 1, !tbaa !11
  %133 = zext i8 %132 to i32
  %134 = and i32 %133, 192
  %135 = ashr i32 %134, 6
  %136 = add nsw i32 %130, %135
  %137 = trunc i32 %136 to i8
  %138 = getelementptr inbounds [4 x i8], ptr %11, i64 0, i64 2
  store i8 %137, ptr %138, align 1, !tbaa !11
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %139

139:                                              ; preds = %154, %105
  %140 = load i32, ptr %9, align 4, !tbaa !9
  %141 = load i32, ptr %8, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  %143 = icmp slt i32 %140, %142
  br i1 %143, label %144, label %157

144:                                              ; preds = %139
  %145 = load i32, ptr %9, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [4 x i8], ptr %11, i64 0, i64 %146
  %148 = load i8, ptr %147, align 1, !tbaa !11
  %149 = zext i8 %148 to i64
  %150 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL12base64_charsB5cxx11, i64 noundef %149) #3
  %151 = load i8, ptr %150, align 1, !tbaa !11
  %152 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %151)
          to label %153 unwind label %84

153:                                              ; preds = %144
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %9, align 4, !tbaa !9
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %9, align 4, !tbaa !9
  br label %139, !llvm.loop !16

157:                                              ; preds = %139
  br label %158

158:                                              ; preds = %164, %157
  %159 = load i32, ptr %8, align 4, !tbaa !9
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %8, align 4, !tbaa !9
  %161 = icmp slt i32 %159, 3
  br i1 %161, label %162, label %165

162:                                              ; preds = %158
  %163 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext 61)
          to label %164 unwind label %84

164:                                              ; preds = %162
  br label %158, !llvm.loop !17

165:                                              ; preds = %158
  br label %166

166:                                              ; preds = %165, %90
  store i1 true, ptr %7, align 1
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 3, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %167 = load i1, ptr %7, align 1
  br i1 %167, label %169, label %168

168:                                              ; preds = %166
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  br label %169

169:                                              ; preds = %168, %166
  ret void

170:                                              ; preds = %84
  %171 = load ptr, ptr %12, align 8
  %172 = load i32, ptr %13, align 4
  %173 = insertvalue { ptr, i32 } poison, ptr %171, 0
  %174 = insertvalue { ptr, i32 } %173, i32 %172, 1
  resume { ptr, i32 } %174
}

; 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

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 }

!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 uwtable
define dso_local void @_Z13base64_encodeB5cxx11PKhj(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca [3 x i8], align 1
  %5 = alloca [4 x i8], align 1
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %.not34 = icmp eq i32 %2, 0
  br i1 %.not34, label %.loopexit, label %.lr.ph

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

9:                                                ; preds = %.lr.ph, %.loopexit31
  %10 = phi i8 [ %.promoted, %.lr.ph ], [ %51, %.loopexit31 ]
  %.in = phi i32 [ %2, %.lr.ph ], [ %11, %.loopexit31 ]
  %.036 = phi ptr [ %1, %.lr.ph ], [ %12, %.loopexit31 ]
  %.02135 = phi i32 [ 0, %.lr.ph ], [ %.2, %.loopexit31 ]
  %11 = add i32 %.in, -1
  %12 = getelementptr inbounds i8, ptr %.036, i64 1
  %13 = load i8, ptr %.036, align 1, !tbaa !5
  %14 = add nuw nsw i32 %.02135, 1
  %15 = zext nneg i32 %.02135 to i64
  %16 = getelementptr inbounds [3 x i8], ptr %4, i64 0, i64 %15
  store i8 %13, ptr %16, align 1, !tbaa !5
  %17 = icmp eq i32 %14, 3
  br i1 %17, label %18, label %.loopexit31

18:                                               ; preds = %9
  %19 = load i8, ptr %4, align 1, !tbaa !5
  %20 = lshr i8 %19, 2
  %21 = load i8, ptr %6, align 1, !tbaa !5
  %22 = shl i8 %21, 2
  %23 = and i8 %22, 60
  %24 = load i8, ptr %7, align 1, !tbaa !5
  %25 = lshr i8 %24, 6
  %26 = or disjoint i8 %25, %23
  %27 = and i8 %24, 63
  %28 = zext nneg i8 %20 to i64
  %29 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL12base64_charsB5cxx11, i64 noundef %28) #5
  %30 = load i8, ptr %29, align 1, !tbaa !5
  %31 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %30)
          to label %32 unwind label %.loopexit.split-lp.loopexit.split-lp

32:                                               ; preds = %18
  %33 = lshr i8 %21, 4
  %34 = shl i8 %19, 4
  %35 = and i8 %34, 48
  %36 = or disjoint i8 %33, %35
  %37 = zext nneg i8 %36 to i64
  %38 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL12base64_charsB5cxx11, i64 noundef %37) #5
  %39 = load i8, ptr %38, align 1, !tbaa !5
  %40 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %39)
          to label %41 unwind label %.loopexit.split-lp.loopexit.split-lp

41:                                               ; preds = %32
  %42 = zext nneg i8 %26 to i64
  %43 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL12base64_charsB5cxx11, i64 noundef %42) #5
  %44 = load i8, ptr %43, align 1, !tbaa !5
  %45 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %44)
          to label %46 unwind label %.loopexit.split-lp.loopexit.split-lp

46:                                               ; preds = %41
  %47 = zext nneg i8 %27 to i64
  %48 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL12base64_charsB5cxx11, i64 noundef %47) #5
  %49 = load i8, ptr %48, align 1, !tbaa !5
  %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 %.loopexit31 unwind label %.loopexit.split-lp.loopexit.split-lp

.loopexit26:                                      ; preds = %82
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %.lr.ph43
  %lpad.loopexit27 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %46, %41, %32, %18
  %lpad.loopexit.split-lp28 = landingpad { ptr, i32 }
          cleanup
  store i8 %27, ptr %8, align 1, !tbaa !5
  br label %.loopexit.split-lp

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

.loopexit31:                                      ; preds = %46, %9
  %51 = phi i8 [ %10, %9 ], [ %27, %46 ]
  %.2 = phi i32 [ %14, %9 ], [ 0, %46 ]
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %._crit_edge, label %9, !llvm.loop !8

._crit_edge:                                      ; preds = %.loopexit31
  store i8 %51, ptr %8, align 1, !tbaa !5
  %.not24 = icmp eq i32 %.2, 0
  br i1 %.not24, label %.loopexit, label %.preheader30

.preheader30:                                     ; preds = %._crit_edge
  %52 = icmp slt i32 %.2, 3
  br i1 %52, label %.lr.ph38.preheader, label %._crit_edge39

.lr.ph38.preheader:                               ; preds = %.preheader30
  %53 = zext i32 %.2 to i64
  %scevgep = getelementptr i8, ptr %4, i64 %53
  %54 = sub i32 2, %.2
  %55 = zext i32 %54 to i64
  %56 = add nuw nsw i64 %55, 1
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 0, i64 %56, i1 false), !tbaa !5
  br label %._crit_edge39

._crit_edge39:                                    ; preds = %.lr.ph38.preheader, %.preheader30
  %57 = load i8, ptr %4, align 1, !tbaa !5
  %58 = lshr i8 %57, 2
  store i8 %58, ptr %5, align 1, !tbaa !5
  %59 = shl i8 %57, 4
  %60 = and i8 %59, 48
  %61 = getelementptr inbounds i8, ptr %4, i64 1
  %62 = load i8, ptr %61, align 1, !tbaa !5
  %63 = lshr i8 %62, 4
  %64 = or disjoint i8 %63, %60
  %65 = getelementptr inbounds i8, ptr %5, i64 1
  store i8 %64, ptr %65, align 1, !tbaa !5
  %66 = shl i8 %62, 2
  %67 = and i8 %66, 60
  %68 = getelementptr inbounds i8, ptr %4, i64 2
  %69 = load i8, ptr %68, align 1, !tbaa !5
  %70 = lshr i8 %69, 6
  %71 = or disjoint i8 %70, %67
  %72 = getelementptr inbounds i8, ptr %5, i64 2
  store i8 %71, ptr %72, align 1, !tbaa !5
  %.not2540 = icmp slt i32 %.2, 0
  br i1 %.not2540, label %.preheader, label %.lr.ph43.preheader

.lr.ph43.preheader:                               ; preds = %._crit_edge39
  %73 = add nuw i32 %.2, 1
  %wide.trip.count = zext i32 %73 to i64
  br label %.lr.ph43

.preheader:                                       ; preds = %80, %._crit_edge39
  %smax = tail call i32 @llvm.smax.i32(i32 %.2, i32 3)
  br label %81

.lr.ph43:                                         ; preds = %.lr.ph43.preheader, %80
  %indvars.iv = phi i64 [ 0, %.lr.ph43.preheader ], [ %indvars.iv.next, %80 ]
  %74 = getelementptr inbounds [4 x i8], ptr %5, i64 0, i64 %indvars.iv
  %75 = load i8, ptr %74, align 1, !tbaa !5
  %76 = zext i8 %75 to i64
  %77 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_ZL12base64_charsB5cxx11, i64 noundef %76) #5
  %78 = load i8, ptr %77, align 1, !tbaa !5
  %79 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %78)
          to label %80 unwind label %.loopexit.split-lp.loopexit

80:                                               ; preds = %.lr.ph43
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph43, !llvm.loop !10

81:                                               ; preds = %.preheader, %82
  %.3 = phi i32 [ %83, %82 ], [ %.2, %.preheader ]
  %exitcond47.not = icmp eq i32 %.3, %smax
  br i1 %exitcond47.not, label %.loopexit, label %82

82:                                               ; preds = %81
  %83 = add i32 %.3, 1
  %84 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext 61)
          to label %81 unwind label %.loopexit26, !llvm.loop !11

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

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass