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

; 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_hmac_state = type { i32, i16, i32, i16, i8, %struct.s2n_hash_state, %struct.s2n_hash_state, %struct.s2n_hash_state, %struct.s2n_hash_state, [128 x i8], [64 x 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 global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.10 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.13 = 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_hmac_hash_alg(i32 noundef, ptr noundef) #3

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_hmac_init(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) #3 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  br label %12

12:                                               ; preds = %4
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %46, label %15

15:                                               ; preds = %12
  br label %16

16:                                               ; preds = %15
  br label %17

17:                                               ; preds = %16
  %18 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %19 = getelementptr inbounds %struct.s2n_debug_info, ptr %18, i32 0, i32 0
  store ptr @.str.10, ptr %19, align 8, !tbaa !11
  %20 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %21 = getelementptr inbounds %struct.s2n_debug_info, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = getelementptr inbounds i8, ptr %22, i64 21
  %24 = call ptr @strrchr(ptr noundef %23, i32 noundef 47) #6
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %33

26:                                               ; preds = %17
  %27 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %28 = getelementptr inbounds %struct.s2n_debug_info, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  %30 = getelementptr inbounds i8, ptr %29, i64 21
  %31 = call ptr @strrchr(ptr noundef %30, i32 noundef 47) #6
  %32 = getelementptr inbounds i8, ptr %31, i64 1
  br label %38

33:                                               ; preds = %17
  %34 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %35 = getelementptr inbounds %struct.s2n_debug_info, ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = getelementptr inbounds i8, ptr %36, i64 21
  br label %38

38:                                               ; preds = %33, %26
  %39 = phi ptr [ %32, %26 ], [ %37, %33 ]
  %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 1
  store ptr %39, ptr %41, align 8, !tbaa !13
  %42 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %42, align 4, !tbaa !9
  %43 = call i32 @s2n_calculate_stacktrace()
  br label %44

44:                                               ; preds = %38
  store i32 -1, ptr %5, align 4
  br label %286

45:                                               ; No predecessors!
  br label %46

46:                                               ; preds = %45, %12
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.s2n_hmac_state, ptr %49, i32 0, i32 0
  store i32 %48, ptr %50, align 8, !tbaa !14
  br label %51

51:                                               ; preds = %47
  %52 = load i32, ptr %7, align 4, !tbaa !9
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.s2n_hmac_state, ptr %53, i32 0, i32 1
  %55 = call i32 @s2n_hmac_hash_block_size(i32 noundef %52, ptr noundef %54)
  %56 = icmp sgt i32 %55, -1
  br i1 %56, label %58, label %57

57:                                               ; preds = %51
  store i32 -1, ptr %5, align 4
  br label %286

58:                                               ; preds = %51
  br label %59

59:                                               ; preds = %58
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.s2n_hmac_state, ptr %60, i32 0, i32 2
  store i32 0, ptr %61, align 8, !tbaa !19
  br label %62

62:                                               ; preds = %59
  %63 = load i32, ptr %7, align 4, !tbaa !9
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.s2n_hmac_state, ptr %64, i32 0, i32 3
  %66 = call i32 @s2n_hmac_xor_pad_size(i32 noundef %63, ptr noundef %65)
  %67 = icmp sgt i32 %66, -1
  br i1 %67, label %69, label %68

68:                                               ; preds = %62
  store i32 -1, ptr %5, align 4
  br label %286

69:                                               ; preds = %62
  br label %70

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %7, align 4, !tbaa !9
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.s2n_hmac_state, ptr %73, i32 0, i32 4
  %75 = call i32 @s2n_hmac_digest_size(i32 noundef %72, ptr noundef %74)
  %76 = icmp sgt i32 %75, -1
  br i1 %76, label %78, label %77

77:                                               ; preds = %71
  store i32 -1, ptr %5, align 4
  br label %286

78:                                               ; preds = %71
  br label %79

79:                                               ; preds = %78
  br label %80

80:                                               ; preds = %79
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.s2n_hmac_state, ptr %81, i32 0, i32 3
  %83 = load i16, ptr %82, align 4, !tbaa !20
  %84 = zext i16 %83 to i64
  %85 = icmp uge i64 128, %84
  br i1 %85, label %117, label %86

86:                                               ; preds = %80
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  %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
  store ptr @.str.11, ptr %90, align 8, !tbaa !11
  %91 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %92 = getelementptr inbounds %struct.s2n_debug_info, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !11
  %94 = getelementptr inbounds i8, ptr %93, i64 21
  %95 = call ptr @strrchr(ptr noundef %94, i32 noundef 47) #6
  %96 = icmp ne ptr %95, null
  br i1 %96, label %97, label %104

97:                                               ; preds = %88
  %98 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %99 = getelementptr inbounds %struct.s2n_debug_info, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !11
  %101 = getelementptr inbounds i8, ptr %100, i64 21
  %102 = call ptr @strrchr(ptr noundef %101, i32 noundef 47) #6
  %103 = getelementptr inbounds i8, ptr %102, i64 1
  br label %109

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

109:                                              ; preds = %104, %97
  %110 = phi ptr [ %103, %97 ], [ %108, %104 ]
  %111 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %112 = getelementptr inbounds %struct.s2n_debug_info, ptr %111, i32 0, i32 1
  store ptr %110, ptr %112, align 8, !tbaa !13
  %113 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %113, align 4, !tbaa !9
  %114 = call i32 @s2n_calculate_stacktrace()
  br label %115

115:                                              ; preds = %109
  store i32 -1, ptr %5, align 4
  br label %286

116:                                              ; No predecessors!
  br label %117

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

118:                                              ; preds = %117
  br label %119

119:                                              ; preds = %118
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.s2n_hmac_state, ptr %120, i32 0, i32 4
  %122 = load i8, ptr %121, align 2, !tbaa !21
  %123 = zext i8 %122 to i64
  %124 = icmp uge i64 64, %123
  br i1 %124, label %156, label %125

125:                                              ; preds = %119
  br label %126

126:                                              ; preds = %125
  br label %127

127:                                              ; preds = %126
  %128 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %129 = getelementptr inbounds %struct.s2n_debug_info, ptr %128, i32 0, i32 0
  store ptr @.str.12, ptr %129, align 8, !tbaa !11
  %130 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %131 = getelementptr inbounds %struct.s2n_debug_info, ptr %130, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8, !tbaa !11
  %133 = getelementptr inbounds i8, ptr %132, i64 21
  %134 = call ptr @strrchr(ptr noundef %133, i32 noundef 47) #6
  %135 = icmp ne ptr %134, null
  br i1 %135, label %136, label %143

136:                                              ; preds = %127
  %137 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %138 = getelementptr inbounds %struct.s2n_debug_info, ptr %137, i32 0, i32 0
  %139 = load ptr, ptr %138, align 8, !tbaa !11
  %140 = getelementptr inbounds i8, ptr %139, i64 21
  %141 = call ptr @strrchr(ptr noundef %140, i32 noundef 47) #6
  %142 = getelementptr inbounds i8, ptr %141, i64 1
  br label %148

143:                                              ; preds = %127
  %144 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %145 = getelementptr inbounds %struct.s2n_debug_info, ptr %144, i32 0, i32 0
  %146 = load ptr, ptr %145, align 8, !tbaa !11
  %147 = getelementptr inbounds i8, ptr %146, i64 21
  br label %148

148:                                              ; preds = %143, %136
  %149 = phi ptr [ %142, %136 ], [ %147, %143 ]
  %150 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %151 = getelementptr inbounds %struct.s2n_debug_info, ptr %150, i32 0, i32 1
  store ptr %149, ptr %151, align 8, !tbaa !13
  %152 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %152, align 4, !tbaa !9
  %153 = call i32 @s2n_calculate_stacktrace()
  br label %154

154:                                              ; preds = %148
  store i32 -1, ptr %5, align 4
  br label %286

155:                                              ; No predecessors!
  br label %156

156:                                              ; preds = %155, %119
  br label %157

157:                                              ; preds = %156
  br label %158

158:                                              ; preds = %157
  %159 = load ptr, ptr %6, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.s2n_hmac_state, ptr %159, i32 0, i32 1
  %161 = load i16, ptr %160, align 4, !tbaa !22
  %162 = zext i16 %161 to i64
  %163 = icmp uge i64 128, %162
  br i1 %163, label %195, label %164

164:                                              ; preds = %158
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  %167 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %168 = getelementptr inbounds %struct.s2n_debug_info, ptr %167, i32 0, i32 0
  store ptr @.str.13, ptr %168, align 8, !tbaa !11
  %169 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %170 = getelementptr inbounds %struct.s2n_debug_info, ptr %169, i32 0, i32 0
  %171 = load ptr, ptr %170, align 8, !tbaa !11
  %172 = getelementptr inbounds i8, ptr %171, i64 21
  %173 = call ptr @strrchr(ptr noundef %172, i32 noundef 47) #6
  %174 = icmp ne ptr %173, null
  br i1 %174, label %175, label %182

175:                                              ; preds = %166
  %176 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %177 = getelementptr inbounds %struct.s2n_debug_info, ptr %176, i32 0, i32 0
  %178 = load ptr, ptr %177, align 8, !tbaa !11
  %179 = getelementptr inbounds i8, ptr %178, i64 21
  %180 = call ptr @strrchr(ptr noundef %179, i32 noundef 47) #6
  %181 = getelementptr inbounds i8, ptr %180, i64 1
  br label %187

182:                                              ; preds = %166
  %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
  %185 = load ptr, ptr %184, align 8, !tbaa !11
  %186 = getelementptr inbounds i8, ptr %185, i64 21
  br label %187

187:                                              ; preds = %182, %175
  %188 = phi ptr [ %181, %175 ], [ %186, %182 ]
  %189 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %190 = getelementptr inbounds %struct.s2n_debug_info, ptr %189, i32 0, i32 1
  store ptr %188, ptr %190, align 8, !tbaa !13
  %191 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %191, align 4, !tbaa !9
  %192 = call i32 @s2n_calculate_stacktrace()
  br label %193

193:                                              ; preds = %187
  store i32 -1, ptr %5, align 4
  br label %286

194:                                              ; No predecessors!
  br label %195

195:                                              ; preds = %194, %158
  br label %196

196:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  br label %197

197:                                              ; preds = %196
  %198 = load i32, ptr %7, align 4, !tbaa !9
  %199 = call i32 @s2n_hmac_hash_alg(i32 noundef %198, ptr noundef %10)
  %200 = icmp sgt i32 %199, -1
  br i1 %200, label %202, label %201

201:                                              ; preds = %197
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

202:                                              ; preds = %197
  br label %203

203:                                              ; preds = %202
  br label %204

204:                                              ; preds = %203
  br label %205

205:                                              ; preds = %204
  %206 = load ptr, ptr %6, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.s2n_hmac_state, ptr %206, i32 0, i32 5
  %208 = load i32, ptr %10, align 4, !tbaa !9
  %209 = call i32 @s2n_hash_init(ptr noundef %207, i32 noundef %208)
  %210 = icmp sgt i32 %209, -1
  br i1 %210, label %212, label %211

211:                                              ; preds = %205
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

212:                                              ; preds = %205
  br label %213

213:                                              ; preds = %212
  br label %214

214:                                              ; preds = %213
  br label %215

215:                                              ; preds = %214
  %216 = load ptr, ptr %6, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.s2n_hmac_state, ptr %216, i32 0, i32 6
  %218 = load i32, ptr %10, align 4, !tbaa !9
  %219 = call i32 @s2n_hash_init(ptr noundef %217, i32 noundef %218)
  %220 = icmp sgt i32 %219, -1
  br i1 %220, label %222, label %221

221:                                              ; preds = %215
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

222:                                              ; preds = %215
  br label %223

223:                                              ; preds = %222
  br label %224

224:                                              ; preds = %223
  br label %225

225:                                              ; preds = %224
  %226 = load ptr, ptr %6, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.s2n_hmac_state, ptr %226, i32 0, i32 7
  %228 = load i32, ptr %10, align 4, !tbaa !9
  %229 = call i32 @s2n_hash_init(ptr noundef %227, i32 noundef %228)
  %230 = icmp sgt i32 %229, -1
  br i1 %230, label %232, label %231

231:                                              ; preds = %225
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

232:                                              ; preds = %225
  br label %233

233:                                              ; preds = %232
  br label %234

234:                                              ; preds = %233
  br label %235

235:                                              ; preds = %234
  %236 = load ptr, ptr %6, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.s2n_hmac_state, ptr %236, i32 0, i32 8
  %238 = load i32, ptr %10, align 4, !tbaa !9
  %239 = call i32 @s2n_hash_init(ptr noundef %237, i32 noundef %238)
  %240 = icmp sgt i32 %239, -1
  br i1 %240, label %242, label %241

241:                                              ; preds = %235
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

242:                                              ; preds = %235
  br label %243

243:                                              ; preds = %242
  br label %244

244:                                              ; preds = %243
  %245 = load i32, ptr %7, align 4, !tbaa !9
  %246 = icmp eq i32 %245, 8
  br i1 %246, label %250, label %247

247:                                              ; preds = %244
  %248 = load i32, ptr %7, align 4, !tbaa !9
  %249 = icmp eq i32 %248, 7
  br i1 %249, label %250, label %262

250:                                              ; preds = %247, %244
  br label %251

251:                                              ; preds = %250
  %252 = load ptr, ptr %6, align 8, !tbaa !5
  %253 = load i32, ptr %7, align 4, !tbaa !9
  %254 = load ptr, ptr %8, align 8, !tbaa !5
  %255 = load i32, ptr %9, align 4, !tbaa !9
  %256 = call i32 @s2n_sslv3_mac_init(ptr noundef %252, i32 noundef %253, ptr noundef %254, i32 noundef %255)
  %257 = icmp sgt i32 %256, -1
  br i1 %257, label %259, label %258

258:                                              ; preds = %251
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

259:                                              ; preds = %251
  br label %260

260:                                              ; preds = %259
  br label %261

261:                                              ; preds = %260
  br label %274

262:                                              ; preds = %247
  br label %263

263:                                              ; preds = %262
  %264 = load ptr, ptr %6, align 8, !tbaa !5
  %265 = load i32, ptr %7, align 4, !tbaa !9
  %266 = load ptr, ptr %8, align 8, !tbaa !5
  %267 = load i32, ptr %9, align 4, !tbaa !9
  %268 = call i32 @s2n_tls_hmac_init(ptr noundef %264, i32 noundef %265, ptr noundef %266, i32 noundef %267)
  %269 = icmp sgt i32 %268, -1
  br i1 %269, label %271, label %270

270:                                              ; preds = %263
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

271:                                              ; preds = %263
  br label %272

272:                                              ; preds = %271
  br label %273

273:                                              ; preds = %272
  br label %274

274:                                              ; preds = %273, %261
  %275 = load ptr, ptr %6, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.s2n_hmac_state, ptr %275, i32 0, i32 9
  call void @llvm.memset.p0.i64(ptr align 8 %276, i8 0, i64 128, i1 false)
  br label %277

277:                                              ; preds = %274
  %278 = load ptr, ptr %6, align 8, !tbaa !5
  %279 = call i32 @s2n_hmac_reset(ptr noundef %278)
  %280 = icmp sgt i32 %279, -1
  br i1 %280, label %282, label %281

281:                                              ; preds = %277
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

282:                                              ; preds = %277
  br label %283

283:                                              ; preds = %282
  br label %284

284:                                              ; preds = %283
  store i32 0, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

285:                                              ; preds = %284, %281, %270, %258, %241, %231, %221, %211, %201
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %286

286:                                              ; preds = %285, %193, %154, %115, %77, %68, %57, %44
  %287 = load i32, ptr %5, align 4
  ret i32 %287
}

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

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

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

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind willreturn memory(read) }
attributes #7 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}
!14 = !{!15, !10, i64 0}
!15 = !{!"s2n_hmac_state", !10, i64 0, !16, i64 4, !10, i64 8, !16, i64 12, !7, i64 14, !17, i64 16, !17, i64 72, !17, i64 128, !17, i64 184, !7, i64 240, !7, i64 368}
!16 = !{!"short", !7, i64 0}
!17 = !{!"s2n_hash_state", !6, i64 0, !10, i64 8, !7, i64 12, !18, i64 16, !7, i64 24}
!18 = !{!"long", !7, i64 0}
!19 = !{!15, !10, i64 8}
!20 = !{!15, !16, i64 12}
!21 = !{!15, !7, i64 14}
!22 = !{!15, !16, i64 4}


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

@_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.10 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [88 x i8], align 1

; 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_hmac_hash_alg(i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_hmac_init(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #3 {
  %5 = alloca i32, align 4
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %6, label %14

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

14:                                               ; preds = %4
  store i32 %1, ptr %0, align 8, !tbaa !13
  %15 = getelementptr inbounds i8, ptr %0, i64 4
  %16 = tail call i32 @s2n_hmac_hash_block_size(i32 noundef %1, ptr noundef nonnull %15)
  %17 = icmp sgt i32 %16, -1
  br i1 %17, label %18, label %95

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 0, ptr %19, align 8, !tbaa !18
  %20 = getelementptr inbounds i8, ptr %0, i64 12
  %21 = tail call i32 @s2n_hmac_xor_pad_size(i32 noundef %1, ptr noundef nonnull %20)
  %22 = icmp sgt i32 %21, -1
  br i1 %22, label %23, label %95

23:                                               ; preds = %18
  %24 = getelementptr inbounds i8, ptr %0, i64 14
  %25 = tail call i32 @s2n_hmac_digest_size(i32 noundef %1, ptr noundef nonnull %24)
  %26 = icmp sgt i32 %25, -1
  br i1 %26, label %27, label %95

27:                                               ; preds = %23
  %28 = load i16, ptr %20, align 4, !tbaa !19
  %29 = icmp ult i16 %28, 129
  br i1 %29, label %38, label %30

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

38:                                               ; preds = %27
  %39 = load i8, ptr %24, align 2, !tbaa !20
  %40 = icmp ult i8 %39, 65
  br i1 %40, label %49, label %41

41:                                               ; preds = %38
  %42 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.12, ptr %42, align 8, !tbaa !5
  %43 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.12, i64 21), i32 noundef 47) #6
  %.not39 = icmp eq ptr %43, null
  %44 = getelementptr inbounds i8, ptr %43, i64 1
  %45 = select i1 %.not39, ptr getelementptr inbounds (i8, ptr @.str.12, i64 21), ptr %44
  %46 = getelementptr inbounds i8, ptr %42, i64 8
  store ptr %45, ptr %46, align 8, !tbaa !10
  %47 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %47, align 4, !tbaa !11
  %48 = tail call i32 @s2n_calculate_stacktrace() #7
  br label %95

49:                                               ; preds = %38
  %50 = load i16, ptr %15, align 4, !tbaa !21
  %51 = icmp ult i16 %50, 129
  br i1 %51, label %60, label %52

52:                                               ; preds = %49
  %53 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.13, ptr %53, align 8, !tbaa !5
  %54 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.13, i64 21), i32 noundef 47) #6
  %.not40 = icmp eq ptr %54, null
  %55 = getelementptr inbounds i8, ptr %54, i64 1
  %56 = select i1 %.not40, ptr getelementptr inbounds (i8, ptr @.str.13, i64 21), ptr %55
  %57 = getelementptr inbounds i8, ptr %53, i64 8
  store ptr %56, ptr %57, align 8, !tbaa !10
  %58 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %58, align 4, !tbaa !11
  %59 = tail call i32 @s2n_calculate_stacktrace() #7
  br label %95

60:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %61 = call i32 @s2n_hmac_hash_alg(i32 noundef %1, ptr noundef nonnull %5)
  %62 = icmp sgt i32 %61, -1
  br i1 %62, label %63, label %94

63:                                               ; preds = %60
  %64 = getelementptr inbounds i8, ptr %0, i64 16
  %65 = load i32, ptr %5, align 4, !tbaa !11
  %66 = call i32 @s2n_hash_init(ptr noundef nonnull %64, i32 noundef %65) #7
  %67 = icmp sgt i32 %66, -1
  br i1 %67, label %68, label %94

68:                                               ; preds = %63
  %69 = getelementptr inbounds i8, ptr %0, i64 72
  %70 = load i32, ptr %5, align 4, !tbaa !11
  %71 = call i32 @s2n_hash_init(ptr noundef nonnull %69, i32 noundef %70) #7
  %72 = icmp sgt i32 %71, -1
  br i1 %72, label %73, label %94

73:                                               ; preds = %68
  %74 = getelementptr inbounds i8, ptr %0, i64 128
  %75 = load i32, ptr %5, align 4, !tbaa !11
  %76 = call i32 @s2n_hash_init(ptr noundef nonnull %74, i32 noundef %75) #7
  %77 = icmp sgt i32 %76, -1
  br i1 %77, label %78, label %94

78:                                               ; preds = %73
  %79 = getelementptr inbounds i8, ptr %0, i64 184
  %80 = load i32, ptr %5, align 4, !tbaa !11
  %81 = call i32 @s2n_hash_init(ptr noundef nonnull %79, i32 noundef %80) #7
  %82 = icmp sgt i32 %81, -1
  br i1 %82, label %83, label %94

83:                                               ; preds = %78
  %84 = add i32 %1, -7
  %or.cond = icmp ult i32 %84, 2
  br i1 %or.cond, label %85, label %88

85:                                               ; preds = %83
  %86 = call i32 @s2n_sslv3_mac_init(ptr noundef nonnull %0, i32 noundef %1, ptr noundef %2, i32 noundef %3)
  %87 = icmp sgt i32 %86, -1
  br i1 %87, label %91, label %94

88:                                               ; preds = %83
  %89 = call i32 @s2n_tls_hmac_init(ptr noundef nonnull %0, i32 noundef %1, ptr noundef %2, i32 noundef %3)
  %90 = icmp sgt i32 %89, -1
  br i1 %90, label %91, label %94

91:                                               ; preds = %88, %85
  %92 = getelementptr inbounds i8, ptr %0, i64 240
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(128) %92, i8 0, i64 128, i1 false)
  %93 = call i32 @s2n_hmac_reset(ptr noundef nonnull %0)
  %.lobit = ashr i32 %93, 31
  br label %94

94:                                               ; preds = %91, %88, %85, %78, %73, %68, %63, %60
  %.0 = phi i32 [ -1, %60 ], [ -1, %63 ], [ -1, %68 ], [ -1, %73 ], [ -1, %78 ], [ -1, %85 ], [ -1, %88 ], [ %.lobit, %91 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %95

95:                                               ; preds = %23, %18, %14, %94, %52, %41, %30, %6
  %.1 = phi i32 [ %.0, %94 ], [ -1, %52 ], [ -1, %41 ], [ -1, %30 ], [ -1, %6 ], [ -1, %14 ], [ -1, %18 ], [ -1, %23 ]
  ret i32 %.1
}

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

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

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

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind willreturn memory(read) }
attributes #7 = { 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, !12, i64 0}
!14 = !{!"s2n_hmac_state", !12, i64 0, !15, i64 4, !12, i64 8, !15, i64 12, !8, i64 14, !16, i64 16, !16, i64 72, !16, i64 128, !16, i64 184, !8, i64 240, !8, i64 368}
!15 = !{!"short", !8, i64 0}
!16 = !{!"s2n_hash_state", !7, i64 0, !12, i64 8, !8, i64 12, !17, i64 16, !8, i64 24}
!17 = !{!"long", !8, i64 0}
!18 = !{!14, !12, i64 8}
!19 = !{!14, !15, i64 12}
!20 = !{!14, !8, i64 14}
!21 = !{!14, !15, i64 4}


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