; LLVM IR from aws/s2n-tls :: tests/unit (s2n_client_auth_handshake_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_handshake_action = type { i8, i8, i8, [2 x 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
@tls13_state_machine = external hidden global [21 x %struct.s2n_handshake_action], align 16
@state_machine = external hidden global [21 x %struct.s2n_handshake_action], align 16
@.str.15 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [94 x i8], align 1
@tls13_handshakes = external hidden global <{ <{ i32, i32, [30 x i32] }>, <{ i32, i32, i32, i32, i32, i32, [26 x i32] }>, [32 x i32], <{ [8 x i32], [24 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [11 x i32], [21 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [10 x i32], [22 x i32] }>, <{ i32, i32, [30 x i32] }>, <{ [8 x i32], [24 x i32] }>, [32 x i32], <{ [10 x i32], [22 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], <{ [8 x i32], [24 x i32] }>, [32 x i32], <{ [10 x i32], [22 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], <{ [10 x i32], [22 x i32] }>, [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], <{ i32, i32, i32, i32, i32, i32, i32, [25 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [9 x i32], [23 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ i32, i32, i32, [29 x i32] }>, <{ [8 x i32], [24 x i32] }>, [32 x i32], <{ [10 x i32], [22 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, <{ i32, i32, i32, [29 x i32] }>, <{ [10 x i32], [22 x i32] }>, [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [9 x i32], [23 x i32] }>, [30 x [32 x i32]] }>, align 16
@handshakes = external hidden global <{ <{ i32, i32, [30 x i32] }>, <{ i32, i32, i32, i32, i32, i32, i32, [25 x i32] }>, [32 x i32], <{ [10 x i32], [22 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [11 x i32], [21 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [11 x i32], [21 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], <{ [8 x i32], [24 x i32] }>, [32 x i32], <{ [11 x i32], [21 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [16 x i32], [16 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], <{ [8 x i32], [24 x i32] }>, [32 x i32], <{ [11 x i32], [21 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [16 x i32], [16 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], <{ [9 x i32], [23 x i32] }>, [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [16 x i32], [16 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [16 x i32], [16 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [17 x i32], [15 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [16 x i32], [16 x i32] }> }>, align 16

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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) #2

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

declare i32 @s2n_calculate_stacktrace() #4

declare i32 @s2n_error_get_type(i32 noundef) #4

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @s2n_handshake_is_complete(ptr noundef) #5

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_negotiate_impl(ptr noundef %0, ptr noundef %1) #5 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.s2n_debug_info, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.s2n_result, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  br label %13

13:                                               ; preds = %2
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %47, label %16

16:                                               ; preds = %13
  br label %17

17:                                               ; preds = %16
  br label %18

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

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

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

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

45:                                               ; preds = %39
  store i32 -1, ptr %3, align 4
  br label %400

46:                                               ; No predecessors!
  br label %47

47:                                               ; preds = %46, %13
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %83, label %52

52:                                               ; preds = %49
  br label %53

53:                                               ; preds = %52
  br label %54

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

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

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

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

81:                                               ; preds = %75
  store i32 -1, ptr %3, align 4
  br label %400

82:                                               ; No predecessors!
  br label %83

83:                                               ; preds = %82, %49
  br label %84

84:                                               ; preds = %83
  br label %85

85:                                               ; preds = %397, %84
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = call zeroext i1 @s2n_handshake_is_complete(ptr noundef %86)
  br i1 %87, label %114, label %88

88:                                               ; preds = %85
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.s2n_connection, ptr %89, i32 0, i32 52
  %91 = getelementptr inbounds %struct.s2n_handshake, ptr %90, i32 0, i32 12
  %92 = load i32, ptr %91, align 4, !tbaa !14
  %93 = icmp eq i32 %92, 2
  %94 = zext i1 %93 to i64
  %95 = select i1 %93, ptr @tls13_handshakes, ptr @handshakes
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.s2n_connection, ptr %96, i32 0, i32 52
  %98 = getelementptr inbounds %struct.s2n_handshake, ptr %97, i32 0, i32 6
  %99 = load i32, ptr %98, align 4, !tbaa !42
  %100 = zext i32 %99 to i64
  %101 = getelementptr inbounds [32 x i32], ptr %95, i64 %100
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.s2n_connection, ptr %102, i32 0, i32 52
  %104 = getelementptr inbounds %struct.s2n_handshake, ptr %103, i32 0, i32 7
  %105 = load i32, ptr %104, align 8, !tbaa !43
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [32 x i32], ptr %101, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !12
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.s2n_connection, ptr %109, i32 0, i32 52
  %111 = getelementptr inbounds %struct.s2n_handshake, ptr %110, i32 0, i32 8
  %112 = load i32, ptr %111, align 4, !tbaa !44
  %113 = icmp ne i32 %108, %112
  br label %114

114:                                              ; preds = %88, %85
  %115 = phi i1 [ false, %85 ], [ %113, %88 ]
  br i1 %115, label %116, label %398

116:                                              ; preds = %114
  %117 = call ptr @__errno_location() #9
  store i32 0, ptr %117, align 4, !tbaa !12
  %118 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 0, ptr %118, align 4, !tbaa !12
  br label %119

119:                                              ; preds = %116
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = call i32 @s2n_flush(ptr noundef %120, ptr noundef %121)
  %123 = icmp sgt i32 %122, -1
  br i1 %123, label %125, label %124

124:                                              ; preds = %119
  store i32 -1, ptr %3, align 4
  br label %400

125:                                              ; preds = %119
  br label %126

126:                                              ; preds = %125
  br label %127

127:                                              ; preds = %126
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = call zeroext i1 @s2n_connection_check_io_status(ptr noundef %128, i32 noundef 2)
  br i1 %129, label %161, label %130

130:                                              ; preds = %127
  br label %131

131:                                              ; preds = %130
  br label %132

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

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

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

153:                                              ; preds = %148, %141
  %154 = phi ptr [ %147, %141 ], [ %152, %148 ]
  %155 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %156 = getelementptr inbounds %struct.s2n_debug_info, ptr %155, i32 0, i32 1
  store ptr %154, ptr %156, align 8, !tbaa !11
  %157 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 134217728, ptr %157, align 4, !tbaa !12
  %158 = call i32 @s2n_calculate_stacktrace()
  br label %159

159:                                              ; preds = %153
  store i32 -1, ptr %3, align 4
  br label %400

160:                                              ; No predecessors!
  br label %161

161:                                              ; preds = %160, %127
  br label %162

162:                                              ; preds = %161
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.s2n_connection, ptr %163, i32 0, i32 52
  %165 = getelementptr inbounds %struct.s2n_handshake, ptr %164, i32 0, i32 11
  %166 = load i8, ptr %165, align 8
  %167 = lshr i8 %166, 1
  %168 = and i8 %167, 1
  %169 = zext i8 %168 to i32
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %180

171:                                              ; preds = %162
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 3, ptr %172, align 4, !tbaa !12
  br label %173

173:                                              ; preds = %171
  %174 = load ptr, ptr %4, align 8, !tbaa !5
  %175 = call i32 @s2n_handle_retry_state(ptr noundef %174)
  %176 = icmp sgt i32 %175, -1
  br i1 %176, label %178, label %177

177:                                              ; preds = %173
  store i32 -1, ptr %3, align 4
  br label %400

178:                                              ; preds = %173
  br label %179

179:                                              ; preds = %178
  br label %180

180:                                              ; preds = %179, %162
  %181 = load ptr, ptr %4, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.s2n_connection, ptr %181, i32 0, i32 52
  %183 = getelementptr inbounds %struct.s2n_handshake, ptr %182, i32 0, i32 12
  %184 = load i32, ptr %183, align 4, !tbaa !14
  %185 = icmp eq i32 %184, 2
  %186 = zext i1 %185 to i64
  %187 = select i1 %185, ptr @tls13_state_machine, ptr @state_machine
  %188 = load ptr, ptr %4, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.s2n_connection, ptr %188, i32 0, i32 52
  %190 = getelementptr inbounds %struct.s2n_handshake, ptr %189, i32 0, i32 12
  %191 = load i32, ptr %190, align 4, !tbaa !14
  %192 = icmp eq i32 %191, 2
  %193 = zext i1 %192 to i64
  %194 = select i1 %192, ptr @tls13_handshakes, ptr @handshakes
  %195 = load ptr, ptr %4, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.s2n_connection, ptr %195, i32 0, i32 52
  %197 = getelementptr inbounds %struct.s2n_handshake, ptr %196, i32 0, i32 6
  %198 = load i32, ptr %197, align 4, !tbaa !42
  %199 = zext i32 %198 to i64
  %200 = getelementptr inbounds [32 x i32], ptr %194, i64 %199
  %201 = load ptr, ptr %4, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.s2n_connection, ptr %201, i32 0, i32 52
  %203 = getelementptr inbounds %struct.s2n_handshake, ptr %202, i32 0, i32 7
  %204 = load i32, ptr %203, align 8, !tbaa !43
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [32 x i32], ptr %200, i64 0, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !12
  %208 = zext i32 %207 to i64
  %209 = getelementptr inbounds %struct.s2n_handshake_action, ptr %187, i64 %208
  %210 = getelementptr inbounds %struct.s2n_handshake_action, ptr %209, i32 0, i32 2
  %211 = load i8, ptr %210, align 2, !tbaa !45
  %212 = sext i8 %211 to i32
  %213 = load ptr, ptr %4, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.s2n_connection, ptr %213, i32 0, i32 13
  %215 = load i32, ptr %214, align 4, !tbaa !47
  %216 = icmp eq i32 %215, 1
  %217 = zext i1 %216 to i64
  %218 = select i1 %216, i32 67, i32 83
  %219 = icmp eq i32 %212, %218
  br i1 %219, label %220, label %288

220:                                              ; preds = %180
  %221 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 2, ptr %221, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #10
  %222 = load ptr, ptr %4, align 8, !tbaa !5
  %223 = call i32 @s2n_handshake_write_io(ptr noundef %222)
  store i32 %223, ptr %6, align 4, !tbaa !12
  %224 = load i32, ptr %6, align 4, !tbaa !12
  %225 = icmp slt i32 %224, 0
  br i1 %225, label %226, label %284

226:                                              ; preds = %220
  %227 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %228 = load i32, ptr %227, align 4, !tbaa !12
  %229 = call i32 @s2n_error_get_type(i32 noundef %228)
  %230 = icmp eq i32 %229, 3
  br i1 %230, label %261, label %231

231:                                              ; preds = %226
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #10
  %232 = call ptr @__errno_location() #9
  %233 = load i32, ptr %232, align 4, !tbaa !12
  store i32 %233, ptr %7, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #10
  %234 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %235 = load i32, ptr %234, align 4, !tbaa !12
  store i32 %235, ptr %8, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #10
  %236 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %236, i64 16, i1 false), !tbaa.struct !48
  %237 = load ptr, ptr %4, align 8, !tbaa !5
  %238 = call i32 @s2n_handshake_read_io(ptr noundef %237)
  %239 = icmp slt i32 %238, 0
  br i1 %239, label %240, label %248

240:                                              ; preds = %231
  %241 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %242 = load i32, ptr %241, align 4, !tbaa !12
  %243 = icmp eq i32 %242, 268435456
  br i1 %243, label %244, label %248

244:                                              ; preds = %240
  br label %245

245:                                              ; preds = %244
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %258

246:                                              ; No predecessors!
  br label %247

247:                                              ; preds = %246
  br label %257

248:                                              ; preds = %240, %231
  %249 = load i32, ptr %7, align 4, !tbaa !12
  %250 = call ptr @__errno_location() #9
  store i32 %249, ptr %250, align 4, !tbaa !12
  %251 = load i32, ptr %8, align 4, !tbaa !12
  %252 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 %251, ptr %252, align 4, !tbaa !12
  %253 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %253, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !48
  br label %254

254:                                              ; preds = %248
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %258

255:                                              ; No predecessors!
  br label %256

256:                                              ; preds = %255
  br label %257

257:                                              ; preds = %256, %247
  store i32 0, ptr %10, align 4
  br label %258

258:                                              ; preds = %257, %254, %245
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #10
  %259 = load i32, ptr %10, align 4
  switch i32 %259, label %285 [
    i32 0, label %260
  ]

260:                                              ; preds = %258
  br label %261

261:                                              ; preds = %260, %226
  %262 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %263 = load i32, ptr %262, align 4, !tbaa !12
  %264 = icmp eq i32 %263, 201326593
  br i1 %264, label %265, label %273

265:                                              ; preds = %261
  %266 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 3, ptr %266, align 4, !tbaa !12
  %267 = load ptr, ptr %4, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.s2n_connection, ptr %267, i32 0, i32 52
  %269 = getelementptr inbounds %struct.s2n_handshake, ptr %268, i32 0, i32 11
  %270 = load i8, ptr %269, align 8
  %271 = and i8 %270, -3
  %272 = or i8 %271, 2
  store i8 %272, ptr %269, align 8
  br label %280

273:                                              ; preds = %261
  %274 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %275 = load i32, ptr %274, align 4, !tbaa !12
  %276 = icmp eq i32 %275, 201326594
  br i1 %276, label %277, label %279

277:                                              ; preds = %273
  %278 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 4, ptr %278, align 4, !tbaa !12
  br label %279

279:                                              ; preds = %277, %273
  br label %280

280:                                              ; preds = %279, %265
  br label %281

281:                                              ; preds = %280
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %285

282:                                              ; No predecessors!
  br label %283

283:                                              ; preds = %282
  br label %284

284:                                              ; preds = %283, %220
  store i32 0, ptr %10, align 4
  br label %285

285:                                              ; preds = %284, %281, %258
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #10
  %286 = load i32, ptr %10, align 4
  switch i32 %286, label %402 [
    i32 0, label %287
    i32 1, label %400
  ]

287:                                              ; preds = %285
  br label %335

288:                                              ; preds = %180
  %289 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 1, ptr %289, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #10
  %290 = load ptr, ptr %4, align 8, !tbaa !5
  %291 = call i32 @s2n_handshake_read_io(ptr noundef %290)
  store i32 %291, ptr %11, align 4, !tbaa !12
  %292 = load i32, ptr %11, align 4, !tbaa !12
  %293 = icmp slt i32 %292, 0
  br i1 %293, label %294, label %331

294:                                              ; preds = %288
  %295 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %296 = load i32, ptr %295, align 4, !tbaa !12
  %297 = call i32 @s2n_error_get_type(i32 noundef %296)
  %298 = icmp eq i32 %297, 3
  br i1 %298, label %308, label %299

299:                                              ; preds = %294
  %300 = load ptr, ptr %4, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.s2n_connection, ptr %300, i32 0, i32 19
  %302 = load i8, ptr %301, align 8, !tbaa !49
  %303 = zext i8 %302 to i32
  %304 = icmp ne i32 %303, 0
  br i1 %304, label %305, label %308

305:                                              ; preds = %299
  %306 = load ptr, ptr %4, align 8, !tbaa !5
  %307 = call i32 @s2n_try_delete_session_cache(ptr noundef %306)
  br label %308

308:                                              ; preds = %305, %299, %294
  %309 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %310 = load i32, ptr %309, align 4, !tbaa !12
  %311 = icmp eq i32 %310, 201326593
  br i1 %311, label %312, label %320

312:                                              ; preds = %308
  %313 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 3, ptr %313, align 4, !tbaa !12
  %314 = load ptr, ptr %4, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.s2n_connection, ptr %314, i32 0, i32 52
  %316 = getelementptr inbounds %struct.s2n_handshake, ptr %315, i32 0, i32 11
  %317 = load i8, ptr %316, align 8
  %318 = and i8 %317, -3
  %319 = or i8 %318, 2
  store i8 %319, ptr %316, align 8
  br label %327

320:                                              ; preds = %308
  %321 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %322 = load i32, ptr %321, align 4, !tbaa !12
  %323 = icmp eq i32 %322, 201326594
  br i1 %323, label %324, label %326

324:                                              ; preds = %320
  %325 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 4, ptr %325, align 4, !tbaa !12
  br label %326

326:                                              ; preds = %324, %320
  br label %327

327:                                              ; preds = %326, %312
  br label %328

328:                                              ; preds = %327
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %332

329:                                              ; No predecessors!
  br label %330

330:                                              ; preds = %329
  br label %331

331:                                              ; preds = %330, %288
  store i32 0, ptr %10, align 4
  br label %332

332:                                              ; preds = %331, %328
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  %333 = load i32, ptr %10, align 4
  switch i32 %333, label %402 [
    i32 0, label %334
    i32 1, label %400
  ]

334:                                              ; preds = %332
  br label %335

335:                                              ; preds = %334, %287
  %336 = load ptr, ptr %4, align 8, !tbaa !5
  %337 = getelementptr inbounds %struct.s2n_connection, ptr %336, i32 0, i32 52
  %338 = getelementptr inbounds %struct.s2n_handshake, ptr %337, i32 0, i32 12
  %339 = load i32, ptr %338, align 4, !tbaa !14
  %340 = icmp eq i32 %339, 2
  %341 = zext i1 %340 to i64
  %342 = select i1 %340, ptr @tls13_state_machine, ptr @state_machine
  %343 = load ptr, ptr %4, align 8, !tbaa !5
  %344 = getelementptr inbounds %struct.s2n_connection, ptr %343, i32 0, i32 52
  %345 = getelementptr inbounds %struct.s2n_handshake, ptr %344, i32 0, i32 12
  %346 = load i32, ptr %345, align 4, !tbaa !14
  %347 = icmp eq i32 %346, 2
  %348 = zext i1 %347 to i64
  %349 = select i1 %347, ptr @tls13_handshakes, ptr @handshakes
  %350 = load ptr, ptr %4, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct.s2n_connection, ptr %350, i32 0, i32 52
  %352 = getelementptr inbounds %struct.s2n_handshake, ptr %351, i32 0, i32 6
  %353 = load i32, ptr %352, align 4, !tbaa !42
  %354 = zext i32 %353 to i64
  %355 = getelementptr inbounds [32 x i32], ptr %349, i64 %354
  %356 = load ptr, ptr %4, align 8, !tbaa !5
  %357 = getelementptr inbounds %struct.s2n_connection, ptr %356, i32 0, i32 52
  %358 = getelementptr inbounds %struct.s2n_handshake, ptr %357, i32 0, i32 7
  %359 = load i32, ptr %358, align 8, !tbaa !43
  %360 = sext i32 %359 to i64
  %361 = getelementptr inbounds [32 x i32], ptr %355, i64 0, i64 %360
  %362 = load i32, ptr %361, align 4, !tbaa !12
  %363 = zext i32 %362 to i64
  %364 = getelementptr inbounds %struct.s2n_handshake_action, ptr %342, i64 %363
  %365 = getelementptr inbounds %struct.s2n_handshake_action, ptr %364, i32 0, i32 2
  %366 = load i8, ptr %365, align 2, !tbaa !45
  %367 = sext i8 %366 to i32
  %368 = icmp eq i32 %367, 66
  br i1 %368, label %369, label %397

369:                                              ; preds = %335
  br label %370

370:                                              ; preds = %369
  %371 = load ptr, ptr %4, align 8, !tbaa !5
  %372 = call i32 @s2n_tls13_secrets_clean(ptr noundef %371)
  %373 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  store i32 %372, ptr %373, align 4
  %374 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  %375 = load i32, ptr %374, align 4
  %376 = call zeroext i1 @s2n_result_is_ok(i32 %375)
  br i1 %376, label %378, label %377

377:                                              ; preds = %370
  store i32 -1, ptr %3, align 4
  br label %400

378:                                              ; preds = %370
  br label %379

379:                                              ; preds = %378
  br label %380

380:                                              ; preds = %379
  %381 = load ptr, ptr %4, align 8, !tbaa !5
  %382 = load ptr, ptr %5, align 8, !tbaa !5
  %383 = call i32 @s2n_post_handshake_send(ptr noundef %381, ptr noundef %382)
  %384 = icmp sgt i32 %383, -1
  br i1 %384, label %386, label %385

385:                                              ; preds = %380
  store i32 -1, ptr %3, align 4
  br label %400

386:                                              ; preds = %380
  br label %387

387:                                              ; preds = %386
  br label %388

388:                                              ; preds = %387
  %389 = load ptr, ptr %4, align 8, !tbaa !5
  %390 = getelementptr inbounds %struct.s2n_connection, ptr %389, i32 0, i32 52
  %391 = getelementptr inbounds %struct.s2n_handshake, ptr %390, i32 0, i32 0
  %392 = call i32 @s2n_stuffer_resize(ptr noundef %391, i32 noundef 0)
  %393 = icmp sgt i32 %392, -1
  br i1 %393, label %395, label %394

394:                                              ; preds = %388
  store i32 -1, ptr %3, align 4
  br label %400

395:                                              ; preds = %388
  br label %396

396:                                              ; preds = %395
  br label %397

397:                                              ; preds = %396, %335
  br label %85, !llvm.loop !50

398:                                              ; preds = %114
  %399 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 0, ptr %399, align 4, !tbaa !12
  store i32 0, ptr %3, align 4
  br label %400

400:                                              ; preds = %398, %394, %385, %377, %332, %285, %177, %159, %124, %81, %45
  %401 = load i32, ptr %3, align 4
  ret i32 %401

402:                                              ; preds = %332, %285
  unreachable
}

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #6

declare zeroext i1 @s2n_connection_check_io_status(ptr noundef, i32 noundef) #4

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_handle_retry_state(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_handshake_write_io(ptr noundef) #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_handshake_read_io(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_try_delete_session_cache(ptr noundef) #5

declare i32 @s2n_tls13_secrets_clean(ptr noundef) #4

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 willreturn memory(none) "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind willreturn memory(none) }
attributes #10 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !13, i64 2204}
!15 = !{!"s2n_connection", !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, !13, i64 2, !13, i64 2, !13, 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, !13, i64 148, !13, i64 152, !16, i64 160, !17, i64 168, !17, 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, !18, i64 240, !6, i64 632, !6, i64 640, !19, i64 648, !26, i64 1144, !29, i64 1688, !6, i64 1752, !7, i64 1760, !13, i64 1764, !7, i64 1768, !32, i64 1776, !32, i64 1816, !32, i64 1856, !32, i64 1896, !13, i64 1936, !17, i64 1944, !7, i64 1952, !32, i64 1960, !7, i64 2000, !7, i64 2001, !7, i64 2002, !25, i64 2003, !33, i64 2004, !33, i64 2008, !34, i64 2016, !31, i64 2208, !13, i64 2212, !31, i64 2216, !17, i64 2224, !7, i64 2232, !17, i64 2240, !17, i64 2248, !17, i64 2256, !33, i64 2264, !33, i64 2268, !7, i64 2272, !7, i64 2528, !13, i64 2784, !24, i64 2792, !13, i64 2816, !24, i64 2824, !24, i64 2848, !24, i64 2872, !36, i64 2896, !38, i64 3704, !6, i64 3760, !6, i64 3768, !7, i64 3776, !13, i64 3780, !24, i64 3784, !13, i64 3808, !40, i64 3816, !7, i64 3848, !32, i64 3992, !24, i64 4032, !24, i64 4056, !25, i64 4080, !25, i64 4081, !25, i64 4082, !31, i64 4084, !31, i64 4086, !13, i64 4088, !13, i64 4092, !24, i64 4096, !13, i64 4120, !41, i64 4128, !33, i64 4176, !7, i64 4180, !7, i64 4181}
!16 = !{!"s2n_timer", !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"s2n_secrets", !7, i64 0, !13, i64 388}
!19 = !{!"s2n_kex_parameters", !20, i64 0, !21, i64 8, !7, i64 24, !21, i64 56, !22, i64 72, !22, i64 184, !7, i64 296, !23, i64 360, !24, i64 448, !24, i64 472}
!20 = !{!"s2n_dh_params", !6, i64 0}
!21 = !{!"s2n_ecc_evp_params", !6, i64 0, !6, i64 8}
!22 = !{!"s2n_kem_group_params", !6, i64 0, !23, i64 8, !21, i64 96}
!23 = !{!"s2n_kem_params", !6, i64 0, !24, i64 8, !24, i64 32, !24, i64 56, !25, i64 80}
!24 = !{!"s2n_blob", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!25 = !{!"_Bool", !7, i64 0}
!26 = !{!"s2n_handshake_parameters", !27, i64 0, !27, i64 48, !24, i64 96, !13, i64 120, !28, 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}
!27 = !{!"s2n_pkey", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!28 = !{!"s2n_sig_scheme_list", !7, i64 0, !7, i64 256}
!29 = !{!"s2n_psk_parameters", !13, i64 0, !30, i64 8, !31, i64 40, !31, i64 42, !6, i64 48, !13, i64 56}
!30 = !{!"s2n_array", !24, i64 0, !13, i64 24, !13, i64 28}
!31 = !{!"short", !7, i64 0}
!32 = !{!"s2n_stuffer", !24, i64 0, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 36, !13, i64 36}
!33 = !{!"", !13, i64 0}
!34 = !{!"s2n_handshake", !32, i64 0, !6, i64 40, !7, i64 48, !7, i64 56, !7, i64 104, !7, i64 152, !13, i64 156, !13, i64 160, !13, i64 164, !13, i64 168, !35, i64 176, !13, i64 184, !13, i64 184, !13, i64 184, !13, i64 184, !13, i64 188}
!35 = !{!"s2n_offered_early_data", !6, i64 0}
!36 = !{!"s2n_client_hello", !24, i64 0, !37, i64 24, !24, i64 728, !24, i64 752, !24, i64 776, !7, i64 800, !7, i64 801, !13, i64 802, !13, i64 802, !13, i64 802, !13, i64 802, !13, i64 802, !13, i64 802, !13, i64 802}
!37 = !{!"", !7, i64 0, !24, i64 672, !31, i64 696}
!38 = !{!"s2n_x509_validator", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !31, i64 18, !6, i64 24, !13, i64 32, !6, i64 40, !39, i64 48, !25, i64 52}
!39 = !{!"s2n_cert_validation_info", !13, i64 0, !13, i64 0}
!40 = !{!"s2n_ticket_fields", !24, i64 0, !13, i64 24}
!41 = !{!"s2n_post_handshake", !32, i64 0, !7, i64 40}
!42 = !{!15, !13, i64 2172}
!43 = !{!15, !13, i64 2176}
!44 = !{!15, !13, i64 2180}
!45 = !{!46, !7, i64 2}
!46 = !{!"s2n_handshake_action", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 8}
!47 = !{!15, !13, i64 148}
!48 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!49 = !{!15, !7, i64 216}
!50 = distinct !{!50, !51}
!51 = !{!"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 }
%struct.s2n_handshake_action = type { i8, i8, i8, [2 x 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
@tls13_state_machine = external hidden local_unnamed_addr global [21 x %struct.s2n_handshake_action], align 16
@state_machine = external hidden local_unnamed_addr global [21 x %struct.s2n_handshake_action], align 16
@.str.15 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [94 x i8], align 1
@tls13_handshakes = external hidden local_unnamed_addr global <{ <{ i32, i32, [30 x i32] }>, <{ i32, i32, i32, i32, i32, i32, [26 x i32] }>, [32 x i32], <{ [8 x i32], [24 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [11 x i32], [21 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [10 x i32], [22 x i32] }>, <{ i32, i32, [30 x i32] }>, <{ [8 x i32], [24 x i32] }>, [32 x i32], <{ [10 x i32], [22 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], <{ [8 x i32], [24 x i32] }>, [32 x i32], <{ [10 x i32], [22 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], <{ [10 x i32], [22 x i32] }>, [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], <{ i32, i32, i32, i32, i32, i32, i32, [25 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [9 x i32], [23 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ i32, i32, i32, [29 x i32] }>, <{ [8 x i32], [24 x i32] }>, [32 x i32], <{ [10 x i32], [22 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, <{ i32, i32, i32, [29 x i32] }>, <{ [10 x i32], [22 x i32] }>, [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [9 x i32], [23 x i32] }>, [30 x [32 x i32]] }>, align 16
@handshakes = external hidden local_unnamed_addr global <{ <{ i32, i32, [30 x i32] }>, <{ i32, i32, i32, i32, i32, i32, i32, [25 x i32] }>, [32 x i32], <{ [10 x i32], [22 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [11 x i32], [21 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [11 x i32], [21 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], <{ [8 x i32], [24 x i32] }>, [32 x i32], <{ [11 x i32], [21 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [16 x i32], [16 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], <{ [8 x i32], [24 x i32] }>, [32 x i32], <{ [11 x i32], [21 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [16 x i32], [16 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], <{ [9 x i32], [23 x i32] }>, [32 x i32], <{ [12 x i32], [20 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [16 x i32], [16 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [13 x i32], [19 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [16 x i32], [16 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [15 x i32], [17 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [14 x i32], [18 x i32] }>, [32 x i32], [32 x i32], [32 x i32], <{ [17 x i32], [15 x i32] }>, [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], [32 x i32], <{ [16 x i32], [16 x i32] }> }>, align 16

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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) #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_error_get_type(i32 noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @s2n_handshake_is_complete(ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @s2n_negotiate_impl(ptr noundef %0, ptr noundef %1) local_unnamed_addr #5 {
  %3 = alloca %struct.s2n_debug_info, align 8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %12

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

12:                                               ; preds = %2
  %.not59 = icmp eq ptr %1, null
  br i1 %.not59, label %22, label %.preheader

.preheader:                                       ; preds = %12
  %13 = tail call zeroext i1 @s2n_handshake_is_complete(ptr noundef nonnull %0)
  br i1 %13, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %14 = getelementptr inbounds i8, ptr %0, i64 2016
  %15 = getelementptr inbounds i8, ptr %0, i64 2204
  %16 = getelementptr inbounds i8, ptr %0, i64 2172
  %17 = getelementptr inbounds i8, ptr %0, i64 2176
  %18 = getelementptr inbounds i8, ptr %0, i64 2180
  %19 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %20 = getelementptr inbounds i8, ptr %0, i64 2200
  %21 = getelementptr inbounds i8, ptr %0, i64 148
  br label %30

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

30:                                               ; preds = %.lr.ph, %144
  %31 = load i32, ptr %15, align 4, !tbaa !13
  %32 = icmp eq i32 %31, 2
  %33 = select i1 %32, ptr @tls13_handshakes, ptr @handshakes
  %34 = load i32, ptr %16, align 4, !tbaa !41
  %35 = zext i32 %34 to i64
  %36 = load i32, ptr %17, align 8, !tbaa !42
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [32 x i32], ptr %33, i64 %35, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !11
  %40 = load i32, ptr %18, align 4, !tbaa !43
  %.not61 = icmp eq i32 %39, %40
  br i1 %.not61, label %.critedge, label %41

41:                                               ; preds = %30
  %42 = tail call ptr @__errno_location() #10
  store i32 0, ptr %42, align 4, !tbaa !11
  store i32 0, ptr %19, align 4, !tbaa !11
  %43 = tail call i32 @s2n_flush(ptr noundef nonnull %0, ptr noundef nonnull %1) #9
  %44 = icmp sgt i32 %43, -1
  br i1 %44, label %45, label %.thread

45:                                               ; preds = %41
  %46 = tail call zeroext i1 @s2n_connection_check_io_status(ptr noundef nonnull %0, i32 noundef 2) #9
  br i1 %46, label %54, label %47

47:                                               ; preds = %45
  %48 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.17, ptr %48, align 8, !tbaa !5
  %49 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.17, i64 21), i32 noundef 47) #8
  %.not62 = icmp eq ptr %49, null
  %50 = getelementptr inbounds i8, ptr %49, i64 1
  %51 = select i1 %.not62, ptr getelementptr inbounds (i8, ptr @.str.17, i64 21), ptr %50
  %52 = getelementptr inbounds i8, ptr %48, i64 8
  store ptr %51, ptr %52, align 8, !tbaa !10
  store i32 134217728, ptr %19, align 4, !tbaa !11
  %53 = tail call i32 @s2n_calculate_stacktrace() #9
  br label %.thread

54:                                               ; preds = %45
  %55 = load i8, ptr %20, align 8
  %56 = and i8 %55, 2
  %.not63 = icmp eq i8 %56, 0
  br i1 %.not63, label %60, label %57

57:                                               ; preds = %54
  store i32 3, ptr %1, align 4, !tbaa !11
  %58 = tail call i32 @s2n_handle_retry_state(ptr noundef nonnull %0)
  %59 = icmp sgt i32 %58, -1
  br i1 %59, label %60, label %.thread

60:                                               ; preds = %57, %54
  %61 = load i32, ptr %15, align 4, !tbaa !13
  %62 = icmp eq i32 %61, 2
  %63 = select i1 %62, ptr @tls13_state_machine, ptr @state_machine
  %64 = select i1 %62, ptr @tls13_handshakes, ptr @handshakes
  %65 = load i32, ptr %16, align 4, !tbaa !41
  %66 = zext i32 %65 to i64
  %67 = load i32, ptr %17, align 8, !tbaa !42
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [32 x i32], ptr %64, i64 %66, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !11
  %71 = zext i32 %70 to i64
  %72 = getelementptr inbounds %struct.s2n_handshake_action, ptr %63, i64 %71, i32 2
  %73 = load i8, ptr %72, align 2, !tbaa !44
  %74 = sext i8 %73 to i32
  %75 = load i32, ptr %21, align 4, !tbaa !46
  %76 = icmp eq i32 %75, 1
  %77 = select i1 %76, i32 67, i32 83
  %78 = icmp eq i32 %77, %74
  br i1 %78, label %79, label %102

79:                                               ; preds = %60
  store i32 2, ptr %1, align 4, !tbaa !11
  %80 = tail call i32 @s2n_handshake_write_io(ptr noundef nonnull %0)
  %81 = icmp slt i32 %80, 0
  br i1 %81, label %82, label %120

82:                                               ; preds = %79
  %83 = load i32, ptr %19, align 4, !tbaa !11
  %84 = tail call i32 @s2n_error_get_type(i32 noundef %83) #9
  %85 = icmp eq i32 %84, 3
  br i1 %85, label %96, label %86

86:                                               ; preds = %82
  %87 = load i32, ptr %42, align 4, !tbaa !11
  %88 = load i32, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3)
  %89 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %89, i64 16, i1 false), !tbaa.struct !47
  %90 = tail call i32 @s2n_handshake_read_io(ptr noundef nonnull %0)
  %91 = icmp slt i32 %90, 0
  %92 = load i32, ptr %19, align 4
  %93 = icmp eq i32 %92, 268435456
  %or.cond = select i1 %91, i1 %93, i1 false
  br i1 %or.cond, label %95, label %94

94:                                               ; preds = %86
  store i32 %87, ptr %42, align 4, !tbaa !11
  store i32 %88, ptr %19, align 4, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %89, ptr noundef nonnull align 8 dereferenceable(16) %3, i64 16, i1 false), !tbaa.struct !47
  br label %95

95:                                               ; preds = %86, %94
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3)
  br label %.thread

96:                                               ; preds = %82
  %97 = load i32, ptr %19, align 4, !tbaa !11
  switch i32 %97, label %.thread [
    i32 201326593, label %98
    i32 201326594, label %101
  ]

98:                                               ; preds = %96
  store i32 3, ptr %1, align 4, !tbaa !11
  %99 = load i8, ptr %20, align 8
  %100 = or i8 %99, 2
  store i8 %100, ptr %20, align 8
  br label %.thread

101:                                              ; preds = %96
  store i32 4, ptr %1, align 4, !tbaa !11
  br label %.thread

102:                                              ; preds = %60
  store i32 1, ptr %1, align 4, !tbaa !11
  %103 = tail call i32 @s2n_handshake_read_io(ptr noundef nonnull %0)
  %104 = icmp slt i32 %103, 0
  br i1 %104, label %105, label %120

105:                                              ; preds = %102
  %106 = load i32, ptr %19, align 4, !tbaa !11
  %107 = tail call i32 @s2n_error_get_type(i32 noundef %106) #9
  %108 = icmp eq i32 %107, 3
  br i1 %108, label %114, label %109

109:                                              ; preds = %105
  %110 = getelementptr inbounds i8, ptr %0, i64 216
  %111 = load i8, ptr %110, align 8, !tbaa !49
  %.not64 = icmp eq i8 %111, 0
  br i1 %.not64, label %114, label %112

112:                                              ; preds = %109
  %113 = tail call i32 @s2n_try_delete_session_cache(ptr noundef nonnull %0)
  br label %114

114:                                              ; preds = %112, %109, %105
  %115 = load i32, ptr %19, align 4, !tbaa !11
  switch i32 %115, label %.thread [
    i32 201326593, label %116
    i32 201326594, label %119
  ]

116:                                              ; preds = %114
  store i32 3, ptr %1, align 4, !tbaa !11
  %117 = load i8, ptr %20, align 8
  %118 = or i8 %117, 2
  store i8 %118, ptr %20, align 8
  br label %.thread

119:                                              ; preds = %114
  store i32 4, ptr %1, align 4, !tbaa !11
  br label %.thread

120:                                              ; preds = %102, %79
  %121 = load i32, ptr %15, align 4, !tbaa !13
  %122 = icmp eq i32 %121, 2
  %123 = select i1 %122, ptr @tls13_state_machine, ptr @state_machine
  %124 = select i1 %122, ptr @tls13_handshakes, ptr @handshakes
  %125 = load i32, ptr %16, align 4, !tbaa !41
  %126 = zext i32 %125 to i64
  %127 = load i32, ptr %17, align 8, !tbaa !42
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [32 x i32], ptr %124, i64 %126, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !11
  %131 = zext i32 %130 to i64
  %132 = getelementptr inbounds %struct.s2n_handshake_action, ptr %123, i64 %131, i32 2
  %133 = load i8, ptr %132, align 2, !tbaa !44
  %134 = icmp eq i8 %133, 66
  br i1 %134, label %135, label %144

135:                                              ; preds = %120
  %136 = tail call i32 @s2n_tls13_secrets_clean(ptr noundef nonnull %0) #9
  %137 = tail call zeroext i1 @s2n_result_is_ok(i32 %136)
  br i1 %137, label %138, label %.thread

138:                                              ; preds = %135
  %139 = tail call i32 @s2n_post_handshake_send(ptr noundef nonnull %0, ptr noundef nonnull %1) #9
  %140 = icmp sgt i32 %139, -1
  br i1 %140, label %141, label %.thread

141:                                              ; preds = %138
  %142 = tail call i32 @s2n_stuffer_resize(ptr noundef nonnull %14, i32 noundef 0) #9
  %143 = icmp sgt i32 %142, -1
  br i1 %143, label %144, label %.thread

144:                                              ; preds = %141, %120
  %145 = tail call zeroext i1 @s2n_handshake_is_complete(ptr noundef nonnull %0)
  br i1 %145, label %.critedge, label %30, !llvm.loop !50

.critedge:                                        ; preds = %30, %144, %.preheader
  store i32 0, ptr %1, align 4, !tbaa !11
  br label %.thread

.thread:                                          ; preds = %141, %138, %135, %57, %41, %114, %116, %119, %95, %96, %98, %101, %.critedge, %47, %22, %4
  %.5 = phi i32 [ 0, %.critedge ], [ -1, %47 ], [ -1, %22 ], [ -1, %4 ], [ -1, %101 ], [ -1, %98 ], [ -1, %96 ], [ -1, %95 ], [ -1, %119 ], [ -1, %116 ], [ -1, %114 ], [ -1, %41 ], [ -1, %57 ], [ -1, %135 ], [ -1, %138 ], [ -1, %141 ]
  ret i32 %.5
}

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #6

declare zeroext i1 @s2n_connection_check_io_status(ptr noundef, i32 noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

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

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

declare i32 @s2n_tls13_secrets_clean(ptr noundef) local_unnamed_addr #4

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(none) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"s2n_debug_info", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!14, !12, i64 2204}
!14 = !{!"s2n_connection", !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 2, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !8, i64 80, !8, i64 102, !8, i64 124, !12, i64 148, !12, i64 152, !15, i64 160, !16, i64 168, !16, i64 176, !8, i64 184, !8, i64 216, !8, i64 217, !8, i64 218, !8, i64 219, !8, i64 220, !8, i64 221, !8, i64 222, !7, i64 224, !7, i64 232, !17, i64 240, !7, i64 632, !7, i64 640, !18, i64 648, !25, i64 1144, !28, i64 1688, !7, i64 1752, !8, i64 1760, !12, i64 1764, !8, i64 1768, !31, i64 1776, !31, i64 1816, !31, i64 1856, !31, i64 1896, !12, i64 1936, !16, i64 1944, !8, i64 1952, !31, i64 1960, !8, i64 2000, !8, i64 2001, !8, i64 2002, !24, i64 2003, !32, i64 2004, !32, i64 2008, !33, i64 2016, !30, i64 2208, !12, i64 2212, !30, i64 2216, !16, i64 2224, !8, i64 2232, !16, i64 2240, !16, i64 2248, !16, i64 2256, !32, i64 2264, !32, i64 2268, !8, i64 2272, !8, i64 2528, !12, i64 2784, !23, i64 2792, !12, i64 2816, !23, i64 2824, !23, i64 2848, !23, i64 2872, !35, i64 2896, !37, i64 3704, !7, i64 3760, !7, i64 3768, !8, i64 3776, !12, i64 3780, !23, i64 3784, !12, i64 3808, !39, i64 3816, !8, i64 3848, !31, i64 3992, !23, i64 4032, !23, i64 4056, !24, i64 4080, !24, i64 4081, !24, i64 4082, !30, i64 4084, !30, i64 4086, !12, i64 4088, !12, i64 4092, !23, i64 4096, !12, i64 4120, !40, i64 4128, !32, i64 4176, !8, i64 4180, !8, i64 4181}
!15 = !{!"s2n_timer", !16, i64 0}
!16 = !{!"long", !8, i64 0}
!17 = !{!"s2n_secrets", !8, i64 0, !12, i64 388}
!18 = !{!"s2n_kex_parameters", !19, i64 0, !20, i64 8, !8, i64 24, !20, i64 56, !21, i64 72, !21, i64 184, !8, i64 296, !22, i64 360, !23, i64 448, !23, i64 472}
!19 = !{!"s2n_dh_params", !7, i64 0}
!20 = !{!"s2n_ecc_evp_params", !7, i64 0, !7, i64 8}
!21 = !{!"s2n_kem_group_params", !7, i64 0, !22, i64 8, !20, i64 96}
!22 = !{!"s2n_kem_params", !7, i64 0, !23, i64 8, !23, i64 32, !23, i64 56, !24, i64 80}
!23 = !{!"s2n_blob", !7, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!24 = !{!"_Bool", !8, i64 0}
!25 = !{!"s2n_handshake_parameters", !26, i64 0, !26, i64 48, !23, i64 96, !12, i64 120, !27, i64 124, !7, i64 384, !7, i64 392, !7, i64 400, !8, i64 408, !8, i64 440, !8, i64 472, !8, i64 473, !8, i64 474, !8, i64 506}
!26 = !{!"s2n_pkey", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!27 = !{!"s2n_sig_scheme_list", !8, i64 0, !8, i64 256}
!28 = !{!"s2n_psk_parameters", !12, i64 0, !29, i64 8, !30, i64 40, !30, i64 42, !7, i64 48, !12, i64 56}
!29 = !{!"s2n_array", !23, i64 0, !12, i64 24, !12, i64 28}
!30 = !{!"short", !8, i64 0}
!31 = !{!"s2n_stuffer", !23, i64 0, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 36, !12, i64 36}
!32 = !{!"", !12, i64 0}
!33 = !{!"s2n_handshake", !31, i64 0, !7, i64 40, !8, i64 48, !8, i64 56, !8, i64 104, !8, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !34, i64 176, !12, i64 184, !12, i64 184, !12, i64 184, !12, i64 184, !12, i64 188}
!34 = !{!"s2n_offered_early_data", !7, i64 0}
!35 = !{!"s2n_client_hello", !23, i64 0, !36, i64 24, !23, i64 728, !23, i64 752, !23, i64 776, !8, i64 800, !8, i64 801, !12, i64 802, !12, i64 802, !12, i64 802, !12, i64 802, !12, i64 802, !12, i64 802, !12, i64 802}
!36 = !{!"", !8, i64 0, !23, i64 672, !30, i64 696}
!37 = !{!"s2n_x509_validator", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !30, i64 18, !7, i64 24, !12, i64 32, !7, i64 40, !38, i64 48, !24, i64 52}
!38 = !{!"s2n_cert_validation_info", !12, i64 0, !12, i64 0}
!39 = !{!"s2n_ticket_fields", !23, i64 0, !12, i64 24}
!40 = !{!"s2n_post_handshake", !31, i64 0, !8, i64 40}
!41 = !{!14, !12, i64 2172}
!42 = !{!14, !12, i64 2176}
!43 = !{!14, !12, i64 2180}
!44 = !{!45, !8, i64 2}
!45 = !{!"s2n_handshake_action", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 8}
!46 = !{!14, !12, i64 148}
!47 = !{i64 0, i64 8, !48, i64 8, i64 8, !48}
!48 = !{!7, !7, i64 0}
!49 = !{!14, !8, i64 216}
!50 = distinct !{!50, !51}
!51 = !{!"llvm.loop.mustprogress"}


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