; LLVM IR from lelegard/cryptobench :: src/lib_openssl.ll (ZN11lib_openssl3aesEbbPKhmS1_mS1_mPhm)

; 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] }
%"class.std::allocator" = type { i8 }

@.str.32 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [67 x i8], align 1

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

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

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

declare i32 @__gxx_personality_v0(...)

; 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 dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

declare void @_ZN3sys6formatB5cxx11EPKcz(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ...) #3

declare void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) #3

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

declare void @_ZN3sys5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN11lib_openssl3aesEbbPKhmS1_mS1_mPhm(ptr noundef nonnull align 8 dereferenceable(96) %0, i1 noundef zeroext %1, i1 noundef zeroext %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6, ptr noundef %7, i64 noundef %8, ptr noundef %9, i64 noundef %10) #2 align 2 personality ptr @__gxx_personality_v0 {
  %12 = alloca ptr, align 8
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca ptr, align 8
  %24 = alloca %"class.std::__cxx11::basic_string", align 8
  %25 = alloca %"class.std::__cxx11::basic_string", align 8
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca %"class.std::__cxx11::basic_string", align 8
  %29 = alloca %"class.std::__cxx11::basic_string", align 8
  %30 = alloca ptr, align 8
  %31 = alloca %"class.std::__cxx11::basic_string", align 8
  %32 = alloca %"class.std::allocator", align 1
  %33 = alloca %"class.std::__cxx11::basic_string", align 8
  %34 = alloca %"class.std::allocator", align 1
  %35 = alloca %"class.std::__cxx11::basic_string", align 8
  %36 = alloca %"class.std::allocator", align 1
  %37 = alloca %"class.std::__cxx11::basic_string", align 8
  %38 = alloca %"class.std::allocator", align 1
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca %"class.std::__cxx11::basic_string", align 8
  %42 = alloca %"class.std::allocator", align 1
  %43 = alloca %"class.std::__cxx11::basic_string", align 8
  %44 = alloca %"class.std::allocator", align 1
  %45 = alloca %"class.std::__cxx11::basic_string", align 8
  %46 = alloca %"class.std::allocator", align 1
  %47 = alloca %"class.std::__cxx11::basic_string", align 8
  %48 = alloca %"class.std::allocator", align 1
  %49 = alloca i64, align 8
  %50 = alloca %"class.std::__cxx11::basic_string", align 8
  store ptr %0, ptr %12, align 8, !tbaa !5
  %51 = zext i1 %1 to i8
  store i8 %51, ptr %13, align 1, !tbaa !9
  %52 = zext i1 %2 to i8
  store i8 %52, ptr %14, align 1, !tbaa !9
  store ptr %3, ptr %15, align 8, !tbaa !5
  store i64 %4, ptr %16, align 8, !tbaa !11
  store ptr %5, ptr %17, align 8, !tbaa !5
  store i64 %6, ptr %18, align 8, !tbaa !11
  store ptr %7, ptr %19, align 8, !tbaa !5
  store i64 %8, ptr %20, align 8, !tbaa !11
  store ptr %9, ptr %21, align 8, !tbaa !5
  store i64 %10, ptr %22, align 8, !tbaa !11
  %53 = load ptr, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  store ptr null, ptr %23, align 8, !tbaa !5
  %54 = load i8, ptr %14, align 1, !tbaa !9, !range !13, !noundef !14
  %55 = trunc i8 %54 to i1
  br i1 %55, label %56, label %80

56:                                               ; preds = %11
  %57 = load i64, ptr %16, align 8, !tbaa !11
  switch i64 %57, label %64 [
    i64 16, label %58
    i64 24, label %60
    i64 32, label %62
  ]

58:                                               ; preds = %56
  %59 = call ptr @EVP_aes_128_cbc()
  store ptr %59, ptr %23, align 8, !tbaa !5
  br label %70

60:                                               ; preds = %56
  %61 = call ptr @EVP_aes_192_cbc()
  store ptr %61, ptr %23, align 8, !tbaa !5
  br label %70

62:                                               ; preds = %56
  %63 = call ptr @EVP_aes_256_cbc()
  store ptr %63, ptr %23, align 8, !tbaa !5
  br label %70

64:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 32, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %25) #4
  call void @_ZNK3lib4nameB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %25, ptr noundef nonnull align 8 dereferenceable(48) %53)
  %65 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %25) #4
  %66 = load i64, ptr %16, align 8, !tbaa !11
  %67 = mul i64 %66, 8
  invoke void (ptr, ptr, ...) @_ZN3sys6formatB5cxx11EPKcz(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %24, ptr noundef @.str.32, ptr noundef %65, i64 noundef %67)
          to label %68 unwind label %71

68:                                               ; preds = %64
  invoke void @_ZN3sys5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %24, i32 noundef 0)
          to label %69 unwind label %75

69:                                               ; preds = %68
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #4
  br label %70

70:                                               ; preds = %69, %62, %60, %58
  br label %104

71:                                               ; preds = %64
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %26, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %27, align 4
  br label %79

75:                                               ; preds = %68
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %26, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %27, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #4
  br label %79

79:                                               ; preds = %75, %71
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #4
  br label %285

80:                                               ; preds = %11
  %81 = load i64, ptr %16, align 8, !tbaa !11
  switch i64 %81, label %88 [
    i64 16, label %82
    i64 24, label %84
    i64 32, label %86
  ]

82:                                               ; preds = %80
  %83 = call ptr @EVP_aes_128_ecb()
  store ptr %83, ptr %23, align 8, !tbaa !5
  br label %94

84:                                               ; preds = %80
  %85 = call ptr @EVP_aes_192_ecb()
  store ptr %85, ptr %23, align 8, !tbaa !5
  br label %94

86:                                               ; preds = %80
  %87 = call ptr @EVP_aes_256_ecb()
  store ptr %87, ptr %23, align 8, !tbaa !5
  br label %94

88:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 32, ptr %28) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %29) #4
  call void @_ZNK3lib4nameB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %29, ptr noundef nonnull align 8 dereferenceable(48) %53)
  %89 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %29) #4
  %90 = load i64, ptr %16, align 8, !tbaa !11
  %91 = mul i64 %90, 8
  invoke void (ptr, ptr, ...) @_ZN3sys6formatB5cxx11EPKcz(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %28, ptr noundef @.str.32, ptr noundef %89, i64 noundef %91)
          to label %92 unwind label %95

92:                                               ; preds = %88
  invoke void @_ZN3sys5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %28, i32 noundef 0)
          to label %93 unwind label %99

93:                                               ; preds = %92
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %29) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %28) #4
  br label %94

94:                                               ; preds = %93, %86, %84, %82
  br label %104

95:                                               ; preds = %88
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %26, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %27, align 4
  br label %103

99:                                               ; preds = %92
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %26, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %27, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #4
  br label %103

103:                                              ; preds = %99, %95
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %29) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %28) #4
  br label %285

104:                                              ; preds = %94, %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  %105 = call ptr @EVP_CIPHER_CTX_new()
  store ptr %105, ptr %30, align 8, !tbaa !5
  %106 = load ptr, ptr %30, align 8, !tbaa !5
  %107 = icmp eq ptr %106, null
  br i1 %107, label %108, label %120

108:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 32, ptr %31) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %32) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %31, ptr noundef @.str.33, ptr noundef nonnull align 1 dereferenceable(1) %32)
          to label %109 unwind label %111

109:                                              ; preds = %108
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %31)
          to label %110 unwind label %115

110:                                              ; preds = %109
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %31) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %31) #4
  br label %120

111:                                              ; preds = %108
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %26, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %27, align 4
  br label %119

115:                                              ; preds = %109
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %26, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %27, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %31) #4
  br label %119

119:                                              ; preds = %115, %111
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %32) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %31) #4
  br label %284

120:                                              ; preds = %110, %104
  %121 = load i8, ptr %13, align 1, !tbaa !9, !range !13, !noundef !14
  %122 = trunc i8 %121 to i1
  br i1 %122, label %123, label %143

123:                                              ; preds = %120
  %124 = load ptr, ptr %30, align 8, !tbaa !5
  %125 = load ptr, ptr %23, align 8, !tbaa !5
  %126 = load ptr, ptr %15, align 8, !tbaa !5
  %127 = load ptr, ptr %17, align 8, !tbaa !5
  %128 = call i32 @EVP_EncryptInit(ptr noundef %124, ptr noundef %125, ptr noundef %126, ptr noundef %127)
  %129 = icmp sle i32 %128, 0
  br i1 %129, label %130, label %142

130:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 32, ptr %33) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %34) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %34) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %33, ptr noundef @.str.34, ptr noundef nonnull align 1 dereferenceable(1) %34)
          to label %131 unwind label %133

131:                                              ; preds = %130
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %33)
          to label %132 unwind label %137

132:                                              ; preds = %131
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %33) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %34) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %33) #4
  br label %142

133:                                              ; preds = %130
  %134 = landingpad { ptr, i32 }
          cleanup
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %26, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %27, align 4
  br label %141

137:                                              ; preds = %131
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %26, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %27, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %33) #4
  br label %141

141:                                              ; preds = %137, %133
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %34) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %33) #4
  br label %284

142:                                              ; preds = %132, %123
  br label %163

143:                                              ; preds = %120
  %144 = load ptr, ptr %30, align 8, !tbaa !5
  %145 = load ptr, ptr %23, align 8, !tbaa !5
  %146 = load ptr, ptr %15, align 8, !tbaa !5
  %147 = load ptr, ptr %17, align 8, !tbaa !5
  %148 = call i32 @EVP_DecryptInit(ptr noundef %144, ptr noundef %145, ptr noundef %146, ptr noundef %147)
  %149 = icmp sle i32 %148, 0
  br i1 %149, label %150, label %162

150:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 32, ptr %35) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %36) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %36) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %35, ptr noundef @.str.35, ptr noundef nonnull align 1 dereferenceable(1) %36)
          to label %151 unwind label %153

151:                                              ; preds = %150
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %35)
          to label %152 unwind label %157

152:                                              ; preds = %151
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %35) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %36) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %36) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %35) #4
  br label %162

153:                                              ; preds = %150
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %26, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %27, align 4
  br label %161

157:                                              ; preds = %151
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %26, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %27, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %35) #4
  br label %161

161:                                              ; preds = %157, %153
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %36) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %36) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %35) #4
  br label %284

162:                                              ; preds = %152, %143
  br label %163

163:                                              ; preds = %162, %142
  %164 = load ptr, ptr %30, align 8, !tbaa !5
  %165 = call i32 @EVP_CIPHER_CTX_set_padding(ptr noundef %164, i32 noundef 0)
  %166 = icmp sle i32 %165, 0
  br i1 %166, label %167, label %179

167:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 32, ptr %37) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %38) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %38) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %37, ptr noundef @.str.36, ptr noundef nonnull align 1 dereferenceable(1) %38)
          to label %168 unwind label %170

168:                                              ; preds = %167
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %37)
          to label %169 unwind label %174

169:                                              ; preds = %168
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %37) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %38) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %38) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %37) #4
  br label %179

170:                                              ; preds = %167
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %26, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %27, align 4
  br label %178

174:                                              ; preds = %168
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %26, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %27, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %37) #4
  br label %178

178:                                              ; preds = %174, %170
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %38) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %38) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %37) #4
  br label %284

179:                                              ; preds = %169, %163
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #4
  store i32 0, ptr %39, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #4
  store i32 0, ptr %40, align 4, !tbaa !15
  %180 = load i8, ptr %13, align 1, !tbaa !9, !range !13, !noundef !14
  %181 = trunc i8 %180 to i1
  br i1 %181, label %182, label %223

182:                                              ; preds = %179
  %183 = load ptr, ptr %30, align 8, !tbaa !5
  %184 = load ptr, ptr %21, align 8, !tbaa !5
  %185 = load ptr, ptr %19, align 8, !tbaa !5
  %186 = load i64, ptr %20, align 8, !tbaa !11
  %187 = trunc i64 %186 to i32
  %188 = call i32 @EVP_EncryptUpdate(ptr noundef %183, ptr noundef %184, ptr noundef %39, ptr noundef %185, i32 noundef %187)
  %189 = icmp sle i32 %188, 0
  br i1 %189, label %190, label %202

190:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 32, ptr %41) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %42) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %42) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %41, ptr noundef @.str.37, ptr noundef nonnull align 1 dereferenceable(1) %42)
          to label %191 unwind label %193

191:                                              ; preds = %190
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %41)
          to label %192 unwind label %197

192:                                              ; preds = %191
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %41) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %42) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %42) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %41) #4
  br label %202

193:                                              ; preds = %190
  %194 = landingpad { ptr, i32 }
          cleanup
  %195 = extractvalue { ptr, i32 } %194, 0
  store ptr %195, ptr %26, align 8
  %196 = extractvalue { ptr, i32 } %194, 1
  store i32 %196, ptr %27, align 4
  br label %201

197:                                              ; preds = %191
  %198 = landingpad { ptr, i32 }
          cleanup
  %199 = extractvalue { ptr, i32 } %198, 0
  store ptr %199, ptr %26, align 8
  %200 = extractvalue { ptr, i32 } %198, 1
  store i32 %200, ptr %27, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %41) #4
  br label %201

201:                                              ; preds = %197, %193
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %42) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %42) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %41) #4
  br label %283

202:                                              ; preds = %192, %182
  %203 = load ptr, ptr %30, align 8, !tbaa !5
  %204 = load ptr, ptr %21, align 8, !tbaa !5
  %205 = load i32, ptr %39, align 4, !tbaa !15
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds i8, ptr %204, i64 %206
  %208 = call i32 @EVP_EncryptFinal(ptr noundef %203, ptr noundef %207, ptr noundef %40)
  %209 = icmp sle i32 %208, 0
  br i1 %209, label %210, label %222

210:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 32, ptr %43) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %44) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %44) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %43, ptr noundef @.str.38, ptr noundef nonnull align 1 dereferenceable(1) %44)
          to label %211 unwind label %213

211:                                              ; preds = %210
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %43)
          to label %212 unwind label %217

212:                                              ; preds = %211
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %43) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %44) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %44) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %43) #4
  br label %222

213:                                              ; preds = %210
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %26, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %27, align 4
  br label %221

217:                                              ; preds = %211
  %218 = landingpad { ptr, i32 }
          cleanup
  %219 = extractvalue { ptr, i32 } %218, 0
  store ptr %219, ptr %26, align 8
  %220 = extractvalue { ptr, i32 } %218, 1
  store i32 %220, ptr %27, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %43) #4
  br label %221

221:                                              ; preds = %217, %213
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %44) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %44) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %43) #4
  br label %283

222:                                              ; preds = %212, %202
  br label %264

223:                                              ; preds = %179
  %224 = load ptr, ptr %30, align 8, !tbaa !5
  %225 = load ptr, ptr %21, align 8, !tbaa !5
  %226 = load ptr, ptr %19, align 8, !tbaa !5
  %227 = load i64, ptr %20, align 8, !tbaa !11
  %228 = trunc i64 %227 to i32
  %229 = call i32 @EVP_DecryptUpdate(ptr noundef %224, ptr noundef %225, ptr noundef %39, ptr noundef %226, i32 noundef %228)
  %230 = icmp sle i32 %229, 0
  br i1 %230, label %231, label %243

231:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 32, ptr %45) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %46) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %46) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %45, ptr noundef @.str.39, ptr noundef nonnull align 1 dereferenceable(1) %46)
          to label %232 unwind label %234

232:                                              ; preds = %231
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %45)
          to label %233 unwind label %238

233:                                              ; preds = %232
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %45) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %46) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %46) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %45) #4
  br label %243

234:                                              ; preds = %231
  %235 = landingpad { ptr, i32 }
          cleanup
  %236 = extractvalue { ptr, i32 } %235, 0
  store ptr %236, ptr %26, align 8
  %237 = extractvalue { ptr, i32 } %235, 1
  store i32 %237, ptr %27, align 4
  br label %242

238:                                              ; preds = %232
  %239 = landingpad { ptr, i32 }
          cleanup
  %240 = extractvalue { ptr, i32 } %239, 0
  store ptr %240, ptr %26, align 8
  %241 = extractvalue { ptr, i32 } %239, 1
  store i32 %241, ptr %27, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %45) #4
  br label %242

242:                                              ; preds = %238, %234
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %46) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %46) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %45) #4
  br label %283

243:                                              ; preds = %233, %223
  %244 = load ptr, ptr %30, align 8, !tbaa !5
  %245 = load ptr, ptr %21, align 8, !tbaa !5
  %246 = load i32, ptr %39, align 4, !tbaa !15
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds i8, ptr %245, i64 %247
  %249 = call i32 @EVP_DecryptFinal(ptr noundef %244, ptr noundef %248, ptr noundef %40)
  %250 = icmp sle i32 %249, 0
  br i1 %250, label %251, label %263

251:                                              ; preds = %243
  call void @llvm.lifetime.start.p0(i64 32, ptr %47) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %48) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %48) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %47, ptr noundef @.str.40, ptr noundef nonnull align 1 dereferenceable(1) %48)
          to label %252 unwind label %254

252:                                              ; preds = %251
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %47)
          to label %253 unwind label %258

253:                                              ; preds = %252
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %47) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %48) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %48) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %47) #4
  br label %263

254:                                              ; preds = %251
  %255 = landingpad { ptr, i32 }
          cleanup
  %256 = extractvalue { ptr, i32 } %255, 0
  store ptr %256, ptr %26, align 8
  %257 = extractvalue { ptr, i32 } %255, 1
  store i32 %257, ptr %27, align 4
  br label %262

258:                                              ; preds = %252
  %259 = landingpad { ptr, i32 }
          cleanup
  %260 = extractvalue { ptr, i32 } %259, 0
  store ptr %260, ptr %26, align 8
  %261 = extractvalue { ptr, i32 } %259, 1
  store i32 %261, ptr %27, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %47) #4
  br label %262

262:                                              ; preds = %258, %254
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %48) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %48) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %47) #4
  br label %283

263:                                              ; preds = %253, %243
  br label %264

264:                                              ; preds = %263, %222
  %265 = load ptr, ptr %30, align 8, !tbaa !5
  call void @EVP_CIPHER_CTX_free(ptr noundef %265)
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #4
  %266 = load i32, ptr %39, align 4, !tbaa !15
  %267 = load i32, ptr %40, align 4, !tbaa !15
  %268 = add nsw i32 %266, %267
  %269 = sext i32 %268 to i64
  store i64 %269, ptr %49, align 8, !tbaa !11
  %270 = load i64, ptr %49, align 8, !tbaa !11
  %271 = load i64, ptr %22, align 8, !tbaa !11
  %272 = icmp ugt i64 %270, %271
  br i1 %272, label %273, label %281

273:                                              ; preds = %264
  call void @llvm.lifetime.start.p0(i64 32, ptr %50) #4
  %274 = load i64, ptr %22, align 8, !tbaa !11
  %275 = load i64, ptr %49, align 8, !tbaa !11
  call void (ptr, ptr, ...) @_ZN3sys6formatB5cxx11EPKcz(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %50, ptr noundef @.str.41, i64 noundef %274, i64 noundef %275)
  invoke void @_ZN3sys5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %50, i32 noundef 0)
          to label %276 unwind label %277

276:                                              ; preds = %273
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %50) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %50) #4
  br label %281

277:                                              ; preds = %273
  %278 = landingpad { ptr, i32 }
          cleanup
  %279 = extractvalue { ptr, i32 } %278, 0
  store ptr %279, ptr %26, align 8
  %280 = extractvalue { ptr, i32 } %278, 1
  store i32 %280, ptr %27, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %50) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %50) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #4
  br label %283

281:                                              ; preds = %276, %264
  %282 = load i64, ptr %49, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  ret i64 %282

283:                                              ; preds = %277, %262, %242, %221, %201
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #4
  br label %284

284:                                              ; preds = %283, %178, %161, %141, %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  br label %285

285:                                              ; preds = %284, %103, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  br label %286

286:                                              ; preds = %285
  %287 = load ptr, ptr %26, align 8
  %288 = load i32, ptr %27, align 4
  %289 = insertvalue { ptr, i32 } poison, ptr %287, 0
  %290 = insertvalue { ptr, i32 } %289, i32 %288, 1
  resume { ptr, i32 } %290
}

declare ptr @EVP_aes_128_cbc() #3

declare ptr @EVP_aes_192_cbc() #3

declare ptr @EVP_aes_256_cbc() #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3lib4nameB5cxx11Ev(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

declare ptr @EVP_aes_128_ecb() #3

declare ptr @EVP_aes_192_ecb() #3

declare ptr @EVP_aes_256_ecb() #3

declare ptr @EVP_CIPHER_CTX_new() #3

declare i32 @EVP_EncryptInit(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @EVP_DecryptInit(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @EVP_CIPHER_CTX_set_padding(ptr noundef, i32 noundef) #3

declare i32 @EVP_EncryptUpdate(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

declare i32 @EVP_EncryptFinal(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @EVP_DecryptUpdate(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

declare i32 @EVP_DecryptFinal(ptr noundef, ptr noundef, ptr noundef) #3

declare void @EVP_CIPHER_CTX_free(ptr noundef) #3

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 = { "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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}


; 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] }
%"class.std::allocator" = type { i8 }

@.str.32 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [67 x i8], align 1

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

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

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

declare i32 @__gxx_personality_v0(...)

; 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 dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

declare void @_ZN3sys6formatB5cxx11EPKcz(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ...) local_unnamed_addr #3

declare void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

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

declare void @_ZN3sys5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i64 -2147483648, 2147483648) i64 @_ZN11lib_openssl3aesEbbPKhmS1_mS1_mPhm(ptr noundef nonnull align 8 dereferenceable(96) %0, i1 noundef zeroext %1, i1 noundef zeroext %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6, ptr noundef %7, i64 noundef %8, ptr noundef %9, i64 noundef %10) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::allocator", align 1
  %18 = alloca %"class.std::__cxx11::basic_string", align 8
  %19 = alloca %"class.std::allocator", align 1
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca %"class.std::allocator", align 1
  %22 = alloca %"class.std::__cxx11::basic_string", align 8
  %23 = alloca %"class.std::allocator", align 1
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca %"class.std::__cxx11::basic_string", align 8
  %27 = alloca %"class.std::allocator", align 1
  %28 = alloca %"class.std::__cxx11::basic_string", align 8
  %29 = alloca %"class.std::allocator", align 1
  %30 = alloca %"class.std::__cxx11::basic_string", align 8
  %31 = alloca %"class.std::allocator", align 1
  %32 = alloca %"class.std::__cxx11::basic_string", align 8
  %33 = alloca %"class.std::allocator", align 1
  %34 = alloca %"class.std::__cxx11::basic_string", align 8
  br i1 %2, label %35, label %52

35:                                               ; preds = %11
  switch i64 %4, label %42 [
    i64 16, label %36
    i64 24, label %38
    i64 32, label %40
  ]

36:                                               ; preds = %35
  %37 = tail call ptr @EVP_aes_128_cbc()
  br label %69

38:                                               ; preds = %35
  %39 = tail call ptr @EVP_aes_192_cbc()
  br label %69

40:                                               ; preds = %35
  %41 = tail call ptr @EVP_aes_256_cbc()
  br label %69

42:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #4
  call void @_ZNK3lib4nameB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %13, ptr noundef nonnull align 8 dereferenceable(48) %0)
  %43 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  %44 = shl i64 %4, 3
  invoke void (ptr, ptr, ...) @_ZN3sys6formatB5cxx11EPKcz(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %12, ptr noundef nonnull @.str.32, ptr noundef %43, i64 noundef %44)
          to label %45 unwind label %47

45:                                               ; preds = %42
  invoke void @_ZN3sys5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %12, i32 noundef 0)
          to label %46 unwind label %49

46:                                               ; preds = %45
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #4
  br label %69

47:                                               ; preds = %42
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %51

49:                                               ; preds = %45
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #4
  br label %51

51:                                               ; preds = %49, %47
  %.pn54 = phi { ptr, i32 } [ %50, %49 ], [ %48, %47 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #4
  br label %178

52:                                               ; preds = %11
  switch i64 %4, label %59 [
    i64 16, label %53
    i64 24, label %55
    i64 32, label %57
  ]

53:                                               ; preds = %52
  %54 = tail call ptr @EVP_aes_128_ecb()
  br label %69

55:                                               ; preds = %52
  %56 = tail call ptr @EVP_aes_192_ecb()
  br label %69

57:                                               ; preds = %52
  %58 = tail call ptr @EVP_aes_256_ecb()
  br label %69

59:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %15) #4
  call void @_ZNK3lib4nameB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %15, ptr noundef nonnull align 8 dereferenceable(48) %0)
  %60 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  %61 = shl i64 %4, 3
  invoke void (ptr, ptr, ...) @_ZN3sys6formatB5cxx11EPKcz(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %14, ptr noundef nonnull @.str.32, ptr noundef %60, i64 noundef %61)
          to label %62 unwind label %64

62:                                               ; preds = %59
  invoke void @_ZN3sys5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef 0)
          to label %63 unwind label %66

63:                                               ; preds = %62
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #4
  br label %69

64:                                               ; preds = %59
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %68

66:                                               ; preds = %62
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #4
  br label %68

68:                                               ; preds = %66, %64
  %.pn = phi { ptr, i32 } [ %67, %66 ], [ %65, %64 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #4
  br label %178

69:                                               ; preds = %53, %55, %57, %63, %36, %38, %40, %46
  %.0 = phi ptr [ null, %46 ], [ %41, %40 ], [ %39, %38 ], [ %37, %36 ], [ null, %63 ], [ %58, %57 ], [ %56, %55 ], [ %54, %53 ]
  %70 = call ptr @EVP_CIPHER_CTX_new()
  %71 = icmp eq ptr %70, null
  br i1 %71, label %72, label %80

72:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %16) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %17) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull @.str.33, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %73 unwind label %75

73:                                               ; preds = %72
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %74 unwind label %77

74:                                               ; preds = %73
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %16) #4
  br label %80

75:                                               ; preds = %72
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %79

77:                                               ; preds = %73
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #4
  br label %79

79:                                               ; preds = %77, %75
  %.pn56 = phi { ptr, i32 } [ %78, %77 ], [ %76, %75 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %16) #4
  br label %178

80:                                               ; preds = %74, %69
  br i1 %1, label %81, label %92

81:                                               ; preds = %80
  %82 = call i32 @EVP_EncryptInit(ptr noundef %70, ptr noundef %.0, ptr noundef %3, ptr noundef %5)
  %83 = icmp slt i32 %82, 1
  br i1 %83, label %84, label %103

84:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %18) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %19) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull @.str.34, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %85 unwind label %87

85:                                               ; preds = %84
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %18)
          to label %86 unwind label %89

86:                                               ; preds = %85
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %19) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %18) #4
  br label %103

87:                                               ; preds = %84
  %88 = landingpad { ptr, i32 }
          cleanup
  br label %91

89:                                               ; preds = %85
  %90 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #4
  br label %91

91:                                               ; preds = %89, %87
  %.pn60 = phi { ptr, i32 } [ %90, %89 ], [ %88, %87 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %19) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %18) #4
  br label %178

92:                                               ; preds = %80
  %93 = call i32 @EVP_DecryptInit(ptr noundef %70, ptr noundef %.0, ptr noundef %3, ptr noundef %5)
  %94 = icmp slt i32 %93, 1
  br i1 %94, label %95, label %103

95:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %20) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %21) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull @.str.35, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %96 unwind label %98

96:                                               ; preds = %95
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %97 unwind label %100

97:                                               ; preds = %96
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %21) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %20) #4
  br label %103

98:                                               ; preds = %95
  %99 = landingpad { ptr, i32 }
          cleanup
  br label %102

100:                                              ; preds = %96
  %101 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #4
  br label %102

102:                                              ; preds = %100, %98
  %.pn58 = phi { ptr, i32 } [ %101, %100 ], [ %99, %98 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %21) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %20) #4
  br label %178

103:                                              ; preds = %92, %97, %81, %86
  %104 = call i32 @EVP_CIPHER_CTX_set_padding(ptr noundef %70, i32 noundef 0)
  %105 = icmp slt i32 %104, 1
  br i1 %105, label %106, label %114

106:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %22) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %23) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef nonnull @.str.36, ptr noundef nonnull align 1 dereferenceable(1) %23)
          to label %107 unwind label %109

107:                                              ; preds = %106
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %22)
          to label %108 unwind label %111

108:                                              ; preds = %107
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %23) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %22) #4
  br label %114

109:                                              ; preds = %106
  %110 = landingpad { ptr, i32 }
          cleanup
  br label %113

111:                                              ; preds = %107
  %112 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #4
  br label %113

113:                                              ; preds = %111, %109
  %.pn62 = phi { ptr, i32 } [ %112, %111 ], [ %110, %109 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %23) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %22) #4
  br label %178

114:                                              ; preds = %108, %103
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %24) #4
  store i32 0, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %25) #4
  store i32 0, ptr %25, align 4, !tbaa !5
  %115 = trunc i64 %8 to i32
  br i1 %1, label %116, label %141

116:                                              ; preds = %114
  %117 = call i32 @EVP_EncryptUpdate(ptr noundef %70, ptr noundef %9, ptr noundef nonnull %24, ptr noundef %7, i32 noundef %115)
  %118 = icmp slt i32 %117, 1
  br i1 %118, label %119, label %127

119:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %26) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %27) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %26, ptr noundef nonnull @.str.37, ptr noundef nonnull align 1 dereferenceable(1) %27)
          to label %120 unwind label %122

120:                                              ; preds = %119
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %26)
          to label %121 unwind label %124

121:                                              ; preds = %120
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %27) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %26) #4
  br label %127

122:                                              ; preds = %119
  %123 = landingpad { ptr, i32 }
          cleanup
  br label %126

124:                                              ; preds = %120
  %125 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #4
  br label %126

126:                                              ; preds = %124, %122
  %.pn68 = phi { ptr, i32 } [ %125, %124 ], [ %123, %122 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %27) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %26) #4
  br label %177

127:                                              ; preds = %121, %116
  %128 = load i32, ptr %24, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i8, ptr %9, i64 %129
  %131 = call i32 @EVP_EncryptFinal(ptr noundef %70, ptr noundef %130, ptr noundef nonnull %25)
  %132 = icmp slt i32 %131, 1
  br i1 %132, label %133, label %166

133:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %28) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %29) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %28, ptr noundef nonnull @.str.38, ptr noundef nonnull align 1 dereferenceable(1) %29)
          to label %134 unwind label %136

134:                                              ; preds = %133
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %28)
          to label %135 unwind label %138

135:                                              ; preds = %134
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %29) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %28) #4
  br label %166

136:                                              ; preds = %133
  %137 = landingpad { ptr, i32 }
          cleanup
  br label %140

138:                                              ; preds = %134
  %139 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #4
  br label %140

140:                                              ; preds = %138, %136
  %.pn70 = phi { ptr, i32 } [ %139, %138 ], [ %137, %136 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %29) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %28) #4
  br label %177

141:                                              ; preds = %114
  %142 = call i32 @EVP_DecryptUpdate(ptr noundef %70, ptr noundef %9, ptr noundef nonnull %24, ptr noundef %7, i32 noundef %115)
  %143 = icmp slt i32 %142, 1
  br i1 %143, label %144, label %152

144:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %30) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %31) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %31) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %30, ptr noundef nonnull @.str.39, ptr noundef nonnull align 1 dereferenceable(1) %31)
          to label %145 unwind label %147

145:                                              ; preds = %144
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %30)
          to label %146 unwind label %149

146:                                              ; preds = %145
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %30) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %31) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %31) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %30) #4
  br label %152

147:                                              ; preds = %144
  %148 = landingpad { ptr, i32 }
          cleanup
  br label %151

149:                                              ; preds = %145
  %150 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %30) #4
  br label %151

151:                                              ; preds = %149, %147
  %.pn64 = phi { ptr, i32 } [ %150, %149 ], [ %148, %147 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %31) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %31) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %30) #4
  br label %177

152:                                              ; preds = %146, %141
  %153 = load i32, ptr %24, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds i8, ptr %9, i64 %154
  %156 = call i32 @EVP_DecryptFinal(ptr noundef %70, ptr noundef %155, ptr noundef nonnull %25)
  %157 = icmp slt i32 %156, 1
  br i1 %157, label %158, label %166

158:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %32) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %33) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %32, ptr noundef nonnull @.str.40, ptr noundef nonnull align 1 dereferenceable(1) %33)
          to label %159 unwind label %161

159:                                              ; preds = %158
  invoke void @_ZN7openssl5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %32)
          to label %160 unwind label %163

160:                                              ; preds = %159
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %32) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %33) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %32) #4
  br label %166

161:                                              ; preds = %158
  %162 = landingpad { ptr, i32 }
          cleanup
  br label %165

163:                                              ; preds = %159
  %164 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %32) #4
  br label %165

165:                                              ; preds = %163, %161
  %.pn66 = phi { ptr, i32 } [ %164, %163 ], [ %162, %161 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %33) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %32) #4
  br label %177

166:                                              ; preds = %152, %160, %127, %135
  call void @EVP_CIPHER_CTX_free(ptr noundef %70)
  %167 = load i32, ptr %24, align 4, !tbaa !5
  %168 = load i32, ptr %25, align 4, !tbaa !5
  %169 = add nsw i32 %168, %167
  %170 = sext i32 %169 to i64
  %171 = icmp ugt i64 %170, %10
  br i1 %171, label %172, label %176

172:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %34) #4
  call void (ptr, ptr, ...) @_ZN3sys6formatB5cxx11EPKcz(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %34, ptr noundef nonnull @.str.41, i64 noundef %10, i64 noundef %170)
  invoke void @_ZN3sys5fatalERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(ptr noundef nonnull align 8 dereferenceable(32) %34, i32 noundef 0)
          to label %173 unwind label %174

173:                                              ; preds = %172
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %34) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %34) #4
  br label %176

174:                                              ; preds = %172
  %175 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %34) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %34) #4
  br label %177

176:                                              ; preds = %173, %166
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %25) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %24) #4
  ret i64 %170

177:                                              ; preds = %174, %165, %151, %140, %126
  %.pn72 = phi { ptr, i32 } [ %175, %174 ], [ %.pn70, %140 ], [ %.pn68, %126 ], [ %.pn66, %165 ], [ %.pn64, %151 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %25) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %24) #4
  br label %178

178:                                              ; preds = %79, %91, %102, %113, %177, %68, %51
  %.pn72.pn.pn = phi { ptr, i32 } [ %.pn54, %51 ], [ %.pn, %68 ], [ %.pn72, %177 ], [ %.pn62, %113 ], [ %.pn60, %91 ], [ %.pn58, %102 ], [ %.pn56, %79 ]
  resume { ptr, i32 } %.pn72.pn.pn
}

declare ptr @EVP_aes_128_cbc() local_unnamed_addr #3

declare ptr @EVP_aes_192_cbc() local_unnamed_addr #3

declare ptr @EVP_aes_256_cbc() local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3lib4nameB5cxx11Ev(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

declare ptr @EVP_aes_128_ecb() local_unnamed_addr #3

declare ptr @EVP_aes_192_ecb() local_unnamed_addr #3

declare ptr @EVP_aes_256_ecb() local_unnamed_addr #3

declare ptr @EVP_CIPHER_CTX_new() local_unnamed_addr #3

declare i32 @EVP_EncryptInit(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @EVP_DecryptInit(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @EVP_CIPHER_CTX_set_padding(ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @EVP_EncryptUpdate(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @EVP_EncryptFinal(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @EVP_DecryptUpdate(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @EVP_DecryptFinal(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @EVP_CIPHER_CTX_free(ptr noundef) local_unnamed_addr #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 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass