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

; 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_hkdf_impl = type { 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.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
@.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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

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

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_hkdf(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #4 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !5
  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 %16

16:                                               ; preds = %6
  %17 = load ptr, ptr %8, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %50, label %19

19:                                               ; preds = %16
  br label %20

20:                                               ; preds = %19
  br label %21

21:                                               ; preds = %20
  %22 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %23 = getelementptr inbounds %struct.s2n_debug_info, ptr %22, i32 0, i32 0
  store ptr @.str.10, ptr %23, align 8, !tbaa !11
  %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
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds i8, ptr %26, i64 21
  %28 = call ptr @strrchr(ptr noundef %27, i32 noundef 47) #5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %37

30:                                               ; preds = %21
  %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) #5
  %36 = getelementptr inbounds i8, ptr %35, i64 1
  br label %42

37:                                               ; preds = %21
  %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
  br label %42

42:                                               ; preds = %37, %30
  %43 = phi ptr [ %36, %30 ], [ %41, %37 ]
  %44 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %45 = getelementptr inbounds %struct.s2n_debug_info, ptr %44, i32 0, i32 1
  store ptr %43, ptr %45, align 8, !tbaa !13
  %46 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %46, align 4, !tbaa !9
  %47 = call i32 @s2n_calculate_stacktrace()
  br label %48

48:                                               ; preds = %42
  store i32 -1, ptr %7, align 4
  br label %253

49:                                               ; No predecessors!
  br label %50

50:                                               ; preds = %49, %16
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = icmp ne ptr %53, null
  br i1 %54, label %86, label %55

55:                                               ; preds = %52
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  %58 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %59 = getelementptr inbounds %struct.s2n_debug_info, ptr %58, i32 0, i32 0
  store ptr @.str.11, ptr %59, align 8, !tbaa !11
  %60 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %61 = getelementptr inbounds %struct.s2n_debug_info, ptr %60, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8, !tbaa !11
  %63 = getelementptr inbounds i8, ptr %62, i64 21
  %64 = call ptr @strrchr(ptr noundef %63, i32 noundef 47) #5
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %73

66:                                               ; preds = %57
  %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) #5
  %72 = getelementptr inbounds i8, ptr %71, i64 1
  br label %78

73:                                               ; preds = %57
  %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
  br label %78

78:                                               ; preds = %73, %66
  %79 = phi ptr [ %72, %66 ], [ %77, %73 ]
  %80 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %81 = getelementptr inbounds %struct.s2n_debug_info, ptr %80, i32 0, i32 1
  store ptr %79, ptr %81, align 8, !tbaa !13
  %82 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %82, align 4, !tbaa !9
  %83 = call i32 @s2n_calculate_stacktrace()
  br label %84

84:                                               ; preds = %78
  store i32 -1, ptr %7, align 4
  br label %253

85:                                               ; No predecessors!
  br label %86

86:                                               ; preds = %85, %52
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = icmp ne ptr %89, null
  br i1 %90, label %122, label %91

91:                                               ; preds = %88
  br label %92

92:                                               ; preds = %91
  br label %93

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

102:                                              ; preds = %93
  %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) #5
  %108 = getelementptr inbounds i8, ptr %107, i64 1
  br label %114

109:                                              ; preds = %93
  %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
  br label %114

114:                                              ; preds = %109, %102
  %115 = phi ptr [ %108, %102 ], [ %113, %109 ]
  %116 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %117 = getelementptr inbounds %struct.s2n_debug_info, ptr %116, i32 0, i32 1
  store ptr %115, ptr %117, align 8, !tbaa !13
  %118 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %118, align 4, !tbaa !9
  %119 = call i32 @s2n_calculate_stacktrace()
  br label %120

120:                                              ; preds = %114
  store i32 -1, ptr %7, align 4
  br label %253

121:                                              ; No predecessors!
  br label %122

122:                                              ; preds = %121, %88
  br label %123

123:                                              ; preds = %122
  br label %124

124:                                              ; preds = %123
  %125 = load ptr, ptr %12, align 8, !tbaa !5
  %126 = icmp ne ptr %125, null
  br i1 %126, label %158, label %127

127:                                              ; preds = %124
  br label %128

128:                                              ; preds = %127
  br label %129

129:                                              ; preds = %128
  %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
  store ptr @.str.13, ptr %131, align 8, !tbaa !11
  %132 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %133 = getelementptr inbounds %struct.s2n_debug_info, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !11
  %135 = getelementptr inbounds i8, ptr %134, i64 21
  %136 = call ptr @strrchr(ptr noundef %135, i32 noundef 47) #5
  %137 = icmp ne ptr %136, null
  br i1 %137, label %138, label %145

138:                                              ; preds = %129
  %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) #5
  %144 = getelementptr inbounds i8, ptr %143, i64 1
  br label %150

145:                                              ; preds = %129
  %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
  br label %150

150:                                              ; preds = %145, %138
  %151 = phi ptr [ %144, %138 ], [ %149, %145 ]
  %152 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %153 = getelementptr inbounds %struct.s2n_debug_info, ptr %152, i32 0, i32 1
  store ptr %151, ptr %153, align 8, !tbaa !13
  %154 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %154, align 4, !tbaa !9
  %155 = call i32 @s2n_calculate_stacktrace()
  br label %156

156:                                              ; preds = %150
  store i32 -1, ptr %7, align 4
  br label %253

157:                                              ; No predecessors!
  br label %158

158:                                              ; preds = %157, %124
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159
  %161 = load ptr, ptr %13, align 8, !tbaa !5
  %162 = icmp ne ptr %161, null
  br i1 %162, label %194, label %163

163:                                              ; preds = %160
  br label %164

164:                                              ; preds = %163
  br label %165

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

174:                                              ; preds = %165
  %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) #5
  %180 = getelementptr inbounds i8, ptr %179, i64 1
  br label %186

181:                                              ; preds = %165
  %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
  br label %186

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

192:                                              ; preds = %186
  store i32 -1, ptr %7, align 4
  br label %253

193:                                              ; No predecessors!
  br label %194

194:                                              ; preds = %193, %160
  br label %195

195:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %196 = call ptr @s2n_get_hkdf_implementation()
  store ptr %196, ptr %14, align 8, !tbaa !5
  br label %197

197:                                              ; preds = %195
  %198 = load ptr, ptr %14, align 8, !tbaa !5
  %199 = icmp ne ptr %198, null
  br i1 %199, label %233, label %200

200:                                              ; preds = %197
  br label %201

201:                                              ; preds = %200
  br label %202

202:                                              ; preds = %201
  %203 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %204 = getelementptr inbounds %struct.s2n_debug_info, ptr %203, i32 0, i32 0
  store ptr @.str.15, ptr %204, align 8, !tbaa !11
  %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 0
  %207 = load ptr, ptr %206, align 8, !tbaa !11
  %208 = getelementptr inbounds i8, ptr %207, i64 21
  %209 = call ptr @strrchr(ptr noundef %208, i32 noundef 47) #5
  %210 = icmp ne ptr %209, null
  br i1 %210, label %211, label %218

211:                                              ; preds = %202
  %212 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %213 = getelementptr inbounds %struct.s2n_debug_info, ptr %212, i32 0, i32 0
  %214 = load ptr, ptr %213, align 8, !tbaa !11
  %215 = getelementptr inbounds i8, ptr %214, i64 21
  %216 = call ptr @strrchr(ptr noundef %215, i32 noundef 47) #5
  %217 = getelementptr inbounds i8, ptr %216, i64 1
  br label %223

218:                                              ; preds = %202
  %219 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %220 = getelementptr inbounds %struct.s2n_debug_info, ptr %219, i32 0, i32 0
  %221 = load ptr, ptr %220, align 8, !tbaa !11
  %222 = getelementptr inbounds i8, ptr %221, i64 21
  br label %223

223:                                              ; preds = %218, %211
  %224 = phi ptr [ %217, %211 ], [ %222, %218 ]
  %225 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %226 = getelementptr inbounds %struct.s2n_debug_info, ptr %225, i32 0, i32 1
  store ptr %224, ptr %226, align 8, !tbaa !13
  %227 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %227, align 4, !tbaa !9
  %228 = call i32 @s2n_calculate_stacktrace()
  br label %229

229:                                              ; preds = %223
  br label %230

230:                                              ; preds = %229
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %252

231:                                              ; No predecessors!
  br label %232

232:                                              ; preds = %231
  br label %233

233:                                              ; preds = %232, %197
  br label %234

234:                                              ; preds = %233
  br label %235

235:                                              ; preds = %234
  br label %236

236:                                              ; preds = %235
  %237 = load ptr, ptr %14, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.s2n_hkdf_impl, ptr %237, i32 0, i32 0
  %239 = load ptr, ptr %238, align 8, !tbaa !14
  %240 = load ptr, ptr %8, align 8, !tbaa !5
  %241 = load i32, ptr %9, align 4, !tbaa !9
  %242 = load ptr, ptr %10, align 8, !tbaa !5
  %243 = load ptr, ptr %11, align 8, !tbaa !5
  %244 = load ptr, ptr %12, align 8, !tbaa !5
  %245 = load ptr, ptr %13, align 8, !tbaa !5
  %246 = call i32 %239(ptr noundef %240, i32 noundef %241, ptr noundef %242, ptr noundef %243, ptr noundef %244, ptr noundef %245)
  %247 = icmp sgt i32 %246, -1
  br i1 %247, label %249, label %248

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

249:                                              ; preds = %236
  br label %250

250:                                              ; preds = %249
  br label %251

251:                                              ; preds = %250
  store i32 0, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %252

252:                                              ; preds = %251, %248, %230
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %253

253:                                              ; preds = %252, %192, %156, %120, %84, %48
  %254 = load i32, ptr %7, align 4
  ret i32 %254
}

; Function Attrs: nounwind uwtable
declare hidden ptr @s2n_get_hkdf_implementation() #4

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { nounwind willreturn memory(read) }
attributes #6 = { 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, !6, i64 0}
!15 = !{!"s2n_hkdf_impl", !6, i64 0, !6, i64 8, !6, 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 }

@_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
@.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: 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
define dso_local range(i32 -1, 1) i32 @s2n_hkdf(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #3 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %7, label %15

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

15:                                               ; preds = %6
  %.not26 = icmp eq ptr %2, null
  br i1 %.not26, label %16, label %24

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

24:                                               ; preds = %15
  %.not28 = icmp eq ptr %3, null
  br i1 %.not28, label %25, label %33

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

33:                                               ; preds = %24
  %.not30 = icmp eq ptr %4, null
  br i1 %.not30, label %34, label %42

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

42:                                               ; preds = %33
  %.not32 = icmp eq ptr %5, null
  br i1 %.not32, label %43, label %51

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

51:                                               ; preds = %42
  %52 = tail call ptr @s2n_get_hkdf_implementation()
  %.not34 = icmp eq ptr %52, null
  br i1 %.not34, label %53, label %61

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

61:                                               ; preds = %51
  %62 = load ptr, ptr %52, align 8, !tbaa !13
  %63 = tail call i32 %62(ptr noundef nonnull %0, i32 noundef %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5) #5
  %.lobit = ashr i32 %63, 31
  br label %64

64:                                               ; preds = %53, %61, %43, %34, %25, %16, %7
  %.1 = phi i32 [ -1, %43 ], [ -1, %34 ], [ -1, %25 ], [ -1, %16 ], [ -1, %7 ], [ -1, %53 ], [ %.lobit, %61 ]
  ret i32 %.1
}

; Function Attrs: nounwind uwtable
declare hidden ptr @s2n_get_hkdf_implementation() 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 = { nounwind willreturn memory(read) }
attributes #5 = { 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_hkdf_impl", !7, i64 0, !7, i64 8, !7, i64 16}


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