; LLVM IR from specinfo-ua/UAPKI :: library/common/pkix (uapki-ns-verify)

; 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.UapkiNS::SmartBA" = type { ptr }

@.str = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7UapkiNS6Verify12verifyEcSignE7SignAlg10EcParamsIdPK12ByteArray_stS5_S5_(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #0

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

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

declare i32 @__gxx_personality_v0(...)

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7UapkiNS6Verify16verifyRsaV15SignE7HashAlgPK12ByteArray_stS4_S4_S4_(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7UapkiNS6Verify9parseSpkiEPK12ByteArray_stP7SignAlgP10EcParamsIdPPS1_S9_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS6Verify15verifySignatureEPKcPK12ByteArray_stbS5_S5_(ptr noundef %0, ptr noundef %1, i1 noundef zeroext %2, ptr noundef %3, ptr noundef %4) #0 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %"class.UapkiNS::SmartBA", align 8
  %14 = alloca %"class.UapkiNS::SmartBA", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"class.UapkiNS::SmartBA", align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  %22 = zext i1 %2 to i8
  store i8 %22, ptr %8, align 1, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  invoke void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %23 unwind label %31

23:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  invoke void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %24 unwind label %35

24:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  store i32 0, ptr %21, align 4, !tbaa !17
  br label %25

25:                                               ; preds = %24
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %43, label %28

28:                                               ; preds = %25
  store i32 2, ptr %11, align 4, !tbaa !11
  %29 = load i32, ptr %11, align 4, !tbaa !11
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 324, i32 noundef %29, ptr noundef null)
          to label %30 unwind label %39

30:                                               ; preds = %28
  br label %217

31:                                               ; preds = %5
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %15, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %16, align 4
  br label %220

35:                                               ; preds = %23
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %15, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %16, align 4
  br label %219

39:                                               ; preds = %211, %204, %197, %195, %192, %185, %178, %174, %167, %160, %156, %148, %138, %133, %131, %128, %120, %114, %111, %108, %103, %98, %94, %85, %75, %72, %67, %58, %49, %28
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %15, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  br label %219

43:                                               ; preds = %25
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %52, label %49

49:                                               ; preds = %46
  store i32 2, ptr %11, align 4, !tbaa !11
  %50 = load i32, ptr %11, align 4, !tbaa !11
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 325, i32 noundef %50, ptr noundef null)
          to label %51 unwind label %39

51:                                               ; preds = %49
  br label %217

52:                                               ; preds = %46
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  br label %55

55:                                               ; preds = %54
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %61, label %58

58:                                               ; preds = %55
  store i32 2, ptr %11, align 4, !tbaa !11
  %59 = load i32, ptr %11, align 4, !tbaa !11
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 326, i32 noundef %59, ptr noundef null)
          to label %60 unwind label %39

60:                                               ; preds = %58
  br label %217

61:                                               ; preds = %55
  br label %62

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62
  br label %64

64:                                               ; preds = %63
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = icmp ne ptr %65, null
  br i1 %66, label %70, label %67

67:                                               ; preds = %64
  store i32 2, ptr %11, align 4, !tbaa !11
  %68 = load i32, ptr %11, align 4, !tbaa !11
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 327, i32 noundef %68, ptr noundef null)
          to label %69 unwind label %39

69:                                               ; preds = %67
  br label %217

70:                                               ; preds = %64
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = invoke i32 @hash_from_oid(ptr noundef %73)
          to label %75 unwind label %39

75:                                               ; preds = %72
  store i32 %74, ptr %18, align 4, !tbaa !13
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = invoke i32 @signature_from_oid(ptr noundef %76)
          to label %78 unwind label %39

78:                                               ; preds = %75
  store i32 %77, ptr %20, align 4, !tbaa !15
  %79 = load i32, ptr %18, align 4, !tbaa !13
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %84, label %81

81:                                               ; preds = %78
  %82 = load i32, ptr %20, align 4, !tbaa !15
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %84, label %90

84:                                               ; preds = %81, %78
  br label %85

85:                                               ; preds = %84
  store i32 4110, ptr %11, align 4, !tbaa !11
  %86 = load i32, ptr %11, align 4, !tbaa !11
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 332, i32 noundef %86, ptr noundef null)
          to label %87 unwind label %39

87:                                               ; preds = %85
  br label %217

88:                                               ; No predecessors!
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89, %81
  %91 = load i8, ptr %8, align 1, !tbaa !9, !range !19, !noundef !20
  %92 = trunc i8 %91 to i1
  br i1 %92, label %111, label %93

93:                                               ; preds = %90
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %18, align 4, !tbaa !13
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %98 unwind label %39

98:                                               ; preds = %94
  %99 = invoke i32 @hash(i32 noundef %95, ptr noundef %96, ptr noundef %97)
          to label %100 unwind label %39

100:                                              ; preds = %98
  store i32 %99, ptr %11, align 4, !tbaa !11
  %101 = load i32, ptr %11, align 4, !tbaa !11
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %106

103:                                              ; preds = %100
  %104 = load i32, ptr %11, align 4, !tbaa !11
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 336, i32 noundef %104)
          to label %105 unwind label %39

105:                                              ; preds = %103
  br label %217

106:                                              ; preds = %100
  br label %107

107:                                              ; preds = %106
  br label %108

108:                                              ; preds = %107
  %109 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %110 unwind label %39

110:                                              ; preds = %108
  store ptr %109, ptr %12, align 8, !tbaa !5
  br label %127

111:                                              ; preds = %90
  %112 = load i32, ptr %18, align 4, !tbaa !13
  %113 = invoke i64 @hash_get_size(i32 noundef %112)
          to label %114 unwind label %39

114:                                              ; preds = %111
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = invoke i64 @ba_get_len(ptr noundef %115)
          to label %117 unwind label %39

117:                                              ; preds = %114
  %118 = icmp ne i64 %113, %116
  br i1 %118, label %119, label %125

119:                                              ; preds = %117
  br label %120

120:                                              ; preds = %119
  store i32 4111, ptr %11, align 4, !tbaa !11
  %121 = load i32, ptr %11, align 4, !tbaa !11
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 341, i32 noundef %121, ptr noundef null)
          to label %122 unwind label %39

122:                                              ; preds = %120
  br label %217

123:                                              ; No predecessors!
  br label %124

124:                                              ; preds = %123
  br label %125

125:                                              ; preds = %124, %117
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %126, ptr %12, align 8, !tbaa !5
  br label %127

127:                                              ; preds = %125, %110
  br label %128

128:                                              ; preds = %127
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %131 unwind label %39

131:                                              ; preds = %128
  %132 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %133 unwind label %39

133:                                              ; preds = %131
  %134 = invoke noundef i32 @_ZN7UapkiNS6Verify9parseSpkiEPK12ByteArray_stP7SignAlgP10EcParamsIdPPS1_S9_(ptr noundef %129, ptr noundef %19, ptr noundef %21, ptr noundef %130, ptr noundef %132)
          to label %135 unwind label %39

135:                                              ; preds = %133
  store i32 %134, ptr %11, align 4, !tbaa !11
  %136 = load i32, ptr %11, align 4, !tbaa !11
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %141

138:                                              ; preds = %135
  %139 = load i32, ptr %11, align 4, !tbaa !11
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 346, i32 noundef %139)
          to label %140 unwind label %39

140:                                              ; preds = %138
  br label %217

141:                                              ; preds = %135
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %19, align 4, !tbaa !15
  %145 = load i32, ptr %20, align 4, !tbaa !15
  %146 = icmp ne i32 %144, %145
  br i1 %146, label %147, label %153

147:                                              ; preds = %143
  br label %148

148:                                              ; preds = %147
  store i32 4101, ptr %11, align 4, !tbaa !11
  %149 = load i32, ptr %11, align 4, !tbaa !11
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 348, i32 noundef %149, ptr noundef null)
          to label %150 unwind label %39

150:                                              ; preds = %148
  br label %217

151:                                              ; No predecessors!
  br label %152

152:                                              ; preds = %151
  br label %153

153:                                              ; preds = %152, %143
  %154 = load i32, ptr %20, align 4, !tbaa !15
  switch i32 %154, label %210 [
    i32 1, label %155
    i32 2, label %173
    i32 7, label %191
  ]

155:                                              ; preds = %153
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %20, align 4, !tbaa !15
  %158 = load i32, ptr %21, align 4, !tbaa !17
  %159 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %160 unwind label %39

160:                                              ; preds = %156
  %161 = load ptr, ptr %12, align 8, !tbaa !5
  %162 = load ptr, ptr %10, align 8, !tbaa !5
  %163 = invoke noundef i32 @_ZN7UapkiNS6Verify12verifyEcSignE7SignAlg10EcParamsIdPK12ByteArray_stS5_S5_(i32 noundef %157, i32 noundef %158, ptr noundef %159, ptr noundef %161, ptr noundef %162)
          to label %164 unwind label %39

164:                                              ; preds = %160
  store i32 %163, ptr %11, align 4, !tbaa !11
  %165 = load i32, ptr %11, align 4, !tbaa !11
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %167, label %170

167:                                              ; preds = %164
  %168 = load i32, ptr %11, align 4, !tbaa !11
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 352, i32 noundef %168)
          to label %169 unwind label %39

169:                                              ; preds = %167
  br label %217

170:                                              ; preds = %164
  br label %171

171:                                              ; preds = %170
  br label %172

172:                                              ; preds = %171
  br label %216

173:                                              ; preds = %153
  br label %174

174:                                              ; preds = %173
  %175 = load i32, ptr %20, align 4, !tbaa !15
  %176 = load i32, ptr %21, align 4, !tbaa !17
  %177 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %178 unwind label %39

178:                                              ; preds = %174
  %179 = load ptr, ptr %12, align 8, !tbaa !5
  %180 = load ptr, ptr %10, align 8, !tbaa !5
  %181 = invoke noundef i32 @_ZN7UapkiNS6Verify12verifyEcSignE7SignAlg10EcParamsIdPK12ByteArray_stS5_S5_(i32 noundef %175, i32 noundef %176, ptr noundef %177, ptr noundef %179, ptr noundef %180)
          to label %182 unwind label %39

182:                                              ; preds = %178
  store i32 %181, ptr %11, align 4, !tbaa !11
  %183 = load i32, ptr %11, align 4, !tbaa !11
  %184 = icmp ne i32 %183, 0
  br i1 %184, label %185, label %188

185:                                              ; preds = %182
  %186 = load i32, ptr %11, align 4, !tbaa !11
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 355, i32 noundef %186)
          to label %187 unwind label %39

187:                                              ; preds = %185
  br label %217

188:                                              ; preds = %182
  br label %189

189:                                              ; preds = %188
  br label %190

190:                                              ; preds = %189
  br label %216

191:                                              ; preds = %153
  br label %192

192:                                              ; preds = %191
  %193 = load i32, ptr %18, align 4, !tbaa !13
  %194 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %195 unwind label %39

195:                                              ; preds = %192
  %196 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %197 unwind label %39

197:                                              ; preds = %195
  %198 = load ptr, ptr %12, align 8, !tbaa !5
  %199 = load ptr, ptr %10, align 8, !tbaa !5
  %200 = invoke noundef i32 @_ZN7UapkiNS6Verify16verifyRsaV15SignE7HashAlgPK12ByteArray_stS4_S4_S4_(i32 noundef %193, ptr noundef %194, ptr noundef %196, ptr noundef %198, ptr noundef %199)
          to label %201 unwind label %39

201:                                              ; preds = %197
  store i32 %200, ptr %11, align 4, !tbaa !11
  %202 = load i32, ptr %11, align 4, !tbaa !11
  %203 = icmp ne i32 %202, 0
  br i1 %203, label %204, label %207

204:                                              ; preds = %201
  %205 = load i32, ptr %11, align 4, !tbaa !11
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 358, i32 noundef %205)
          to label %206 unwind label %39

206:                                              ; preds = %204
  br label %217

207:                                              ; preds = %201
  br label %208

208:                                              ; preds = %207
  br label %209

209:                                              ; preds = %208
  br label %216

210:                                              ; preds = %153
  br label %211

211:                                              ; preds = %210
  store i32 4110, ptr %11, align 4, !tbaa !11
  %212 = load i32, ptr %11, align 4, !tbaa !11
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 361, i32 noundef %212, ptr noundef null)
          to label %213 unwind label %39

213:                                              ; preds = %211
  br label %217

214:                                              ; No predecessors!
  br label %215

215:                                              ; preds = %214
  br label %216

216:                                              ; preds = %215, %209, %190, %172
  br label %217

217:                                              ; preds = %216, %213, %206, %187, %169, %150, %140, %122, %105, %87, %69, %60, %51, %30
  %218 = load i32, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  ret i32 %218

219:                                              ; preds = %39, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  br label %220

220:                                              ; preds = %219, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %221

221:                                              ; preds = %220
  %222 = load ptr, ptr %15, align 8
  %223 = load i32, ptr %16, align 4
  %224 = insertvalue { ptr, i32 } poison, ptr %222, 0
  %225 = insertvalue { ptr, i32 } %224, i32 %223, 1
  resume { ptr, i32 } %225
}

declare i32 @hash_from_oid(ptr noundef) #3

declare i32 @signature_from_oid(ptr noundef) #3

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

declare i64 @hash_get_size(i32 noundef) #3

declare i64 @ba_get_len(ptr noundef) #3

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTS7HashAlg", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"_ZTS7SignAlg", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"_ZTS10EcParamsId", !7, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}


; 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.UapkiNS::SmartBA" = type { ptr }

@.str = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7UapkiNS6Verify12verifyEcSignE7SignAlg10EcParamsIdPK12ByteArray_stS5_S5_(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

declare i32 @__gxx_personality_v0(...)

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #3

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

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

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7UapkiNS6Verify16verifyRsaV15SignE7HashAlgPK12ByteArray_stS4_S4_S4_(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7UapkiNS6Verify9parseSpkiEPK12ByteArray_stP7SignAlgP10EcParamsIdPPS1_S9_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS6Verify15verifySignatureEPKcPK12ByteArray_stbS5_S5_(ptr noundef %0, ptr noundef %1, i1 noundef zeroext %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.UapkiNS::SmartBA", align 8
  %7 = alloca %"class.UapkiNS::SmartBA", align 8
  %8 = alloca %"class.UapkiNS::SmartBA", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %.invoke71, label %13

11:                                               ; preds = %.invoke71, %.invoke, %65, %60, %59, %54, %53, %48, %46, %43, %38, %37, %34, %32, %29, %25, %19, %17
  %12 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  resume { ptr, i32 } %12

13:                                               ; preds = %5
  %.not61 = icmp eq ptr %1, null
  br i1 %.not61, label %.invoke71, label %14

14:                                               ; preds = %13
  %.not62 = icmp eq ptr %3, null
  br i1 %.not62, label %.invoke71, label %15

15:                                               ; preds = %14
  %.not63 = icmp eq ptr %4, null
  br i1 %.not63, label %.invoke71, label %17

.invoke71:                                        ; preds = %5, %15, %14, %13
  %16 = phi i64 [ 325, %13 ], [ 326, %14 ], [ 327, %15 ], [ 324, %5 ]
  invoke void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef %16, i32 noundef 2, ptr noundef null)
          to label %67 unwind label %11

17:                                               ; preds = %15
  %18 = invoke i32 @hash_from_oid(ptr noundef nonnull %0)
          to label %19 unwind label %11

19:                                               ; preds = %17
  %20 = invoke i32 @signature_from_oid(ptr noundef nonnull %0)
          to label %21 unwind label %11

21:                                               ; preds = %19
  %22 = icmp eq i32 %18, 0
  %23 = icmp eq i32 %20, 0
  %or.cond = select i1 %22, i1 true, i1 %23
  br i1 %or.cond, label %.invoke, label %24

24:                                               ; preds = %21
  br i1 %2, label %32, label %25

25:                                               ; preds = %24
  %26 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %27 = invoke i32 @hash(i32 noundef %18, ptr noundef nonnull %1, ptr noundef %26)
          to label %28 unwind label %11

28:                                               ; preds = %25
  %.not64 = icmp eq i32 %27, 0
  br i1 %.not64, label %30, label %29

29:                                               ; preds = %28
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 336, i32 noundef %27)
          to label %67 unwind label %11

30:                                               ; preds = %28
  %31 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  br label %38

32:                                               ; preds = %24
  %33 = invoke i64 @hash_get_size(i32 noundef %18)
          to label %34 unwind label %11

34:                                               ; preds = %32
  %35 = invoke i64 @ba_get_len(ptr noundef nonnull %1)
          to label %36 unwind label %11

36:                                               ; preds = %34
  %.not65 = icmp eq i64 %33, %35
  br i1 %.not65, label %38, label %37

37:                                               ; preds = %36
  invoke void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 341, i32 noundef 4111, ptr noundef null)
          to label %67 unwind label %11

38:                                               ; preds = %36, %30
  %.047 = phi ptr [ %31, %30 ], [ %1, %36 ]
  %39 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %40 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %41 = invoke noundef i32 @_ZN7UapkiNS6Verify9parseSpkiEPK12ByteArray_stP7SignAlgP10EcParamsIdPPS1_S9_(ptr noundef nonnull %3, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef %39, ptr noundef %40)
          to label %42 unwind label %11

42:                                               ; preds = %38
  %.not66 = icmp eq i32 %41, 0
  br i1 %.not66, label %44, label %43

43:                                               ; preds = %42
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 346, i32 noundef %41)
          to label %67 unwind label %11

44:                                               ; preds = %42
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %.not67 = icmp eq i32 %45, %20
  br i1 %.not67, label %47, label %46

46:                                               ; preds = %44
  invoke void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 348, i32 noundef 4101, ptr noundef null)
          to label %67 unwind label %11

47:                                               ; preds = %44
  switch i32 %20, label %.invoke [
    i32 1, label %48
    i32 2, label %54
    i32 7, label %60
  ]

48:                                               ; preds = %47
  %49 = load i32, ptr %10, align 4, !tbaa !9
  %50 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %51 = invoke noundef i32 @_ZN7UapkiNS6Verify12verifyEcSignE7SignAlg10EcParamsIdPK12ByteArray_stS5_S5_(i32 noundef 1, i32 noundef %49, ptr noundef %50, ptr noundef %.047, ptr noundef nonnull %4)
          to label %52 unwind label %11

52:                                               ; preds = %48
  %.not70 = icmp eq i32 %51, 0
  br i1 %.not70, label %67, label %53

53:                                               ; preds = %52
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 352, i32 noundef %51)
          to label %67 unwind label %11

54:                                               ; preds = %47
  %55 = load i32, ptr %10, align 4, !tbaa !9
  %56 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %57 = invoke noundef i32 @_ZN7UapkiNS6Verify12verifyEcSignE7SignAlg10EcParamsIdPK12ByteArray_stS5_S5_(i32 noundef 2, i32 noundef %55, ptr noundef %56, ptr noundef %.047, ptr noundef nonnull %4)
          to label %58 unwind label %11

58:                                               ; preds = %54
  %.not69 = icmp eq i32 %57, 0
  br i1 %.not69, label %67, label %59

59:                                               ; preds = %58
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 355, i32 noundef %57)
          to label %67 unwind label %11

60:                                               ; preds = %47
  %61 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %62 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %63 = invoke noundef i32 @_ZN7UapkiNS6Verify16verifyRsaV15SignE7HashAlgPK12ByteArray_stS4_S4_S4_(i32 noundef %18, ptr noundef %61, ptr noundef %62, ptr noundef %.047, ptr noundef nonnull %4)
          to label %64 unwind label %11

64:                                               ; preds = %60
  %.not68 = icmp eq i32 %63, 0
  br i1 %.not68, label %67, label %65

65:                                               ; preds = %64
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 358, i32 noundef %63)
          to label %67 unwind label %11

.invoke:                                          ; preds = %47, %21
  %66 = phi i64 [ 332, %21 ], [ 361, %47 ]
  invoke void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef %66, i32 noundef 4110, ptr noundef null)
          to label %67 unwind label %11

67:                                               ; preds = %.invoke71, %.invoke, %52, %58, %64, %65, %59, %53, %46, %43, %37, %29
  %.0 = phi i32 [ 4111, %37 ], [ %41, %43 ], [ 4101, %46 ], [ %63, %65 ], [ 0, %64 ], [ %57, %59 ], [ 0, %58 ], [ %51, %53 ], [ 0, %52 ], [ %27, %29 ], [ 4110, %.invoke ], [ 2, %.invoke71 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  ret i32 %.0
}

declare i32 @hash_from_oid(ptr noundef) local_unnamed_addr #3

declare i32 @signature_from_oid(ptr noundef) local_unnamed_addr #3

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

declare i64 @hash_get_size(i32 noundef) local_unnamed_addr #3

declare i64 @ba_get_len(ptr noundef) local_unnamed_addr #3

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


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