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

; 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_cipher_suite = type { i8, ptr, ptr, [2 x i8], ptr, i32, ptr, [2 x ptr], i8, ptr, ptr, i32, i8 }
%struct.s2n_result = type { i32 }
%struct.s2n_hmac_state = type { i32, i16, i32, i16, i8, %struct.s2n_hash_state, %struct.s2n_hash_state, %struct.s2n_hash_state, %struct.s2n_hash_state, [128 x i8], [64 x i8] }
%struct.s2n_hash_state = type { ptr, i32, i8, i64, %union.anon }
%union.anon = type { %struct.s2n_hash_evp_digest }
%struct.s2n_hash_evp_digest = type { %struct.s2n_evp_digest, %struct.s2n_evp_digest }
%struct.s2n_evp_digest = type { ptr, ptr }
%struct.s2n_session_key = type { ptr }
%struct.s2n_crypto_parameters = type { ptr, %struct.s2n_session_key, %struct.s2n_session_key, %struct.s2n_hmac_state, %struct.s2n_hmac_state, [16 x i8], [16 x i8], [8 x i8], [8 x i8] }
%struct.s2n_record_algorithm = type { ptr, i32, i32, i64 }
%struct.s2n_cipher = type { i32, %union.anon.0, i8, ptr, ptr, ptr, ptr, ptr, ptr }
%union.anon.0 = type { %struct.s2n_composite_cipher }
%struct.s2n_composite_cipher = type { i8, i8, i8, ptr, ptr, ptr, ptr }

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

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

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

declare i32 @s2n_calculate_stacktrace() #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_crypto_parameters_wipe(ptr noundef %0) #6 {
  %2 = alloca %struct.s2n_result, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %struct.s2n_hmac_state, align 8
  %5 = alloca %struct.s2n_hmac_state, align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.s2n_session_key, align 8
  %8 = alloca %struct.s2n_session_key, align 8
  %9 = alloca %struct.s2n_result, align 4
  %10 = alloca %struct.s2n_result, align 4
  %11 = alloca %struct.s2n_crypto_parameters, align 8
  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 %47, 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.2, 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) #8
  %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) #8
  %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
  %45 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %45, align 4, !tbaa !14
  br label %173

46:                                               ; No predecessors!
  br label %47

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

48:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 432, ptr %4) #9
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %49, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %50, i64 432, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.start.p0(i64 432, ptr %5) #9
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %51, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 %52, i64 432, i1 false), !tbaa.struct !16
  br label %53

53:                                               ; preds = %48
  %54 = call i32 @s2n_hmac_init(ptr noundef %4, i32 noundef 0, ptr noundef null, i32 noundef 0)
  %55 = icmp sgt i32 %54, -1
  br i1 %55, label %58, label %56

56:                                               ; preds = %53
  %57 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %57, align 4, !tbaa !14
  store i32 1, ptr %6, align 4
  br label %172

58:                                               ; preds = %53
  br label %59

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60
  %62 = call i32 @s2n_hmac_init(ptr noundef %5, i32 noundef 0, ptr noundef null, i32 noundef 0)
  %63 = icmp sgt i32 %62, -1
  br i1 %63, label %66, label %64

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

66:                                               ; preds = %61
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %69, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %70, i64 8, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %71, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %72, i64 8, i1 false), !tbaa.struct !22
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %73, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !23
  %76 = icmp ne ptr %75, null
  br i1 %76, label %77, label %149

77:                                               ; preds = %68
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %78, i32 0, i32 0
  %80 = load ptr, ptr %79, align 8, !tbaa !23
  %81 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %80, i32 0, i32 6
  %82 = load ptr, ptr %81, align 8, !tbaa !28
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %149

84:                                               ; preds = %77
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %85, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !23
  %88 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %87, i32 0, i32 6
  %89 = load ptr, ptr %88, align 8, !tbaa !28
  %90 = getelementptr inbounds %struct.s2n_record_algorithm, ptr %89, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8, !tbaa !30
  %92 = icmp ne ptr %91, null
  br i1 %92, label %93, label %149

93:                                               ; preds = %84
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %94, i32 0, i32 0
  %96 = load ptr, ptr %95, align 8, !tbaa !23
  %97 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %96, i32 0, i32 6
  %98 = load ptr, ptr %97, align 8, !tbaa !28
  %99 = getelementptr inbounds %struct.s2n_record_algorithm, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !30
  %101 = getelementptr inbounds %struct.s2n_cipher, ptr %100, i32 0, i32 7
  %102 = load ptr, ptr %101, align 8, !tbaa !32
  %103 = icmp ne ptr %102, null
  br i1 %103, label %104, label %149

104:                                              ; preds = %93
  br label %105

105:                                              ; preds = %104
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %106, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8, !tbaa !23
  %109 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %108, i32 0, i32 6
  %110 = load ptr, ptr %109, align 8, !tbaa !28
  %111 = getelementptr inbounds %struct.s2n_record_algorithm, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !30
  %113 = getelementptr inbounds %struct.s2n_cipher, ptr %112, i32 0, i32 7
  %114 = load ptr, ptr %113, align 8, !tbaa !32
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %115, i32 0, i32 1
  %117 = call i32 %114(ptr noundef %116)
  %118 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  store i32 %117, ptr %118, align 4
  %119 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  %120 = load i32, ptr %119, align 4
  %121 = call zeroext i1 @s2n_result_is_ok(i32 %120)
  br i1 %121, label %124, label %122

122:                                              ; preds = %105
  %123 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %123, align 4, !tbaa !14
  store i32 1, ptr %6, align 4
  br label %171

124:                                              ; preds = %105
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125
  br label %127

127:                                              ; preds = %126
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !23
  %131 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %130, i32 0, i32 6
  %132 = load ptr, ptr %131, align 8, !tbaa !28
  %133 = getelementptr inbounds %struct.s2n_record_algorithm, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !30
  %135 = getelementptr inbounds %struct.s2n_cipher, ptr %134, i32 0, i32 7
  %136 = load ptr, ptr %135, align 8, !tbaa !32
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %137, i32 0, i32 2
  %139 = call i32 %136(ptr noundef %138)
  %140 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  store i32 %139, ptr %140, align 4
  %141 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  %142 = load i32, ptr %141, align 4
  %143 = call zeroext i1 @s2n_result_is_ok(i32 %142)
  br i1 %143, label %146, label %144

144:                                              ; preds = %127
  %145 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %145, align 4, !tbaa !14
  store i32 1, ptr %6, align 4
  br label %171

146:                                              ; preds = %127
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148, %93, %84, %77, %68
  %150 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 936, i1 false)
  %151 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %11, i32 0, i32 0
  %152 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %11, i32 0, i32 1
  %153 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %11, i32 0, i32 2
  %154 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %11, i32 0, i32 3
  %155 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %11, i32 0, i32 4
  %156 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %11, i32 0, i32 5
  %157 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %11, i32 0, i32 6
  %158 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %11, i32 0, i32 7
  %159 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %11, i32 0, i32 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %150, ptr align 8 %11, i64 936, i1 false), !tbaa.struct !34
  %160 = load ptr, ptr %3, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %160, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %161, ptr align 8 %4, i64 432, i1 false), !tbaa.struct !16
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %162, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %163, ptr align 8 %5, i64 432, i1 false), !tbaa.struct !16
  %164 = load ptr, ptr %3, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %164, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %165, ptr align 8 %7, i64 8, i1 false), !tbaa.struct !22
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %166, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %167, ptr align 8 %8, i64 8, i1 false), !tbaa.struct !22
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %168, i32 0, i32 0
  store ptr @s2n_null_cipher_suite, ptr %169, align 8, !tbaa !23
  %170 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 0, ptr %170, align 4, !tbaa !14
  store i32 1, ptr %6, align 4
  br label %171

171:                                              ; preds = %149, %144, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  br label %172

172:                                              ; preds = %171, %64, %56
  call void @llvm.lifetime.end.p0(i64 432, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 432, ptr %4) #9
  br label %173

173:                                              ; preds = %172, %44
  %174 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  %175 = load i32, ptr %174, align 4
  ret i32 %175
}

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

declare i32 @s2n_hmac_init(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #2 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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 = !{i64 0, i64 4, !12, i64 4, i64 2, !17, i64 8, i64 4, !12, i64 12, i64 2, !17, i64 14, i64 1, !19, i64 16, i64 8, !5, i64 24, i64 4, !12, i64 28, i64 1, !19, i64 32, i64 8, !20, i64 40, i64 32, !19, i64 72, i64 8, !5, i64 80, i64 4, !12, i64 84, i64 1, !19, i64 88, i64 8, !20, i64 96, i64 32, !19, i64 128, i64 8, !5, i64 136, i64 4, !12, i64 140, i64 1, !19, i64 144, i64 8, !20, i64 152, i64 32, !19, i64 184, i64 8, !5, i64 192, i64 4, !12, i64 196, i64 1, !19, i64 200, i64 8, !20, i64 208, i64 32, !19, i64 240, i64 128, !19, i64 368, i64 64, !19}
!17 = !{!18, !18, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{i64 0, i64 8, !5}
!23 = !{!24, !6, i64 0}
!24 = !{!"s2n_crypto_parameters", !6, i64 0, !25, i64 8, !25, i64 16, !26, i64 24, !26, i64 456, !7, i64 888, !7, i64 904, !7, i64 920, !7, i64 928}
!25 = !{!"s2n_session_key", !6, i64 0}
!26 = !{!"s2n_hmac_state", !13, i64 0, !18, i64 4, !13, i64 8, !18, i64 12, !7, i64 14, !27, i64 16, !27, i64 72, !27, i64 128, !27, i64 184, !7, i64 240, !7, i64 368}
!27 = !{!"s2n_hash_state", !6, i64 0, !13, i64 8, !7, i64 12, !21, i64 16, !7, i64 24}
!28 = !{!29, !6, i64 48}
!29 = !{!"s2n_cipher_suite", !13, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !6, i64 32, !13, i64 40, !6, i64 48, !7, i64 56, !7, i64 72, !6, i64 80, !6, i64 88, !13, i64 96, !7, i64 100}
!30 = !{!31, !6, i64 0}
!31 = !{!"s2n_record_algorithm", !6, i64 0, !13, i64 8, !13, i64 12, !21, i64 16}
!32 = !{!33, !6, i64 88}
!33 = !{!"s2n_cipher", !13, i64 0, !7, i64 8, !7, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!34 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, i64 4, !12, i64 28, i64 2, !17, i64 32, i64 4, !12, i64 36, i64 2, !17, i64 38, i64 1, !19, i64 40, i64 8, !5, i64 48, i64 4, !12, i64 52, i64 1, !19, i64 56, i64 8, !20, i64 64, i64 32, !19, i64 96, i64 8, !5, i64 104, i64 4, !12, i64 108, i64 1, !19, i64 112, i64 8, !20, i64 120, i64 32, !19, i64 152, i64 8, !5, i64 160, i64 4, !12, i64 164, i64 1, !19, i64 168, i64 8, !20, i64 176, i64 32, !19, i64 208, i64 8, !5, i64 216, i64 4, !12, i64 220, i64 1, !19, i64 224, i64 8, !20, i64 232, i64 32, !19, i64 264, i64 128, !19, i64 392, i64 64, !19, i64 456, i64 4, !12, i64 460, i64 2, !17, i64 464, i64 4, !12, i64 468, i64 2, !17, i64 470, i64 1, !19, i64 472, i64 8, !5, i64 480, i64 4, !12, i64 484, i64 1, !19, i64 488, i64 8, !20, i64 496, i64 32, !19, i64 528, i64 8, !5, i64 536, i64 4, !12, i64 540, i64 1, !19, i64 544, i64 8, !20, i64 552, i64 32, !19, i64 584, i64 8, !5, i64 592, i64 4, !12, i64 596, i64 1, !19, i64 600, i64 8, !20, i64 608, i64 32, !19, i64 640, i64 8, !5, i64 648, i64 4, !12, i64 652, i64 1, !19, i64 656, i64 8, !20, i64 664, i64 32, !19, i64 696, i64 128, !19, i64 824, i64 64, !19, i64 888, i64 16, !19, i64 904, i64 16, !19, i64 920, i64 8, !19, i64 928, i64 8, !19}


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

%struct.s2n_debug_info = type { ptr, ptr }
%struct.s2n_cipher_suite = type { i8, ptr, ptr, [2 x i8], ptr, i32, ptr, [2 x ptr], i8, ptr, ptr, i32, i8 }
%struct.s2n_hmac_state = type { i32, i16, i32, i16, i8, %struct.s2n_hash_state, %struct.s2n_hash_state, %struct.s2n_hash_state, %struct.s2n_hash_state, [128 x i8], [64 x i8] }
%struct.s2n_hash_state = type { ptr, i32, i8, i64, %union.anon }
%union.anon = type { %struct.s2n_hash_evp_digest }
%struct.s2n_hash_evp_digest = type { %struct.s2n_evp_digest, %struct.s2n_evp_digest }
%struct.s2n_evp_digest = 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.2 = external hidden unnamed_addr constant [86 x i8], align 1
@s2n_null_cipher_suite = external global %struct.s2n_cipher_suite, align 8

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #1

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #2

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

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

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

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

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

12:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 432, ptr nonnull %2) #9
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(432) %2, ptr noundef nonnull align 8 dereferenceable(432) %13, i64 432, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 432, ptr nonnull %3) #9
  %14 = getelementptr inbounds i8, ptr %0, i64 456
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(432) %3, ptr noundef nonnull align 8 dereferenceable(432) %14, i64 432, i1 false), !tbaa.struct !13
  %15 = call i32 @s2n_hmac_init(ptr noundef nonnull %2, i32 noundef 0, ptr noundef null, i32 noundef 0) #9
  %16 = icmp sgt i32 %15, -1
  br i1 %16, label %17, label %47

17:                                               ; preds = %12
  %18 = call i32 @s2n_hmac_init(ptr noundef nonnull %3, i32 noundef 0, ptr noundef null, i32 noundef 0) #9
  %19 = icmp sgt i32 %18, -1
  br i1 %19, label %20, label %47

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  %22 = getelementptr inbounds i8, ptr %0, i64 16
  %23 = load <2 x ptr>, ptr %21, align 8, !tbaa !17
  %24 = load ptr, ptr %0, align 8, !tbaa !20
  %.not31 = icmp eq ptr %24, null
  br i1 %.not31, label %45, label %25

25:                                               ; preds = %20
  %26 = getelementptr inbounds i8, ptr %24, i64 48
  %27 = load ptr, ptr %26, align 8, !tbaa !25
  %.not32 = icmp eq ptr %27, null
  br i1 %.not32, label %45, label %28

28:                                               ; preds = %25
  %29 = load ptr, ptr %27, align 8, !tbaa !27
  %.not33 = icmp eq ptr %29, null
  br i1 %.not33, label %45, label %30

30:                                               ; preds = %28
  %31 = getelementptr inbounds i8, ptr %29, i64 88
  %32 = load ptr, ptr %31, align 8, !tbaa !29
  %.not34 = icmp eq ptr %32, null
  br i1 %.not34, label %45, label %33

33:                                               ; preds = %30
  %34 = call i32 %32(ptr noundef nonnull %21) #9
  %35 = call zeroext i1 @s2n_result_is_ok(i32 %34)
  br i1 %35, label %36, label %47

36:                                               ; preds = %33
  %37 = load ptr, ptr %0, align 8, !tbaa !20
  %38 = getelementptr inbounds i8, ptr %37, i64 48
  %39 = load ptr, ptr %38, align 8, !tbaa !25
  %40 = load ptr, ptr %39, align 8, !tbaa !27
  %41 = getelementptr inbounds i8, ptr %40, i64 88
  %42 = load ptr, ptr %41, align 8, !tbaa !29
  %43 = call i32 %42(ptr noundef nonnull %22) #9
  %44 = call zeroext i1 @s2n_result_is_ok(i32 %43)
  br i1 %44, label %45, label %47

45:                                               ; preds = %36, %30, %28, %25, %20
  %46 = getelementptr inbounds i8, ptr %0, i64 888
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %46, i8 0, i64 48, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(432) %13, ptr noundef nonnull align 8 dereferenceable(432) %2, i64 432, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(432) %14, ptr noundef nonnull align 8 dereferenceable(432) %3, i64 432, i1 false), !tbaa.struct !13
  store <2 x ptr> %23, ptr %21, align 8, !tbaa !17
  store ptr @s2n_null_cipher_suite, ptr %0, align 8, !tbaa !20
  br label %47

47:                                               ; preds = %45, %33, %36, %17, %12
  %.sroa.024.1 = phi i32 [ -1, %12 ], [ -1, %17 ], [ 0, %45 ], [ -1, %33 ], [ -1, %36 ]
  call void @llvm.lifetime.end.p0(i64 432, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 432, ptr nonnull %2) #9
  br label %48

48:                                               ; preds = %47, %4
  %.sroa.024.2 = phi i32 [ %.sroa.024.1, %47 ], [ -1, %4 ]
  ret i32 %.sroa.024.2
}

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

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

declare i32 @s2n_hmac_init(ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"s2n_debug_info", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{i64 0, i64 4, !11, i64 4, i64 2, !14, i64 8, i64 4, !11, i64 12, i64 2, !14, i64 14, i64 1, !16, i64 16, i64 8, !17, i64 24, i64 4, !11, i64 28, i64 1, !16, i64 32, i64 8, !18, i64 40, i64 32, !16, i64 72, i64 8, !17, i64 80, i64 4, !11, i64 84, i64 1, !16, i64 88, i64 8, !18, i64 96, i64 32, !16, i64 128, i64 8, !17, i64 136, i64 4, !11, i64 140, i64 1, !16, i64 144, i64 8, !18, i64 152, i64 32, !16, i64 184, i64 8, !17, i64 192, i64 4, !11, i64 196, i64 1, !16, i64 200, i64 8, !18, i64 208, i64 32, !16, i64 240, i64 128, !16, i64 368, i64 64, !16}
!14 = !{!15, !15, i64 0}
!15 = !{!"short", !8, i64 0}
!16 = !{!8, !8, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"long", !8, i64 0}
!20 = !{!21, !7, i64 0}
!21 = !{!"s2n_crypto_parameters", !7, i64 0, !22, i64 8, !22, i64 16, !23, i64 24, !23, i64 456, !8, i64 888, !8, i64 904, !8, i64 920, !8, i64 928}
!22 = !{!"s2n_session_key", !7, i64 0}
!23 = !{!"s2n_hmac_state", !12, i64 0, !15, i64 4, !12, i64 8, !15, i64 12, !8, i64 14, !24, i64 16, !24, i64 72, !24, i64 128, !24, i64 184, !8, i64 240, !8, i64 368}
!24 = !{!"s2n_hash_state", !7, i64 0, !12, i64 8, !8, i64 12, !19, i64 16, !8, i64 24}
!25 = !{!26, !7, i64 48}
!26 = !{!"s2n_cipher_suite", !12, i64 0, !7, i64 8, !7, i64 16, !8, i64 24, !7, i64 32, !12, i64 40, !7, i64 48, !8, i64 56, !8, i64 72, !7, i64 80, !7, i64 88, !12, i64 96, !8, i64 100}
!27 = !{!28, !7, i64 0}
!28 = !{!"s2n_record_algorithm", !7, i64 0, !12, i64 8, !12, i64 12, !19, i64 16}
!29 = !{!30, !7, i64 88}
!30 = !{!"s2n_cipher", !12, i64 0, !8, i64 8, !8, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96}


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