; 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_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.10 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [8 x i8], align 1
@tls13_handshake_type_names = external hidden global [8 x ptr], align 16
@tls12_handshake_type_names = external hidden global [8 x ptr], align 16
@handshake_type_str = external hidden global [256 x [142 x i8]], align 16
@.str.12 = external hidden unnamed_addr constant [94 x i8], align 1

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

; Function Attrs: 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_handshake_validate(ptr noundef) #4

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

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

19:                                               ; preds = %16
  br label %20

20:                                               ; preds = %19
  br label %21

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

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

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

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

48:                                               ; preds = %42
  store ptr null, ptr %2, align 8
  br label %246

49:                                               ; No predecessors!
  br label %50

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

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.s2n_connection, ptr %53, i32 0, i32 52
  %55 = call i32 @s2n_handshake_validate(ptr noundef %54)
  %56 = getelementptr inbounds %struct.s2n_result, ptr %5, i32 0, i32 0
  store i32 %55, ptr %56, align 4
  %57 = getelementptr inbounds %struct.s2n_result, ptr %5, i32 0, i32 0
  %58 = load i32, ptr %57, align 4
  %59 = call zeroext i1 @s2n_result_is_ok(i32 %58)
  %60 = xor i1 %59, true
  %61 = xor i1 %60, true
  %62 = zext i1 %61 to i32
  %63 = sext i32 %62 to i64
  %64 = call i64 @llvm.expect.i64(i64 %63, i64 1)
  %65 = icmp ne i64 %64, 0
  br i1 %65, label %66, label %68

66:                                               ; preds = %52
  %67 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 0, ptr %67, align 4, !tbaa !14
  br label %70

68:                                               ; preds = %52
  %69 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %69, align 4, !tbaa !14
  br label %70

70:                                               ; preds = %68, %66
  %71 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  %72 = load i32, ptr %71, align 4
  %73 = call zeroext i1 @s2n_result_is_ok(i32 %72)
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store ptr null, ptr %2, align 8
  br label %246

75:                                               ; preds = %70
  br label %76

76:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.s2n_connection, ptr %77, i32 0, i32 52
  %79 = getelementptr inbounds %struct.s2n_handshake, ptr %78, i32 0, i32 6
  %80 = load i32, ptr %79, align 4, !tbaa !16
  store i32 %80, ptr %6, align 4, !tbaa !12
  %81 = load i32, ptr %6, align 4, !tbaa !12
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %83, label %84

83:                                               ; preds = %76
  store ptr @.str.11, ptr %2, align 8
  store i32 1, ptr %7, align 4
  br label %245

84:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store ptr @tls13_handshake_type_names, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store i64 8, ptr %9, align 8, !tbaa !43
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = call zeroext i8 @s2n_connection_get_protocol_version(ptr noundef %85)
  %87 = zext i8 %86 to i32
  %88 = icmp slt i32 %87, 34
  br i1 %88, label %89, label %90

89:                                               ; preds = %84
  store ptr @tls12_handshake_type_names, ptr %8, align 8, !tbaa !5
  store i64 8, ptr %9, align 8, !tbaa !43
  br label %90

90:                                               ; preds = %89, %84
  %91 = load i32, ptr %6, align 4, !tbaa !12
  %92 = zext i32 %91 to i64
  %93 = getelementptr inbounds [256 x [142 x i8]], ptr @handshake_type_str, i64 0, i64 %92
  %94 = getelementptr inbounds [142 x i8], ptr %93, i64 0, i64 0
  %95 = load i8, ptr %94, align 2, !tbaa !44
  %96 = sext i8 %95 to i32
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %103

98:                                               ; preds = %90
  %99 = load i32, ptr %6, align 4, !tbaa !12
  %100 = zext i32 %99 to i64
  %101 = getelementptr inbounds [256 x [142 x i8]], ptr @handshake_type_str, i64 0, i64 %100
  %102 = getelementptr inbounds [142 x i8], ptr %101, i64 0, i64 0
  store ptr %102, ptr %2, align 8
  store i32 1, ptr %7, align 4
  br label %244

103:                                              ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %104 = load i32, ptr %6, align 4, !tbaa !12
  %105 = zext i32 %104 to i64
  %106 = getelementptr inbounds [256 x [142 x i8]], ptr @handshake_type_str, i64 0, i64 %105
  %107 = getelementptr inbounds [142 x i8], ptr %106, i64 0, i64 0
  store ptr %107, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store i64 142, ptr %11, align 8, !tbaa !43
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  store i64 0, ptr %12, align 8, !tbaa !43
  br label %108

108:                                              ; preds = %217, %103
  %109 = load i64, ptr %12, align 8, !tbaa !43
  %110 = load i64, ptr %9, align 8, !tbaa !43
  %111 = icmp ult i64 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 10, ptr %7, align 4
  br label %220

113:                                              ; preds = %108
  %114 = load i32, ptr %6, align 4, !tbaa !12
  %115 = load i64, ptr %12, align 8, !tbaa !43
  %116 = trunc i64 %115 to i32
  %117 = shl i32 1, %116
  %118 = and i32 %114, %117
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %216

120:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %121 = load i64, ptr %11, align 8, !tbaa !43
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = load i64, ptr %12, align 8, !tbaa !43
  %124 = getelementptr inbounds ptr, ptr %122, i64 %123
  %125 = load ptr, ptr %124, align 8, !tbaa !5
  %126 = call i64 @strlen(ptr noundef %125) #7
  %127 = icmp ult i64 %121, %126
  br i1 %127, label %128, label %130

128:                                              ; preds = %120
  %129 = load i64, ptr %11, align 8, !tbaa !43
  br label %136

130:                                              ; preds = %120
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = load i64, ptr %12, align 8, !tbaa !43
  %133 = getelementptr inbounds ptr, ptr %131, i64 %132
  %134 = load ptr, ptr %133, align 8, !tbaa !5
  %135 = call i64 @strlen(ptr noundef %134) #7
  br label %136

136:                                              ; preds = %130, %128
  %137 = phi i64 [ %129, %128 ], [ %135, %130 ]
  store i64 %137, ptr %13, align 8, !tbaa !43
  br label %138

138:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %139 = load i64, ptr %13, align 8, !tbaa !43
  store i64 %139, ptr %14, align 8, !tbaa !43
  %140 = load i64, ptr %14, align 8, !tbaa !43
  %141 = icmp ne i64 %140, 0
  %142 = xor i1 %141, true
  %143 = xor i1 %142, true
  %144 = zext i1 %143 to i32
  %145 = sext i32 %144 to i64
  %146 = call i64 @llvm.expect.i64(i64 %145, i64 1)
  %147 = icmp ne i64 %146, 0
  br i1 %147, label %148, label %198

148:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %149 = load ptr, ptr %10, align 8, !tbaa !5
  %150 = load ptr, ptr %8, align 8, !tbaa !5
  %151 = load i64, ptr %12, align 8, !tbaa !43
  %152 = getelementptr inbounds ptr, ptr %150, i64 %151
  %153 = load ptr, ptr %152, align 8, !tbaa !5
  %154 = load i64, ptr %14, align 8, !tbaa !43
  %155 = call ptr @s2n_ensure_memmove_trace(ptr noundef %149, ptr noundef %153, i64 noundef %154)
  store ptr %155, ptr %15, align 8, !tbaa !5
  br label %156

156:                                              ; preds = %148
  %157 = load ptr, ptr %15, align 8, !tbaa !5
  %158 = icmp ne ptr %157, null
  br i1 %158, label %192, label %159

159:                                              ; preds = %156
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160
  %162 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %163 = getelementptr inbounds %struct.s2n_debug_info, ptr %162, i32 0, i32 0
  store ptr @.str.12, ptr %163, align 8, !tbaa !9
  %164 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %165 = getelementptr inbounds %struct.s2n_debug_info, ptr %164, i32 0, i32 0
  %166 = load ptr, ptr %165, align 8, !tbaa !9
  %167 = getelementptr inbounds i8, ptr %166, i64 21
  %168 = call ptr @strrchr(ptr noundef %167, i32 noundef 47) #7
  %169 = icmp ne ptr %168, null
  br i1 %169, label %170, label %177

170:                                              ; preds = %161
  %171 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %172 = getelementptr inbounds %struct.s2n_debug_info, ptr %171, i32 0, i32 0
  %173 = load ptr, ptr %172, align 8, !tbaa !9
  %174 = getelementptr inbounds i8, ptr %173, i64 21
  %175 = call ptr @strrchr(ptr noundef %174, i32 noundef 47) #7
  %176 = getelementptr inbounds i8, ptr %175, i64 1
  br label %182

177:                                              ; preds = %161
  %178 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %179 = getelementptr inbounds %struct.s2n_debug_info, ptr %178, i32 0, i32 0
  %180 = load ptr, ptr %179, align 8, !tbaa !9
  %181 = getelementptr inbounds i8, ptr %180, i64 21
  br label %182

182:                                              ; preds = %177, %170
  %183 = phi ptr [ %176, %170 ], [ %181, %177 ]
  %184 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %185 = getelementptr inbounds %struct.s2n_debug_info, ptr %184, i32 0, i32 1
  store ptr %183, ptr %185, align 8, !tbaa !11
  %186 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %186, align 4, !tbaa !12
  %187 = call i32 @s2n_calculate_stacktrace()
  br label %188

188:                                              ; preds = %182
  br label %189

189:                                              ; preds = %188
  store ptr null, ptr %2, align 8
  store i32 1, ptr %7, align 4
  br label %195

190:                                              ; No predecessors!
  br label %191

191:                                              ; preds = %190
  br label %192

192:                                              ; preds = %191, %156
  br label %193

193:                                              ; preds = %192
  br label %194

194:                                              ; preds = %193
  store i32 0, ptr %7, align 4
  br label %195

195:                                              ; preds = %194, %189
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  %196 = load i32, ptr %7, align 4
  switch i32 %196, label %199 [
    i32 0, label %197
  ]

197:                                              ; preds = %195
  br label %198

198:                                              ; preds = %197, %138
  store i32 0, ptr %7, align 4
  br label %199

199:                                              ; preds = %198, %195
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  %200 = load i32, ptr %7, align 4
  switch i32 %200, label %213 [
    i32 0, label %201
  ]

201:                                              ; preds = %199
  br label %202

202:                                              ; preds = %201
  br label %203

203:                                              ; preds = %202
  %204 = load ptr, ptr %10, align 8, !tbaa !5
  %205 = load i64, ptr %13, align 8, !tbaa !43
  %206 = getelementptr inbounds i8, ptr %204, i64 %205
  store i8 0, ptr %206, align 1, !tbaa !44
  %207 = load i64, ptr %13, align 8, !tbaa !43
  %208 = load ptr, ptr %10, align 8, !tbaa !5
  %209 = getelementptr inbounds i8, ptr %208, i64 %207
  store ptr %209, ptr %10, align 8, !tbaa !5
  %210 = load i64, ptr %13, align 8, !tbaa !43
  %211 = load i64, ptr %11, align 8, !tbaa !43
  %212 = sub i64 %211, %210
  store i64 %212, ptr %11, align 8, !tbaa !43
  store i32 0, ptr %7, align 4
  br label %213

213:                                              ; preds = %203, %199
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  %214 = load i32, ptr %7, align 4
  switch i32 %214, label %220 [
    i32 0, label %215
  ]

215:                                              ; preds = %213
  br label %216

216:                                              ; preds = %215, %113
  br label %217

217:                                              ; preds = %216
  %218 = load i64, ptr %12, align 8, !tbaa !43
  %219 = add i64 %218, 1
  store i64 %219, ptr %12, align 8, !tbaa !43
  br label %108, !llvm.loop !45

220:                                              ; preds = %213, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  %221 = load i32, ptr %7, align 4
  switch i32 %221, label %243 [
    i32 10, label %222
  ]

222:                                              ; preds = %220
  %223 = load ptr, ptr %10, align 8, !tbaa !5
  %224 = load i32, ptr %6, align 4, !tbaa !12
  %225 = zext i32 %224 to i64
  %226 = getelementptr inbounds [256 x [142 x i8]], ptr @handshake_type_str, i64 0, i64 %225
  %227 = getelementptr inbounds [142 x i8], ptr %226, i64 0, i64 0
  %228 = icmp ne ptr %223, %227
  br i1 %228, label %229, label %238

229:                                              ; preds = %222
  %230 = load ptr, ptr %10, align 8, !tbaa !5
  %231 = getelementptr inbounds i8, ptr %230, i64 -1
  %232 = load i8, ptr %231, align 1, !tbaa !44
  %233 = sext i8 %232 to i32
  %234 = icmp eq i32 124, %233
  br i1 %234, label %235, label %238

235:                                              ; preds = %229
  %236 = load ptr, ptr %10, align 8, !tbaa !5
  %237 = getelementptr inbounds i8, ptr %236, i64 -1
  store i8 0, ptr %237, align 1, !tbaa !44
  br label %238

238:                                              ; preds = %235, %229, %222
  %239 = load i32, ptr %6, align 4, !tbaa !12
  %240 = zext i32 %239 to i64
  %241 = getelementptr inbounds [256 x [142 x i8]], ptr @handshake_type_str, i64 0, i64 %240
  %242 = getelementptr inbounds [142 x i8], ptr %241, i64 0, i64 0
  store ptr %242, ptr %2, align 8
  store i32 1, ptr %7, align 4
  br label %243

243:                                              ; preds = %238, %220
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %244

244:                                              ; preds = %243, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %245

245:                                              ; preds = %244, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %246

246:                                              ; preds = %245, %74, %48
  %247 = load ptr, ptr %2, align 8
  ret ptr %247
}

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

declare zeroext i8 @s2n_connection_get_protocol_version(ptr noundef) #4

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

declare ptr @s2n_ensure_memmove_trace(ptr noundef, ptr noundef, i64 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 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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 0}
!15 = !{!"", !13, i64 0}
!16 = !{!17, !13, i64 2172}
!17 = !{!"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, !18, i64 160, !19, i64 168, !19, 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, !20, i64 240, !6, i64 632, !6, i64 640, !21, i64 648, !28, i64 1144, !31, i64 1688, !6, i64 1752, !7, i64 1760, !13, i64 1764, !7, i64 1768, !34, i64 1776, !34, i64 1816, !34, i64 1856, !34, i64 1896, !13, i64 1936, !19, i64 1944, !7, i64 1952, !34, i64 1960, !7, i64 2000, !7, i64 2001, !7, i64 2002, !27, i64 2003, !15, i64 2004, !15, i64 2008, !35, i64 2016, !33, i64 2208, !13, i64 2212, !33, i64 2216, !19, i64 2224, !7, i64 2232, !19, i64 2240, !19, i64 2248, !19, i64 2256, !15, i64 2264, !15, i64 2268, !7, i64 2272, !7, i64 2528, !13, i64 2784, !26, i64 2792, !13, i64 2816, !26, i64 2824, !26, i64 2848, !26, i64 2872, !37, i64 2896, !39, i64 3704, !6, i64 3760, !6, i64 3768, !7, i64 3776, !13, i64 3780, !26, i64 3784, !13, i64 3808, !41, i64 3816, !7, i64 3848, !34, i64 3992, !26, i64 4032, !26, i64 4056, !27, i64 4080, !27, i64 4081, !27, i64 4082, !33, i64 4084, !33, i64 4086, !13, i64 4088, !13, i64 4092, !26, i64 4096, !13, i64 4120, !42, i64 4128, !15, i64 4176, !7, i64 4180, !7, i64 4181}
!18 = !{!"s2n_timer", !19, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"s2n_secrets", !7, i64 0, !13, i64 388}
!21 = !{!"s2n_kex_parameters", !22, i64 0, !23, i64 8, !7, i64 24, !23, i64 56, !24, i64 72, !24, i64 184, !7, i64 296, !25, i64 360, !26, i64 448, !26, i64 472}
!22 = !{!"s2n_dh_params", !6, i64 0}
!23 = !{!"s2n_ecc_evp_params", !6, i64 0, !6, i64 8}
!24 = !{!"s2n_kem_group_params", !6, i64 0, !25, i64 8, !23, i64 96}
!25 = !{!"s2n_kem_params", !6, i64 0, !26, i64 8, !26, i64 32, !26, i64 56, !27, i64 80}
!26 = !{!"s2n_blob", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!27 = !{!"_Bool", !7, i64 0}
!28 = !{!"s2n_handshake_parameters", !29, i64 0, !29, i64 48, !26, i64 96, !13, i64 120, !30, 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}
!29 = !{!"s2n_pkey", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!30 = !{!"s2n_sig_scheme_list", !7, i64 0, !7, i64 256}
!31 = !{!"s2n_psk_parameters", !13, i64 0, !32, i64 8, !33, i64 40, !33, i64 42, !6, i64 48, !13, i64 56}
!32 = !{!"s2n_array", !26, i64 0, !13, i64 24, !13, i64 28}
!33 = !{!"short", !7, i64 0}
!34 = !{!"s2n_stuffer", !26, i64 0, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 36, !13, i64 36}
!35 = !{!"s2n_handshake", !34, 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, !36, i64 176, !13, i64 184, !13, i64 184, !13, i64 184, !13, i64 184, !13, i64 188}
!36 = !{!"s2n_offered_early_data", !6, i64 0}
!37 = !{!"s2n_client_hello", !26, i64 0, !38, i64 24, !26, i64 728, !26, i64 752, !26, 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}
!38 = !{!"", !7, i64 0, !26, i64 672, !33, i64 696}
!39 = !{!"s2n_x509_validator", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !33, i64 18, !6, i64 24, !13, i64 32, !6, i64 40, !40, i64 48, !27, i64 52}
!40 = !{!"s2n_cert_validation_info", !13, i64 0, !13, i64 0}
!41 = !{!"s2n_ticket_fields", !26, i64 0, !13, i64 24}
!42 = !{!"s2n_post_handshake", !34, i64 0, !7, i64 40}
!43 = !{!19, !19, i64 0}
!44 = !{!7, !7, i64 0}
!45 = distinct !{!45, !46}
!46 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.s2n_debug_info = type { ptr, ptr }

@_s2n_debug_info = external thread_local local_unnamed_addr global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local local_unnamed_addr global i32, align 4
@.str.10 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [8 x i8], align 1
@tls13_handshake_type_names = external hidden local_unnamed_addr global [8 x ptr], align 16
@tls12_handshake_type_names = external hidden local_unnamed_addr global [8 x ptr], align 16
@handshake_type_str = external hidden global [256 x [142 x i8]], align 16
@.str.12 = external hidden unnamed_addr constant [94 x i8], align 1

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) 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

declare i32 @s2n_handshake_validate(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @s2n_connection_get_handshake_type_name(ptr noundef %0) local_unnamed_addr #4 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %2, label %10

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

10:                                               ; preds = %1
  %11 = getelementptr inbounds i8, ptr %0, i64 2016
  %12 = tail call i32 @s2n_handshake_validate(ptr noundef nonnull %11) #7
  %13 = tail call zeroext i1 @s2n_result_is_ok(i32 %12)
  %not. = xor i1 %13, true
  %. = sext i1 %not. to i32
  %14 = tail call zeroext i1 @s2n_result_is_ok(i32 %.)
  br i1 %14, label %15, label %102

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %0, i64 2172
  %17 = load i32, ptr %16, align 4, !tbaa !13
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %102, label %19

19:                                               ; preds = %15
  %20 = tail call zeroext i8 @s2n_connection_get_protocol_version(ptr noundef nonnull %0) #7
  %21 = icmp ult i8 %20, 34
  %22 = zext i32 %17 to i64
  %23 = getelementptr inbounds [256 x [142 x i8]], ptr @handshake_type_str, i64 0, i64 %22
  %24 = load i8, ptr %23, align 2, !tbaa !41
  %.not66 = icmp eq i8 %24, 0
  br i1 %.not66, label %.preheader.preheader, label %102

.preheader.preheader:                             ; preds = %19
  %25 = and i32 %17, 1
  %.not67 = icmp eq i32 %25, 0
  br i1 %.not67, label %.preheader.1, label %26

26:                                               ; preds = %.preheader.preheader
  %tls12_handshake_type_names.val = load ptr, ptr @tls12_handshake_type_names, align 16
  %tls13_handshake_type_names.val = load ptr, ptr @tls13_handshake_type_names, align 16
  %27 = select i1 %21, ptr %tls12_handshake_type_names.val, ptr %tls13_handshake_type_names.val
  %28 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %27) #6
  %.050. = tail call i64 @llvm.umin.i64(i64 %28, i64 142)
  %.not68 = icmp eq i64 %28, 0
  br i1 %.not68, label %.thread, label %29, !prof !42

29:                                               ; preds = %26
  %30 = tail call ptr @s2n_ensure_memmove_trace(ptr noundef nonnull %23, ptr noundef %27, i64 noundef %.050.) #7
  %.not69.not = icmp eq ptr %30, null
  br i1 %.not69.not, label %89, label %.thread

.thread:                                          ; preds = %26, %29
  %31 = getelementptr inbounds i8, ptr %23, i64 %.050.
  store i8 0, ptr %31, align 1, !tbaa !41
  %32 = sub nuw nsw i64 142, %.050.
  br label %.preheader.1

.preheader.1:                                     ; preds = %.thread, %.preheader.preheader
  %.255 = phi ptr [ %23, %.preheader.preheader ], [ %31, %.thread ]
  %.252 = phi i64 [ 142, %.preheader.preheader ], [ %32, %.thread ]
  %33 = and i32 %17, 2
  %.not67.1 = icmp eq i32 %33, 0
  br i1 %.not67.1, label %.preheader.2, label %34

34:                                               ; preds = %.preheader.1
  %.val = load ptr, ptr getelementptr inbounds (i8, ptr @tls12_handshake_type_names, i64 8), align 8
  %.val85 = load ptr, ptr getelementptr inbounds (i8, ptr @tls13_handshake_type_names, i64 8), align 8
  %35 = select i1 %21, ptr %.val, ptr %.val85
  %36 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %35) #6
  %.050..1 = tail call i64 @llvm.umin.i64(i64 %.252, i64 %36)
  %.not68.1 = icmp eq i64 %.050..1, 0
  br i1 %.not68.1, label %.thread.1, label %37, !prof !42

37:                                               ; preds = %34
  %38 = tail call ptr @s2n_ensure_memmove_trace(ptr noundef nonnull %.255, ptr noundef %35, i64 noundef %.050..1) #7
  %.not69.not.1 = icmp eq ptr %38, null
  br i1 %.not69.not.1, label %89, label %.thread.1

.thread.1:                                        ; preds = %37, %34
  %39 = getelementptr inbounds i8, ptr %.255, i64 %.050..1
  store i8 0, ptr %39, align 1, !tbaa !41
  %40 = sub nsw i64 %.252, %.050..1
  br label %.preheader.2

.preheader.2:                                     ; preds = %.thread.1, %.preheader.1
  %.255.1 = phi ptr [ %.255, %.preheader.1 ], [ %39, %.thread.1 ]
  %.252.1 = phi i64 [ %.252, %.preheader.1 ], [ %40, %.thread.1 ]
  %41 = and i32 %17, 4
  %.not67.2 = icmp eq i32 %41, 0
  br i1 %.not67.2, label %.preheader.3, label %42

42:                                               ; preds = %.preheader.2
  %.val86 = load ptr, ptr getelementptr inbounds (i8, ptr @tls12_handshake_type_names, i64 16), align 16
  %.val87 = load ptr, ptr getelementptr inbounds (i8, ptr @tls13_handshake_type_names, i64 16), align 16
  %43 = select i1 %21, ptr %.val86, ptr %.val87
  %44 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %43) #6
  %.050..2 = tail call i64 @llvm.umin.i64(i64 %.252.1, i64 %44)
  %.not68.2 = icmp eq i64 %.050..2, 0
  br i1 %.not68.2, label %.thread.2, label %45, !prof !42

45:                                               ; preds = %42
  %46 = tail call ptr @s2n_ensure_memmove_trace(ptr noundef nonnull %.255.1, ptr noundef %43, i64 noundef %.050..2) #7
  %.not69.not.2 = icmp eq ptr %46, null
  br i1 %.not69.not.2, label %89, label %.thread.2

.thread.2:                                        ; preds = %45, %42
  %47 = getelementptr inbounds i8, ptr %.255.1, i64 %.050..2
  store i8 0, ptr %47, align 1, !tbaa !41
  %48 = sub i64 %.252.1, %.050..2
  br label %.preheader.3

.preheader.3:                                     ; preds = %.thread.2, %.preheader.2
  %.255.2 = phi ptr [ %.255.1, %.preheader.2 ], [ %47, %.thread.2 ]
  %.252.2 = phi i64 [ %.252.1, %.preheader.2 ], [ %48, %.thread.2 ]
  %49 = and i32 %17, 8
  %.not67.3 = icmp eq i32 %49, 0
  br i1 %.not67.3, label %.preheader.4, label %50

50:                                               ; preds = %.preheader.3
  %.val88 = load ptr, ptr getelementptr inbounds (i8, ptr @tls12_handshake_type_names, i64 24), align 8
  %.val89 = load ptr, ptr getelementptr inbounds (i8, ptr @tls13_handshake_type_names, i64 24), align 8
  %51 = select i1 %21, ptr %.val88, ptr %.val89
  %52 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %51) #6
  %.050..3 = tail call i64 @llvm.umin.i64(i64 %.252.2, i64 %52)
  %.not68.3 = icmp eq i64 %.050..3, 0
  br i1 %.not68.3, label %.thread.3, label %53, !prof !42

53:                                               ; preds = %50
  %54 = tail call ptr @s2n_ensure_memmove_trace(ptr noundef nonnull %.255.2, ptr noundef %51, i64 noundef %.050..3) #7
  %.not69.not.3 = icmp eq ptr %54, null
  br i1 %.not69.not.3, label %89, label %.thread.3

.thread.3:                                        ; preds = %53, %50
  %55 = getelementptr inbounds i8, ptr %.255.2, i64 %.050..3
  store i8 0, ptr %55, align 1, !tbaa !41
  %56 = sub i64 %.252.2, %.050..3
  br label %.preheader.4

.preheader.4:                                     ; preds = %.thread.3, %.preheader.3
  %.255.3 = phi ptr [ %.255.2, %.preheader.3 ], [ %55, %.thread.3 ]
  %.252.3 = phi i64 [ %.252.2, %.preheader.3 ], [ %56, %.thread.3 ]
  %57 = and i32 %17, 16
  %.not67.4 = icmp eq i32 %57, 0
  br i1 %.not67.4, label %.preheader.5, label %58

58:                                               ; preds = %.preheader.4
  %.val90 = load ptr, ptr getelementptr inbounds (i8, ptr @tls12_handshake_type_names, i64 32), align 16
  %.val91 = load ptr, ptr getelementptr inbounds (i8, ptr @tls13_handshake_type_names, i64 32), align 16
  %59 = select i1 %21, ptr %.val90, ptr %.val91
  %60 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %59) #6
  %.050..4 = tail call i64 @llvm.umin.i64(i64 %.252.3, i64 %60)
  %.not68.4 = icmp eq i64 %.050..4, 0
  br i1 %.not68.4, label %.thread.4, label %61, !prof !42

61:                                               ; preds = %58
  %62 = tail call ptr @s2n_ensure_memmove_trace(ptr noundef nonnull %.255.3, ptr noundef %59, i64 noundef %.050..4) #7
  %.not69.not.4 = icmp eq ptr %62, null
  br i1 %.not69.not.4, label %89, label %.thread.4

.thread.4:                                        ; preds = %61, %58
  %63 = getelementptr inbounds i8, ptr %.255.3, i64 %.050..4
  store i8 0, ptr %63, align 1, !tbaa !41
  %64 = sub i64 %.252.3, %.050..4
  br label %.preheader.5

.preheader.5:                                     ; preds = %.thread.4, %.preheader.4
  %.255.4 = phi ptr [ %.255.3, %.preheader.4 ], [ %63, %.thread.4 ]
  %.252.4 = phi i64 [ %.252.3, %.preheader.4 ], [ %64, %.thread.4 ]
  %65 = and i32 %17, 32
  %.not67.5 = icmp eq i32 %65, 0
  br i1 %.not67.5, label %.preheader.6, label %66

66:                                               ; preds = %.preheader.5
  %.val92 = load ptr, ptr getelementptr inbounds (i8, ptr @tls12_handshake_type_names, i64 40), align 8
  %.val93 = load ptr, ptr getelementptr inbounds (i8, ptr @tls13_handshake_type_names, i64 40), align 8
  %67 = select i1 %21, ptr %.val92, ptr %.val93
  %68 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %67) #6
  %.050..5 = tail call i64 @llvm.umin.i64(i64 %.252.4, i64 %68)
  %.not68.5 = icmp eq i64 %.050..5, 0
  br i1 %.not68.5, label %.thread.5, label %69, !prof !42

69:                                               ; preds = %66
  %70 = tail call ptr @s2n_ensure_memmove_trace(ptr noundef nonnull %.255.4, ptr noundef %67, i64 noundef %.050..5) #7
  %.not69.not.5 = icmp eq ptr %70, null
  br i1 %.not69.not.5, label %89, label %.thread.5

.thread.5:                                        ; preds = %69, %66
  %71 = getelementptr inbounds i8, ptr %.255.4, i64 %.050..5
  store i8 0, ptr %71, align 1, !tbaa !41
  %72 = sub i64 %.252.4, %.050..5
  br label %.preheader.6

.preheader.6:                                     ; preds = %.thread.5, %.preheader.5
  %.255.5 = phi ptr [ %.255.4, %.preheader.5 ], [ %71, %.thread.5 ]
  %.252.5 = phi i64 [ %.252.4, %.preheader.5 ], [ %72, %.thread.5 ]
  %73 = and i32 %17, 64
  %.not67.6 = icmp eq i32 %73, 0
  br i1 %.not67.6, label %.preheader.7, label %74

74:                                               ; preds = %.preheader.6
  %.val94 = load ptr, ptr getelementptr inbounds (i8, ptr @tls12_handshake_type_names, i64 48), align 16
  %.val95 = load ptr, ptr getelementptr inbounds (i8, ptr @tls13_handshake_type_names, i64 48), align 16
  %75 = select i1 %21, ptr %.val94, ptr %.val95
  %76 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %75) #6
  %.050..6 = tail call i64 @llvm.umin.i64(i64 %.252.5, i64 %76)
  %.not68.6 = icmp eq i64 %.050..6, 0
  br i1 %.not68.6, label %.thread.6, label %77, !prof !42

77:                                               ; preds = %74
  %78 = tail call ptr @s2n_ensure_memmove_trace(ptr noundef nonnull %.255.5, ptr noundef %75, i64 noundef %.050..6) #7
  %.not69.not.6 = icmp eq ptr %78, null
  br i1 %.not69.not.6, label %89, label %.thread.6

.thread.6:                                        ; preds = %77, %74
  %79 = getelementptr inbounds i8, ptr %.255.5, i64 %.050..6
  store i8 0, ptr %79, align 1, !tbaa !41
  %80 = sub i64 %.252.5, %.050..6
  br label %.preheader.7

.preheader.7:                                     ; preds = %.thread.6, %.preheader.6
  %.255.6 = phi ptr [ %.255.5, %.preheader.6 ], [ %79, %.thread.6 ]
  %.252.6 = phi i64 [ %.252.5, %.preheader.6 ], [ %80, %.thread.6 ]
  %81 = and i32 %17, 128
  %.not67.7 = icmp eq i32 %81, 0
  br i1 %.not67.7, label %88, label %82

82:                                               ; preds = %.preheader.7
  %.val96 = load ptr, ptr getelementptr inbounds (i8, ptr @tls12_handshake_type_names, i64 56), align 8
  %.val97 = load ptr, ptr getelementptr inbounds (i8, ptr @tls13_handshake_type_names, i64 56), align 8
  %83 = select i1 %21, ptr %.val96, ptr %.val97
  %84 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %83) #6
  %.050..7 = tail call i64 @llvm.umin.i64(i64 %.252.6, i64 %84)
  %.not68.7 = icmp eq i64 %.050..7, 0
  br i1 %.not68.7, label %.thread.7, label %85, !prof !42

85:                                               ; preds = %82
  %86 = tail call ptr @s2n_ensure_memmove_trace(ptr noundef nonnull %.255.6, ptr noundef %83, i64 noundef %.050..7) #7
  %.not69.not.7 = icmp eq ptr %86, null
  br i1 %.not69.not.7, label %89, label %.thread.7

.thread.7:                                        ; preds = %85, %82
  %87 = getelementptr inbounds i8, ptr %.255.6, i64 %.050..7
  store i8 0, ptr %87, align 1, !tbaa !41
  br label %88

88:                                               ; preds = %.thread.7, %.preheader.7
  %.255.7 = phi ptr [ %.255.6, %.preheader.7 ], [ %87, %.thread.7 ]
  %.not71 = icmp eq ptr %.255.7, %23
  br i1 %.not71, label %102, label %97

89:                                               ; preds = %85, %77, %69, %61, %53, %45, %37, %29
  %90 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.12, ptr %90, align 8, !tbaa !5
  %91 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.12, i64 21), i32 noundef 47) #6
  %.not70 = icmp eq ptr %91, null
  %92 = getelementptr inbounds i8, ptr %91, i64 1
  %93 = select i1 %.not70, ptr getelementptr inbounds (i8, ptr @.str.12, i64 21), ptr %92
  %94 = getelementptr inbounds i8, ptr %90, i64 8
  store ptr %93, ptr %94, align 8, !tbaa !10
  %95 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %95, align 4, !tbaa !11
  %96 = tail call i32 @s2n_calculate_stacktrace() #7
  br label %102

97:                                               ; preds = %88
  %98 = getelementptr inbounds i8, ptr %.255.7, i64 -1
  %99 = load i8, ptr %98, align 1, !tbaa !41
  %100 = icmp eq i8 %99, 124
  br i1 %100, label %101, label %102

101:                                              ; preds = %97
  store i8 0, ptr %98, align 1, !tbaa !41
  br label %102

102:                                              ; preds = %89, %15, %101, %97, %88, %19, %10, %2
  %.9 = phi ptr [ null, %2 ], [ null, %10 ], [ @.str.11, %15 ], [ %23, %19 ], [ null, %89 ], [ %23, %101 ], [ %23, %97 ], [ %23, %88 ]
  ret ptr %.9
}

declare zeroext i8 @s2n_connection_get_protocol_version(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2

declare ptr @s2n_ensure_memmove_trace(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"s2n_debug_info", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!14, !12, i64 2172}
!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 = !{!8, !8, i64 0}
!42 = !{!"branch_weights", !"expected", i32 1, i32 2000}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LowerExpectIntrinsicPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass