; 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_blob = type { ptr, i32, i32, i8 }
%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_post_handshake = type { %struct.s2n_stuffer, [4 x i8] }
%struct.s2n_atomic_flag = type { i32 }

; Function Attrs: nounwind uwtable
define dso_local ptr @s2n_connection_new(i32 noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca %struct.s2n_blob, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %struct.s2n_blob, align 8
  %8 = alloca %struct.s2n_blob, align 8
  %9 = alloca %struct.s2n_result, align 4
  %10 = alloca %struct.s2n_result, align 4
  %11 = alloca %struct.s2n_blob, align 8
  %12 = alloca %struct.s2n_result, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #6
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 24, i1 false)
  br label %13

13:                                               ; preds = %1
  %14 = call i32 @s2n_alloc(ptr noundef %4, i32 noundef 4184)
  %15 = icmp sgt i32 %14, -1
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %187

17:                                               ; preds = %13
  br label %18

18:                                               ; preds = %17
  br label %19

19:                                               ; preds = %18
  br label %20

20:                                               ; preds = %19
  %21 = call i32 @s2n_blob_zero(ptr noundef %4)
  %22 = icmp sgt i32 %21, -1
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %187

24:                                               ; preds = %20
  br label %25

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %27 = getelementptr inbounds %struct.s2n_blob, ptr %4, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  store ptr %28, ptr %6, align 8, !tbaa !12
  br label %29

29:                                               ; preds = %26
  %30 = load ptr, ptr %6, align 8, !tbaa !12
  %31 = call ptr @s2n_fetch_default_config()
  %32 = call i32 @s2n_connection_set_config(ptr noundef %30, ptr noundef %31)
  %33 = icmp sgt i32 %32, -1
  br i1 %33, label %35, label %34

34:                                               ; preds = %29
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

35:                                               ; preds = %29
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = load ptr, ptr %6, align 8, !tbaa !12
  %40 = getelementptr inbounds %struct.s2n_connection, ptr %39, i32 0, i32 13
  store i32 %38, ptr %40, align 4, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 24, i1 false)
  %41 = getelementptr inbounds %struct.s2n_blob, ptr %7, i32 0, i32 0
  %42 = getelementptr inbounds %struct.s2n_blob, ptr %7, i32 0, i32 1
  %43 = getelementptr inbounds %struct.s2n_blob, ptr %7, i32 0, i32 2
  %44 = getelementptr inbounds %struct.s2n_blob, ptr %7, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %7, i64 24, i1 false), !tbaa.struct !40
  br label %45

45:                                               ; preds = %37
  %46 = load ptr, ptr %6, align 8, !tbaa !12
  %47 = getelementptr inbounds %struct.s2n_connection, ptr %46, i32 0, i32 44
  %48 = getelementptr inbounds [2 x i8], ptr %47, i64 0, i64 0
  %49 = call i32 @s2n_blob_init(ptr noundef %4, ptr noundef %48, i32 noundef 2)
  %50 = icmp sgt i32 %49, -1
  br i1 %50, label %52, label %51

51:                                               ; preds = %45
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

52:                                               ; preds = %45
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  br label %55

55:                                               ; preds = %54
  %56 = load ptr, ptr %6, align 8, !tbaa !12
  %57 = getelementptr inbounds %struct.s2n_connection, ptr %56, i32 0, i32 45
  %58 = call i32 @s2n_stuffer_init(ptr noundef %57, ptr noundef %4)
  %59 = icmp sgt i32 %58, -1
  br i1 %59, label %61, label %60

60:                                               ; preds = %55
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

61:                                               ; preds = %55
  br label %62

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 24, i1 false)
  %64 = getelementptr inbounds %struct.s2n_blob, ptr %8, i32 0, i32 0
  %65 = getelementptr inbounds %struct.s2n_blob, ptr %8, i32 0, i32 1
  %66 = getelementptr inbounds %struct.s2n_blob, ptr %8, i32 0, i32 2
  %67 = getelementptr inbounds %struct.s2n_blob, ptr %8, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %8, i64 24, i1 false), !tbaa.struct !40
  br label %68

68:                                               ; preds = %63
  %69 = load ptr, ptr %6, align 8, !tbaa !12
  %70 = getelementptr inbounds %struct.s2n_connection, ptr %69, i32 0, i32 80
  %71 = getelementptr inbounds [138 x i8], ptr %70, i64 0, i64 0
  %72 = call i32 @s2n_blob_init(ptr noundef %4, ptr noundef %71, i32 noundef 138)
  %73 = icmp sgt i32 %72, -1
  br i1 %73, label %75, label %74

74:                                               ; preds = %68
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

75:                                               ; preds = %68
  br label %76

76:                                               ; preds = %75
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77
  %79 = load ptr, ptr %6, align 8, !tbaa !12
  %80 = getelementptr inbounds %struct.s2n_connection, ptr %79, i32 0, i32 81
  %81 = call i32 @s2n_stuffer_init(ptr noundef %80, ptr noundef %4)
  %82 = icmp sgt i32 %81, -1
  br i1 %82, label %84, label %83

83:                                               ; preds = %78
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

84:                                               ; preds = %78
  br label %85

85:                                               ; preds = %84
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86
  %88 = load ptr, ptr %6, align 8, !tbaa !12
  %89 = call i32 @s2n_prf_new(ptr noundef %88)
  %90 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  store i32 %89, ptr %90, align 4
  %91 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  %92 = load i32, ptr %91, align 4
  %93 = call zeroext i1 @s2n_result_is_ok(i32 %92)
  br i1 %93, label %95, label %94

94:                                               ; preds = %87
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

95:                                               ; preds = %87
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  %99 = load ptr, ptr %6, align 8, !tbaa !12
  %100 = getelementptr inbounds %struct.s2n_connection, ptr %99, i32 0, i32 52
  %101 = getelementptr inbounds %struct.s2n_handshake, ptr %100, i32 0, i32 1
  %102 = call i32 @s2n_handshake_hashes_new(ptr noundef %101)
  %103 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  store i32 %102, ptr %103, align 4
  %104 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  %105 = load i32, ptr %104, align 4
  %106 = call zeroext i1 @s2n_result_is_ok(i32 %105)
  br i1 %106, label %108, label %107

107:                                              ; preds = %98
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

108:                                              ; preds = %98
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 24, i1 false)
  %111 = getelementptr inbounds %struct.s2n_blob, ptr %11, i32 0, i32 0
  %112 = getelementptr inbounds %struct.s2n_blob, ptr %11, i32 0, i32 1
  %113 = getelementptr inbounds %struct.s2n_blob, ptr %11, i32 0, i32 2
  %114 = getelementptr inbounds %struct.s2n_blob, ptr %11, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %11, i64 24, i1 false), !tbaa.struct !40
  br label %115

115:                                              ; preds = %110
  %116 = load ptr, ptr %6, align 8, !tbaa !12
  %117 = getelementptr inbounds %struct.s2n_connection, ptr %116, i32 0, i32 37
  %118 = getelementptr inbounds [5 x i8], ptr %117, i64 0, i64 0
  %119 = call i32 @s2n_blob_init(ptr noundef %4, ptr noundef %118, i32 noundef 5)
  %120 = icmp sgt i32 %119, -1
  br i1 %120, label %122, label %121

121:                                              ; preds = %115
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

122:                                              ; preds = %115
  br label %123

123:                                              ; preds = %122
  br label %124

124:                                              ; preds = %123
  br label %125

125:                                              ; preds = %124
  %126 = load ptr, ptr %6, align 8, !tbaa !12
  %127 = getelementptr inbounds %struct.s2n_connection, ptr %126, i32 0, i32 38
  %128 = call i32 @s2n_stuffer_init(ptr noundef %127, ptr noundef %4)
  %129 = icmp sgt i32 %128, -1
  br i1 %129, label %131, label %130

130:                                              ; preds = %125
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

131:                                              ; preds = %125
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132
  br label %134

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

139:                                              ; preds = %134
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

140:                                              ; preds = %134
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  %144 = load ptr, ptr %6, align 8, !tbaa !12
  %145 = getelementptr inbounds %struct.s2n_connection, ptr %144, i32 0, i32 39
  %146 = call i32 @s2n_stuffer_growable_alloc(ptr noundef %145, i32 noundef 0)
  %147 = icmp sgt i32 %146, -1
  br i1 %147, label %149, label %148

148:                                              ; preds = %143
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

149:                                              ; preds = %143
  br label %150

150:                                              ; preds = %149
  br label %151

151:                                              ; preds = %150
  br label %152

152:                                              ; preds = %151
  %153 = load ptr, ptr %6, align 8, !tbaa !12
  %154 = getelementptr inbounds %struct.s2n_connection, ptr %153, i32 0, i32 52
  %155 = getelementptr inbounds %struct.s2n_handshake, ptr %154, i32 0, i32 0
  %156 = call i32 @s2n_stuffer_growable_alloc(ptr noundef %155, i32 noundef 0)
  %157 = icmp sgt i32 %156, -1
  br i1 %157, label %159, label %158

158:                                              ; preds = %152
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

159:                                              ; preds = %152
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160
  br label %162

162:                                              ; preds = %161
  %163 = load ptr, ptr %6, align 8, !tbaa !12
  %164 = getelementptr inbounds %struct.s2n_connection, ptr %163, i32 0, i32 1
  %165 = load ptr, ptr %164, align 8, !tbaa !42
  %166 = load ptr, ptr %6, align 8, !tbaa !12
  %167 = getelementptr inbounds %struct.s2n_connection, ptr %166, i32 0, i32 15
  %168 = call i32 @s2n_timer_start(ptr noundef %165, ptr noundef %167)
  %169 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  store i32 %168, ptr %169, align 4
  %170 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  %171 = load i32, ptr %170, align 4
  %172 = call zeroext i1 @s2n_result_is_ok(i32 %171)
  br i1 %172, label %174, label %173

173:                                              ; preds = %162
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

174:                                              ; preds = %162
  br label %175

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175
  br label %177

177:                                              ; preds = %176
  %178 = load ptr, ptr %6, align 8, !tbaa !12
  %179 = call i32 @s2n_connection_wipe(ptr noundef %178)
  %180 = icmp sgt i32 %179, -1
  br i1 %180, label %182, label %181

181:                                              ; preds = %177
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

182:                                              ; preds = %177
  br label %183

183:                                              ; preds = %182
  br label %184

184:                                              ; preds = %183
  %185 = load ptr, ptr %6, align 8, !tbaa !12
  store ptr %185, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %186

186:                                              ; preds = %184, %181, %173, %158, %148, %139, %130, %121, %107, %94, %83, %74, %60, %51, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %187

187:                                              ; preds = %186, %23, %16
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #6
  %188 = load ptr, ptr %2, align 8
  ret ptr %188
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

declare i32 @s2n_blob_zero(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_connection_set_config(ptr noundef, ptr noundef) #0

declare ptr @s2n_fetch_default_config() #3

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

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

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

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

declare i32 @s2n_prf_new(ptr noundef) #3

declare i32 @s2n_handshake_hashes_new(ptr noundef) #3

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_connection_wipe(ptr noundef) #0

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

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

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

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


; 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_blob = type { ptr, i32, i32, i8 }

; Function Attrs: nounwind uwtable
define dso_local ptr @s2n_connection_new(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca %struct.s2n_blob, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %2, i8 0, i64 24, i1 false)
  %3 = call i32 @s2n_alloc(ptr noundef nonnull %2, i32 noundef 4184) #5
  %4 = icmp sgt i32 %3, -1
  br i1 %4, label %5, label %66

5:                                                ; preds = %1
  %6 = call i32 @s2n_blob_zero(ptr noundef nonnull %2) #5
  %7 = icmp sgt i32 %6, -1
  br i1 %7, label %8, label %66

8:                                                ; preds = %5
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = call ptr @s2n_fetch_default_config() #5
  %11 = call i32 @s2n_connection_set_config(ptr noundef %9, ptr noundef %10)
  %12 = icmp sgt i32 %11, -1
  br i1 %12, label %13, label %66

13:                                               ; preds = %8
  %14 = getelementptr inbounds i8, ptr %9, i64 148
  store i32 %0, ptr %14, align 4, !tbaa !11
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %2, i8 0, i64 24, i1 false)
  %15 = getelementptr inbounds i8, ptr %9, i64 1952
  %16 = call i32 @s2n_blob_init(ptr noundef nonnull %2, ptr noundef nonnull %15, i32 noundef 2) #5
  %17 = icmp sgt i32 %16, -1
  br i1 %17, label %18, label %66

18:                                               ; preds = %13
  %19 = getelementptr inbounds i8, ptr %9, i64 1960
  %20 = call i32 @s2n_stuffer_init(ptr noundef nonnull %19, ptr noundef nonnull %2) #5
  %21 = icmp sgt i32 %20, -1
  br i1 %21, label %22, label %66

22:                                               ; preds = %18
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %2, i8 0, i64 24, i1 false)
  %23 = getelementptr inbounds i8, ptr %9, i64 3848
  %24 = call i32 @s2n_blob_init(ptr noundef nonnull %2, ptr noundef nonnull %23, i32 noundef 138) #5
  %25 = icmp sgt i32 %24, -1
  br i1 %25, label %26, label %66

26:                                               ; preds = %22
  %27 = getelementptr inbounds i8, ptr %9, i64 3992
  %28 = call i32 @s2n_stuffer_init(ptr noundef nonnull %27, ptr noundef nonnull %2) #5
  %29 = icmp sgt i32 %28, -1
  br i1 %29, label %30, label %66

30:                                               ; preds = %26
  %31 = call i32 @s2n_prf_new(ptr noundef nonnull %9) #5
  %32 = call zeroext i1 @s2n_result_is_ok(i32 %31)
  br i1 %32, label %33, label %66

33:                                               ; preds = %30
  %34 = getelementptr inbounds i8, ptr %9, i64 2016
  %35 = getelementptr inbounds i8, ptr %9, i64 2056
  %36 = call i32 @s2n_handshake_hashes_new(ptr noundef nonnull %35) #5
  %37 = call zeroext i1 @s2n_result_is_ok(i32 %36)
  br i1 %37, label %38, label %66

38:                                               ; preds = %33
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %2, i8 0, i64 24, i1 false)
  %39 = getelementptr inbounds i8, ptr %9, i64 1768
  %40 = call i32 @s2n_blob_init(ptr noundef nonnull %2, ptr noundef nonnull %39, i32 noundef 5) #5
  %41 = icmp sgt i32 %40, -1
  br i1 %41, label %42, label %66

42:                                               ; preds = %38
  %43 = getelementptr inbounds i8, ptr %9, i64 1776
  %44 = call i32 @s2n_stuffer_init(ptr noundef nonnull %43, ptr noundef nonnull %2) #5
  %45 = icmp sgt i32 %44, -1
  br i1 %45, label %46, label %66

46:                                               ; preds = %42
  %47 = getelementptr inbounds i8, ptr %9, i64 1896
  %48 = call i32 @s2n_stuffer_growable_alloc(ptr noundef nonnull %47, i32 noundef 0) #5
  %49 = icmp sgt i32 %48, -1
  br i1 %49, label %50, label %66

50:                                               ; preds = %46
  %51 = getelementptr inbounds i8, ptr %9, i64 1816
  %52 = call i32 @s2n_stuffer_growable_alloc(ptr noundef nonnull %51, i32 noundef 0) #5
  %53 = icmp sgt i32 %52, -1
  br i1 %53, label %54, label %66

54:                                               ; preds = %50
  %55 = call i32 @s2n_stuffer_growable_alloc(ptr noundef nonnull %34, i32 noundef 0) #5
  %56 = icmp sgt i32 %55, -1
  br i1 %56, label %57, label %66

57:                                               ; preds = %54
  %58 = getelementptr inbounds i8, ptr %9, i64 8
  %59 = load ptr, ptr %58, align 8, !tbaa !38
  %60 = getelementptr inbounds i8, ptr %9, i64 160
  %61 = call i32 @s2n_timer_start(ptr noundef %59, ptr noundef nonnull %60) #5
  %62 = call zeroext i1 @s2n_result_is_ok(i32 %61)
  br i1 %62, label %63, label %66

63:                                               ; preds = %57
  %64 = call i32 @s2n_connection_wipe(ptr noundef nonnull %9)
  %65 = icmp sgt i32 %64, -1
  %. = select i1 %65, ptr %9, ptr null
  br label %66

66:                                               ; preds = %8, %13, %18, %22, %26, %30, %33, %38, %42, %46, %50, %54, %57, %63, %5, %1
  %.1 = phi ptr [ null, %1 ], [ null, %5 ], [ null, %8 ], [ null, %13 ], [ null, %18 ], [ null, %22 ], [ null, %26 ], [ null, %30 ], [ null, %33 ], [ null, %38 ], [ null, %42 ], [ null, %46 ], [ null, %50 ], [ null, %54 ], [ null, %57 ], [ %., %63 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  ret ptr %.1
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

declare i32 @s2n_blob_zero(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_connection_set_config(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @s2n_fetch_default_config() local_unnamed_addr #3

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

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

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

declare i32 @s2n_prf_new(ptr noundef) local_unnamed_addr #3

declare i32 @s2n_handshake_hashes_new(ptr noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_connection_wipe(ptr noundef) local_unnamed_addr #0

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

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 willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #5 = { 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_blob", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !10, i64 148}
!12 = !{!"s2n_connection", !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 2, !10, i64 2, !10, i64 2, !10, i64 2, !10, i64 2, !10, i64 2, !10, i64 2, !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, !10, i64 148, !10, i64 152, !13, i64 160, !14, i64 168, !14, 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, !15, i64 240, !7, i64 632, !7, i64 640, !16, i64 648, !22, i64 1144, !25, i64 1688, !7, i64 1752, !8, i64 1760, !10, i64 1764, !8, i64 1768, !28, i64 1776, !28, i64 1816, !28, i64 1856, !28, i64 1896, !10, i64 1936, !14, i64 1944, !8, i64 1952, !28, i64 1960, !8, i64 2000, !8, i64 2001, !8, i64 2002, !21, i64 2003, !29, i64 2004, !29, i64 2008, !30, i64 2016, !27, i64 2208, !10, i64 2212, !27, i64 2216, !14, i64 2224, !8, i64 2232, !14, i64 2240, !14, i64 2248, !14, i64 2256, !29, i64 2264, !29, i64 2268, !8, i64 2272, !8, i64 2528, !10, i64 2784, !6, i64 2792, !10, i64 2816, !6, i64 2824, !6, i64 2848, !6, i64 2872, !32, i64 2896, !34, i64 3704, !7, i64 3760, !7, i64 3768, !8, i64 3776, !10, i64 3780, !6, i64 3784, !10, i64 3808, !36, i64 3816, !8, i64 3848, !28, i64 3992, !6, i64 4032, !6, i64 4056, !21, i64 4080, !21, i64 4081, !21, i64 4082, !27, i64 4084, !27, i64 4086, !10, i64 4088, !10, i64 4092, !6, i64 4096, !10, i64 4120, !37, i64 4128, !29, i64 4176, !8, i64 4180, !8, i64 4181}
!13 = !{!"s2n_timer", !14, i64 0}
!14 = !{!"long", !8, i64 0}
!15 = !{!"s2n_secrets", !8, i64 0, !10, i64 388}
!16 = !{!"s2n_kex_parameters", !17, i64 0, !18, i64 8, !8, i64 24, !18, i64 56, !19, i64 72, !19, i64 184, !8, i64 296, !20, i64 360, !6, i64 448, !6, i64 472}
!17 = !{!"s2n_dh_params", !7, i64 0}
!18 = !{!"s2n_ecc_evp_params", !7, i64 0, !7, i64 8}
!19 = !{!"s2n_kem_group_params", !7, i64 0, !20, i64 8, !18, i64 96}
!20 = !{!"s2n_kem_params", !7, i64 0, !6, i64 8, !6, i64 32, !6, i64 56, !21, i64 80}
!21 = !{!"_Bool", !8, i64 0}
!22 = !{!"s2n_handshake_parameters", !23, i64 0, !23, i64 48, !6, i64 96, !10, i64 120, !24, 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}
!23 = !{!"s2n_pkey", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!24 = !{!"s2n_sig_scheme_list", !8, i64 0, !8, i64 256}
!25 = !{!"s2n_psk_parameters", !10, i64 0, !26, i64 8, !27, i64 40, !27, i64 42, !7, i64 48, !10, i64 56}
!26 = !{!"s2n_array", !6, i64 0, !10, i64 24, !10, i64 28}
!27 = !{!"short", !8, i64 0}
!28 = !{!"s2n_stuffer", !6, i64 0, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 36, !10, i64 36}
!29 = !{!"", !10, i64 0}
!30 = !{!"s2n_handshake", !28, i64 0, !7, i64 40, !8, i64 48, !8, i64 56, !8, i64 104, !8, i64 152, !10, i64 156, !10, i64 160, !10, i64 164, !10, i64 168, !31, i64 176, !10, i64 184, !10, i64 184, !10, i64 184, !10, i64 184, !10, i64 188}
!31 = !{!"s2n_offered_early_data", !7, i64 0}
!32 = !{!"s2n_client_hello", !6, i64 0, !33, i64 24, !6, i64 728, !6, i64 752, !6, i64 776, !8, i64 800, !8, i64 801, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802}
!33 = !{!"", !8, i64 0, !6, i64 672, !27, i64 696}
!34 = !{!"s2n_x509_validator", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !27, i64 18, !7, i64 24, !10, i64 32, !7, i64 40, !35, i64 48, !21, i64 52}
!35 = !{!"s2n_cert_validation_info", !10, i64 0, !10, i64 0}
!36 = !{!"s2n_ticket_fields", !6, i64 0, !10, i64 24}
!37 = !{!"s2n_post_handshake", !28, i64 0, !8, i64 40}
!38 = !{!12, !7, i64 8}


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