; LLVM IR from PaddlePaddle/FastDeploy :: fastdeploy/encryption/util/src/crypto (base64)

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

@_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_112base64_charsB5cxx11E = 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 @_ZN10fastdeploy5baidu4base6base6413base64_encodeERKNSt7__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 i1, align 1
  %6 = alloca i64, align 8
  %7 = alloca [3 x i8], align 1
  %8 = alloca [4 x i8], align 1
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  store i1 false, ptr %5, align 1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  store i64 0, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 3, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %14

14:                                               ; preds = %55, %2
  %15 = load i64, ptr %9, align 8, !tbaa !9
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %16) #3
  %18 = icmp ne i64 %15, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  br label %58

20:                                               ; preds = %14
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = load i64, ptr %9, 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) #3
  %24 = load i8, ptr %23, align 1, !tbaa !11
  %25 = load i64, ptr %6, align 8, !tbaa !9
  %26 = add i64 %25, 1
  store i64 %26, ptr %6, align 8, !tbaa !9
  %27 = getelementptr inbounds [3 x i8], ptr %7, i64 0, i64 %25
  store i8 %24, ptr %27, align 1, !tbaa !11
  %28 = load i64, ptr %6, align 8, !tbaa !9
  %29 = icmp eq i64 %28, 3
  br i1 %29, label %30, label %54

30:                                               ; preds = %20
  %31 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 0
  %32 = getelementptr inbounds [3 x i8], ptr %7, i64 0, i64 0
  invoke void @_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_117encode_char_arrayEPhPKh(ptr noundef %31, ptr noundef %32)
          to label %33 unwind label %49

33:                                               ; preds = %30
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %34

34:                                               ; preds = %46, %33
  %35 = load i64, ptr %6, align 8, !tbaa !9
  %36 = icmp ult i64 %35, 4
  br i1 %36, label %37, label %53

37:                                               ; preds = %34
  %38 = load i64, ptr %6, align 8, !tbaa !9
  %39 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 %38
  %40 = load i8, ptr %39, align 1, !tbaa !11
  %41 = zext i8 %40 to i64
  %42 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_112base64_charsB5cxx11E, i64 noundef %41) #3
  %43 = load i8, ptr %42, align 1, !tbaa !11
  %44 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %43)
          to label %45 unwind label %49

45:                                               ; preds = %37
  br label %46

46:                                               ; preds = %45
  %47 = load i64, ptr %6, align 8, !tbaa !9
  %48 = add i64 %47, 1
  store i64 %48, ptr %6, align 8, !tbaa !9
  br label %34, !llvm.loop !12

49:                                               ; preds = %37, %30
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %10, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  br label %114

53:                                               ; preds = %34
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %54

54:                                               ; preds = %53, %20
  br label %55

55:                                               ; preds = %54
  %56 = load i64, ptr %9, align 8, !tbaa !9
  %57 = add i64 %56, 1
  store i64 %57, ptr %9, align 8, !tbaa !9
  br label %14, !llvm.loop !14

58:                                               ; preds = %19
  %59 = load i64, ptr %6, align 8, !tbaa !9
  %60 = icmp ugt i64 %59, 0
  br i1 %60, label %61, label %112

61:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %62 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %62, ptr %12, align 8, !tbaa !9
  br label %63

63:                                               ; preds = %70, %61
  %64 = load i64, ptr %12, align 8, !tbaa !9
  %65 = icmp ult i64 %64, 3
  br i1 %65, label %67, label %66

66:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %73

67:                                               ; preds = %63
  %68 = load i64, ptr %12, align 8, !tbaa !9
  %69 = getelementptr inbounds [3 x i8], ptr %7, i64 0, i64 %68
  store i8 0, ptr %69, align 1, !tbaa !11
  br label %70

70:                                               ; preds = %67
  %71 = load i64, ptr %12, align 8, !tbaa !9
  %72 = add i64 %71, 1
  store i64 %72, ptr %12, align 8, !tbaa !9
  br label %63, !llvm.loop !15

73:                                               ; preds = %66
  %74 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 0
  %75 = getelementptr inbounds [3 x i8], ptr %7, i64 0, i64 0
  invoke void @_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_117encode_char_arrayEPhPKh(ptr noundef %74, ptr noundef %75)
          to label %76 unwind label %83

76:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %77

77:                                               ; preds = %96, %76
  %78 = load i64, ptr %13, align 8, !tbaa !9
  %79 = load i64, ptr %6, align 8, !tbaa !9
  %80 = add i64 %79, 1
  %81 = icmp ult i64 %78, %80
  br i1 %81, label %87, label %82

82:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %103

83:                                               ; preds = %108, %73
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %10, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %11, align 4
  br label %114

87:                                               ; preds = %77
  %88 = load i64, ptr %13, align 8, !tbaa !9
  %89 = getelementptr inbounds [4 x i8], ptr %8, i64 0, i64 %88
  %90 = load i8, ptr %89, align 1, !tbaa !11
  %91 = zext i8 %90 to i64
  %92 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_112base64_charsB5cxx11E, i64 noundef %91) #3
  %93 = load i8, ptr %92, align 1, !tbaa !11
  %94 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %93)
          to label %95 unwind label %99

95:                                               ; preds = %87
  br label %96

96:                                               ; preds = %95
  %97 = load i64, ptr %13, align 8, !tbaa !9
  %98 = add i64 %97, 1
  store i64 %98, ptr %13, align 8, !tbaa !9
  br label %77, !llvm.loop !16

99:                                               ; preds = %87
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %10, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %114

103:                                              ; preds = %82
  br label %104

104:                                              ; preds = %110, %103
  %105 = load i64, ptr %6, align 8, !tbaa !9
  %106 = add i64 %105, 1
  store i64 %106, ptr %6, align 8, !tbaa !9
  %107 = icmp ult i64 %105, 3
  br i1 %107, label %108, label %111

108:                                              ; preds = %104
  %109 = 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 %110 unwind label %83

110:                                              ; preds = %108
  br label %104, !llvm.loop !17

111:                                              ; preds = %104
  br label %112

112:                                              ; preds = %111, %58
  store i1 true, ptr %5, align 1
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 3, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %113 = load i1, ptr %5, align 1
  br i1 %113, label %116, label %115

114:                                              ; preds = %99, %83, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 3, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  br label %117

115:                                              ; preds = %112
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  br label %116

116:                                              ; preds = %115, %112
  ret void

117:                                              ; preds = %114
  %118 = load ptr, ptr %10, align 8
  %119 = load i32, ptr %11, align 4
  %120 = insertvalue { ptr, i32 } poison, ptr %118, 0
  %121 = insertvalue { ptr, i32 } %120, i32 %119, 1
  resume { ptr, i32 } %121
}

; 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 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 hidden void @_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_117encode_char_arrayEPhPKh(ptr noundef, ptr noundef) #1

; 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 = !{!"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}


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

@_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_112base64_charsB5cxx11E = 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 @_ZN10fastdeploy5baidu4base6base6413base64_encodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias nonnull 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 [3 x i8], align 1
  %4 = alloca [4 x i8], align 1
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %5 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  %.not35 = icmp eq i64 %5, 0
  br i1 %.not35, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %2
  %6 = getelementptr inbounds i8, ptr %4, i64 1
  %7 = getelementptr inbounds i8, ptr %4, i64 2
  %8 = getelementptr inbounds i8, ptr %4, i64 3
  br label %.lr.ph

._crit_edge:                                      ; preds = %.loopexit32
  %.not28 = icmp eq i64 %.2, 0
  br i1 %.not28, label %.loopexit, label %.preheader31

.preheader31:                                     ; preds = %._crit_edge
  %9 = icmp ult i64 %.2, 3
  br i1 %9, label %.lr.ph39.preheader, label %._crit_edge40

.lr.ph39.preheader:                               ; preds = %.preheader31
  %scevgep = getelementptr i8, ptr %3, i64 %.2
  %10 = sub nuw nsw i64 3, %.2
  call void @llvm.memset.p0.i64(ptr align 1 %scevgep, i8 0, i64 %10, i1 false), !tbaa !5
  br label %._crit_edge40

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.loopexit32
  %.02537 = phi i64 [ %42, %.loopexit32 ], [ 0, %.lr.ph.preheader ]
  %.02636 = phi i64 [ %.2, %.loopexit32 ], [ 0, %.lr.ph.preheader ]
  %11 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.02537) #4
  %12 = load i8, ptr %11, align 1, !tbaa !5
  %13 = add nuw nsw i64 %.02636, 1
  %14 = getelementptr inbounds [3 x i8], ptr %3, i64 0, i64 %.02636
  store i8 %12, ptr %14, align 1, !tbaa !5
  %15 = icmp eq i64 %13, 3
  br i1 %15, label %16, label %.loopexit32

16:                                               ; preds = %.lr.ph
  call void @_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_117encode_char_arrayEPhPKh(ptr noundef nonnull %4, ptr noundef nonnull %3)
  %17 = load i8, ptr %4, align 1, !tbaa !5
  %18 = zext i8 %17 to i64
  %19 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_112base64_charsB5cxx11E, i64 noundef %18) #4
  %20 = load i8, ptr %19, align 1, !tbaa !5
  %21 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %20)
          to label %22 unwind label %40

22:                                               ; preds = %16
  %23 = load i8, ptr %6, align 1, !tbaa !5
  %24 = zext i8 %23 to i64
  %25 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_112base64_charsB5cxx11E, i64 noundef %24) #4
  %26 = load i8, ptr %25, align 1, !tbaa !5
  %27 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %26)
          to label %28 unwind label %40

28:                                               ; preds = %22
  %29 = load i8, ptr %7, align 1, !tbaa !5
  %30 = zext i8 %29 to i64
  %31 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_112base64_charsB5cxx11E, i64 noundef %30) #4
  %32 = load i8, ptr %31, align 1, !tbaa !5
  %33 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %32)
          to label %34 unwind label %40

34:                                               ; preds = %28
  %35 = load i8, ptr %8, align 1, !tbaa !5
  %36 = zext i8 %35 to i64
  %37 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_112base64_charsB5cxx11E, i64 noundef %36) #4
  %38 = load i8, ptr %37, align 1, !tbaa !5
  %39 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %38)
          to label %.loopexit32 unwind label %40

40:                                               ; preds = %34, %28, %22, %16
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %61

.loopexit32:                                      ; preds = %34, %.lr.ph
  %.2 = phi i64 [ %13, %.lr.ph ], [ 0, %34 ]
  %42 = add i64 %.02537, 1
  %43 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  %.not = icmp eq i64 %42, %43
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !8

._crit_edge40:                                    ; preds = %.lr.ph39.preheader, %.preheader31
  call void @_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_117encode_char_arrayEPhPKh(ptr noundef nonnull %4, ptr noundef nonnull %3)
  br label %46

44:                                               ; preds = %58
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %61

46:                                               ; preds = %._crit_edge40, %53
  %.041 = phi i64 [ 0, %._crit_edge40 ], [ %54, %53 ]
  %47 = getelementptr inbounds [4 x i8], ptr %4, i64 0, i64 %.041
  %48 = load i8, ptr %47, align 1, !tbaa !5
  %49 = zext i8 %48 to i64
  %50 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_112base64_charsB5cxx11E, i64 noundef %49) #4
  %51 = load i8, ptr %50, align 1, !tbaa !5
  %52 = 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 %53 unwind label %55

53:                                               ; preds = %46
  %54 = add nuw i64 %.041, 1
  %exitcond.not = icmp eq i64 %.041, %.2
  br i1 %exitcond.not, label %.preheader, label %46, !llvm.loop !10

55:                                               ; preds = %46
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %61

.preheader:                                       ; preds = %53, %58
  %.3 = phi i64 [ %59, %58 ], [ %.2, %53 ]
  %57 = icmp ult i64 %.3, 3
  br i1 %57, label %58, label %.loopexit

58:                                               ; preds = %.preheader
  %59 = add nuw nsw i64 %.3, 1
  %60 = 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 %.preheader unwind label %44, !llvm.loop !11

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

61:                                               ; preds = %55, %44, %40
  %.pn = phi { ptr, i32 } [ %41, %40 ], [ %56, %55 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %3) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  resume { ptr, i32 } %.pn
}

; 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 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 hidden void @_ZN10fastdeploy5baidu4base6base6412_GLOBAL__N_117encode_char_arrayEPhPKh(ptr noundef, ptr noundef) local_unnamed_addr #1

; 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

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 = { 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,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass