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

; 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_fingerprint = type { i64, ptr, ptr, %struct.s2n_hash_state, %struct.s2n_stuffer }
%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_stuffer = type { %struct.s2n_blob, i32, i32, i32, i8 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }
%struct.s2n_result = type { i32 }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.35 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [92 x i8], align 1

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

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

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

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

declare i32 @s2n_calculate_stacktrace() #4

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

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_fingerprint_free_fields(ptr noundef) #6

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

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

declare i32 @s2n_blob_init(ptr noundef, ptr noundef, i32 noundef) #4

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

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

23:                                               ; preds = %6
  %24 = load i32, ptr %9, align 4, !tbaa !9
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %57, label %26

26:                                               ; preds = %23
  br label %27

27:                                               ; preds = %26
  br label %28

28:                                               ; preds = %27
  %29 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %30 = getelementptr inbounds %struct.s2n_debug_info, ptr %29, i32 0, i32 0
  store ptr @.str.35, ptr %30, align 8, !tbaa !11
  %31 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %32 = getelementptr inbounds %struct.s2n_debug_info, ptr %31, i32 0, i32 0
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %34 = getelementptr inbounds i8, ptr %33, i64 21
  %35 = call ptr @strrchr(ptr noundef %34, i32 noundef 47) #7
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %44

37:                                               ; preds = %28
  %38 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %39 = getelementptr inbounds %struct.s2n_debug_info, ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = getelementptr inbounds i8, ptr %40, i64 21
  %42 = call ptr @strrchr(ptr noundef %41, i32 noundef 47) #7
  %43 = getelementptr inbounds i8, ptr %42, i64 1
  br label %49

44:                                               ; preds = %28
  %45 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %46 = getelementptr inbounds %struct.s2n_debug_info, ptr %45, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8, !tbaa !11
  %48 = getelementptr inbounds i8, ptr %47, i64 21
  br label %49

49:                                               ; preds = %44, %37
  %50 = phi ptr [ %43, %37 ], [ %48, %44 ]
  %51 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %52 = getelementptr inbounds %struct.s2n_debug_info, ptr %51, i32 0, i32 1
  store ptr %50, ptr %52, align 8, !tbaa !13
  %53 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762089, ptr %53, align 4, !tbaa !9
  %54 = call i32 @s2n_calculate_stacktrace()
  br label %55

55:                                               ; preds = %49
  store i32 -1, ptr %7, align 4
  br label %283

56:                                               ; No predecessors!
  br label %57

57:                                               ; preds = %56, %23
  br label %58

58:                                               ; preds = %57
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %10, align 4, !tbaa !9
  %61 = icmp uge i32 %60, 16
  br i1 %61, label %93, label %62

62:                                               ; preds = %59
  br label %63

63:                                               ; preds = %62
  br label %64

64:                                               ; preds = %63
  %65 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %66 = getelementptr inbounds %struct.s2n_debug_info, ptr %65, i32 0, i32 0
  store ptr @.str.36, ptr %66, align 8, !tbaa !11
  %67 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %68 = getelementptr inbounds %struct.s2n_debug_info, ptr %67, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8, !tbaa !11
  %70 = getelementptr inbounds i8, ptr %69, i64 21
  %71 = call ptr @strrchr(ptr noundef %70, i32 noundef 47) #7
  %72 = icmp ne ptr %71, null
  br i1 %72, label %73, label %80

73:                                               ; preds = %64
  %74 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %75 = getelementptr inbounds %struct.s2n_debug_info, ptr %74, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !11
  %77 = getelementptr inbounds i8, ptr %76, i64 21
  %78 = call ptr @strrchr(ptr noundef %77, i32 noundef 47) #7
  %79 = getelementptr inbounds i8, ptr %78, i64 1
  br label %85

80:                                               ; preds = %64
  %81 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %82 = getelementptr inbounds %struct.s2n_debug_info, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !11
  %84 = getelementptr inbounds i8, ptr %83, i64 21
  br label %85

85:                                               ; preds = %80, %73
  %86 = phi ptr [ %79, %73 ], [ %84, %80 ]
  %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 1
  store ptr %86, ptr %88, align 8, !tbaa !13
  %89 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762120, ptr %89, align 4, !tbaa !9
  %90 = call i32 @s2n_calculate_stacktrace()
  br label %91

91:                                               ; preds = %85
  store i32 -1, ptr %7, align 4
  br label %283

92:                                               ; No predecessors!
  br label %93

93:                                               ; preds = %92, %59
  br label %94

94:                                               ; preds = %93
  br label %95

95:                                               ; preds = %94
  %96 = load ptr, ptr %13, align 8, !tbaa !5
  %97 = icmp ne ptr %96, null
  br i1 %97, label %129, label %98

98:                                               ; preds = %95
  br label %99

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %99
  %101 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %102 = getelementptr inbounds %struct.s2n_debug_info, ptr %101, i32 0, i32 0
  store ptr @.str.37, ptr %102, align 8, !tbaa !11
  %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 !11
  %106 = getelementptr inbounds i8, ptr %105, i64 21
  %107 = call ptr @strrchr(ptr noundef %106, i32 noundef 47) #7
  %108 = icmp ne ptr %107, null
  br i1 %108, label %109, label %116

109:                                              ; preds = %100
  %110 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %111 = getelementptr inbounds %struct.s2n_debug_info, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !11
  %113 = getelementptr inbounds i8, ptr %112, i64 21
  %114 = call ptr @strrchr(ptr noundef %113, i32 noundef 47) #7
  %115 = getelementptr inbounds i8, ptr %114, i64 1
  br label %121

116:                                              ; preds = %100
  %117 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %118 = getelementptr inbounds %struct.s2n_debug_info, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !11
  %120 = getelementptr inbounds i8, ptr %119, i64 21
  br label %121

121:                                              ; preds = %116, %109
  %122 = phi ptr [ %115, %109 ], [ %120, %116 ]
  %123 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %124 = getelementptr inbounds %struct.s2n_debug_info, ptr %123, i32 0, i32 1
  store ptr %122, ptr %124, align 8, !tbaa !13
  %125 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762089, ptr %125, align 4, !tbaa !9
  %126 = call i32 @s2n_calculate_stacktrace()
  br label %127

127:                                              ; preds = %121
  store i32 -1, ptr %7, align 4
  br label %283

128:                                              ; No predecessors!
  br label %129

129:                                              ; preds = %128, %95
  br label %130

130:                                              ; preds = %129
  br label %131

131:                                              ; preds = %130
  %132 = load ptr, ptr %12, align 8, !tbaa !5
  %133 = icmp ne ptr %132, null
  br i1 %133, label %165, label %134

134:                                              ; preds = %131
  br label %135

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135
  %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
  store ptr @.str.38, ptr %138, align 8, !tbaa !11
  %139 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %140 = getelementptr inbounds %struct.s2n_debug_info, ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !11
  %142 = getelementptr inbounds i8, ptr %141, i64 21
  %143 = call ptr @strrchr(ptr noundef %142, i32 noundef 47) #7
  %144 = icmp ne ptr %143, null
  br i1 %144, label %145, label %152

145:                                              ; preds = %136
  %146 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %147 = getelementptr inbounds %struct.s2n_debug_info, ptr %146, i32 0, i32 0
  %148 = load ptr, ptr %147, align 8, !tbaa !11
  %149 = getelementptr inbounds i8, ptr %148, i64 21
  %150 = call ptr @strrchr(ptr noundef %149, i32 noundef 47) #7
  %151 = getelementptr inbounds i8, ptr %150, i64 1
  br label %157

152:                                              ; preds = %136
  %153 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %154 = getelementptr inbounds %struct.s2n_debug_info, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !11
  %156 = getelementptr inbounds i8, ptr %155, i64 21
  br label %157

157:                                              ; preds = %152, %145
  %158 = phi ptr [ %151, %145 ], [ %156, %152 ]
  %159 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %160 = getelementptr inbounds %struct.s2n_debug_info, ptr %159, i32 0, i32 1
  store ptr %158, ptr %160, align 8, !tbaa !13
  %161 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762089, ptr %161, align 4, !tbaa !9
  %162 = call i32 @s2n_calculate_stacktrace()
  br label %163

163:                                              ; preds = %157
  store i32 -1, ptr %7, align 4
  br label %283

164:                                              ; No predecessors!
  br label %165

165:                                              ; preds = %164, %131
  br label %166

166:                                              ; preds = %165
  br label %167

167:                                              ; preds = %166
  %168 = load ptr, ptr %11, align 8, !tbaa !5
  %169 = icmp ne ptr %168, null
  br i1 %169, label %201, label %170

170:                                              ; preds = %167
  br label %171

171:                                              ; preds = %170
  br label %172

172:                                              ; preds = %171
  %173 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %174 = getelementptr inbounds %struct.s2n_debug_info, ptr %173, i32 0, i32 0
  store ptr @.str.39, ptr %174, align 8, !tbaa !11
  %175 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %176 = getelementptr inbounds %struct.s2n_debug_info, ptr %175, i32 0, i32 0
  %177 = load ptr, ptr %176, align 8, !tbaa !11
  %178 = getelementptr inbounds i8, ptr %177, i64 21
  %179 = call ptr @strrchr(ptr noundef %178, i32 noundef 47) #7
  %180 = icmp ne ptr %179, null
  br i1 %180, label %181, label %188

181:                                              ; preds = %172
  %182 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %183 = getelementptr inbounds %struct.s2n_debug_info, ptr %182, i32 0, i32 0
  %184 = load ptr, ptr %183, align 8, !tbaa !11
  %185 = getelementptr inbounds i8, ptr %184, i64 21
  %186 = call ptr @strrchr(ptr noundef %185, i32 noundef 47) #7
  %187 = getelementptr inbounds i8, ptr %186, i64 1
  br label %193

188:                                              ; preds = %172
  %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 0
  %191 = load ptr, ptr %190, align 8, !tbaa !11
  %192 = getelementptr inbounds i8, ptr %191, i64 21
  br label %193

193:                                              ; preds = %188, %181
  %194 = phi ptr [ %187, %181 ], [ %192, %188 ]
  %195 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %196 = getelementptr inbounds %struct.s2n_debug_info, ptr %195, i32 0, i32 1
  store ptr %194, ptr %196, align 8, !tbaa !13
  %197 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762089, ptr %197, align 4, !tbaa !9
  %198 = call i32 @s2n_calculate_stacktrace()
  br label %199

199:                                              ; preds = %193
  store i32 -1, ptr %7, align 4
  br label %283

200:                                              ; No predecessors!
  br label %201

201:                                              ; preds = %200, %167
  br label %202

202:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 120, ptr %14) #8
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 120, i1 false)
  br label %203

203:                                              ; preds = %202
  %204 = load i32, ptr %9, align 4, !tbaa !9
  %205 = call i32 @s2n_fingerprint_init(ptr noundef %14, i32 noundef %204)
  %206 = getelementptr inbounds %struct.s2n_result, ptr %15, i32 0, i32 0
  store i32 %205, ptr %206, align 4
  %207 = getelementptr inbounds %struct.s2n_result, ptr %15, i32 0, i32 0
  %208 = load i32, ptr %207, align 4
  %209 = call zeroext i1 @s2n_result_is_ok(i32 %208)
  br i1 %209, label %211, label %210

210:                                              ; preds = %203
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %280

211:                                              ; preds = %203
  br label %212

212:                                              ; preds = %211
  br label %213

213:                                              ; preds = %212
  br label %214

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

218:                                              ; preds = %214
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %280

219:                                              ; preds = %214
  br label %220

220:                                              ; preds = %219
  br label %221

221:                                              ; preds = %220
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #8
  call void @llvm.memset.p0.i64(ptr align 16 %18, i8 0, i64 32, i1 false)
  br label %222

222:                                              ; preds = %221
  %223 = getelementptr inbounds [32 x i8], ptr %18, i64 0, i64 0
  %224 = call i32 @s2n_fingerprint_get_hash(ptr noundef %14, i32 noundef 32, ptr noundef %223, ptr noundef %17)
  %225 = icmp sgt i32 %224, -1
  br i1 %225, label %227, label %226

226:                                              ; preds = %222
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %279

227:                                              ; preds = %222
  br label %228

228:                                              ; preds = %227
  br label %229

229:                                              ; preds = %228
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #8
  call void @llvm.memset.p0.i64(ptr align 8 %19, i8 0, i64 24, i1 false)
  br label %230

230:                                              ; preds = %229
  %231 = load ptr, ptr %11, align 8, !tbaa !5
  %232 = call i32 @s2n_blob_init(ptr noundef %19, ptr noundef %231, i32 noundef 16)
  %233 = icmp sgt i32 %232, -1
  br i1 %233, label %235, label %234

234:                                              ; preds = %230
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %278

235:                                              ; preds = %230
  br label %236

236:                                              ; preds = %235
  br label %237

237:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 40, ptr %20) #8
  call void @llvm.memset.p0.i64(ptr align 8 %20, i8 0, i64 40, i1 false)
  br label %238

238:                                              ; preds = %237
  %239 = getelementptr inbounds %struct.s2n_stuffer, ptr %20, i32 0, i32 0
  %240 = getelementptr inbounds [32 x i8], ptr %18, i64 0, i64 0
  %241 = load i32, ptr %17, align 4, !tbaa !9
  %242 = call i32 @s2n_blob_init(ptr noundef %239, ptr noundef %240, i32 noundef %241)
  %243 = icmp sgt i32 %242, -1
  br i1 %243, label %245, label %244

244:                                              ; preds = %238
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %277

245:                                              ; preds = %238
  br label %246

246:                                              ; preds = %245
  br label %247

247:                                              ; preds = %246
  br label %248

248:                                              ; preds = %247
  %249 = load i32, ptr %17, align 4, !tbaa !9
  %250 = call i32 @s2n_stuffer_skip_write(ptr noundef %20, i32 noundef %249)
  %251 = icmp sgt i32 %250, -1
  br i1 %251, label %253, label %252

252:                                              ; preds = %248
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %277

253:                                              ; preds = %248
  br label %254

254:                                              ; preds = %253
  br label %255

255:                                              ; preds = %254
  br label %256

256:                                              ; preds = %255
  %257 = call i32 @s2n_stuffer_read_hex(ptr noundef %20, ptr noundef %19)
  %258 = getelementptr inbounds %struct.s2n_result, ptr %21, i32 0, i32 0
  store i32 %257, ptr %258, align 4
  %259 = getelementptr inbounds %struct.s2n_result, ptr %21, i32 0, i32 0
  %260 = load i32, ptr %259, align 4
  %261 = call zeroext i1 @s2n_result_is_ok(i32 %260)
  br i1 %261, label %263, label %262

262:                                              ; preds = %256
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %277

263:                                              ; preds = %256
  br label %264

264:                                              ; preds = %263
  br label %265

265:                                              ; preds = %264
  %266 = getelementptr inbounds %struct.s2n_blob, ptr %19, i32 0, i32 1
  %267 = load i32, ptr %266, align 8, !tbaa !14
  %268 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 %267, ptr %268, align 4, !tbaa !9
  br label %269

269:                                              ; preds = %265
  %270 = load ptr, ptr %13, align 8, !tbaa !5
  %271 = call i32 @s2n_fingerprint_get_raw_size(ptr noundef %14, ptr noundef %270)
  %272 = icmp sgt i32 %271, -1
  br i1 %272, label %274, label %273

273:                                              ; preds = %269
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %277

274:                                              ; preds = %269
  br label %275

275:                                              ; preds = %274
  br label %276

276:                                              ; preds = %275
  store i32 0, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %277

277:                                              ; preds = %276, %273, %262, %252, %244
  call void @llvm.lifetime.end.p0(i64 40, ptr %20) #8
  br label %278

278:                                              ; preds = %277, %234
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #8
  br label %279

279:                                              ; preds = %278, %226
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %280

280:                                              ; preds = %279, %218, %210
  %281 = call i32 @s2n_fingerprint_free_fields(ptr noundef %14)
  %282 = getelementptr inbounds %struct.s2n_result, ptr %22, i32 0, i32 0
  store i32 %281, ptr %282, align 4
  call void @llvm.lifetime.end.p0(i64 120, ptr %14) #8
  br label %283

283:                                              ; preds = %280, %199, %163, %127, %91, %55
  %284 = load i32, ptr %7, align 4
  ret i32 %284
}

declare i32 @s2n_stuffer_skip_write(ptr noundef, i32 noundef) #4

declare i32 @s2n_stuffer_read_hex(ptr noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { "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 = { 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 #6 = { 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 #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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 8}
!15 = !{!"s2n_blob", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}


; 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_fingerprint = type { i64, ptr, ptr, %struct.s2n_hash_state, %struct.s2n_stuffer }
%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_stuffer = type { %struct.s2n_blob, i32, i32, i32, i8 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }

@_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.35 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [92 x i8], align 1

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

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

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

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #4

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

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_fingerprint_free_fields(ptr noundef) local_unnamed_addr #6

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

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

declare i32 @s2n_blob_init(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_client_hello_get_fingerprint_hash(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef writeonly %4, ptr noundef %5) local_unnamed_addr #6 {
  %7 = alloca %struct.s2n_fingerprint, align 8
  %8 = alloca i32, align 4
  %9 = alloca [32 x i8], align 16
  %10 = alloca %struct.s2n_blob, align 8
  %11 = alloca %struct.s2n_stuffer, align 8
  %12 = icmp eq i32 %1, 0
  br i1 %12, label %21, label %13

13:                                               ; preds = %6
  %14 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.35, ptr %14, align 8, !tbaa !5
  %15 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.35, i64 21), i32 noundef 47) #7
  %.not = icmp eq ptr %15, null
  %16 = getelementptr inbounds i8, ptr %15, i64 1
  %17 = select i1 %.not, ptr getelementptr inbounds (i8, ptr @.str.35, i64 21), ptr %16
  %18 = getelementptr inbounds i8, ptr %14, i64 8
  store ptr %17, ptr %18, align 8, !tbaa !10
  %19 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762089, ptr %19, align 4, !tbaa !11
  %20 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %90

21:                                               ; preds = %6
  %22 = icmp ugt i32 %2, 15
  br i1 %22, label %31, label %23

23:                                               ; preds = %21
  %24 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.36, ptr %24, align 8, !tbaa !5
  %25 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.36, i64 21), i32 noundef 47) #7
  %.not21 = icmp eq ptr %25, null
  %26 = getelementptr inbounds i8, ptr %25, i64 1
  %27 = select i1 %.not21, ptr getelementptr inbounds (i8, ptr @.str.36, i64 21), ptr %26
  %28 = getelementptr inbounds i8, ptr %24, i64 8
  store ptr %27, ptr %28, align 8, !tbaa !10
  %29 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762120, ptr %29, align 4, !tbaa !11
  %30 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %90

31:                                               ; preds = %21
  %.not22 = icmp eq ptr %5, null
  br i1 %.not22, label %32, label %40

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

40:                                               ; preds = %31
  %.not24 = icmp eq ptr %4, null
  br i1 %.not24, label %41, label %49

41:                                               ; preds = %40
  %42 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.38, ptr %42, align 8, !tbaa !5
  %43 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.38, i64 21), i32 noundef 47) #7
  %.not25 = icmp eq ptr %43, null
  %44 = getelementptr inbounds i8, ptr %43, i64 1
  %45 = select i1 %.not25, ptr getelementptr inbounds (i8, ptr @.str.38, 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 469762089, ptr %47, align 4, !tbaa !11
  %48 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %90

49:                                               ; preds = %40
  %.not26 = icmp eq ptr %3, null
  br i1 %.not26, label %50, label %58

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

58:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %7) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(120) %7, i8 0, i64 120, i1 false)
  %59 = call i32 @s2n_fingerprint_init(ptr noundef nonnull %7, i32 noundef 0)
  %60 = call zeroext i1 @s2n_result_is_ok(i32 %59)
  br i1 %60, label %61, label %88

61:                                               ; preds = %58
  %62 = call i32 @s2n_fingerprint_set_client_hello(ptr noundef nonnull %7, ptr noundef %0)
  %63 = icmp sgt i32 %62, -1
  br i1 %63, label %64, label %88

64:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  store i32 0, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %9, i8 0, i64 32, i1 false)
  %65 = call i32 @s2n_fingerprint_get_hash(ptr noundef nonnull %7, i32 noundef 32, ptr noundef nonnull %9, ptr noundef nonnull %8)
  %66 = icmp sgt i32 %65, -1
  br i1 %66, label %67, label %87

67:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %10, i8 0, i64 24, i1 false)
  %68 = call i32 @s2n_blob_init(ptr noundef nonnull %10, ptr noundef nonnull %3, i32 noundef 16) #8
  %69 = icmp sgt i32 %68, -1
  br i1 %69, label %70, label %86

70:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %11) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %11, i8 0, i64 40, i1 false)
  %71 = load i32, ptr %8, align 4, !tbaa !11
  %72 = call i32 @s2n_blob_init(ptr noundef nonnull %11, ptr noundef nonnull %9, i32 noundef %71) #8
  %73 = icmp sgt i32 %72, -1
  br i1 %73, label %74, label %85

74:                                               ; preds = %70
  %75 = load i32, ptr %8, align 4, !tbaa !11
  %76 = call i32 @s2n_stuffer_skip_write(ptr noundef nonnull %11, i32 noundef %75) #8
  %77 = icmp sgt i32 %76, -1
  br i1 %77, label %78, label %85

78:                                               ; preds = %74
  %79 = call i32 @s2n_stuffer_read_hex(ptr noundef nonnull %11, ptr noundef nonnull %10) #8
  %80 = call zeroext i1 @s2n_result_is_ok(i32 %79)
  br i1 %80, label %81, label %85

81:                                               ; preds = %78
  %82 = getelementptr inbounds i8, ptr %10, i64 8
  %83 = load i32, ptr %82, align 8, !tbaa !13
  store i32 %83, ptr %4, align 4, !tbaa !11
  %84 = call i32 @s2n_fingerprint_get_raw_size(ptr noundef nonnull %7, ptr noundef nonnull %5)
  %.lobit = ashr i32 %84, 31
  br label %85

85:                                               ; preds = %81, %78, %74, %70
  %.0 = phi i32 [ -1, %70 ], [ -1, %74 ], [ -1, %78 ], [ %.lobit, %81 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #8
  br label %86

86:                                               ; preds = %67, %85
  %.1 = phi i32 [ %.0, %85 ], [ -1, %67 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #8
  br label %87

87:                                               ; preds = %64, %86
  %.2 = phi i32 [ %.1, %86 ], [ -1, %64 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  br label %88

88:                                               ; preds = %61, %58, %87
  %.3 = phi i32 [ %.2, %87 ], [ -1, %58 ], [ -1, %61 ]
  %89 = call i32 @s2n_fingerprint_free_fields(ptr noundef nonnull %7)
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %7) #8
  br label %90

90:                                               ; preds = %88, %50, %41, %32, %23, %13
  %.4 = phi i32 [ %.3, %88 ], [ -1, %50 ], [ -1, %41 ], [ -1, %32 ], [ -1, %23 ], [ -1, %13 ]
  ret i32 %.4
}

declare i32 @s2n_stuffer_skip_write(ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @s2n_stuffer_read_hex(ptr noundef, ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { "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 = { 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 #6 = { 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 #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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 8}
!14 = !{!"s2n_blob", !7, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}


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