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

; 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 }

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

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

9:                                                ; preds = %2
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = icmp ne ptr %10, null
  br i1 %11, label %44, label %12

12:                                               ; preds = %9
  br label %13

13:                                               ; preds = %12
  br label %14

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

23:                                               ; preds = %14
  %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) #5
  %29 = getelementptr inbounds i8, ptr %28, i64 1
  br label %35

30:                                               ; preds = %14
  %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
  br label %35

35:                                               ; preds = %30, %23
  %36 = phi ptr [ %29, %23 ], [ %34, %30 ]
  %37 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %38 = getelementptr inbounds %struct.s2n_debug_info, ptr %37, i32 0, i32 1
  store ptr %36, ptr %38, align 8, !tbaa !11
  %39 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %39, align 4, !tbaa !12
  %40 = call i32 @s2n_calculate_stacktrace()
  br label %41

41:                                               ; preds = %35
  %42 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %42, align 4, !tbaa !14
  br label %232

43:                                               ; No predecessors!
  br label %44

44:                                               ; preds = %43, %9
  br label %45

45:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.s2n_connection, ptr %46, i32 0, i32 52
  %48 = getelementptr inbounds %struct.s2n_handshake, ptr %47, i32 0, i32 5
  %49 = load i8, ptr %48, align 8, !tbaa !16
  store i8 %49, ptr %6, align 1, !tbaa !43
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.s2n_connection, ptr %50, i32 0, i32 23
  %52 = load i8, ptr %51, align 4, !tbaa !44
  %53 = zext i8 %52 to i32
  %54 = icmp eq i32 %53, 30
  br i1 %54, label %55, label %97

55:                                               ; preds = %45
  br label %56

56:                                               ; preds = %55
  %57 = load i8, ptr %6, align 1, !tbaa !43
  %58 = zext i8 %57 to i32
  %59 = icmp eq i32 %58, 36
  br i1 %59, label %94, label %60

60:                                               ; preds = %56
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  %63 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %64 = getelementptr inbounds %struct.s2n_debug_info, ptr %63, i32 0, i32 0
  store ptr @.str.1, ptr %64, align 8, !tbaa !9
  %65 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %66 = getelementptr inbounds %struct.s2n_debug_info, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = getelementptr inbounds i8, ptr %67, i64 21
  %69 = call ptr @strrchr(ptr noundef %68, i32 noundef 47) #5
  %70 = icmp ne ptr %69, null
  br i1 %70, label %71, label %78

71:                                               ; preds = %62
  %72 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %73 = getelementptr inbounds %struct.s2n_debug_info, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !9
  %75 = getelementptr inbounds i8, ptr %74, i64 21
  %76 = call ptr @strrchr(ptr noundef %75, i32 noundef 47) #5
  %77 = getelementptr inbounds i8, ptr %76, i64 1
  br label %83

78:                                               ; preds = %62
  %79 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %80 = getelementptr inbounds %struct.s2n_debug_info, ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !9
  %82 = getelementptr inbounds i8, ptr %81, i64 21
  br label %83

83:                                               ; preds = %78, %71
  %84 = phi ptr [ %77, %71 ], [ %82, %78 ]
  %85 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %86 = getelementptr inbounds %struct.s2n_debug_info, ptr %85, i32 0, i32 1
  store ptr %84, ptr %86, align 8, !tbaa !11
  %87 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %87, align 4, !tbaa !12
  %88 = call i32 @s2n_calculate_stacktrace()
  br label %89

89:                                               ; preds = %83
  br label %90

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

92:                                               ; No predecessors!
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93, %56
  br label %95

95:                                               ; preds = %94
  br label %96

96:                                               ; preds = %95
  br label %139

97:                                               ; preds = %45
  br label %98

98:                                               ; preds = %97
  %99 = load i8, ptr %6, align 1, !tbaa !43
  %100 = zext i8 %99 to i32
  %101 = icmp eq i32 %100, 12
  br i1 %101, label %136, 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.2, 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) #5
  %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) #5
  %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 402653194, ptr %129, align 4, !tbaa !12
  %130 = call i32 @s2n_calculate_stacktrace()
  br label %131

131:                                              ; preds = %125
  br label %132

132:                                              ; preds = %131
  %133 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %133, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %231

134:                                              ; No predecessors!
  br label %135

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135, %98
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137
  br label %139

139:                                              ; preds = %138, %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.s2n_connection, ptr %140, i32 0, i32 52
  %142 = getelementptr inbounds %struct.s2n_handshake, ptr %141, i32 0, i32 0
  %143 = load i8, ptr %6, align 1, !tbaa !43
  %144 = zext i8 %143 to i32
  %145 = call ptr @s2n_stuffer_raw_read(ptr noundef %142, i32 noundef %144)
  store ptr %145, ptr %8, align 8, !tbaa !5
  br label %146

146:                                              ; preds = %139
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = icmp ne ptr %147, null
  br i1 %148, label %183, label %149

149:                                              ; preds = %146
  br label %150

150:                                              ; preds = %149
  br label %151

151:                                              ; preds = %150
  %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
  store ptr @.str.3, ptr %153, align 8, !tbaa !9
  %154 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %155 = getelementptr inbounds %struct.s2n_debug_info, ptr %154, i32 0, i32 0
  %156 = load ptr, ptr %155, align 8, !tbaa !9
  %157 = getelementptr inbounds i8, ptr %156, i64 21
  %158 = call ptr @strrchr(ptr noundef %157, i32 noundef 47) #5
  %159 = icmp ne ptr %158, null
  br i1 %159, label %160, label %167

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

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

172:                                              ; preds = %167, %160
  %173 = phi ptr [ %166, %160 ], [ %171, %167 ]
  %174 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %175 = getelementptr inbounds %struct.s2n_debug_info, ptr %174, i32 0, i32 1
  store ptr %173, ptr %175, align 8, !tbaa !11
  %176 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %176, align 4, !tbaa !12
  %177 = call i32 @s2n_calculate_stacktrace()
  br label %178

178:                                              ; preds = %172
  br label %179

179:                                              ; preds = %178
  %180 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %180, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %230

181:                                              ; No predecessors!
  br label %182

182:                                              ; preds = %181
  br label %183

183:                                              ; preds = %182, %146
  br label %184

184:                                              ; preds = %183
  br label %185

185:                                              ; preds = %184
  br label %186

186:                                              ; preds = %185
  %187 = load ptr, ptr %5, align 8, !tbaa !5
  %188 = load ptr, ptr %8, align 8, !tbaa !5
  %189 = load i8, ptr %6, align 1, !tbaa !43
  %190 = zext i8 %189 to i32
  %191 = call zeroext i1 @s2n_constant_time_equals(ptr noundef %187, ptr noundef %188, i32 noundef %190)
  br i1 %191, label %226, label %192

192:                                              ; preds = %186
  br label %193

193:                                              ; preds = %192
  br label %194

194:                                              ; preds = %193
  %195 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %196 = getelementptr inbounds %struct.s2n_debug_info, ptr %195, i32 0, i32 0
  store ptr @.str.4, ptr %196, align 8, !tbaa !9
  %197 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %198 = getelementptr inbounds %struct.s2n_debug_info, ptr %197, i32 0, i32 0
  %199 = load ptr, ptr %198, align 8, !tbaa !9
  %200 = getelementptr inbounds i8, ptr %199, i64 21
  %201 = call ptr @strrchr(ptr noundef %200, i32 noundef 47) #5
  %202 = icmp ne ptr %201, null
  br i1 %202, label %203, label %210

203:                                              ; preds = %194
  %204 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %205 = getelementptr inbounds %struct.s2n_debug_info, ptr %204, i32 0, i32 0
  %206 = load ptr, ptr %205, align 8, !tbaa !9
  %207 = getelementptr inbounds i8, ptr %206, i64 21
  %208 = call ptr @strrchr(ptr noundef %207, i32 noundef 47) #5
  %209 = getelementptr inbounds i8, ptr %208, i64 1
  br label %215

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

215:                                              ; preds = %210, %203
  %216 = phi ptr [ %209, %203 ], [ %214, %210 ]
  %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 1
  store ptr %216, ptr %218, align 8, !tbaa !11
  %219 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544322, ptr %219, align 4, !tbaa !12
  %220 = call i32 @s2n_calculate_stacktrace()
  br label %221

221:                                              ; preds = %215
  br label %222

222:                                              ; preds = %221
  %223 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %223, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %230

224:                                              ; No predecessors!
  br label %225

225:                                              ; preds = %224
  br label %226

226:                                              ; preds = %225, %186
  br label %227

227:                                              ; preds = %226
  br label %228

228:                                              ; preds = %227
  %229 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 0, ptr %229, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %230

230:                                              ; preds = %228, %222, %179
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %231

231:                                              ; preds = %230, %132, %90
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  br label %232

232:                                              ; preds = %231, %41
  %233 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  %234 = load i32, ptr %233, align 4
  ret i32 %234
}

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

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

declare i32 @s2n_calculate_stacktrace() #3

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

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

declare zeroext i1 @s2n_constant_time_equals(ptr noundef, ptr noundef, i32 noundef) #3

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

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


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

%struct.s2n_debug_info = type { ptr, ptr }

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_finished_recv(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %.sink.split, label %3

3:                                                ; preds = %2
  %4 = getelementptr inbounds i8, ptr %0, i64 2016
  %5 = getelementptr inbounds i8, ptr %0, i64 2168
  %6 = load i8, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 220
  %8 = load i8, ptr %7, align 4, !tbaa !37
  %9 = icmp eq i8 %8, 30
  br i1 %9, label %10, label %12

10:                                               ; preds = %3
  %11 = icmp eq i8 %6, 36
  br i1 %11, label %14, label %.sink.split

12:                                               ; preds = %3
  %13 = icmp eq i8 %6, 12
  br i1 %13, label %14, label %.sink.split

14:                                               ; preds = %12, %10
  %15 = zext nneg i8 %6 to i32
  %16 = tail call ptr @s2n_stuffer_raw_read(ptr noundef nonnull %4, i32 noundef %15) #4
  %.not19 = icmp eq ptr %16, null
  br i1 %.not19, label %.sink.split, label %17

17:                                               ; preds = %14
  %18 = tail call zeroext i1 @s2n_constant_time_equals(ptr noundef %1, ptr noundef nonnull %16, i32 noundef %15) #4
  br i1 %18, label %26, label %.sink.split

.sink.split:                                      ; preds = %17, %14, %12, %10, %2
  %.str.1.sink = phi ptr [ @.str, %2 ], [ @.str.1, %10 ], [ @.str.2, %12 ], [ @.str.3, %14 ], [ @.str.4, %17 ]
  %.sink30 = phi ptr [ getelementptr inbounds (i8, ptr @.str, i64 21), %2 ], [ getelementptr inbounds (i8, ptr @.str.1, i64 21), %10 ], [ getelementptr inbounds (i8, ptr @.str.2, i64 21), %12 ], [ getelementptr inbounds (i8, ptr @.str.3, i64 21), %14 ], [ getelementptr inbounds (i8, ptr @.str.4, i64 21), %17 ]
  %.sink = phi i32 [ 402653193, %2 ], [ 402653194, %10 ], [ 402653194, %12 ], [ 402653193, %14 ], [ 335544322, %17 ]
  %19 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.1.sink, ptr %19, align 8, !tbaa !38
  %20 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink30, i32 noundef 47) #5
  %.not18 = icmp eq ptr %20, null
  %21 = getelementptr inbounds i8, ptr %20, i64 1
  %22 = select i1 %.not18, ptr %.sink30, ptr %21
  %23 = getelementptr inbounds i8, ptr %19, i64 8
  store ptr %22, ptr %23, align 8, !tbaa !40
  %24 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 %.sink, ptr %24, align 4, !tbaa !41
  %25 = tail call i32 @s2n_calculate_stacktrace() #4
  br label %26

26:                                               ; preds = %.sink.split, %17
  %.sroa.0.2 = phi i32 [ 0, %17 ], [ -1, %.sink.split ]
  ret i32 %.sroa.0.2
}

; 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 ptr @s2n_stuffer_raw_read(ptr noundef, i32 noundef) local_unnamed_addr #3

declare zeroext i1 @s2n_constant_time_equals(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

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


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