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

; 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_connection = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, [22 x i8], [22 x i8], [22 x i8], i32, i32, %struct.s2n_timer, i64, i64, [32 x i8], i8, i8, i8, i8, i8, i8, i8, ptr, ptr, %struct.s2n_secrets, ptr, ptr, %struct.s2n_kex_parameters, %struct.s2n_handshake_parameters, %struct.s2n_psk_parameters, ptr, i8, i32, [5 x i8], %struct.s2n_stuffer, %struct.s2n_stuffer, %struct.s2n_stuffer, %struct.s2n_stuffer, i32, i64, [2 x i8], %struct.s2n_stuffer, i8, i8, i8, i8, %struct.s2n_atomic_flag, %struct.s2n_atomic_flag, %struct.s2n_handshake, i16, i32, i16, i64, i8, i64, i64, i64, %struct.s2n_atomic_flag, %struct.s2n_atomic_flag, [256 x i8], [256 x i8], i32, %struct.s2n_blob, i32, %struct.s2n_blob, %struct.s2n_blob, %struct.s2n_blob, %struct.s2n_client_hello, %struct.s2n_x509_validator, ptr, ptr, i8, i32, %struct.s2n_blob, i32, %struct.s2n_ticket_fields, [138 x i8], %struct.s2n_stuffer, %struct.s2n_blob, %struct.s2n_blob, i8, i8, i8, i16, i16, i32, i32, %struct.s2n_blob, i32, %struct.s2n_post_handshake, %struct.s2n_atomic_flag, i8, i8 }
%struct.s2n_timer = type { i64 }
%struct.s2n_secrets = type { %union.anon, i32 }
%union.anon = type { %struct.s2n_tls13_secrets }
%struct.s2n_tls13_secrets = type { [48 x i8], [48 x i8], [48 x i8], [48 x i8], [48 x i8], [48 x i8], [48 x i8], [48 x i8], i32 }
%struct.s2n_kex_parameters = type { %struct.s2n_dh_params, %struct.s2n_ecc_evp_params, [4 x ptr], %struct.s2n_ecc_evp_params, %struct.s2n_kem_group_params, %struct.s2n_kem_group_params, [8 x ptr], %struct.s2n_kem_params, %struct.s2n_blob, %struct.s2n_blob }
%struct.s2n_dh_params = type { ptr }
%struct.s2n_ecc_evp_params = type { ptr, ptr }
%struct.s2n_kem_group_params = type { ptr, %struct.s2n_kem_params, %struct.s2n_ecc_evp_params }
%struct.s2n_kem_params = type { ptr, %struct.s2n_blob, %struct.s2n_blob, %struct.s2n_blob, i8 }
%struct.s2n_handshake_parameters = type { %struct.s2n_pkey, %struct.s2n_pkey, %struct.s2n_blob, i32, %struct.s2n_sig_scheme_list, ptr, ptr, ptr, [4 x ptr], [4 x ptr], i8, i8, [32 x i8], [32 x i8] }
%struct.s2n_pkey = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.s2n_sig_scheme_list = type { [128 x i16], i8 }
%struct.s2n_psk_parameters = type { i32, %struct.s2n_array, i16, i16, ptr, i32 }
%struct.s2n_array = type { %struct.s2n_blob, i32, i32 }
%struct.s2n_handshake = type { %struct.s2n_stuffer, ptr, [8 x i8], [48 x i8], [48 x i8], i8, i32, i32, i32, i32, %struct.s2n_offered_early_data, i8, i32 }
%struct.s2n_offered_early_data = type { ptr }
%struct.s2n_client_hello = type { %struct.s2n_blob, %struct.s2n_parsed_extensions_list, %struct.s2n_blob, %struct.s2n_blob, %struct.s2n_blob, i8, i8, i8 }
%struct.s2n_parsed_extensions_list = type { [21 x %struct.s2n_parsed_extension], %struct.s2n_blob, i16 }
%struct.s2n_parsed_extension = type { %struct.s2n_blob, i16, i16, i8 }
%struct.s2n_x509_validator = type { ptr, ptr, i8, i8, i16, ptr, i32, ptr, %struct.s2n_cert_validation_info, i8 }
%struct.s2n_cert_validation_info = type { i8, [3 x i8] }
%struct.s2n_ticket_fields = type { %struct.s2n_blob, i32 }
%struct.s2n_stuffer = type { %struct.s2n_blob, i32, i32, i32, i8 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }
%struct.s2n_post_handshake = type { %struct.s2n_stuffer, [4 x i8] }
%struct.s2n_atomic_flag = type { i32 }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.4 = external hidden unnamed_addr constant [85 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_recv_in_init(ptr noundef, i32 noundef, i32 noundef) #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.start.p0(i64 immarg, ptr nocapture) #4

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_read_full_record(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.s2n_result, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i16, align 2
  %14 = alloca ptr, align 8
  %15 = alloca %struct.s2n_result, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %struct.s2n_result, align 4
  %18 = alloca i32, align 4
  %19 = alloca %struct.s2n_result, align 4
  %20 = alloca i32, align 4
  %21 = alloca %struct.s2n_result, align 4
  %22 = alloca ptr, align 8
  %23 = alloca %struct.s2n_result, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %24, align 4, !tbaa !9
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = load i32, ptr %25, align 8
  %27 = lshr i32 %26, 19
  %28 = and i32 %27, 1
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %34

30:                                               ; preds = %3
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = call i32 @s2n_ktls_read_full_record(ptr noundef %31, ptr noundef %32)
  store i32 %33, ptr %4, align 4
  br label %362

34:                                               ; preds = %3
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.s2n_connection, ptr %35, i32 0, i32 42
  %37 = load i32, ptr %36, align 8, !tbaa !11
  %38 = icmp eq i32 %37, 1
  br i1 %38, label %39, label %41

39:                                               ; preds = %34
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  store i8 23, ptr %40, align 1, !tbaa !39
  store i32 0, ptr %4, align 4
  br label %362

41:                                               ; preds = %34
  br label %42

42:                                               ; preds = %41
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.s2n_connection, ptr %43, i32 0, i32 38
  %45 = call i32 @s2n_stuffer_reread(ptr noundef %44)
  %46 = icmp sgt i32 %45, -1
  br i1 %46, label %48, label %47

47:                                               ; preds = %42
  store i32 -1, ptr %4, align 4
  br label %362

48:                                               ; preds = %42
  br label %49

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.s2n_connection, ptr %50, i32 0, i32 38
  %52 = getelementptr inbounds %struct.s2n_stuffer, ptr %51, i32 0, i32 2
  %53 = load i32, ptr %52, align 4, !tbaa !40
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.s2n_connection, ptr %54, i32 0, i32 38
  %56 = getelementptr inbounds %struct.s2n_stuffer, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 8, !tbaa !41
  %58 = sub i32 %53, %57
  store i32 %58, ptr %8, align 4, !tbaa !9
  %59 = load i32, ptr %8, align 4, !tbaa !9
  %60 = icmp ult i32 %59, 5
  br i1 %60, label %61, label %117

61:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %62 = load i32, ptr %8, align 4, !tbaa !9
  %63 = sub i32 5, %62
  store i32 %63, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = load i32, ptr %9, align 4, !tbaa !9
  %66 = zext i32 %65 to i64
  %67 = call i32 @s2n_recv_buffer_in(ptr noundef %64, i64 noundef %66)
  %68 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  store i32 %67, ptr %68, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.s2n_connection, ptr %70, i32 0, i32 39
  %72 = getelementptr inbounds %struct.s2n_stuffer, ptr %71, i32 0, i32 2
  %73 = load i32, ptr %72, align 4, !tbaa !42
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.s2n_connection, ptr %74, i32 0, i32 39
  %76 = getelementptr inbounds %struct.s2n_stuffer, ptr %75, i32 0, i32 1
  %77 = load i32, ptr %76, align 8, !tbaa !43
  %78 = sub i32 %73, %77
  %79 = icmp ult i32 %69, %78
  br i1 %79, label %80, label %82

80:                                               ; preds = %61
  %81 = load i32, ptr %9, align 4, !tbaa !9
  br label %92

82:                                               ; preds = %61
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.s2n_connection, ptr %83, i32 0, i32 39
  %85 = getelementptr inbounds %struct.s2n_stuffer, ptr %84, i32 0, i32 2
  %86 = load i32, ptr %85, align 4, !tbaa !42
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.s2n_connection, ptr %87, i32 0, i32 39
  %89 = getelementptr inbounds %struct.s2n_stuffer, ptr %88, i32 0, i32 1
  %90 = load i32, ptr %89, align 8, !tbaa !43
  %91 = sub i32 %86, %90
  br label %92

92:                                               ; preds = %82, %80
  %93 = phi i32 [ %81, %80 ], [ %91, %82 ]
  store i32 %93, ptr %11, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %92
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.s2n_connection, ptr %95, i32 0, i32 39
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.s2n_connection, ptr %97, i32 0, i32 38
  %99 = load i32, ptr %11, align 4, !tbaa !9
  %100 = call i32 @s2n_stuffer_copy(ptr noundef %96, ptr noundef %98, i32 noundef %99)
  %101 = icmp sgt i32 %100, -1
  br i1 %101, label %103, label %102

102:                                              ; preds = %94
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %114

103:                                              ; preds = %94
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105
  %107 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  %108 = load i32, ptr %107, align 4
  %109 = call zeroext i1 @s2n_result_is_ok(i32 %108)
  br i1 %109, label %111, label %110

110:                                              ; preds = %106
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %114

111:                                              ; preds = %106
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112
  store i32 0, ptr %12, align 4
  br label %114

114:                                              ; preds = %113, %110, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %115 = load i32, ptr %12, align 4
  switch i32 %115, label %361 [
    i32 0, label %116
  ]

116:                                              ; preds = %114
  br label %117

117:                                              ; preds = %116, %49
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #6
  store i16 0, ptr %13, align 2, !tbaa !44
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.s2n_connection, ptr %118, i32 0, i32 38
  %120 = getelementptr inbounds %struct.s2n_stuffer, ptr %119, i32 0, i32 0
  %121 = getelementptr inbounds %struct.s2n_blob, ptr %120, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !45
  %123 = getelementptr inbounds i8, ptr %122, i64 0
  %124 = load i8, ptr %123, align 1, !tbaa !39
  %125 = zext i8 %124 to i32
  %126 = and i32 %125, 128
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %154

128:                                              ; preds = %117
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 1, ptr %129, align 4, !tbaa !9
  br label %130

130:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %131, ptr %14, align 8, !tbaa !5
  br label %132

132:                                              ; preds = %130
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.s2n_connection, ptr %135, i32 0, i32 21
  %137 = call i32 @s2n_sslv2_record_header_parse(ptr noundef %133, ptr noundef %134, ptr noundef %136, ptr noundef %13)
  %138 = icmp sgt i32 %137, -1
  br i1 %138, label %140, label %139

139:                                              ; preds = %132
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %147

140:                                              ; preds = %132
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141
  %143 = load ptr, ptr %14, align 8, !tbaa !5
  %144 = icmp ne ptr %143, null
  br i1 %144, label %145, label %146

145:                                              ; preds = %142
  store ptr null, ptr %14, align 8, !tbaa !5
  br label %146

146:                                              ; preds = %145, %142
  store i32 0, ptr %12, align 4
  br label %147

147:                                              ; preds = %146, %139
  %148 = call i32 @s2n_connection_apply_error_blinding(ptr noundef %14)
  %149 = getelementptr inbounds %struct.s2n_result, ptr %15, i32 0, i32 0
  store i32 %148, ptr %149, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %150 = load i32, ptr %12, align 4
  switch i32 %150, label %360 [
    i32 0, label %151
  ]

151:                                              ; preds = %147
  br label %152

152:                                              ; preds = %151
  br label %153

153:                                              ; preds = %152
  br label %177

154:                                              ; preds = %117
  br label %155

155:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %156, ptr %16, align 8, !tbaa !5
  br label %157

157:                                              ; preds = %155
  %158 = load ptr, ptr %5, align 8, !tbaa !5
  %159 = load ptr, ptr %6, align 8, !tbaa !5
  %160 = call i32 @s2n_record_header_parse(ptr noundef %158, ptr noundef %159, ptr noundef %13)
  %161 = icmp sgt i32 %160, -1
  br i1 %161, label %163, label %162

162:                                              ; preds = %157
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %170

163:                                              ; preds = %157
  br label %164

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164
  %166 = load ptr, ptr %16, align 8, !tbaa !5
  %167 = icmp ne ptr %166, null
  br i1 %167, label %168, label %169

168:                                              ; preds = %165
  store ptr null, ptr %16, align 8, !tbaa !5
  br label %169

169:                                              ; preds = %168, %165
  store i32 0, ptr %12, align 4
  br label %170

170:                                              ; preds = %169, %162
  %171 = call i32 @s2n_connection_apply_error_blinding(ptr noundef %16)
  %172 = getelementptr inbounds %struct.s2n_result, ptr %17, i32 0, i32 0
  store i32 %171, ptr %172, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  %173 = load i32, ptr %12, align 4
  switch i32 %173, label %360 [
    i32 0, label %174
  ]

174:                                              ; preds = %170
  br label %175

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175
  br label %177

177:                                              ; preds = %176, %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.s2n_connection, ptr %178, i32 0, i32 40
  %180 = getelementptr inbounds %struct.s2n_stuffer, ptr %179, i32 0, i32 2
  %181 = load i32, ptr %180, align 4, !tbaa !46
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.s2n_connection, ptr %182, i32 0, i32 40
  %184 = getelementptr inbounds %struct.s2n_stuffer, ptr %183, i32 0, i32 1
  %185 = load i32, ptr %184, align 8, !tbaa !47
  %186 = sub i32 %181, %185
  store i32 %186, ptr %18, align 4, !tbaa !9
  %187 = load i32, ptr %18, align 4, !tbaa !9
  %188 = load i16, ptr %13, align 2, !tbaa !44
  %189 = zext i16 %188 to i32
  %190 = icmp ult i32 %187, %189
  br i1 %190, label %195, label %191

191:                                              ; preds = %177
  %192 = load i16, ptr %13, align 2, !tbaa !44
  %193 = zext i16 %192 to i32
  %194 = icmp eq i32 %193, 0
  br i1 %194, label %195, label %263

195:                                              ; preds = %191, %177
  br label %196

196:                                              ; preds = %195
  %197 = load ptr, ptr %5, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.s2n_connection, ptr %197, i32 0, i32 39
  %199 = load i32, ptr %18, align 4, !tbaa !9
  %200 = call i32 @s2n_stuffer_rewind_read(ptr noundef %198, i32 noundef %199)
  %201 = icmp sgt i32 %200, -1
  br i1 %201, label %203, label %202

202:                                              ; preds = %196
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %359

203:                                              ; preds = %196
  br label %204

204:                                              ; preds = %203
  br label %205

205:                                              ; preds = %204
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %206 = load ptr, ptr %5, align 8, !tbaa !5
  %207 = load i16, ptr %13, align 2, !tbaa !44
  %208 = zext i16 %207 to i64
  %209 = call i32 @s2n_recv_buffer_in(ptr noundef %206, i64 noundef %208)
  %210 = getelementptr inbounds %struct.s2n_result, ptr %19, i32 0, i32 0
  store i32 %209, ptr %210, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %211 = load i16, ptr %13, align 2, !tbaa !44
  %212 = zext i16 %211 to i32
  %213 = load ptr, ptr %5, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.s2n_connection, ptr %213, i32 0, i32 39
  %215 = getelementptr inbounds %struct.s2n_stuffer, ptr %214, i32 0, i32 2
  %216 = load i32, ptr %215, align 4, !tbaa !42
  %217 = load ptr, ptr %5, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.s2n_connection, ptr %217, i32 0, i32 39
  %219 = getelementptr inbounds %struct.s2n_stuffer, ptr %218, i32 0, i32 1
  %220 = load i32, ptr %219, align 8, !tbaa !43
  %221 = sub i32 %216, %220
  %222 = icmp ult i32 %212, %221
  br i1 %222, label %223, label %226

223:                                              ; preds = %205
  %224 = load i16, ptr %13, align 2, !tbaa !44
  %225 = zext i16 %224 to i32
  br label %236

226:                                              ; preds = %205
  %227 = load ptr, ptr %5, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.s2n_connection, ptr %227, i32 0, i32 39
  %229 = getelementptr inbounds %struct.s2n_stuffer, ptr %228, i32 0, i32 2
  %230 = load i32, ptr %229, align 4, !tbaa !42
  %231 = load ptr, ptr %5, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.s2n_connection, ptr %231, i32 0, i32 39
  %233 = getelementptr inbounds %struct.s2n_stuffer, ptr %232, i32 0, i32 1
  %234 = load i32, ptr %233, align 8, !tbaa !43
  %235 = sub i32 %230, %234
  br label %236

236:                                              ; preds = %226, %223
  %237 = phi i32 [ %225, %223 ], [ %235, %226 ]
  store i32 %237, ptr %20, align 4, !tbaa !9
  br label %238

238:                                              ; preds = %236
  %239 = load ptr, ptr %5, align 8, !tbaa !5
  %240 = load i32, ptr %20, align 4, !tbaa !9
  %241 = load i16, ptr %13, align 2, !tbaa !44
  %242 = zext i16 %241 to i32
  %243 = call i32 @s2n_recv_in_init(ptr noundef %239, i32 noundef %240, i32 noundef %242)
  %244 = getelementptr inbounds %struct.s2n_result, ptr %21, i32 0, i32 0
  store i32 %243, ptr %244, align 4
  %245 = getelementptr inbounds %struct.s2n_result, ptr %21, i32 0, i32 0
  %246 = load i32, ptr %245, align 4
  %247 = call zeroext i1 @s2n_result_is_ok(i32 %246)
  br i1 %247, label %249, label %248

248:                                              ; preds = %238
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %260

249:                                              ; preds = %238
  br label %250

250:                                              ; preds = %249
  br label %251

251:                                              ; preds = %250
  br label %252

252:                                              ; preds = %251
  %253 = getelementptr inbounds %struct.s2n_result, ptr %19, i32 0, i32 0
  %254 = load i32, ptr %253, align 4
  %255 = call zeroext i1 @s2n_result_is_ok(i32 %254)
  br i1 %255, label %257, label %256

256:                                              ; preds = %252
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %260

257:                                              ; preds = %252
  br label %258

258:                                              ; preds = %257
  br label %259

259:                                              ; preds = %258
  store i32 0, ptr %12, align 4
  br label %260

260:                                              ; preds = %259, %256, %248
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %261 = load i32, ptr %12, align 4
  switch i32 %261, label %359 [
    i32 0, label %262
  ]

262:                                              ; preds = %260
  br label %263

263:                                              ; preds = %262, %191
  %264 = load ptr, ptr %7, align 8, !tbaa !5
  %265 = load i32, ptr %264, align 4, !tbaa !9
  %266 = icmp ne i32 %265, 0
  br i1 %266, label %267, label %268

267:                                              ; preds = %263
  store i32 0, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %359

268:                                              ; preds = %263
  %269 = load ptr, ptr %5, align 8, !tbaa !5
  %270 = load ptr, ptr %6, align 8, !tbaa !5
  %271 = load i8, ptr %270, align 1, !tbaa !39
  %272 = call zeroext i1 @s2n_early_data_is_trial_decryption_allowed(ptr noundef %269, i8 noundef zeroext %271)
  br i1 %272, label %273, label %314

273:                                              ; preds = %268
  br label %274

274:                                              ; preds = %273
  %275 = load ptr, ptr %5, align 8, !tbaa !5
  %276 = call i32 @s2n_record_parse(ptr noundef %275)
  %277 = icmp sge i32 %276, 0
  br i1 %277, label %311, label %278

278:                                              ; preds = %274
  br label %279

279:                                              ; preds = %278
  br label %280

280:                                              ; preds = %279
  %281 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %282 = getelementptr inbounds %struct.s2n_debug_info, ptr %281, i32 0, i32 0
  store ptr @.str.4, ptr %282, align 8, !tbaa !48
  %283 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %284 = getelementptr inbounds %struct.s2n_debug_info, ptr %283, i32 0, i32 0
  %285 = load ptr, ptr %284, align 8, !tbaa !48
  %286 = getelementptr inbounds i8, ptr %285, i64 21
  %287 = call ptr @strrchr(ptr noundef %286, i32 noundef 47) #7
  %288 = icmp ne ptr %287, null
  br i1 %288, label %289, label %296

289:                                              ; preds = %280
  %290 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %291 = getelementptr inbounds %struct.s2n_debug_info, ptr %290, i32 0, i32 0
  %292 = load ptr, ptr %291, align 8, !tbaa !48
  %293 = getelementptr inbounds i8, ptr %292, i64 21
  %294 = call ptr @strrchr(ptr noundef %293, i32 noundef 47) #7
  %295 = getelementptr inbounds i8, ptr %294, i64 1
  br label %301

296:                                              ; preds = %280
  %297 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %298 = getelementptr inbounds %struct.s2n_debug_info, ptr %297, i32 0, i32 0
  %299 = load ptr, ptr %298, align 8, !tbaa !48
  %300 = getelementptr inbounds i8, ptr %299, i64 21
  br label %301

301:                                              ; preds = %296, %289
  %302 = phi ptr [ %295, %289 ], [ %300, %296 ]
  %303 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %304 = getelementptr inbounds %struct.s2n_debug_info, ptr %303, i32 0, i32 1
  store ptr %302, ptr %304, align 8, !tbaa !50
  %305 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544397, ptr %305, align 4, !tbaa !9
  %306 = call i32 @s2n_calculate_stacktrace()
  br label %307

307:                                              ; preds = %301
  br label %308

308:                                              ; preds = %307
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %359

309:                                              ; No predecessors!
  br label %310

310:                                              ; preds = %309
  br label %311

311:                                              ; preds = %310, %274
  br label %312

312:                                              ; preds = %311
  br label %313

313:                                              ; preds = %312
  br label %336

314:                                              ; preds = %268
  br label %315

315:                                              ; preds = %314
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %316 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %316, ptr %22, align 8, !tbaa !5
  br label %317

317:                                              ; preds = %315
  %318 = load ptr, ptr %5, align 8, !tbaa !5
  %319 = call i32 @s2n_record_parse(ptr noundef %318)
  %320 = icmp sgt i32 %319, -1
  br i1 %320, label %322, label %321

321:                                              ; preds = %317
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %329

322:                                              ; preds = %317
  br label %323

323:                                              ; preds = %322
  br label %324

324:                                              ; preds = %323
  %325 = load ptr, ptr %22, align 8, !tbaa !5
  %326 = icmp ne ptr %325, null
  br i1 %326, label %327, label %328

327:                                              ; preds = %324
  store ptr null, ptr %22, align 8, !tbaa !5
  br label %328

328:                                              ; preds = %327, %324
  store i32 0, ptr %12, align 4
  br label %329

329:                                              ; preds = %328, %321
  %330 = call i32 @s2n_connection_apply_error_blinding(ptr noundef %22)
  %331 = getelementptr inbounds %struct.s2n_result, ptr %23, i32 0, i32 0
  store i32 %330, ptr %331, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  %332 = load i32, ptr %12, align 4
  switch i32 %332, label %359 [
    i32 0, label %333
  ]

333:                                              ; preds = %329
  br label %334

334:                                              ; preds = %333
  br label %335

335:                                              ; preds = %334
  br label %336

336:                                              ; preds = %335, %313
  %337 = load ptr, ptr %5, align 8, !tbaa !5
  %338 = getelementptr inbounds %struct.s2n_connection, ptr %337, i32 0, i32 23
  %339 = load i8, ptr %338, align 4, !tbaa !51
  %340 = zext i8 %339 to i32
  %341 = icmp eq i32 %340, 34
  br i1 %341, label %342, label %358

342:                                              ; preds = %336
  %343 = load ptr, ptr %6, align 8, !tbaa !5
  %344 = load i8, ptr %343, align 1, !tbaa !39
  %345 = zext i8 %344 to i32
  %346 = icmp eq i32 %345, 23
  br i1 %346, label %347, label %358

347:                                              ; preds = %342
  br label %348

348:                                              ; preds = %347
  %349 = load ptr, ptr %5, align 8, !tbaa !5
  %350 = getelementptr inbounds %struct.s2n_connection, ptr %349, i32 0, i32 40
  %351 = load ptr, ptr %6, align 8, !tbaa !5
  %352 = call i32 @s2n_tls13_parse_record_type(ptr noundef %350, ptr noundef %351)
  %353 = icmp sgt i32 %352, -1
  br i1 %353, label %355, label %354

354:                                              ; preds = %348
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %359

355:                                              ; preds = %348
  br label %356

356:                                              ; preds = %355
  br label %357

357:                                              ; preds = %356
  br label %358

358:                                              ; preds = %357, %342, %336
  store i32 0, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %359

359:                                              ; preds = %358, %354, %329, %308, %267, %260, %202
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %360

360:                                              ; preds = %359, %170, %147
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #6
  br label %361

361:                                              ; preds = %360, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %362

362:                                              ; preds = %361, %47, %39, %30
  %363 = load i32, ptr %4, align 4
  ret i32 %363
}

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

declare i32 @s2n_stuffer_reread(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_recv_buffer_in(ptr noundef, i64 noundef) #0

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

declare i32 @s2n_connection_apply_error_blinding(ptr noundef) #3

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

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

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

declare zeroext i1 @s2n_early_data_is_trial_decryption_allowed(ptr noundef, i8 noundef zeroext) #3

declare i32 @s2n_record_parse(ptr noundef) #3

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

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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
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, !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, !10, i64 1936}
!12 = !{!"s2n_connection", !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 2, !10, i64 2, !10, i64 2, !10, i64 2, !10, i64 2, !10, i64 2, !10, i64 2, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !7, i64 80, !7, i64 102, !7, i64 124, !10, i64 148, !10, i64 152, !13, i64 160, !14, i64 168, !14, i64 176, !7, i64 184, !7, i64 216, !7, i64 217, !7, i64 218, !7, i64 219, !7, i64 220, !7, i64 221, !7, i64 222, !6, i64 224, !6, i64 232, !15, i64 240, !6, i64 632, !6, i64 640, !16, i64 648, !23, i64 1144, !26, i64 1688, !6, i64 1752, !7, i64 1760, !10, i64 1764, !7, i64 1768, !29, i64 1776, !29, i64 1816, !29, i64 1856, !29, i64 1896, !10, i64 1936, !14, i64 1944, !7, i64 1952, !29, i64 1960, !7, i64 2000, !7, i64 2001, !7, i64 2002, !22, i64 2003, !30, i64 2004, !30, i64 2008, !31, i64 2016, !28, i64 2208, !10, i64 2212, !28, i64 2216, !14, i64 2224, !7, i64 2232, !14, i64 2240, !14, i64 2248, !14, i64 2256, !30, i64 2264, !30, i64 2268, !7, i64 2272, !7, i64 2528, !10, i64 2784, !21, i64 2792, !10, i64 2816, !21, i64 2824, !21, i64 2848, !21, i64 2872, !33, i64 2896, !35, i64 3704, !6, i64 3760, !6, i64 3768, !7, i64 3776, !10, i64 3780, !21, i64 3784, !10, i64 3808, !37, i64 3816, !7, i64 3848, !29, i64 3992, !21, i64 4032, !21, i64 4056, !22, i64 4080, !22, i64 4081, !22, i64 4082, !28, i64 4084, !28, i64 4086, !10, i64 4088, !10, i64 4092, !21, i64 4096, !10, i64 4120, !38, i64 4128, !30, i64 4176, !7, i64 4180, !7, i64 4181}
!13 = !{!"s2n_timer", !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"s2n_secrets", !7, i64 0, !10, i64 388}
!16 = !{!"s2n_kex_parameters", !17, i64 0, !18, i64 8, !7, i64 24, !18, i64 56, !19, i64 72, !19, i64 184, !7, i64 296, !20, i64 360, !21, i64 448, !21, i64 472}
!17 = !{!"s2n_dh_params", !6, i64 0}
!18 = !{!"s2n_ecc_evp_params", !6, i64 0, !6, i64 8}
!19 = !{!"s2n_kem_group_params", !6, i64 0, !20, i64 8, !18, i64 96}
!20 = !{!"s2n_kem_params", !6, i64 0, !21, i64 8, !21, i64 32, !21, i64 56, !22, i64 80}
!21 = !{!"s2n_blob", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!22 = !{!"_Bool", !7, i64 0}
!23 = !{!"s2n_handshake_parameters", !24, i64 0, !24, i64 48, !21, i64 96, !10, i64 120, !25, i64 124, !6, i64 384, !6, i64 392, !6, i64 400, !7, i64 408, !7, i64 440, !7, i64 472, !7, i64 473, !7, i64 474, !7, i64 506}
!24 = !{!"s2n_pkey", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!25 = !{!"s2n_sig_scheme_list", !7, i64 0, !7, i64 256}
!26 = !{!"s2n_psk_parameters", !10, i64 0, !27, i64 8, !28, i64 40, !28, i64 42, !6, i64 48, !10, i64 56}
!27 = !{!"s2n_array", !21, i64 0, !10, i64 24, !10, i64 28}
!28 = !{!"short", !7, i64 0}
!29 = !{!"s2n_stuffer", !21, i64 0, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 36, !10, i64 36}
!30 = !{!"", !10, i64 0}
!31 = !{!"s2n_handshake", !29, i64 0, !6, i64 40, !7, i64 48, !7, i64 56, !7, i64 104, !7, i64 152, !10, i64 156, !10, i64 160, !10, i64 164, !10, i64 168, !32, i64 176, !10, i64 184, !10, i64 184, !10, i64 184, !10, i64 184, !10, i64 188}
!32 = !{!"s2n_offered_early_data", !6, i64 0}
!33 = !{!"s2n_client_hello", !21, i64 0, !34, i64 24, !21, i64 728, !21, i64 752, !21, i64 776, !7, i64 800, !7, i64 801, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802}
!34 = !{!"", !7, i64 0, !21, i64 672, !28, i64 696}
!35 = !{!"s2n_x509_validator", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !28, i64 18, !6, i64 24, !10, i64 32, !6, i64 40, !36, i64 48, !22, i64 52}
!36 = !{!"s2n_cert_validation_info", !10, i64 0, !10, i64 0}
!37 = !{!"s2n_ticket_fields", !21, i64 0, !10, i64 24}
!38 = !{!"s2n_post_handshake", !29, i64 0, !7, i64 40}
!39 = !{!7, !7, i64 0}
!40 = !{!12, !10, i64 1804}
!41 = !{!12, !10, i64 1800}
!42 = !{!12, !10, i64 1844}
!43 = !{!12, !10, i64 1840}
!44 = !{!28, !28, i64 0}
!45 = !{!12, !6, i64 1776}
!46 = !{!12, !10, i64 1884}
!47 = !{!12, !10, i64 1880}
!48 = !{!49, !6, i64 0}
!49 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!50 = !{!49, !6, i64 8}
!51 = !{!12, !7, i64 220}


; 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.4 = external hidden unnamed_addr constant [85 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_recv_in_init(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #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.start.p0(i64 immarg, ptr nocapture) #4

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_read_full_record(ptr noundef %0, ptr noundef %1, ptr nocapture noundef %2) local_unnamed_addr #0 {
  %4 = alloca i16, align 2
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  store i32 0, ptr %2, align 4, !tbaa !5
  %8 = load i32, ptr %0, align 8
  %9 = and i32 %8, 524288
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %12, label %10

10:                                               ; preds = %3
  %11 = tail call i32 @s2n_ktls_read_full_record(ptr noundef nonnull %0, ptr noundef %1) #7
  br label %.critedge

12:                                               ; preds = %3
  %13 = getelementptr inbounds i8, ptr %0, i64 1936
  %14 = load i32, ptr %13, align 8, !tbaa !9
  %15 = icmp eq i32 %14, 1
  br i1 %15, label %16, label %17

16:                                               ; preds = %12
  store i8 23, ptr %1, align 1, !tbaa !38
  br label %.critedge

17:                                               ; preds = %12
  %18 = getelementptr inbounds i8, ptr %0, i64 1776
  %19 = tail call i32 @s2n_stuffer_reread(ptr noundef nonnull %18) #7
  %20 = icmp sgt i32 %19, -1
  br i1 %20, label %21, label %.critedge

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %0, i64 1804
  %23 = load i32, ptr %22, align 4, !tbaa !39
  %24 = getelementptr inbounds i8, ptr %0, i64 1800
  %25 = load i32, ptr %24, align 8, !tbaa !40
  %26 = sub i32 %23, %25
  %27 = icmp ult i32 %26, 5
  br i1 %27, label %28, label %42

28:                                               ; preds = %21
  %29 = sub nuw nsw i32 5, %26
  %30 = zext nneg i32 %29 to i64
  %31 = tail call i32 @s2n_recv_buffer_in(ptr noundef nonnull %0, i64 noundef %30)
  %32 = getelementptr inbounds i8, ptr %0, i64 1816
  %33 = getelementptr inbounds i8, ptr %0, i64 1844
  %34 = load i32, ptr %33, align 4, !tbaa !41
  %35 = getelementptr inbounds i8, ptr %0, i64 1840
  %36 = load i32, ptr %35, align 8, !tbaa !42
  %37 = sub i32 %34, %36
  %. = tail call i32 @llvm.umin.i32(i32 %29, i32 %37)
  %38 = tail call i32 @s2n_stuffer_copy(ptr noundef nonnull %32, ptr noundef nonnull %18, i32 noundef %.) #7
  %39 = icmp sgt i32 %38, -1
  br i1 %39, label %40, label %.critedge

40:                                               ; preds = %28
  %41 = tail call zeroext i1 @s2n_result_is_ok(i32 %31)
  br i1 %41, label %42, label %.critedge

42:                                               ; preds = %40, %21
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %4) #7
  store i16 0, ptr %4, align 2, !tbaa !43
  %43 = load ptr, ptr %18, align 8, !tbaa !44
  %44 = load i8, ptr %43, align 1, !tbaa !38
  %.not79 = icmp sgt i8 %44, -1
  br i1 %.not79, label %51, label %45

45:                                               ; preds = %42
  store i32 1, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  store ptr %0, ptr %5, align 8, !tbaa !45
  %46 = getelementptr inbounds i8, ptr %0, i64 218
  %47 = call i32 @s2n_sslv2_record_header_parse(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %46, ptr noundef nonnull %4) #7
  %48 = icmp sgt i32 %47, -1
  br i1 %48, label %49, label %.critedge87

49:                                               ; preds = %45
  store ptr null, ptr %5, align 8, !tbaa !45
  %50 = call i32 @s2n_connection_apply_error_blinding(ptr noundef nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %56

51:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  store ptr %0, ptr %6, align 8, !tbaa !45
  %52 = call i32 @s2n_record_header_parse(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %4) #7
  %53 = icmp sgt i32 %52, -1
  br i1 %53, label %54, label %.critedge89

54:                                               ; preds = %51
  store ptr null, ptr %6, align 8, !tbaa !45
  %55 = call i32 @s2n_connection_apply_error_blinding(ptr noundef nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %56

56:                                               ; preds = %54, %49
  %57 = getelementptr inbounds i8, ptr %0, i64 1856
  %58 = getelementptr inbounds i8, ptr %0, i64 1884
  %59 = load i32, ptr %58, align 4, !tbaa !46
  %60 = getelementptr inbounds i8, ptr %0, i64 1880
  %61 = load i32, ptr %60, align 8, !tbaa !47
  %62 = sub i32 %59, %61
  %63 = load i16, ptr %4, align 2
  %64 = zext i16 %63 to i32
  %65 = icmp ult i32 %62, %64
  %66 = icmp eq i16 %63, 0
  %or.cond = or i1 %66, %65
  br i1 %or.cond, label %67, label %86

67:                                               ; preds = %56
  %68 = getelementptr inbounds i8, ptr %0, i64 1816
  %69 = call i32 @s2n_stuffer_rewind_read(ptr noundef nonnull %68, i32 noundef %62) #7
  %70 = icmp sgt i32 %69, -1
  br i1 %70, label %71, label %.critedge93

71:                                               ; preds = %67
  %72 = load i16, ptr %4, align 2, !tbaa !43
  %73 = zext i16 %72 to i64
  %74 = call i32 @s2n_recv_buffer_in(ptr noundef nonnull %0, i64 noundef %73)
  %75 = load i16, ptr %4, align 2, !tbaa !43
  %76 = zext i16 %75 to i32
  %77 = getelementptr inbounds i8, ptr %0, i64 1844
  %78 = load i32, ptr %77, align 4, !tbaa !41
  %79 = getelementptr inbounds i8, ptr %0, i64 1840
  %80 = load i32, ptr %79, align 8, !tbaa !42
  %81 = sub i32 %78, %80
  %.90 = call i32 @llvm.umin.i32(i32 %81, i32 %76)
  %82 = call i32 @s2n_recv_in_init(ptr noundef nonnull %0, i32 noundef %.90, i32 noundef %76)
  %83 = call zeroext i1 @s2n_result_is_ok(i32 %82)
  br i1 %83, label %84, label %.critedge93

84:                                               ; preds = %71
  %85 = call zeroext i1 @s2n_result_is_ok(i32 %74)
  br i1 %85, label %86, label %.critedge93

86:                                               ; preds = %84, %56
  %87 = load i32, ptr %2, align 4, !tbaa !5
  %.not82 = icmp eq i32 %87, 0
  br i1 %.not82, label %88, label %.critedge93

88:                                               ; preds = %86
  %89 = load i8, ptr %1, align 1, !tbaa !38
  %90 = call zeroext i1 @s2n_early_data_is_trial_decryption_allowed(ptr noundef nonnull %0, i8 noundef zeroext %89) #7
  br i1 %90, label %91, label %102

91:                                               ; preds = %88
  %92 = call i32 @s2n_record_parse(ptr noundef nonnull %0) #7
  %93 = icmp sgt i32 %92, -1
  br i1 %93, label %107, label %94

94:                                               ; preds = %91
  %95 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.4, ptr %95, align 8, !tbaa !48
  %96 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.4, i64 21), i32 noundef 47) #8
  %.not84 = icmp eq ptr %96, null
  %97 = getelementptr inbounds i8, ptr %96, i64 1
  %98 = select i1 %.not84, ptr getelementptr inbounds (i8, ptr @.str.4, i64 21), ptr %97
  %99 = getelementptr inbounds i8, ptr %95, i64 8
  store ptr %98, ptr %99, align 8, !tbaa !50
  %100 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544397, ptr %100, align 4, !tbaa !5
  %101 = call i32 @s2n_calculate_stacktrace() #7
  br label %.critedge93

102:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  store ptr %0, ptr %7, align 8, !tbaa !45
  %103 = call i32 @s2n_record_parse(ptr noundef nonnull %0) #7
  %104 = icmp sgt i32 %103, -1
  br i1 %104, label %105, label %.critedge95

105:                                              ; preds = %102
  store ptr null, ptr %7, align 8, !tbaa !45
  %106 = call i32 @s2n_connection_apply_error_blinding(ptr noundef nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %107

107:                                              ; preds = %105, %91
  %108 = getelementptr inbounds i8, ptr %0, i64 220
  %109 = load i8, ptr %108, align 4, !tbaa !51
  %110 = icmp eq i8 %109, 34
  br i1 %110, label %111, label %117

111:                                              ; preds = %107
  %112 = load i8, ptr %1, align 1, !tbaa !38
  %113 = icmp eq i8 %112, 23
  br i1 %113, label %114, label %117

114:                                              ; preds = %111
  %115 = call i32 @s2n_tls13_parse_record_type(ptr noundef nonnull %57, ptr noundef nonnull %1) #7
  %116 = icmp sgt i32 %115, -1
  br i1 %116, label %117, label %.critedge93

117:                                              ; preds = %114, %111, %107
  br label %.critedge93

.critedge95:                                      ; preds = %102
  %118 = call i32 @s2n_connection_apply_error_blinding(ptr noundef nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %.critedge93

.critedge87:                                      ; preds = %45
  %119 = call i32 @s2n_connection_apply_error_blinding(ptr noundef nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %.critedge93

.critedge89:                                      ; preds = %51
  %120 = call i32 @s2n_connection_apply_error_blinding(ptr noundef nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %.critedge93

.critedge93:                                      ; preds = %94, %117, %84, %67, %86, %.critedge95, %114, %71, %.critedge89, %.critedge87
  %.9 = phi i32 [ -1, %.critedge87 ], [ -1, %.critedge89 ], [ 0, %117 ], [ -1, %94 ], [ -1, %84 ], [ -1, %67 ], [ 0, %86 ], [ -1, %.critedge95 ], [ -1, %114 ], [ -1, %71 ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %4) #7
  br label %.critedge

.critedge:                                        ; preds = %.critedge93, %40, %28, %17, %16, %10
  %.11 = phi i32 [ %11, %10 ], [ 0, %16 ], [ -1, %17 ], [ %.9, %.critedge93 ], [ -1, %40 ], [ -1, %28 ]
  ret i32 %.11
}

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

declare i32 @s2n_stuffer_reread(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_recv_buffer_in(ptr noundef, i64 noundef) local_unnamed_addr #0

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

declare i32 @s2n_connection_apply_error_blinding(ptr noundef) local_unnamed_addr #3

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

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

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

declare zeroext i1 @s2n_early_data_is_trial_decryption_allowed(ptr noundef, i8 noundef zeroext) local_unnamed_addr #3

declare i32 @s2n_record_parse(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #6

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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 1936}
!10 = !{!"s2n_connection", !6, i64 0, !6, i64 0, !6, i64 0, !6, i64 0, !6, i64 0, !6, i64 0, !6, i64 0, !6, i64 0, !6, i64 1, !6, i64 1, !6, i64 1, !6, i64 1, !6, i64 1, !6, i64 1, !6, i64 1, !6, i64 1, !6, i64 2, !6, i64 2, !6, i64 2, !6, i64 2, !6, i64 2, !6, i64 2, !6, i64 2, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !7, i64 80, !7, i64 102, !7, i64 124, !6, i64 148, !6, i64 152, !12, i64 160, !13, i64 168, !13, i64 176, !7, i64 184, !7, i64 216, !7, i64 217, !7, i64 218, !7, i64 219, !7, i64 220, !7, i64 221, !7, i64 222, !11, i64 224, !11, i64 232, !14, i64 240, !11, i64 632, !11, i64 640, !15, i64 648, !22, i64 1144, !25, i64 1688, !11, i64 1752, !7, i64 1760, !6, i64 1764, !7, i64 1768, !28, i64 1776, !28, i64 1816, !28, i64 1856, !28, i64 1896, !6, i64 1936, !13, i64 1944, !7, i64 1952, !28, i64 1960, !7, i64 2000, !7, i64 2001, !7, i64 2002, !21, i64 2003, !29, i64 2004, !29, i64 2008, !30, i64 2016, !27, i64 2208, !6, i64 2212, !27, i64 2216, !13, i64 2224, !7, i64 2232, !13, i64 2240, !13, i64 2248, !13, i64 2256, !29, i64 2264, !29, i64 2268, !7, i64 2272, !7, i64 2528, !6, i64 2784, !20, i64 2792, !6, i64 2816, !20, i64 2824, !20, i64 2848, !20, i64 2872, !32, i64 2896, !34, i64 3704, !11, i64 3760, !11, i64 3768, !7, i64 3776, !6, i64 3780, !20, i64 3784, !6, i64 3808, !36, i64 3816, !7, i64 3848, !28, i64 3992, !20, i64 4032, !20, i64 4056, !21, i64 4080, !21, i64 4081, !21, i64 4082, !27, i64 4084, !27, i64 4086, !6, i64 4088, !6, i64 4092, !20, i64 4096, !6, i64 4120, !37, i64 4128, !29, i64 4176, !7, i64 4180, !7, i64 4181}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"s2n_timer", !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"s2n_secrets", !7, i64 0, !6, i64 388}
!15 = !{!"s2n_kex_parameters", !16, i64 0, !17, i64 8, !7, i64 24, !17, i64 56, !18, i64 72, !18, i64 184, !7, i64 296, !19, i64 360, !20, i64 448, !20, i64 472}
!16 = !{!"s2n_dh_params", !11, i64 0}
!17 = !{!"s2n_ecc_evp_params", !11, i64 0, !11, i64 8}
!18 = !{!"s2n_kem_group_params", !11, i64 0, !19, i64 8, !17, i64 96}
!19 = !{!"s2n_kem_params", !11, i64 0, !20, i64 8, !20, i64 32, !20, i64 56, !21, i64 80}
!20 = !{!"s2n_blob", !11, i64 0, !6, i64 8, !6, i64 12, !6, i64 16}
!21 = !{!"_Bool", !7, i64 0}
!22 = !{!"s2n_handshake_parameters", !23, i64 0, !23, i64 48, !20, i64 96, !6, i64 120, !24, i64 124, !11, i64 384, !11, i64 392, !11, i64 400, !7, i64 408, !7, i64 440, !7, i64 472, !7, i64 473, !7, i64 474, !7, i64 506}
!23 = !{!"s2n_pkey", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40}
!24 = !{!"s2n_sig_scheme_list", !7, i64 0, !7, i64 256}
!25 = !{!"s2n_psk_parameters", !6, i64 0, !26, i64 8, !27, i64 40, !27, i64 42, !11, i64 48, !6, i64 56}
!26 = !{!"s2n_array", !20, i64 0, !6, i64 24, !6, i64 28}
!27 = !{!"short", !7, i64 0}
!28 = !{!"s2n_stuffer", !20, i64 0, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 36, !6, i64 36}
!29 = !{!"", !6, i64 0}
!30 = !{!"s2n_handshake", !28, i64 0, !11, i64 40, !7, i64 48, !7, i64 56, !7, i64 104, !7, i64 152, !6, i64 156, !6, i64 160, !6, i64 164, !6, i64 168, !31, i64 176, !6, i64 184, !6, i64 184, !6, i64 184, !6, i64 184, !6, i64 188}
!31 = !{!"s2n_offered_early_data", !11, i64 0}
!32 = !{!"s2n_client_hello", !20, i64 0, !33, i64 24, !20, i64 728, !20, i64 752, !20, i64 776, !7, i64 800, !7, i64 801, !6, i64 802, !6, i64 802, !6, i64 802, !6, i64 802, !6, i64 802, !6, i64 802, !6, i64 802}
!33 = !{!"", !7, i64 0, !20, i64 672, !27, i64 696}
!34 = !{!"s2n_x509_validator", !11, i64 0, !11, i64 8, !7, i64 16, !7, i64 17, !27, i64 18, !11, i64 24, !6, i64 32, !11, i64 40, !35, i64 48, !21, i64 52}
!35 = !{!"s2n_cert_validation_info", !6, i64 0, !6, i64 0}
!36 = !{!"s2n_ticket_fields", !20, i64 0, !6, i64 24}
!37 = !{!"s2n_post_handshake", !28, i64 0, !7, i64 40}
!38 = !{!7, !7, i64 0}
!39 = !{!10, !6, i64 1804}
!40 = !{!10, !6, i64 1800}
!41 = !{!10, !6, i64 1844}
!42 = !{!10, !6, i64 1840}
!43 = !{!27, !27, i64 0}
!44 = !{!10, !11, i64 1776}
!45 = !{!11, !11, i64 0}
!46 = !{!10, !6, i64 1884}
!47 = !{!10, !6, i64 1880}
!48 = !{!49, !11, i64 0}
!49 = !{!"s2n_debug_info", !11, i64 0, !11, i64 8}
!50 = !{!49, !11, i64 8}
!51 = !{!10, !7, i64 220}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass