; LLVM IR from aws/s2n-tls :: tests/fuzz (s2n_client_key_recv_fuzz_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_cipher_preferences = type { i16, ptr, i8 }
%struct.s2n_debug_info = type { ptr, ptr }

@cert_chain_pem = external dso_local global ptr, align 8
@private_key_pem = external dso_local global ptr, align 8
@dhparams_pem = external dso_local global ptr, align 8
@cert_chain_len = external dso_local global i32, align 4
@private_key_len = external dso_local global i32, align 4
@cipher_preferences_test_all = external constant %struct.s2n_cipher_preferences, align 8
@test_suites = external dso_local global ptr, align 8
@num_suites = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [112 x i8], align 1
@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.1 = external hidden unnamed_addr constant [112 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [112 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [26 x i8], align 1
@config = external dso_local global ptr, align 8
@chain_and_key = external dso_local global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [112 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [112 x i8], align 1
@cert = external dso_local global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [112 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_fuzz_init(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %6 = load ptr, ptr getelementptr inbounds (%struct.s2n_cipher_preferences, ptr @cipher_preferences_test_all, i32 0, i32 1), align 8, !tbaa !9
  store ptr %6, ptr @test_suites, align 8, !tbaa !5
  %7 = load i16, ptr @cipher_preferences_test_all, align 8, !tbaa !13
  %8 = zext i16 %7 to i32
  store i32 %8, ptr @num_suites, align 4, !tbaa !14
  %9 = call noalias ptr @malloc(i64 noundef 12000) #5
  store ptr %9, ptr @cert_chain_pem, align 8, !tbaa !5
  %10 = call noalias ptr @malloc(i64 noundef 12000) #5
  store ptr %10, ptr @private_key_pem, align 8, !tbaa !5
  %11 = call noalias ptr @malloc(i64 noundef 12000) #5
  store ptr %11, ptr @dhparams_pem, align 8, !tbaa !5
  br label %12

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

15:                                               ; preds = %12
  br label %16

16:                                               ; preds = %15
  br label %17

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

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

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

38:                                               ; preds = %33, %26
  %39 = phi ptr [ %32, %26 ], [ %37, %33 ]
  %40 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %41 = getelementptr inbounds %struct.s2n_debug_info, ptr %40, i32 0, i32 1
  store ptr %39, ptr %41, align 8, !tbaa !18
  %42 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %42, align 4, !tbaa !14
  %43 = call i32 @s2n_calculate_stacktrace()
  br label %44

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

45:                                               ; No predecessors!
  br label %46

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

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47
  %49 = load ptr, ptr @private_key_pem, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %82, label %51

51:                                               ; preds = %48
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  %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
  store ptr @.str.1, ptr %55, align 8, !tbaa !16
  %56 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %57 = getelementptr inbounds %struct.s2n_debug_info, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !16
  %59 = getelementptr inbounds i8, ptr %58, i64 21
  %60 = call ptr @strrchr(ptr noundef %59, i32 noundef 47) #6
  %61 = icmp ne ptr %60, null
  br i1 %61, label %62, label %69

62:                                               ; preds = %53
  %63 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %64 = getelementptr inbounds %struct.s2n_debug_info, ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !16
  %66 = getelementptr inbounds i8, ptr %65, i64 21
  %67 = call ptr @strrchr(ptr noundef %66, i32 noundef 47) #6
  %68 = getelementptr inbounds i8, ptr %67, i64 1
  br label %74

69:                                               ; preds = %53
  %70 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %71 = getelementptr inbounds %struct.s2n_debug_info, ptr %70, i32 0, i32 0
  %72 = load ptr, ptr %71, align 8, !tbaa !16
  %73 = getelementptr inbounds i8, ptr %72, i64 21
  br label %74

74:                                               ; preds = %69, %62
  %75 = phi ptr [ %68, %62 ], [ %73, %69 ]
  %76 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %77 = getelementptr inbounds %struct.s2n_debug_info, ptr %76, i32 0, i32 1
  store ptr %75, ptr %77, align 8, !tbaa !18
  %78 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %78, align 4, !tbaa !14
  %79 = call i32 @s2n_calculate_stacktrace()
  br label %80

80:                                               ; preds = %74
  store i32 -1, ptr %3, align 4
  br label %250

81:                                               ; No predecessors!
  br label %82

82:                                               ; preds = %81, %48
  br label %83

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83
  %85 = load ptr, ptr @dhparams_pem, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %118, label %87

87:                                               ; preds = %84
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88
  %90 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %91 = getelementptr inbounds %struct.s2n_debug_info, ptr %90, i32 0, i32 0
  store ptr @.str.2, ptr %91, align 8, !tbaa !16
  %92 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %93 = getelementptr inbounds %struct.s2n_debug_info, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !16
  %95 = getelementptr inbounds i8, ptr %94, i64 21
  %96 = call ptr @strrchr(ptr noundef %95, i32 noundef 47) #6
  %97 = icmp ne ptr %96, null
  br i1 %97, label %98, label %105

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

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

110:                                              ; preds = %105, %98
  %111 = phi ptr [ %104, %98 ], [ %109, %105 ]
  %112 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %113 = getelementptr inbounds %struct.s2n_debug_info, ptr %112, i32 0, i32 1
  store ptr %111, ptr %113, align 8, !tbaa !18
  %114 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %114, align 4, !tbaa !14
  %115 = call i32 @s2n_calculate_stacktrace()
  br label %116

116:                                              ; preds = %110
  store i32 -1, ptr %3, align 4
  br label %250

117:                                              ; No predecessors!
  br label %118

118:                                              ; preds = %117, %84
  br label %119

119:                                              ; preds = %118
  %120 = load ptr, ptr @cert_chain_pem, align 8, !tbaa !5
  %121 = call i32 @s2n_read_test_pem_and_len(ptr noundef @.str.3, ptr noundef %120, ptr noundef @cert_chain_len, i64 noundef 12000)
  %122 = load ptr, ptr @private_key_pem, align 8, !tbaa !5
  %123 = call i32 @s2n_read_test_pem_and_len(ptr noundef @.str.4, ptr noundef %122, ptr noundef @private_key_len, i64 noundef 12000)
  %124 = load ptr, ptr @dhparams_pem, align 8, !tbaa !5
  %125 = call i32 @s2n_read_test_pem(ptr noundef @.str.5, ptr noundef %124, i64 noundef 12000)
  %126 = call ptr @s2n_config_new()
  store ptr %126, ptr @config, align 8, !tbaa !5
  %127 = call ptr @s2n_cert_chain_and_key_new()
  store ptr %127, ptr @chain_and_key, align 8, !tbaa !5
  br label %128

128:                                              ; preds = %119
  %129 = load ptr, ptr @config, align 8, !tbaa !5
  %130 = icmp ne ptr %129, null
  br i1 %130, label %162, label %131

131:                                              ; preds = %128
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132
  %134 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %135 = getelementptr inbounds %struct.s2n_debug_info, ptr %134, i32 0, i32 0
  store ptr @.str.6, ptr %135, align 8, !tbaa !16
  %136 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %137 = getelementptr inbounds %struct.s2n_debug_info, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !16
  %139 = getelementptr inbounds i8, ptr %138, i64 21
  %140 = call ptr @strrchr(ptr noundef %139, i32 noundef 47) #6
  %141 = icmp ne ptr %140, null
  br i1 %141, label %142, label %149

142:                                              ; preds = %133
  %143 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %144 = getelementptr inbounds %struct.s2n_debug_info, ptr %143, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8, !tbaa !16
  %146 = getelementptr inbounds i8, ptr %145, i64 21
  %147 = call ptr @strrchr(ptr noundef %146, i32 noundef 47) #6
  %148 = getelementptr inbounds i8, ptr %147, i64 1
  br label %154

149:                                              ; preds = %133
  %150 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %151 = getelementptr inbounds %struct.s2n_debug_info, ptr %150, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8, !tbaa !16
  %153 = getelementptr inbounds i8, ptr %152, i64 21
  br label %154

154:                                              ; preds = %149, %142
  %155 = phi ptr [ %148, %142 ], [ %153, %149 ]
  %156 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %157 = getelementptr inbounds %struct.s2n_debug_info, ptr %156, i32 0, i32 1
  store ptr %155, ptr %157, align 8, !tbaa !18
  %158 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %158, align 4, !tbaa !14
  %159 = call i32 @s2n_calculate_stacktrace()
  br label %160

160:                                              ; preds = %154
  store i32 -1, ptr %3, align 4
  br label %250

161:                                              ; No predecessors!
  br label %162

162:                                              ; preds = %161, %128
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163
  %165 = load ptr, ptr @chain_and_key, align 8, !tbaa !5
  %166 = icmp ne ptr %165, null
  br i1 %166, label %198, label %167

167:                                              ; preds = %164
  br label %168

168:                                              ; preds = %167
  br label %169

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

178:                                              ; preds = %169
  %179 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %180 = getelementptr inbounds %struct.s2n_debug_info, ptr %179, i32 0, i32 0
  %181 = load ptr, ptr %180, align 8, !tbaa !16
  %182 = getelementptr inbounds i8, ptr %181, i64 21
  %183 = call ptr @strrchr(ptr noundef %182, i32 noundef 47) #6
  %184 = getelementptr inbounds i8, ptr %183, i64 1
  br label %190

185:                                              ; preds = %169
  %186 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %187 = getelementptr inbounds %struct.s2n_debug_info, ptr %186, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !16
  %189 = getelementptr inbounds i8, ptr %188, i64 21
  br label %190

190:                                              ; preds = %185, %178
  %191 = phi ptr [ %184, %178 ], [ %189, %185 ]
  %192 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %193 = getelementptr inbounds %struct.s2n_debug_info, ptr %192, i32 0, i32 1
  store ptr %191, ptr %193, align 8, !tbaa !18
  %194 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %194, align 4, !tbaa !14
  %195 = call i32 @s2n_calculate_stacktrace()
  br label %196

196:                                              ; preds = %190
  store i32 -1, ptr %3, align 4
  br label %250

197:                                              ; No predecessors!
  br label %198

198:                                              ; preds = %197, %164
  br label %199

199:                                              ; preds = %198
  %200 = load ptr, ptr @chain_and_key, align 8, !tbaa !5
  %201 = load ptr, ptr @cert_chain_pem, align 8, !tbaa !5
  %202 = load i32, ptr @cert_chain_len, align 4, !tbaa !14
  %203 = load ptr, ptr @private_key_pem, align 8, !tbaa !5
  %204 = load i32, ptr @private_key_len, align 4, !tbaa !14
  %205 = call i32 @s2n_cert_chain_and_key_load_pem_bytes(ptr noundef %200, ptr noundef %201, i32 noundef %202, ptr noundef %203, i32 noundef %204)
  %206 = load ptr, ptr @config, align 8, !tbaa !5
  %207 = load ptr, ptr @chain_and_key, align 8, !tbaa !5
  %208 = call i32 @s2n_config_add_cert_chain_and_key_to_store(ptr noundef %206, ptr noundef %207)
  %209 = load ptr, ptr @config, align 8, !tbaa !5
  %210 = load ptr, ptr @dhparams_pem, align 8, !tbaa !5
  %211 = call i32 @s2n_config_add_dhparams(ptr noundef %209, ptr noundef %210)
  %212 = load ptr, ptr @config, align 8, !tbaa !5
  %213 = call ptr @s2n_config_get_single_default_cert(ptr noundef %212)
  store ptr %213, ptr @cert, align 8, !tbaa !5
  br label %214

214:                                              ; preds = %199
  %215 = load ptr, ptr @cert, align 8, !tbaa !5
  %216 = icmp ne ptr %215, null
  br i1 %216, label %248, label %217

217:                                              ; preds = %214
  br label %218

218:                                              ; preds = %217
  br label %219

219:                                              ; preds = %218
  %220 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %221 = getelementptr inbounds %struct.s2n_debug_info, ptr %220, i32 0, i32 0
  store ptr @.str.8, ptr %221, align 8, !tbaa !16
  %222 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %223 = getelementptr inbounds %struct.s2n_debug_info, ptr %222, i32 0, i32 0
  %224 = load ptr, ptr %223, align 8, !tbaa !16
  %225 = getelementptr inbounds i8, ptr %224, i64 21
  %226 = call ptr @strrchr(ptr noundef %225, i32 noundef 47) #6
  %227 = icmp ne ptr %226, null
  br i1 %227, label %228, label %235

228:                                              ; preds = %219
  %229 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %230 = getelementptr inbounds %struct.s2n_debug_info, ptr %229, i32 0, i32 0
  %231 = load ptr, ptr %230, align 8, !tbaa !16
  %232 = getelementptr inbounds i8, ptr %231, i64 21
  %233 = call ptr @strrchr(ptr noundef %232, i32 noundef 47) #6
  %234 = getelementptr inbounds i8, ptr %233, i64 1
  br label %240

235:                                              ; preds = %219
  %236 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %237 = getelementptr inbounds %struct.s2n_debug_info, ptr %236, i32 0, i32 0
  %238 = load ptr, ptr %237, align 8, !tbaa !16
  %239 = getelementptr inbounds i8, ptr %238, i64 21
  br label %240

240:                                              ; preds = %235, %228
  %241 = phi ptr [ %234, %228 ], [ %239, %235 ]
  %242 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %243 = getelementptr inbounds %struct.s2n_debug_info, ptr %242, i32 0, i32 1
  store ptr %241, ptr %243, align 8, !tbaa !18
  %244 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %244, align 4, !tbaa !14
  %245 = call i32 @s2n_calculate_stacktrace()
  br label %246

246:                                              ; preds = %240
  store i32 -1, ptr %3, align 4
  br label %250

247:                                              ; No predecessors!
  br label %248

248:                                              ; preds = %247, %214
  br label %249

249:                                              ; preds = %248
  store i32 0, ptr %3, align 4
  br label %250

250:                                              ; preds = %249, %246, %196, %160, %116, %80, %44
  %251 = load i32, ptr %3, align 4
  ret i32 %251
}

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #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

declare i32 @s2n_read_test_pem_and_len(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #4

declare i32 @s2n_read_test_pem(ptr noundef, ptr noundef, i64 noundef) #4

declare ptr @s2n_config_new() #4

declare ptr @s2n_cert_chain_and_key_new() #4

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

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

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

declare ptr @s2n_config_get_single_default_cert(ptr noundef) #4

attributes #0 = { 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 #1 = { nounwind allocsize(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 #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 = { nounwind allocsize(0) }
attributes #6 = { 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, !6, i64 8}
!10 = !{!"s2n_cipher_preferences", !11, i64 0, !6, i64 8, !12, i64 16}
!11 = !{!"short", !7, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!10, !11, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !6, i64 0}
!17 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!18 = !{!17, !6, i64 8}


; 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_cipher_preferences = type { i16, ptr, i8 }
%struct.s2n_debug_info = type { ptr, ptr }

@cert_chain_pem = external dso_local local_unnamed_addr global ptr, align 8
@private_key_pem = external dso_local local_unnamed_addr global ptr, align 8
@dhparams_pem = external dso_local local_unnamed_addr global ptr, align 8
@cert_chain_len = external dso_local global i32, align 4
@private_key_len = external dso_local global i32, align 4
@cipher_preferences_test_all = external local_unnamed_addr constant %struct.s2n_cipher_preferences, align 8
@test_suites = external dso_local local_unnamed_addr global ptr, align 8
@num_suites = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [112 x i8], align 1
@_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.1 = external hidden unnamed_addr constant [112 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [112 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [26 x i8], align 1
@config = external dso_local local_unnamed_addr global ptr, align 8
@chain_and_key = external dso_local local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [112 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [112 x i8], align 1
@cert = external dso_local local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [112 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_fuzz_init(ptr nocapture noundef readnone %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = load ptr, ptr getelementptr inbounds (i8, ptr @cipher_preferences_test_all, i64 8), align 8, !tbaa !5
  store ptr %3, ptr @test_suites, align 8, !tbaa !12
  %4 = load i16, ptr @cipher_preferences_test_all, align 8, !tbaa !13
  %5 = zext i16 %4 to i32
  store i32 %5, ptr @num_suites, align 4, !tbaa !14
  %6 = tail call noalias dereferenceable_or_null(12000) ptr @malloc(i64 noundef 12000) #5
  store ptr %6, ptr @cert_chain_pem, align 8, !tbaa !12
  %7 = tail call noalias dereferenceable_or_null(12000) ptr @malloc(i64 noundef 12000) #5
  store ptr %7, ptr @private_key_pem, align 8, !tbaa !12
  %8 = tail call noalias dereferenceable_or_null(12000) ptr @malloc(i64 noundef 12000) #5
  store ptr %8, ptr @dhparams_pem, align 8, !tbaa !12
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %.sink.split, label %9

9:                                                ; preds = %2
  %.not10 = icmp eq ptr %7, null
  br i1 %.not10, label %.sink.split, label %10

10:                                               ; preds = %9
  %.not12 = icmp eq ptr %8, null
  br i1 %.not12, label %.sink.split, label %11

11:                                               ; preds = %10
  %12 = tail call i32 @s2n_read_test_pem_and_len(ptr noundef nonnull @.str.3, ptr noundef nonnull %6, ptr noundef nonnull @cert_chain_len, i64 noundef 12000) #6
  %13 = load ptr, ptr @private_key_pem, align 8, !tbaa !12
  %14 = tail call i32 @s2n_read_test_pem_and_len(ptr noundef nonnull @.str.4, ptr noundef %13, ptr noundef nonnull @private_key_len, i64 noundef 12000) #6
  %15 = load ptr, ptr @dhparams_pem, align 8, !tbaa !12
  %16 = tail call i32 @s2n_read_test_pem(ptr noundef nonnull @.str.5, ptr noundef %15, i64 noundef 12000) #6
  %17 = tail call ptr @s2n_config_new() #6
  store ptr %17, ptr @config, align 8, !tbaa !12
  %18 = tail call ptr @s2n_cert_chain_and_key_new() #6
  store ptr %18, ptr @chain_and_key, align 8, !tbaa !12
  %19 = load ptr, ptr @config, align 8, !tbaa !12
  %.not14 = icmp eq ptr %19, null
  br i1 %.not14, label %.sink.split, label %20

20:                                               ; preds = %11
  %.not16 = icmp eq ptr %18, null
  br i1 %.not16, label %.sink.split, label %21

21:                                               ; preds = %20
  %22 = load ptr, ptr @cert_chain_pem, align 8, !tbaa !12
  %23 = load i32, ptr @cert_chain_len, align 4, !tbaa !14
  %24 = load ptr, ptr @private_key_pem, align 8, !tbaa !12
  %25 = load i32, ptr @private_key_len, align 4, !tbaa !14
  %26 = tail call i32 @s2n_cert_chain_and_key_load_pem_bytes(ptr noundef nonnull %18, ptr noundef %22, i32 noundef %23, ptr noundef %24, i32 noundef %25) #6
  %27 = load ptr, ptr @config, align 8, !tbaa !12
  %28 = load ptr, ptr @chain_and_key, align 8, !tbaa !12
  %29 = tail call i32 @s2n_config_add_cert_chain_and_key_to_store(ptr noundef %27, ptr noundef %28) #6
  %30 = load ptr, ptr @config, align 8, !tbaa !12
  %31 = load ptr, ptr @dhparams_pem, align 8, !tbaa !12
  %32 = tail call i32 @s2n_config_add_dhparams(ptr noundef %30, ptr noundef %31) #6
  %33 = load ptr, ptr @config, align 8, !tbaa !12
  %34 = tail call ptr @s2n_config_get_single_default_cert(ptr noundef %33) #6
  store ptr %34, ptr @cert, align 8, !tbaa !12
  %.not18 = icmp eq ptr %34, null
  br i1 %.not18, label %.sink.split, label %42

.sink.split:                                      ; preds = %21, %20, %11, %10, %9, %2
  %.str.8.sink = phi ptr [ @.str, %2 ], [ @.str.1, %9 ], [ @.str.2, %10 ], [ @.str.6, %11 ], [ @.str.7, %20 ], [ @.str.8, %21 ]
  %.sink25 = phi ptr [ getelementptr inbounds (i8, ptr @.str, i64 21), %2 ], [ getelementptr inbounds (i8, ptr @.str.1, i64 21), %9 ], [ getelementptr inbounds (i8, ptr @.str.2, i64 21), %10 ], [ getelementptr inbounds (i8, ptr @.str.6, i64 21), %11 ], [ getelementptr inbounds (i8, ptr @.str.7, i64 21), %20 ], [ getelementptr inbounds (i8, ptr @.str.8, i64 21), %21 ]
  %35 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.8.sink, ptr %35, align 8, !tbaa !16
  %36 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink25, i32 noundef 47) #7
  %.not19 = icmp eq ptr %36, null
  %37 = getelementptr inbounds i8, ptr %36, i64 1
  %38 = select i1 %.not19, ptr %.sink25, ptr %37
  %39 = getelementptr inbounds i8, ptr %35, i64 8
  store ptr %38, ptr %39, align 8, !tbaa !18
  %40 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %40, align 4, !tbaa !14
  %41 = tail call i32 @s2n_calculate_stacktrace() #6
  br label %42

42:                                               ; preds = %.sink.split, %21
  %.0 = phi i32 [ 0, %21 ], [ -1, %.sink.split ]
  ret i32 %.0
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #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

declare i32 @s2n_read_test_pem_and_len(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

declare i32 @s2n_read_test_pem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

declare ptr @s2n_config_new() local_unnamed_addr #4

declare ptr @s2n_cert_chain_and_key_new() local_unnamed_addr #4

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

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

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

declare ptr @s2n_config_get_single_default_cert(ptr noundef) local_unnamed_addr #4

attributes #0 = { 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 #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 = { nounwind allocsize(0) }
attributes #6 = { nounwind }
attributes #7 = { 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, !10, i64 8}
!6 = !{!"s2n_cipher_preferences", !7, i64 0, !10, i64 8, !11, i64 16}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_Bool", !8, i64 0}
!12 = !{!10, !10, i64 0}
!13 = !{!6, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !8, i64 0}
!16 = !{!17, !10, i64 0}
!17 = !{!"s2n_debug_info", !10, i64 0, !10, i64 8}
!18 = !{!17, !10, i64 8}


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