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

; 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 [91 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [91 x i8], align 1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1

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

declare i32 @s2n_calculate_stacktrace() #3

declare i32 @s2n_stuffer_free(ptr noundef) #3

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

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

15:                                               ; preds = %12
  br label %16

16:                                               ; preds = %15
  br label %17

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

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

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

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

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

45:                                               ; No predecessors!
  br label %46

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

47:                                               ; preds = %46
  br label %48

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

62:                                               ; preds = %48
  %63 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 0, ptr %63, align 4, !tbaa !14
  br label %66

64:                                               ; preds = %48
  %65 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %65, align 4, !tbaa !14
  br label %66

66:                                               ; preds = %64, %62
  %67 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  %68 = load i32, ptr %67, align 4
  %69 = call zeroext i1 @s2n_result_is_ok(i32 %68)
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 -1, ptr %2, align 4
  br label %290

71:                                               ; preds = %66
  br label %72

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.s2n_connection, ptr %74, i32 0, i32 40
  %76 = call i32 @s2n_stuffer_validate(ptr noundef %75)
  %77 = getelementptr inbounds %struct.s2n_result, ptr %7, i32 0, i32 0
  store i32 %76, ptr %77, align 4
  %78 = getelementptr inbounds %struct.s2n_result, ptr %7, i32 0, i32 0
  %79 = load i32, ptr %78, align 4
  %80 = call zeroext i1 @s2n_result_is_ok(i32 %79)
  %81 = xor i1 %80, true
  %82 = xor i1 %81, true
  %83 = zext i1 %82 to i32
  %84 = sext i32 %83 to i64
  %85 = call i64 @llvm.expect.i64(i64 %84, i64 1)
  %86 = icmp ne i64 %85, 0
  br i1 %86, label %87, label %89

87:                                               ; preds = %73
  %88 = getelementptr inbounds %struct.s2n_result, ptr %6, i32 0, i32 0
  store i32 0, ptr %88, align 4, !tbaa !14
  br label %91

89:                                               ; preds = %73
  %90 = getelementptr inbounds %struct.s2n_result, ptr %6, i32 0, i32 0
  store i32 -1, ptr %90, align 4, !tbaa !14
  br label %91

91:                                               ; preds = %89, %87
  %92 = getelementptr inbounds %struct.s2n_result, ptr %6, i32 0, i32 0
  %93 = load i32, ptr %92, align 4
  %94 = call zeroext i1 @s2n_result_is_ok(i32 %93)
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  store i32 -1, ptr %2, align 4
  br label %290

96:                                               ; preds = %91
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.s2n_connection, ptr %99, i32 0, i32 41
  %101 = call zeroext i1 @s2n_stuffer_is_consumed(ptr noundef %100)
  br i1 %101, label %133, label %102

102:                                              ; preds = %98
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  %105 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %106 = getelementptr inbounds %struct.s2n_debug_info, ptr %105, i32 0, i32 0
  store ptr @.str.11, ptr %106, align 8, !tbaa !9
  %107 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %108 = getelementptr inbounds %struct.s2n_debug_info, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  %110 = getelementptr inbounds i8, ptr %109, i64 21
  %111 = call ptr @strrchr(ptr noundef %110, i32 noundef 47) #6
  %112 = icmp ne ptr %111, null
  br i1 %112, label %113, label %120

113:                                              ; preds = %104
  %114 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %115 = getelementptr inbounds %struct.s2n_debug_info, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  %117 = getelementptr inbounds i8, ptr %116, i64 21
  %118 = call ptr @strrchr(ptr noundef %117, i32 noundef 47) #6
  %119 = getelementptr inbounds i8, ptr %118, i64 1
  br label %125

120:                                              ; preds = %104
  %121 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %122 = getelementptr inbounds %struct.s2n_debug_info, ptr %121, i32 0, i32 0
  %123 = load ptr, ptr %122, align 8, !tbaa !9
  %124 = getelementptr inbounds i8, ptr %123, i64 21
  br label %125

125:                                              ; preds = %120, %113
  %126 = phi ptr [ %119, %113 ], [ %124, %120 ]
  %127 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %128 = getelementptr inbounds %struct.s2n_debug_info, ptr %127, i32 0, i32 1
  store ptr %126, ptr %128, align 8, !tbaa !11
  %129 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653204, ptr %129, align 4, !tbaa !12
  %130 = call i32 @s2n_calculate_stacktrace()
  br label %131

131:                                              ; preds = %125
  store i32 -1, ptr %2, align 4
  br label %290

132:                                              ; No predecessors!
  br label %133

133:                                              ; preds = %132, %98
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.s2n_connection, ptr %136, i32 0, i32 41
  %138 = call i32 @s2n_stuffer_resize(ptr noundef %137, i32 noundef 0)
  %139 = icmp sgt i32 %138, -1
  br i1 %139, label %141, label %140

140:                                              ; preds = %135
  store i32 -1, ptr %2, align 4
  br label %290

141:                                              ; preds = %135
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.s2n_connection, ptr %144, i32 0, i32 40
  %146 = call zeroext i1 @s2n_stuffer_is_consumed(ptr noundef %145)
  br i1 %146, label %178, label %147

147:                                              ; preds = %143
  br label %148

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148
  %150 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %151 = getelementptr inbounds %struct.s2n_debug_info, ptr %150, i32 0, i32 0
  store ptr @.str.12, ptr %151, align 8, !tbaa !9
  %152 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %153 = getelementptr inbounds %struct.s2n_debug_info, ptr %152, i32 0, i32 0
  %154 = load ptr, ptr %153, align 8, !tbaa !9
  %155 = getelementptr inbounds i8, ptr %154, i64 21
  %156 = call ptr @strrchr(ptr noundef %155, i32 noundef 47) #6
  %157 = icmp ne ptr %156, null
  br i1 %157, label %158, label %165

158:                                              ; preds = %149
  %159 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %160 = getelementptr inbounds %struct.s2n_debug_info, ptr %159, i32 0, i32 0
  %161 = load ptr, ptr %160, align 8, !tbaa !9
  %162 = getelementptr inbounds i8, ptr %161, i64 21
  %163 = call ptr @strrchr(ptr noundef %162, i32 noundef 47) #6
  %164 = getelementptr inbounds i8, ptr %163, i64 1
  br label %170

165:                                              ; preds = %149
  %166 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %167 = getelementptr inbounds %struct.s2n_debug_info, ptr %166, i32 0, i32 0
  %168 = load ptr, ptr %167, align 8, !tbaa !9
  %169 = getelementptr inbounds i8, ptr %168, i64 21
  br label %170

170:                                              ; preds = %165, %158
  %171 = phi ptr [ %164, %158 ], [ %169, %165 ]
  %172 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %173 = getelementptr inbounds %struct.s2n_debug_info, ptr %172, i32 0, i32 1
  store ptr %171, ptr %173, align 8, !tbaa !11
  %174 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653204, ptr %174, align 4, !tbaa !12
  %175 = call i32 @s2n_calculate_stacktrace()
  br label %176

176:                                              ; preds = %170
  store i32 -1, ptr %2, align 4
  br label %290

177:                                              ; No predecessors!
  br label %178

178:                                              ; preds = %177, %143
  br label %179

179:                                              ; preds = %178
  %180 = load ptr, ptr %3, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.s2n_connection, ptr %180, i32 0, i32 39
  %182 = call zeroext i1 @s2n_stuffer_is_consumed(ptr noundef %181)
  br i1 %182, label %183, label %192

183:                                              ; preds = %179
  br label %184

184:                                              ; preds = %183
  %185 = load ptr, ptr %3, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.s2n_connection, ptr %185, i32 0, i32 39
  %187 = call i32 @s2n_stuffer_resize(ptr noundef %186, i32 noundef 0)
  %188 = icmp sgt i32 %187, -1
  br i1 %188, label %190, label %189

189:                                              ; preds = %184
  store i32 -1, ptr %2, align 4
  br label %290

190:                                              ; preds = %184
  br label %191

191:                                              ; preds = %190
  br label %192

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

193:                                              ; preds = %192
  %194 = load ptr, ptr %3, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.s2n_connection, ptr %194, i32 0, i32 93
  %196 = getelementptr inbounds %struct.s2n_post_handshake, ptr %195, i32 0, i32 0
  %197 = call zeroext i1 @s2n_stuffer_is_consumed(ptr noundef %196)
  br i1 %197, label %229, label %198

198:                                              ; preds = %193
  br label %199

199:                                              ; preds = %198
  br label %200

200:                                              ; preds = %199
  %201 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %202 = getelementptr inbounds %struct.s2n_debug_info, ptr %201, i32 0, i32 0
  store ptr @.str.13, ptr %202, align 8, !tbaa !9
  %203 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %204 = getelementptr inbounds %struct.s2n_debug_info, ptr %203, i32 0, i32 0
  %205 = load ptr, ptr %204, align 8, !tbaa !9
  %206 = getelementptr inbounds i8, ptr %205, i64 21
  %207 = call ptr @strrchr(ptr noundef %206, i32 noundef 47) #6
  %208 = icmp ne ptr %207, null
  br i1 %208, label %209, label %216

209:                                              ; preds = %200
  %210 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %211 = getelementptr inbounds %struct.s2n_debug_info, ptr %210, i32 0, i32 0
  %212 = load ptr, ptr %211, align 8, !tbaa !9
  %213 = getelementptr inbounds i8, ptr %212, i64 21
  %214 = call ptr @strrchr(ptr noundef %213, i32 noundef 47) #6
  %215 = getelementptr inbounds i8, ptr %214, i64 1
  br label %221

216:                                              ; preds = %200
  %217 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %218 = getelementptr inbounds %struct.s2n_debug_info, ptr %217, i32 0, i32 0
  %219 = load ptr, ptr %218, align 8, !tbaa !9
  %220 = getelementptr inbounds i8, ptr %219, i64 21
  br label %221

221:                                              ; preds = %216, %209
  %222 = phi ptr [ %215, %209 ], [ %220, %216 ]
  %223 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %224 = getelementptr inbounds %struct.s2n_debug_info, ptr %223, i32 0, i32 1
  store ptr %222, ptr %224, align 8, !tbaa !11
  %225 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653204, ptr %225, align 4, !tbaa !12
  %226 = call i32 @s2n_calculate_stacktrace()
  br label %227

227:                                              ; preds = %221
  store i32 -1, ptr %2, align 4
  br label %290

228:                                              ; No predecessors!
  br label %229

229:                                              ; preds = %228, %193
  br label %230

230:                                              ; preds = %229
  br label %231

231:                                              ; preds = %230
  %232 = load ptr, ptr %3, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.s2n_connection, ptr %232, i32 0, i32 93
  %234 = getelementptr inbounds %struct.s2n_post_handshake, ptr %233, i32 0, i32 0
  %235 = call i32 @s2n_stuffer_free(ptr noundef %234)
  %236 = icmp sgt i32 %235, -1
  br i1 %236, label %238, label %237

237:                                              ; preds = %231
  store i32 -1, ptr %2, align 4
  br label %290

238:                                              ; preds = %231
  br label %239

239:                                              ; preds = %238
  br label %240

240:                                              ; preds = %239
  %241 = load ptr, ptr %3, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.s2n_connection, ptr %241, i32 0, i32 41
  %243 = call i32 @s2n_stuffer_validate(ptr noundef %242)
  %244 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  store i32 %243, ptr %244, align 4
  %245 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  %246 = load i32, ptr %245, align 4
  %247 = call zeroext i1 @s2n_result_is_ok(i32 %246)
  %248 = xor i1 %247, true
  %249 = xor i1 %248, true
  %250 = zext i1 %249 to i32
  %251 = sext i32 %250 to i64
  %252 = call i64 @llvm.expect.i64(i64 %251, i64 1)
  %253 = icmp ne i64 %252, 0
  br i1 %253, label %254, label %256

254:                                              ; preds = %240
  %255 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  store i32 0, ptr %255, align 4, !tbaa !14
  br label %258

256:                                              ; preds = %240
  %257 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  store i32 -1, ptr %257, align 4, !tbaa !14
  br label %258

258:                                              ; preds = %256, %254
  %259 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  %260 = load i32, ptr %259, align 4
  %261 = call zeroext i1 @s2n_result_is_ok(i32 %260)
  br i1 %261, label %263, label %262

262:                                              ; preds = %258
  store i32 -1, ptr %2, align 4
  br label %290

263:                                              ; preds = %258
  br label %264

264:                                              ; preds = %263
  br label %265

265:                                              ; preds = %264
  %266 = load ptr, ptr %3, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.s2n_connection, ptr %266, i32 0, i32 40
  %268 = call i32 @s2n_stuffer_validate(ptr noundef %267)
  %269 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  store i32 %268, ptr %269, align 4
  %270 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  %271 = load i32, ptr %270, align 4
  %272 = call zeroext i1 @s2n_result_is_ok(i32 %271)
  %273 = xor i1 %272, true
  %274 = xor i1 %273, true
  %275 = zext i1 %274 to i32
  %276 = sext i32 %275 to i64
  %277 = call i64 @llvm.expect.i64(i64 %276, i64 1)
  %278 = icmp ne i64 %277, 0
  br i1 %278, label %279, label %281

279:                                              ; preds = %265
  %280 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  store i32 0, ptr %280, align 4, !tbaa !14
  br label %283

281:                                              ; preds = %265
  %282 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  store i32 -1, ptr %282, align 4, !tbaa !14
  br label %283

283:                                              ; preds = %281, %279
  %284 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  %285 = load i32, ptr %284, align 4
  %286 = call zeroext i1 @s2n_result_is_ok(i32 %285)
  br i1 %286, label %288, label %287

287:                                              ; preds = %283
  store i32 -1, ptr %2, align 4
  br label %290

288:                                              ; preds = %283
  br label %289

289:                                              ; preds = %288
  store i32 0, ptr %2, align 4
  br label %290

290:                                              ; preds = %289, %287, %262, %237, %227, %189, %176, %140, %131, %95, %70, %44
  %291 = load i32, ptr %2, align 4
  ret i32 %291
}

declare i32 @s2n_stuffer_validate(ptr noundef) #3

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

declare zeroext i1 @s2n_stuffer_is_consumed(ptr noundef) #3

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

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

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

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


; 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 [91 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [91 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_stuffer_free(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_connection_release_buffers(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) #5
  %.not24 = icmp eq ptr %4, null
  %5 = getelementptr inbounds i8, ptr %4, i64 1
  %6 = select i1 %.not24, 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() #6
  br label %71

10:                                               ; preds = %1
  %11 = getelementptr inbounds i8, ptr %0, i64 1896
  %12 = tail call i32 @s2n_stuffer_validate(ptr noundef nonnull %11) #6
  %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 %71

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %0, i64 1856
  %17 = tail call i32 @s2n_stuffer_validate(ptr noundef nonnull %16) #6
  %18 = tail call zeroext i1 @s2n_result_is_ok(i32 %17)
  %not.31 = xor i1 %18, true
  %.28 = sext i1 %not.31 to i32
  %19 = tail call zeroext i1 @s2n_result_is_ok(i32 %.28)
  br i1 %19, label %20, label %71

20:                                               ; preds = %15
  %21 = tail call zeroext i1 @s2n_stuffer_is_consumed(ptr noundef nonnull %11) #6
  br i1 %21, label %30, label %22

22:                                               ; preds = %20
  %23 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.11, ptr %23, align 8, !tbaa !5
  %24 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.11, i64 21), i32 noundef 47) #5
  %.not25 = icmp eq ptr %24, null
  %25 = getelementptr inbounds i8, ptr %24, i64 1
  %26 = select i1 %.not25, ptr getelementptr inbounds (i8, ptr @.str.11, 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 402653204, ptr %28, align 4, !tbaa !11
  %29 = tail call i32 @s2n_calculate_stacktrace() #6
  br label %71

30:                                               ; preds = %20
  %31 = tail call i32 @s2n_stuffer_resize(ptr noundef nonnull %11, i32 noundef 0) #6
  %32 = icmp sgt i32 %31, -1
  br i1 %32, label %33, label %71

33:                                               ; preds = %30
  %34 = tail call zeroext i1 @s2n_stuffer_is_consumed(ptr noundef nonnull %16) #6
  br i1 %34, label %43, label %35

35:                                               ; preds = %33
  %36 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.12, ptr %36, align 8, !tbaa !5
  %37 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.12, i64 21), i32 noundef 47) #5
  %.not26 = icmp eq ptr %37, null
  %38 = getelementptr inbounds i8, ptr %37, i64 1
  %39 = select i1 %.not26, ptr getelementptr inbounds (i8, ptr @.str.12, i64 21), ptr %38
  %40 = getelementptr inbounds i8, ptr %36, i64 8
  store ptr %39, ptr %40, align 8, !tbaa !10
  %41 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653204, ptr %41, align 4, !tbaa !11
  %42 = tail call i32 @s2n_calculate_stacktrace() #6
  br label %71

43:                                               ; preds = %33
  %44 = getelementptr inbounds i8, ptr %0, i64 1816
  %45 = tail call zeroext i1 @s2n_stuffer_is_consumed(ptr noundef nonnull %44) #6
  br i1 %45, label %46, label %49

46:                                               ; preds = %43
  %47 = tail call i32 @s2n_stuffer_resize(ptr noundef nonnull %44, i32 noundef 0) #6
  %48 = icmp sgt i32 %47, -1
  br i1 %48, label %49, label %71

49:                                               ; preds = %43, %46
  %50 = getelementptr inbounds i8, ptr %0, i64 4128
  %51 = tail call zeroext i1 @s2n_stuffer_is_consumed(ptr noundef nonnull %50) #6
  br i1 %51, label %60, label %52

52:                                               ; preds = %49
  %53 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.13, ptr %53, align 8, !tbaa !5
  %54 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.13, i64 21), i32 noundef 47) #5
  %.not27 = icmp eq ptr %54, null
  %55 = getelementptr inbounds i8, ptr %54, i64 1
  %56 = select i1 %.not27, ptr getelementptr inbounds (i8, ptr @.str.13, i64 21), ptr %55
  %57 = getelementptr inbounds i8, ptr %53, i64 8
  store ptr %56, ptr %57, align 8, !tbaa !10
  %58 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653204, ptr %58, align 4, !tbaa !11
  %59 = tail call i32 @s2n_calculate_stacktrace() #6
  br label %71

60:                                               ; preds = %49
  %61 = tail call i32 @s2n_stuffer_free(ptr noundef nonnull %50) #6
  %62 = icmp sgt i32 %61, -1
  br i1 %62, label %63, label %71

63:                                               ; preds = %60
  %64 = tail call i32 @s2n_stuffer_validate(ptr noundef nonnull %11) #6
  %65 = tail call zeroext i1 @s2n_result_is_ok(i32 %64)
  %not.32 = xor i1 %65, true
  %.29 = sext i1 %not.32 to i32
  %66 = tail call zeroext i1 @s2n_result_is_ok(i32 %.29)
  br i1 %66, label %67, label %71

67:                                               ; preds = %63
  %68 = tail call i32 @s2n_stuffer_validate(ptr noundef nonnull %16) #6
  %69 = tail call zeroext i1 @s2n_result_is_ok(i32 %68)
  %not.33 = xor i1 %69, true
  %.30 = sext i1 %not.33 to i32
  %70 = tail call zeroext i1 @s2n_result_is_ok(i32 %.30)
  %not.34 = xor i1 %70, true
  %spec.select = sext i1 %not.34 to i32
  br label %71

71:                                               ; preds = %67, %63, %60, %46, %30, %15, %10, %52, %35, %22, %2
  %.0 = phi i32 [ -1, %52 ], [ -1, %35 ], [ -1, %22 ], [ -1, %2 ], [ -1, %10 ], [ -1, %15 ], [ -1, %30 ], [ -1, %46 ], [ -1, %60 ], [ -1, %63 ], [ %spec.select, %67 ]
  ret i32 %.0
}

declare i32 @s2n_stuffer_validate(ptr noundef) local_unnamed_addr #3

declare zeroext i1 @s2n_stuffer_is_consumed(ptr noundef) local_unnamed_addr #3

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

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 = { nounwind willreturn memory(read) }
attributes #6 = { 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}


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