; LLVM IR from aws/s2n-tls :: crypto (s2n_pkey)

; 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"

%struct.s2n_debug_info = type { ptr, ptr }
%struct.s2n_result = type { i32 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }
%struct.s2n_hash_state = type { ptr, i32, i8, i64, %union.anon }
%union.anon = type { %struct.s2n_hash_evp_digest }
%struct.s2n_hash_evp_digest = type { %struct.s2n_evp_digest, %struct.s2n_evp_digest }
%struct.s2n_evp_digest = type { ptr, ptr }
%struct.s2n_pkey = type { ptr, ptr, ptr, ptr, ptr, ptr }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.12 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [88 x i8], align 1
@__const.s2n_pkey_match.input = external hidden unnamed_addr constant [10 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [88 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #0

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strrchr(ptr noundef, i32 noundef) #1

declare i32 @s2n_calculate_stacktrace() #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_pkey_size(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_pkey_sign(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_pkey_verify(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_pkey_match(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.s2n_result, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.s2n_result, align 4
  %11 = alloca [10 x i8], align 1
  %12 = alloca %struct.s2n_blob, align 8
  %13 = alloca %struct.s2n_hash_state, align 8
  %14 = alloca %struct.s2n_hash_state, align 8
  %15 = alloca i32, align 4
  %16 = alloca %struct.s2n_result, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %2
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %52, label %21

21:                                               ; preds = %18
  br label %22

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22
  %24 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %25 = getelementptr inbounds %struct.s2n_debug_info, ptr %24, i32 0, i32 0
  store ptr @.str.12, ptr %25, align 8, !tbaa !9
  %26 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %27 = getelementptr inbounds %struct.s2n_debug_info, ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = getelementptr inbounds i8, ptr %28, i64 21
  %30 = call ptr @strrchr(ptr noundef %29, i32 noundef 47) #8
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %39

32:                                               ; preds = %23
  %33 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %34 = getelementptr inbounds %struct.s2n_debug_info, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  %36 = getelementptr inbounds i8, ptr %35, i64 21
  %37 = call ptr @strrchr(ptr noundef %36, i32 noundef 47) #8
  %38 = getelementptr inbounds i8, ptr %37, i64 1
  br label %44

39:                                               ; preds = %23
  %40 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %41 = getelementptr inbounds %struct.s2n_debug_info, ptr %40, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %42, i64 21
  br label %44

44:                                               ; preds = %39, %32
  %45 = phi ptr [ %38, %32 ], [ %43, %39 ]
  %46 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %47 = getelementptr inbounds %struct.s2n_debug_info, ptr %46, i32 0, i32 1
  store ptr %45, ptr %47, align 8, !tbaa !11
  %48 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %48, align 4, !tbaa !12
  %49 = call i32 @s2n_calculate_stacktrace()
  br label %50

50:                                               ; preds = %44
  store i32 -1, ptr %3, align 4
  br label %272

51:                                               ; No predecessors!
  br label %52

52:                                               ; preds = %51, %18
  br label %53

53:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  store i32 0, ptr %6, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 0, ptr %7, align 4, !tbaa !12
  br label %54

54:                                               ; preds = %53
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.s2n_pkey, ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !14
  %58 = call i32 @s2n_pkey_get_type(ptr noundef %57, ptr noundef %6)
  %59 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  store i32 %58, ptr %59, align 4
  %60 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  %61 = load i32, ptr %60, align 4
  %62 = call zeroext i1 @s2n_result_is_ok(i32 %61)
  br i1 %62, label %64, label %63

63:                                               ; preds = %54
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %271

64:                                               ; preds = %54
  br label %65

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.s2n_pkey, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !14
  %71 = call i32 @s2n_pkey_get_type(ptr noundef %70, ptr noundef %7)
  %72 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  store i32 %71, ptr %72, align 4
  %73 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  %74 = load i32, ptr %73, align 4
  %75 = call zeroext i1 @s2n_result_is_ok(i32 %74)
  br i1 %75, label %77, label %76

76:                                               ; preds = %67
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %271

77:                                               ; preds = %67
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %6, align 4, !tbaa !12
  %82 = load i32, ptr %7, align 4, !tbaa !12
  %83 = icmp eq i32 %81, %82
  br i1 %83, label %117, label %84

84:                                               ; preds = %80
  br label %85

85:                                               ; preds = %84
  br label %86

86:                                               ; preds = %85
  %87 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %88 = getelementptr inbounds %struct.s2n_debug_info, ptr %87, i32 0, i32 0
  store ptr @.str.13, ptr %88, align 8, !tbaa !9
  %89 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %90 = getelementptr inbounds %struct.s2n_debug_info, ptr %89, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8, !tbaa !9
  %92 = getelementptr inbounds i8, ptr %91, i64 21
  %93 = call ptr @strrchr(ptr noundef %92, i32 noundef 47) #8
  %94 = icmp ne ptr %93, null
  br i1 %94, label %95, label %102

95:                                               ; preds = %86
  %96 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %97 = getelementptr inbounds %struct.s2n_debug_info, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  %99 = getelementptr inbounds i8, ptr %98, i64 21
  %100 = call ptr @strrchr(ptr noundef %99, i32 noundef 47) #8
  %101 = getelementptr inbounds i8, ptr %100, i64 1
  br label %107

102:                                              ; preds = %86
  %103 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %104 = getelementptr inbounds %struct.s2n_debug_info, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !9
  %106 = getelementptr inbounds i8, ptr %105, i64 21
  br label %107

107:                                              ; preds = %102, %95
  %108 = phi ptr [ %101, %95 ], [ %106, %102 ]
  %109 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %110 = getelementptr inbounds %struct.s2n_debug_info, ptr %109, i32 0, i32 1
  store ptr %108, ptr %110, align 8, !tbaa !11
  %111 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762068, ptr %111, align 4, !tbaa !12
  %112 = call i32 @s2n_calculate_stacktrace()
  br label %113

113:                                              ; preds = %107
  br label %114

114:                                              ; preds = %113
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %271

115:                                              ; No predecessors!
  br label %116

116:                                              ; preds = %115
  br label %117

117:                                              ; preds = %116, %80
  br label %118

118:                                              ; preds = %117
  br label %119

119:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 10, ptr %11) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %11, ptr align 1 @__const.s2n_pkey_match.input, i64 10, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #9
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 56, ptr %13) #9
  call void @llvm.memset.p0.i64(ptr align 8 %13, i8 0, i64 56, i1 false)
  br label %120

120:                                              ; preds = %119
  %121 = call i32 @s2n_hash_new(ptr noundef %13)
  %122 = icmp sgt i32 %121, -1
  br i1 %122, label %124, label %123

123:                                              ; preds = %120
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %268

124:                                              ; preds = %120
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125
  br label %127

127:                                              ; preds = %126
  %128 = call i32 @s2n_hash_init(ptr noundef %13, i32 noundef 4)
  %129 = icmp sgt i32 %128, -1
  br i1 %129, label %131, label %130

130:                                              ; preds = %127
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %268

131:                                              ; preds = %127
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132
  br label %134

134:                                              ; preds = %133
  %135 = getelementptr inbounds [10 x i8], ptr %11, i64 0, i64 0
  %136 = call i32 @s2n_hash_update(ptr noundef %13, ptr noundef %135, i32 noundef 10)
  %137 = icmp sgt i32 %136, -1
  br i1 %137, label %139, label %138

138:                                              ; preds = %134
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %268

139:                                              ; preds = %134
  br label %140

140:                                              ; preds = %139
  br label %141

141:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 56, ptr %14) #9
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 56, i1 false)
  br label %142

142:                                              ; preds = %141
  %143 = call i32 @s2n_hash_new(ptr noundef %14)
  %144 = icmp sgt i32 %143, -1
  br i1 %144, label %146, label %145

145:                                              ; preds = %142
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %266

146:                                              ; preds = %142
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148
  %150 = call i32 @s2n_hash_copy(ptr noundef %14, ptr noundef %13)
  %151 = icmp sgt i32 %150, -1
  br i1 %151, label %153, label %152

152:                                              ; preds = %149
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %266

153:                                              ; preds = %149
  br label %154

154:                                              ; preds = %153
  br label %155

155:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  store i32 0, ptr %15, align 4, !tbaa !12
  br label %156

156:                                              ; preds = %155
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = call i32 @s2n_pkey_size(ptr noundef %157, ptr noundef %15)
  %159 = getelementptr inbounds %struct.s2n_result, ptr %16, i32 0, i32 0
  store i32 %158, ptr %159, align 4
  %160 = getelementptr inbounds %struct.s2n_result, ptr %16, i32 0, i32 0
  %161 = load i32, ptr %160, align 4
  %162 = call zeroext i1 @s2n_result_is_ok(i32 %161)
  br i1 %162, label %164, label %163

163:                                              ; preds = %156
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %265

164:                                              ; preds = %156
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  br label %167

167:                                              ; preds = %166
  %168 = load i32, ptr %15, align 4, !tbaa !12
  %169 = call i32 @s2n_alloc(ptr noundef %12, i32 noundef %168)
  %170 = icmp sgt i32 %169, -1
  br i1 %170, label %172, label %171

171:                                              ; preds = %167
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %265

172:                                              ; preds = %167
  br label %173

173:                                              ; preds = %172
  br label %174

174:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  store i32 0, ptr %17, align 4, !tbaa !12
  %175 = load i32, ptr %6, align 4, !tbaa !12
  switch i32 %175, label %180 [
    i32 1, label %176
    i32 0, label %177
    i32 2, label %178
    i32 3, label %179
  ]

176:                                              ; preds = %174
  store i32 3, ptr %17, align 4, !tbaa !12
  br label %213

177:                                              ; preds = %174
  store i32 1, ptr %17, align 4, !tbaa !12
  br label %213

178:                                              ; preds = %174
  store i32 225, ptr %17, align 4, !tbaa !12
  br label %213

179:                                              ; preds = %174
  store i32 226, ptr %17, align 4, !tbaa !12
  br label %213

180:                                              ; preds = %174
  br label %181

181:                                              ; preds = %180
  br label %182

182:                                              ; preds = %181
  %183 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %184 = getelementptr inbounds %struct.s2n_debug_info, ptr %183, i32 0, i32 0
  store ptr @.str.14, ptr %184, align 8, !tbaa !9
  %185 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %186 = getelementptr inbounds %struct.s2n_debug_info, ptr %185, i32 0, i32 0
  %187 = load ptr, ptr %186, align 8, !tbaa !9
  %188 = getelementptr inbounds i8, ptr %187, i64 21
  %189 = call ptr @strrchr(ptr noundef %188, i32 noundef 47) #8
  %190 = icmp ne ptr %189, null
  br i1 %190, label %191, label %198

191:                                              ; preds = %182
  %192 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %193 = getelementptr inbounds %struct.s2n_debug_info, ptr %192, i32 0, i32 0
  %194 = load ptr, ptr %193, align 8, !tbaa !9
  %195 = getelementptr inbounds i8, ptr %194, i64 21
  %196 = call ptr @strrchr(ptr noundef %195, i32 noundef 47) #8
  %197 = getelementptr inbounds i8, ptr %196, i64 1
  br label %203

198:                                              ; preds = %182
  %199 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %200 = getelementptr inbounds %struct.s2n_debug_info, ptr %199, i32 0, i32 0
  %201 = load ptr, ptr %200, align 8, !tbaa !9
  %202 = getelementptr inbounds i8, ptr %201, i64 21
  br label %203

203:                                              ; preds = %198, %191
  %204 = phi ptr [ %197, %191 ], [ %202, %198 ]
  %205 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %206 = getelementptr inbounds %struct.s2n_debug_info, ptr %205, i32 0, i32 1
  store ptr %204, ptr %206, align 8, !tbaa !11
  %207 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544370, ptr %207, align 4, !tbaa !12
  %208 = call i32 @s2n_calculate_stacktrace()
  br label %209

209:                                              ; preds = %203
  br label %210

210:                                              ; preds = %209
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %264

211:                                              ; No predecessors!
  br label %212

212:                                              ; preds = %211
  br label %213

213:                                              ; preds = %212, %179, %178, %177, %176
  br label %214

214:                                              ; preds = %213
  %215 = load ptr, ptr %5, align 8, !tbaa !5
  %216 = load i32, ptr %17, align 4, !tbaa !12
  %217 = call i32 @s2n_pkey_sign(ptr noundef %215, i32 noundef %216, ptr noundef %13, ptr noundef %12)
  %218 = icmp sgt i32 %217, -1
  br i1 %218, label %220, label %219

219:                                              ; preds = %214
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %264

220:                                              ; preds = %214
  br label %221

221:                                              ; preds = %220
  br label %222

222:                                              ; preds = %221
  br label %223

223:                                              ; preds = %222
  %224 = load ptr, ptr %4, align 8, !tbaa !5
  %225 = load i32, ptr %17, align 4, !tbaa !12
  %226 = call i32 @s2n_pkey_verify(ptr noundef %224, i32 noundef %225, ptr noundef %14, ptr noundef %12)
  %227 = icmp eq i32 %226, 0
  br i1 %227, label %261, label %228

228:                                              ; preds = %223
  br label %229

229:                                              ; preds = %228
  br label %230

230:                                              ; preds = %229
  %231 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %232 = getelementptr inbounds %struct.s2n_debug_info, ptr %231, i32 0, i32 0
  store ptr @.str.15, ptr %232, align 8, !tbaa !9
  %233 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %234 = getelementptr inbounds %struct.s2n_debug_info, ptr %233, i32 0, i32 0
  %235 = load ptr, ptr %234, align 8, !tbaa !9
  %236 = getelementptr inbounds i8, ptr %235, i64 21
  %237 = call ptr @strrchr(ptr noundef %236, i32 noundef 47) #8
  %238 = icmp ne ptr %237, null
  br i1 %238, label %239, label %246

239:                                              ; preds = %230
  %240 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %241 = getelementptr inbounds %struct.s2n_debug_info, ptr %240, i32 0, i32 0
  %242 = load ptr, ptr %241, align 8, !tbaa !9
  %243 = getelementptr inbounds i8, ptr %242, i64 21
  %244 = call ptr @strrchr(ptr noundef %243, i32 noundef 47) #8
  %245 = getelementptr inbounds i8, ptr %244, i64 1
  br label %251

246:                                              ; preds = %230
  %247 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %248 = getelementptr inbounds %struct.s2n_debug_info, ptr %247, i32 0, i32 0
  %249 = load ptr, ptr %248, align 8, !tbaa !9
  %250 = getelementptr inbounds i8, ptr %249, i64 21
  br label %251

251:                                              ; preds = %246, %239
  %252 = phi ptr [ %245, %239 ], [ %250, %246 ]
  %253 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %254 = getelementptr inbounds %struct.s2n_debug_info, ptr %253, i32 0, i32 1
  store ptr %252, ptr %254, align 8, !tbaa !11
  %255 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762068, ptr %255, align 4, !tbaa !12
  %256 = call i32 @s2n_calculate_stacktrace()
  br label %257

257:                                              ; preds = %251
  br label %258

258:                                              ; preds = %257
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %264

259:                                              ; No predecessors!
  br label %260

260:                                              ; preds = %259
  br label %261

261:                                              ; preds = %260, %223
  br label %262

262:                                              ; preds = %261
  br label %263

263:                                              ; preds = %262
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %264

264:                                              ; preds = %263, %258, %219, %210
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  br label %265

265:                                              ; preds = %264, %171, %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %266

266:                                              ; preds = %265, %152, %145
  %267 = call i32 @s2n_hash_free(ptr noundef %14)
  call void @llvm.lifetime.end.p0(i64 56, ptr %14) #9
  br label %268

268:                                              ; preds = %266, %138, %130, %123
  %269 = call i32 @s2n_hash_free(ptr noundef %13)
  call void @llvm.lifetime.end.p0(i64 56, ptr %13) #9
  %270 = call i32 @s2n_free(ptr noundef %12)
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 10, ptr %11) #9
  br label %271

271:                                              ; preds = %268, %114, %76, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %272

272:                                              ; preds = %271, %50
  %273 = load i32, ptr %3, align 4
  ret i32 %273
}

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_pkey_get_type(ptr noundef, ptr noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

declare i32 @s2n_free(ptr noundef) #2

declare i32 @s2n_hash_free(ptr noundef) #2

declare i32 @s2n_hash_new(ptr noundef) #2

declare i32 @s2n_hash_init(ptr noundef, i32 noundef) #2

declare i32 @s2n_hash_update(ptr noundef, ptr noundef, i32 noundef) #2

declare i32 @s2n_hash_copy(ptr noundef, ptr noundef) #2

declare i32 @s2n_alloc(ptr noundef, i32 noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nounwind willreturn memory(read) "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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint 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 #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"s2n_pkey", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}


; 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"

%struct.s2n_debug_info = type { ptr, ptr }
%struct.s2n_blob = type { ptr, i32, i32, i8 }
%struct.s2n_hash_state = type { ptr, i32, i8, i64, %union.anon }
%union.anon = type { %struct.s2n_hash_evp_digest }
%struct.s2n_hash_evp_digest = type { %struct.s2n_evp_digest, %struct.s2n_evp_digest }
%struct.s2n_evp_digest = type { ptr, ptr }

@_s2n_debug_info = external thread_local local_unnamed_addr global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local local_unnamed_addr global i32, align 4
@.str.12 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [88 x i8], align 1
@__const.s2n_pkey_match.input = external hidden unnamed_addr constant [10 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [88 x i8], align 1
@switch.table.s2n_pkey_match = private unnamed_addr constant [4 x i32] [i32 1, i32 3, i32 225, i32 226], align 4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #1

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_pkey_size(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_pkey_sign(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_pkey_verify(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_pkey_match(ptr noundef %0, ptr noundef %1) local_unnamed_addr #3 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [10 x i8], align 1
  %6 = alloca %struct.s2n_blob, align 8
  %7 = alloca %struct.s2n_hash_state, align 8
  %8 = alloca %struct.s2n_hash_state, align 8
  %9 = alloca i32, align 4
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %10, label %18

10:                                               ; preds = %2
  %11 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.12, ptr %11, align 8, !tbaa !5
  %12 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.12, i64 21), i32 noundef 47) #8
  %.not16 = icmp eq ptr %12, null
  %13 = getelementptr inbounds i8, ptr %12, i64 1
  %14 = select i1 %.not16, ptr getelementptr inbounds (i8, ptr @.str.12, i64 21), ptr %13
  %15 = getelementptr inbounds i8, ptr %11, i64 8
  store ptr %14, ptr %15, align 8, !tbaa !10
  %16 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %16, align 4, !tbaa !11
  %17 = tail call i32 @s2n_calculate_stacktrace() #9
  br label %83

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  store i32 0, ptr %3, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  store i32 0, ptr %4, align 4, !tbaa !11
  %19 = load ptr, ptr %1, align 8, !tbaa !13
  %20 = call i32 @s2n_pkey_get_type(ptr noundef %19, ptr noundef nonnull %3)
  %21 = call zeroext i1 @s2n_result_is_ok(i32 %20)
  br i1 %21, label %22, label %82

22:                                               ; preds = %18
  %23 = load ptr, ptr %0, align 8, !tbaa !13
  %24 = call i32 @s2n_pkey_get_type(ptr noundef %23, ptr noundef nonnull %4)
  %25 = call zeroext i1 @s2n_result_is_ok(i32 %24)
  br i1 %25, label %26, label %82

26:                                               ; preds = %22
  %27 = load i32, ptr %3, align 4, !tbaa !11
  %28 = load i32, ptr %4, align 4, !tbaa !11
  %29 = icmp eq i32 %27, %28
  br i1 %29, label %38, label %30

30:                                               ; preds = %26
  %31 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.13, ptr %31, align 8, !tbaa !5
  %32 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.13, i64 21), i32 noundef 47) #8
  %.not17 = icmp eq ptr %32, null
  %33 = getelementptr inbounds i8, ptr %32, i64 1
  %34 = select i1 %.not17, ptr getelementptr inbounds (i8, ptr @.str.13, i64 21), ptr %33
  %35 = getelementptr inbounds i8, ptr %31, i64 8
  store ptr %34, ptr %35, align 8, !tbaa !10
  %36 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762068, ptr %36, align 4, !tbaa !11
  %37 = call i32 @s2n_calculate_stacktrace() #9
  br label %82

38:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %5) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %5, ptr noundef nonnull align 1 dereferenceable(10) @__const.s2n_pkey_match.input, i64 10, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %6, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %7) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(56) %7, i8 0, i64 56, i1 false)
  %39 = call i32 @s2n_hash_new(ptr noundef nonnull %7) #9
  %40 = icmp sgt i32 %39, -1
  br i1 %40, label %41, label %79

41:                                               ; preds = %38
  %42 = call i32 @s2n_hash_init(ptr noundef nonnull %7, i32 noundef 4) #9
  %43 = icmp sgt i32 %42, -1
  br i1 %43, label %44, label %79

44:                                               ; preds = %41
  %45 = call i32 @s2n_hash_update(ptr noundef nonnull %7, ptr noundef nonnull %5, i32 noundef 10) #9
  %46 = icmp sgt i32 %45, -1
  br i1 %46, label %47, label %79

47:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %8) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(56) %8, i8 0, i64 56, i1 false)
  %48 = call i32 @s2n_hash_new(ptr noundef nonnull %8) #9
  %49 = icmp sgt i32 %48, -1
  br i1 %49, label %50, label %77

50:                                               ; preds = %47
  %51 = call i32 @s2n_hash_copy(ptr noundef nonnull %8, ptr noundef nonnull %7) #9
  %52 = icmp sgt i32 %51, -1
  br i1 %52, label %53, label %77

53:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  store i32 0, ptr %9, align 4, !tbaa !11
  %54 = call i32 @s2n_pkey_size(ptr noundef nonnull %1, ptr noundef nonnull %9)
  %55 = call zeroext i1 @s2n_result_is_ok(i32 %54)
  br i1 %55, label %56, label %76

56:                                               ; preds = %53
  %57 = load i32, ptr %9, align 4, !tbaa !11
  %58 = call i32 @s2n_alloc(ptr noundef nonnull %6, i32 noundef %57) #9
  %59 = icmp sgt i32 %58, -1
  br i1 %59, label %60, label %76

60:                                               ; preds = %56
  %61 = load i32, ptr %3, align 4, !tbaa !11
  %62 = icmp ult i32 %61, 4
  br i1 %62, label %switch.lookup, label %.sink.split

switch.lookup:                                    ; preds = %60
  %63 = zext nneg i32 %61 to i64
  %switch.gep = getelementptr inbounds [4 x i32], ptr @switch.table.s2n_pkey_match, i64 0, i64 %63
  %switch.load = load i32, ptr %switch.gep, align 4
  %64 = call i32 @s2n_pkey_sign(ptr noundef nonnull %1, i32 noundef %switch.load, ptr noundef nonnull %7, ptr noundef nonnull %6)
  %65 = icmp sgt i32 %64, -1
  br i1 %65, label %66, label %76

66:                                               ; preds = %switch.lookup
  %67 = call i32 @s2n_pkey_verify(ptr noundef nonnull %0, i32 noundef %switch.load, ptr noundef nonnull %8, ptr noundef nonnull %6)
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %76, label %.sink.split

.sink.split:                                      ; preds = %60, %66
  %.str.14.sink = phi ptr [ @.str.14, %60 ], [ @.str.15, %66 ]
  %.sink28 = phi ptr [ getelementptr inbounds (i8, ptr @.str.14, i64 21), %60 ], [ getelementptr inbounds (i8, ptr @.str.15, i64 21), %66 ]
  %.sink = phi i32 [ 335544370, %60 ], [ 469762068, %66 ]
  %69 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.14.sink, ptr %69, align 8, !tbaa !5
  %70 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink28, i32 noundef 47) #8
  %.not19 = icmp eq ptr %70, null
  %71 = getelementptr inbounds i8, ptr %70, i64 1
  %72 = select i1 %.not19, ptr %.sink28, ptr %71
  %73 = getelementptr inbounds i8, ptr %69, i64 8
  store ptr %72, ptr %73, align 8, !tbaa !10
  %74 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 %.sink, ptr %74, align 4, !tbaa !11
  %75 = call i32 @s2n_calculate_stacktrace() #9
  br label %76

76:                                               ; preds = %.sink.split, %switch.lookup, %66, %56, %53
  %.1 = phi i32 [ -1, %53 ], [ -1, %56 ], [ -1, %switch.lookup ], [ 0, %66 ], [ -1, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  br label %77

77:                                               ; preds = %50, %47, %76
  %.2 = phi i32 [ %.1, %76 ], [ -1, %47 ], [ -1, %50 ]
  %78 = call i32 @s2n_hash_free(ptr noundef nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #9
  br label %79

79:                                               ; preds = %44, %41, %38, %77
  %.3 = phi i32 [ %.2, %77 ], [ -1, %38 ], [ -1, %41 ], [ -1, %44 ]
  %80 = call i32 @s2n_hash_free(ptr noundef nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7) #9
  %81 = call i32 @s2n_free(ptr noundef nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %5) #9
  br label %82

82:                                               ; preds = %22, %18, %79, %30
  %.4 = phi i32 [ %.3, %79 ], [ -1, %30 ], [ -1, %18 ], [ -1, %22 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  br label %83

83:                                               ; preds = %82, %10
  %.5 = phi i32 [ %.4, %82 ], [ -1, %10 ]
  ret i32 %.5
}

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_pkey_get_type(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

declare i32 @s2n_free(ptr noundef) local_unnamed_addr #2

declare i32 @s2n_hash_free(ptr noundef) local_unnamed_addr #2

declare i32 @s2n_hash_new(ptr noundef) local_unnamed_addr #2

declare i32 @s2n_hash_init(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @s2n_hash_update(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @s2n_hash_copy(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @s2n_alloc(ptr noundef, i32 noundef) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint 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 #5 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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, !7, i64 0}
!6 = !{!"s2n_debug_info", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!14, !7, i64 0}
!14 = !{!"s2n_pkey", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}


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