; LLVM IR from aws/s2n-tls :: tests/unit (s2n_resume_test)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.s2n_debug_info = type { ptr, ptr }
%struct.s2n_result = type { i32 }
%struct.s2n_config = type { i32, ptr, ptr, %struct.certs_by_type, %struct.s2n_blob, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, i64, ptr, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, i32, i8, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, %struct.s2n_x509_trust_store, i16, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, i32, i32, ptr, ptr, i32, %struct.s2n_blob }
%struct.certs_by_type = type { [4 x ptr] }
%struct.s2n_x509_trust_store = type { ptr, i8 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }
%struct.s2n_ticket_key = type { [16 x i8], [32 x i8], [12 x i8], i64 }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.28 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [87 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 nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1

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

declare i32 @s2n_calculate_stacktrace() #3

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

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

; 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
define dso_local ptr @s2n_get_ticket_encrypt_decrypt_key(ptr noundef %0) #6 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca [48 x i8], align 16
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca %struct.s2n_result, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.s2n_result, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.s2n_result, align 4
  %15 = alloca i64, align 8
  %16 = alloca %struct.s2n_result, align 4
  %17 = alloca i8, align 1
  %18 = alloca %struct.s2n_result, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #7
  store i8 0, ptr %4, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 48, ptr %5) #7
  call void @llvm.memset.p0.i64(ptr align 16 %5, i8 0, i64 48, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !10
  br label %19

19:                                               ; preds = %1
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = call i32 @s2n_config_wall_clock(ptr noundef %20, ptr noundef %7)
  %22 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  store i32 %21, ptr %22, align 4
  %23 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  %24 = load i32, ptr %23, align 4
  %25 = call zeroext i1 @s2n_result_is_ok(i32 %24)
  br i1 %25, label %27, label %26

26:                                               ; preds = %19
  store ptr null, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %228

27:                                               ; preds = %19
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.s2n_config, ptr %31, i32 0, i32 15
  %33 = load ptr, ptr %32, align 8, !tbaa !12
  %34 = icmp ne ptr %33, null
  br i1 %34, label %68, label %35

35:                                               ; preds = %30
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  %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
  store ptr @.str.28, ptr %39, align 8, !tbaa !19
  %40 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %41 = getelementptr inbounds %struct.s2n_debug_info, ptr %40, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8, !tbaa !19
  %43 = getelementptr inbounds i8, ptr %42, i64 21
  %44 = call ptr @strrchr(ptr noundef %43, i32 noundef 47) #8
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %53

46:                                               ; preds = %37
  %47 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %48 = getelementptr inbounds %struct.s2n_debug_info, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !19
  %50 = getelementptr inbounds i8, ptr %49, i64 21
  %51 = call ptr @strrchr(ptr noundef %50, i32 noundef 47) #8
  %52 = getelementptr inbounds i8, ptr %51, i64 1
  br label %58

53:                                               ; preds = %37
  %54 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %55 = getelementptr inbounds %struct.s2n_debug_info, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !19
  %57 = getelementptr inbounds i8, ptr %56, i64 21
  br label %58

58:                                               ; preds = %53, %46
  %59 = phi ptr [ %52, %46 ], [ %57, %53 ]
  %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 1
  store ptr %59, ptr %61, align 8, !tbaa !21
  %62 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %62, align 4, !tbaa !22
  %63 = call i32 @s2n_calculate_stacktrace()
  br label %64

64:                                               ; preds = %58
  br label %65

65:                                               ; preds = %64
  store ptr null, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %228

66:                                               ; No predecessors!
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67, %30
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !22
  br label %71

71:                                               ; preds = %70
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.s2n_config, ptr %72, i32 0, i32 15
  %74 = load ptr, ptr %73, align 8, !tbaa !12
  %75 = call i32 @s2n_array_num_elements(ptr noundef %74, ptr noundef %10)
  %76 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  store i32 %75, ptr %76, align 4
  %77 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  %78 = load i32, ptr %77, align 4
  %79 = call zeroext i1 @s2n_result_is_ok(i32 %78)
  br i1 %79, label %81, label %80

80:                                               ; preds = %71
  store ptr null, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %227

81:                                               ; preds = %71
  br label %82

82:                                               ; preds = %81
  br label %83

83:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %84 = load i32, ptr %10, align 4, !tbaa !22
  store i32 %84, ptr %12, align 4, !tbaa !22
  br label %85

85:                                               ; preds = %132, %83
  %86 = load i32, ptr %12, align 4, !tbaa !22
  %87 = icmp ugt i32 %86, 0
  br i1 %87, label %89, label %88

88:                                               ; preds = %85
  store i32 12, ptr %9, align 4
  br label %135

89:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %90 = load i32, ptr %12, align 4, !tbaa !22
  %91 = sub i32 %90, 1
  store i32 %91, ptr %13, align 4, !tbaa !22
  br label %92

92:                                               ; preds = %89
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.s2n_config, ptr %93, i32 0, i32 15
  %95 = load ptr, ptr %94, align 8, !tbaa !12
  %96 = load i32, ptr %13, align 4, !tbaa !22
  %97 = call i32 @s2n_array_get(ptr noundef %95, i32 noundef %96, ptr noundef %6)
  %98 = getelementptr inbounds %struct.s2n_result, ptr %14, i32 0, i32 0
  store i32 %97, ptr %98, align 4
  %99 = getelementptr inbounds %struct.s2n_result, ptr %14, i32 0, i32 0
  %100 = load i32, ptr %99, align 4
  %101 = call zeroext i1 @s2n_result_is_ok(i32 %100)
  br i1 %101, label %103, label %102

102:                                              ; preds = %92
  store ptr null, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %129

103:                                              ; preds = %92
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.s2n_ticket_key, ptr %106, i32 0, i32 3
  %108 = load i64, ptr %107, align 8, !tbaa !23
  store i64 %108, ptr %15, align 8, !tbaa !10
  %109 = load i64, ptr %15, align 8, !tbaa !10
  %110 = load i64, ptr %7, align 8, !tbaa !10
  %111 = icmp ule i64 %109, %110
  br i1 %111, label %112, label %128

112:                                              ; preds = %105
  %113 = load i64, ptr %7, align 8, !tbaa !10
  %114 = load i64, ptr %15, align 8, !tbaa !10
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.s2n_config, ptr %115, i32 0, i32 16
  %117 = load i64, ptr %116, align 8, !tbaa !25
  %118 = add i64 %114, %117
  %119 = icmp ult i64 %113, %118
  br i1 %119, label %120, label %128

120:                                              ; preds = %112
  %121 = load i32, ptr %13, align 4, !tbaa !22
  %122 = trunc i32 %121 to i8
  %123 = load i8, ptr %4, align 1, !tbaa !9
  %124 = zext i8 %123 to i64
  %125 = getelementptr inbounds [48 x i8], ptr %5, i64 0, i64 %124
  store i8 %122, ptr %125, align 1, !tbaa !9
  %126 = load i8, ptr %4, align 1, !tbaa !9
  %127 = add i8 %126, 1
  store i8 %127, ptr %4, align 1, !tbaa !9
  br label %128

128:                                              ; preds = %120, %112, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  store i32 0, ptr %9, align 4
  br label %129

129:                                              ; preds = %128, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %130 = load i32, ptr %9, align 4
  switch i32 %130, label %135 [
    i32 0, label %131
  ]

131:                                              ; preds = %129
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %12, align 4, !tbaa !22
  %134 = add i32 %133, -1
  store i32 %134, ptr %12, align 4, !tbaa !22
  br label %85, !llvm.loop !26

135:                                              ; preds = %129, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  %136 = load i32, ptr %9, align 4
  switch i32 %136, label %227 [
    i32 12, label %137
  ]

137:                                              ; preds = %135
  %138 = load i8, ptr %4, align 1, !tbaa !9
  %139 = zext i8 %138 to i32
  %140 = icmp eq i32 %139, 0
  br i1 %140, label %141, label %174

141:                                              ; preds = %137
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  %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
  store ptr @.str.29, ptr %145, align 8, !tbaa !19
  %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 !19
  %149 = getelementptr inbounds i8, ptr %148, i64 21
  %150 = call ptr @strrchr(ptr noundef %149, i32 noundef 47) #8
  %151 = icmp ne ptr %150, null
  br i1 %151, label %152, label %159

152:                                              ; preds = %143
  %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 !19
  %156 = getelementptr inbounds i8, ptr %155, i64 21
  %157 = call ptr @strrchr(ptr noundef %156, i32 noundef 47) #8
  %158 = getelementptr inbounds i8, ptr %157, i64 1
  br label %164

159:                                              ; preds = %143
  %160 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %161 = getelementptr inbounds %struct.s2n_debug_info, ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %161, align 8, !tbaa !19
  %163 = getelementptr inbounds i8, ptr %162, i64 21
  br label %164

164:                                              ; preds = %159, %152
  %165 = phi ptr [ %158, %152 ], [ %163, %159 ]
  %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 1
  store ptr %165, ptr %167, align 8, !tbaa !21
  %168 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762084, ptr %168, align 4, !tbaa !22
  %169 = call i32 @s2n_calculate_stacktrace()
  br label %170

170:                                              ; preds = %164
  br label %171

171:                                              ; preds = %170
  store ptr null, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %227

172:                                              ; No predecessors!
  br label %173

173:                                              ; preds = %172
  br label %174

174:                                              ; preds = %173, %137
  %175 = load i8, ptr %4, align 1, !tbaa !9
  %176 = zext i8 %175 to i32
  %177 = icmp eq i32 %176, 1
  br i1 %177, label %178, label %196

178:                                              ; preds = %174
  br label %179

179:                                              ; preds = %178
  %180 = load ptr, ptr %3, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.s2n_config, ptr %180, i32 0, i32 15
  %182 = load ptr, ptr %181, align 8, !tbaa !12
  %183 = getelementptr inbounds [48 x i8], ptr %5, i64 0, i64 0
  %184 = load i8, ptr %183, align 16, !tbaa !9
  %185 = zext i8 %184 to i32
  %186 = call i32 @s2n_array_get(ptr noundef %182, i32 noundef %185, ptr noundef %6)
  %187 = getelementptr inbounds %struct.s2n_result, ptr %16, i32 0, i32 0
  store i32 %186, ptr %187, align 4
  %188 = getelementptr inbounds %struct.s2n_result, ptr %16, i32 0, i32 0
  %189 = load i32, ptr %188, align 4
  %190 = call zeroext i1 @s2n_result_is_ok(i32 %189)
  br i1 %190, label %192, label %191

191:                                              ; preds = %179
  store ptr null, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %227

192:                                              ; preds = %179
  br label %193

193:                                              ; preds = %192
  br label %194

194:                                              ; preds = %193
  %195 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %195, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %227

196:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #7
  store i8 0, ptr %17, align 1, !tbaa !9
  br label %197

197:                                              ; preds = %196
  %198 = load ptr, ptr %3, align 8, !tbaa !5
  %199 = getelementptr inbounds [48 x i8], ptr %5, i64 0, i64 0
  %200 = load i8, ptr %4, align 1, !tbaa !9
  %201 = load i64, ptr %7, align 8, !tbaa !10
  %202 = call i32 @s2n_compute_weight_of_encrypt_decrypt_keys(ptr noundef %198, ptr noundef %199, i8 noundef zeroext %200, i64 noundef %201)
  %203 = trunc i32 %202 to i8
  store i8 %203, ptr %17, align 1, !tbaa !9
  %204 = sext i8 %203 to i32
  %205 = icmp sgt i32 %204, -1
  br i1 %205, label %207, label %206

206:                                              ; preds = %197
  store ptr null, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %226

207:                                              ; preds = %197
  br label %208

208:                                              ; preds = %207
  br label %209

209:                                              ; preds = %208
  br label %210

210:                                              ; preds = %209
  %211 = load ptr, ptr %3, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.s2n_config, ptr %211, i32 0, i32 15
  %213 = load ptr, ptr %212, align 8, !tbaa !12
  %214 = load i8, ptr %17, align 1, !tbaa !9
  %215 = sext i8 %214 to i32
  %216 = call i32 @s2n_array_get(ptr noundef %213, i32 noundef %215, ptr noundef %6)
  %217 = getelementptr inbounds %struct.s2n_result, ptr %18, i32 0, i32 0
  store i32 %216, ptr %217, align 4
  %218 = getelementptr inbounds %struct.s2n_result, ptr %18, i32 0, i32 0
  %219 = load i32, ptr %218, align 4
  %220 = call zeroext i1 @s2n_result_is_ok(i32 %219)
  br i1 %220, label %222, label %221

221:                                              ; preds = %210
  store ptr null, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %226

222:                                              ; preds = %210
  br label %223

223:                                              ; preds = %222
  br label %224

224:                                              ; preds = %223
  %225 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %225, ptr %2, align 8
  store i32 1, ptr %9, align 4
  br label %226

226:                                              ; preds = %224, %221, %206
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  br label %227

227:                                              ; preds = %226, %194, %191, %171, %135, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %228

228:                                              ; preds = %227, %65, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  %229 = load ptr, ptr %2, align 8
  ret ptr %229
}

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_compute_weight_of_encrypt_decrypt_keys(ptr noundef, ptr noundef, i8 noundef zeroext, i64 noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 }
attributes #8 = { nounwind willreturn memory(read) }

!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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !6, i64 152}
!13 = !{!"s2n_config", !14, i64 0, !14, i64 0, !14, i64 0, !14, i64 0, !14, i64 0, !14, i64 0, !14, i64 0, !14, i64 0, !14, i64 1, !14, i64 1, !14, i64 1, !14, i64 1, !14, i64 1, !14, i64 1, !14, i64 1, !14, i64 1, !14, i64 2, !14, i64 2, !14, i64 2, !14, i64 2, !6, i64 8, !6, i64 16, !15, i64 24, !16, i64 56, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !14, i64 128, !14, i64 132, !6, i64 136, !11, i64 144, !6, i64 152, !11, i64 160, !11, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !14, i64 224, !7, i64 228, !14, i64 232, !14, i64 236, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !17, i64 304, !18, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !14, i64 392, !14, i64 396, !14, i64 400, !6, i64 408, !14, i64 416, !14, i64 420, !6, i64 424, !6, i64 432, !14, i64 440, !16, i64 448}
!14 = !{!"int", !7, i64 0}
!15 = !{!"certs_by_type", !7, i64 0}
!16 = !{!"s2n_blob", !6, i64 0, !14, i64 8, !14, i64 12, !14, i64 16}
!17 = !{!"s2n_x509_trust_store", !6, i64 0, !14, i64 8}
!18 = !{!"short", !7, i64 0}
!19 = !{!20, !6, i64 0}
!20 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!21 = !{!20, !6, i64 8}
!22 = !{!14, !14, i64 0}
!23 = !{!24, !11, i64 64}
!24 = !{!"s2n_ticket_key", !7, i64 0, !7, i64 16, !7, i64 48, !11, i64 64}
!25 = !{!13, !11, i64 160}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


; 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.28 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [87 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 nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #3

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

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

; 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
define dso_local ptr @s2n_get_ticket_encrypt_decrypt_key(ptr noundef %0) local_unnamed_addr #6 {
  %2 = alloca [48 x i8], align 16
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(48) %2, i8 0, i64 48, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store i64 0, ptr %4, align 8, !tbaa !9
  %6 = call i32 @s2n_config_wall_clock(ptr noundef %0, ptr noundef nonnull %4) #7
  %7 = call zeroext i1 @s2n_result_is_ok(i32 %6)
  br i1 %7, label %8, label %69

8:                                                ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 152
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %11, label %19

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

19:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 0, ptr %5, align 4, !tbaa !21
  %20 = call i32 @s2n_array_num_elements(ptr noundef nonnull %10, ptr noundef nonnull %5) #7
  %21 = call zeroext i1 @s2n_result_is_ok(i32 %20)
  br i1 %21, label %22, label %.loopexit

22:                                               ; preds = %19
  %23 = load i32, ptr %5, align 4, !tbaa !21
  %.not4252 = icmp eq i32 %23, 0
  br i1 %.not4252, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %22
  %24 = getelementptr inbounds i8, ptr %0, i64 160
  br label %25

25:                                               ; preds = %.lr.ph, %44
  %.02854 = phi i8 [ 0, %.lr.ph ], [ %.230.ph, %44 ]
  %.03453 = phi i32 [ %23, %.lr.ph ], [ %26, %44 ]
  %26 = add i32 %.03453, -1
  %27 = load ptr, ptr %9, align 8, !tbaa !11
  %28 = call i32 @s2n_array_get(ptr noundef %27, i32 noundef %26, ptr noundef nonnull %3) #7
  %29 = call zeroext i1 @s2n_result_is_ok(i32 %28)
  br i1 %29, label %30, label %.loopexit

30:                                               ; preds = %25
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 64
  %33 = load i64, ptr %32, align 8, !tbaa !22
  %34 = load i64, ptr %4, align 8, !tbaa !9
  %.not43 = icmp ugt i64 %33, %34
  br i1 %.not43, label %44, label %35

35:                                               ; preds = %30
  %36 = load i64, ptr %24, align 8, !tbaa !24
  %37 = add i64 %36, %33
  %38 = icmp ult i64 %34, %37
  br i1 %38, label %39, label %44

39:                                               ; preds = %35
  %40 = trunc i32 %26 to i8
  %41 = zext i8 %.02854 to i64
  %42 = getelementptr inbounds [48 x i8], ptr %2, i64 0, i64 %41
  store i8 %40, ptr %42, align 1, !tbaa !25
  %43 = add i8 %.02854, 1
  br label %44

44:                                               ; preds = %30, %35, %39
  %.230.ph = phi i8 [ %.02854, %30 ], [ %.02854, %35 ], [ %43, %39 ]
  %.not42 = icmp eq i32 %26, 0
  br i1 %.not42, label %._crit_edge, label %25, !llvm.loop !26

._crit_edge:                                      ; preds = %44
  switch i8 %.230.ph, label %59 [
    i8 0, label %._crit_edge.thread
    i8 1, label %52
  ]

._crit_edge.thread:                               ; preds = %22, %._crit_edge
  %45 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.29, ptr %45, align 8, !tbaa !18
  %46 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.29, i64 21), i32 noundef 47) #8
  %.not44 = icmp eq ptr %46, null
  %47 = getelementptr inbounds i8, ptr %46, i64 1
  %48 = select i1 %.not44, ptr getelementptr inbounds (i8, ptr @.str.29, i64 21), ptr %47
  %49 = getelementptr inbounds i8, ptr %45, i64 8
  store ptr %48, ptr %49, align 8, !tbaa !20
  %50 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762084, ptr %50, align 4, !tbaa !21
  %51 = call i32 @s2n_calculate_stacktrace() #7
  br label %.loopexit

52:                                               ; preds = %._crit_edge
  %53 = load ptr, ptr %9, align 8, !tbaa !11
  %54 = load i8, ptr %2, align 16, !tbaa !25
  %55 = zext i8 %54 to i32
  %56 = call i32 @s2n_array_get(ptr noundef %53, i32 noundef %55, ptr noundef nonnull %3) #7
  %57 = call zeroext i1 @s2n_result_is_ok(i32 %56)
  %58 = load ptr, ptr %3, align 8
  %spec.select = select i1 %57, ptr %58, ptr null
  br label %.loopexit

59:                                               ; preds = %._crit_edge
  %60 = load i64, ptr %4, align 8, !tbaa !9
  %61 = call i32 @s2n_compute_weight_of_encrypt_decrypt_keys(ptr noundef nonnull %0, ptr noundef nonnull %2, i8 noundef zeroext %.230.ph, i64 noundef %60)
  %sext = shl i32 %61, 24
  %62 = ashr exact i32 %sext, 24
  %63 = icmp sgt i32 %62, -1
  br i1 %63, label %64, label %.loopexit

64:                                               ; preds = %59
  %65 = load ptr, ptr %9, align 8, !tbaa !11
  %66 = call i32 @s2n_array_get(ptr noundef %65, i32 noundef %62, ptr noundef nonnull %3) #7
  %67 = call zeroext i1 @s2n_result_is_ok(i32 %66)
  %68 = load ptr, ptr %3, align 8
  %spec.select45 = select i1 %67, ptr %68, ptr null
  br label %.loopexit

.loopexit:                                        ; preds = %25, %64, %52, %59, %19, %._crit_edge.thread
  %.4 = phi ptr [ null, %._crit_edge.thread ], [ null, %19 ], [ null, %59 ], [ %spec.select, %52 ], [ %spec.select45, %64 ], [ null, %25 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %69

69:                                               ; preds = %1, %.loopexit, %11
  %.5 = phi ptr [ %.4, %.loopexit ], [ null, %11 ], [ null, %1 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #7
  ret ptr %.5
}

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_compute_weight_of_encrypt_decrypt_keys(ptr noundef, ptr noundef, i8 noundef zeroext, i64 noundef) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 }
attributes #8 = { nounwind willreturn memory(read) }

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 152}
!12 = !{!"s2n_config", !13, i64 0, !13, i64 0, !13, i64 0, !13, i64 0, !13, i64 0, !13, i64 0, !13, i64 0, !13, i64 0, !13, i64 1, !13, i64 1, !13, i64 1, !13, i64 1, !13, i64 1, !13, i64 1, !13, i64 1, !13, i64 1, !13, i64 2, !13, i64 2, !13, i64 2, !13, i64 2, !6, i64 8, !6, i64 16, !14, i64 24, !15, i64 56, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !13, i64 128, !13, i64 132, !6, i64 136, !10, i64 144, !6, i64 152, !10, i64 160, !10, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !13, i64 224, !7, i64 228, !13, i64 232, !13, i64 236, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !16, i64 304, !17, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !13, i64 392, !13, i64 396, !13, i64 400, !6, i64 408, !13, i64 416, !13, i64 420, !6, i64 424, !6, i64 432, !13, i64 440, !15, i64 448}
!13 = !{!"int", !7, i64 0}
!14 = !{!"certs_by_type", !7, i64 0}
!15 = !{!"s2n_blob", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!16 = !{!"s2n_x509_trust_store", !6, i64 0, !13, i64 8}
!17 = !{!"short", !7, i64 0}
!18 = !{!19, !6, i64 0}
!19 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!20 = !{!19, !6, i64 8}
!21 = !{!13, !13, i64 0}
!22 = !{!23, !10, i64 64}
!23 = !{!"s2n_ticket_key", !7, i64 0, !7, i64 16, !7, i64 48, !10, i64 64}
!24 = !{!12, !10, i64 160}
!25 = !{!7, !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass