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

; 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_ecc_evp_params = type { ptr, ptr }
%struct.s2n_ecc_named_curve = type { i16, i32, ptr, i8, ptr }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.9 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [91 x i8], align 1

; Function Attrs: 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: nounwind uwtable
define dso_local i32 @s2n_ecc_evp_compute_shared_secret_from_params(ptr noundef %0, ptr noundef %1, ptr noundef %2) #3 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %3
  %9 = load ptr, ptr %5, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %9, i32 0, i32 0
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = icmp ne ptr %11, null
  br i1 %12, label %44, label %13

13:                                               ; preds = %8
  br label %14

14:                                               ; preds = %13
  br label %15

15:                                               ; preds = %14
  %16 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %17 = getelementptr inbounds %struct.s2n_debug_info, ptr %16, i32 0, i32 0
  store ptr @.str.9, ptr %17, align 8, !tbaa !11
  %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
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = getelementptr inbounds i8, ptr %20, i64 21
  %22 = call ptr @strrchr(ptr noundef %21, i32 noundef 47) #4
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %31

24:                                               ; preds = %15
  %25 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %26 = getelementptr inbounds %struct.s2n_debug_info, ptr %25, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = getelementptr inbounds i8, ptr %27, i64 21
  %29 = call ptr @strrchr(ptr noundef %28, i32 noundef 47) #4
  %30 = getelementptr inbounds i8, ptr %29, i64 1
  br label %36

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

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

42:                                               ; preds = %36
  store i32 -1, ptr %4, align 4
  br label %225

43:                                               ; No predecessors!
  br label %44

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

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %47, i32 0, i32 1
  %49 = load ptr, ptr %48, align 8, !tbaa !16
  %50 = icmp ne ptr %49, null
  br i1 %50, label %82, label %51

51:                                               ; preds = %46
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  %54 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %55 = getelementptr inbounds %struct.s2n_debug_info, ptr %54, i32 0, i32 0
  store ptr @.str.10, ptr %55, align 8, !tbaa !11
  %56 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %57 = getelementptr inbounds %struct.s2n_debug_info, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !11
  %59 = getelementptr inbounds i8, ptr %58, i64 21
  %60 = call ptr @strrchr(ptr noundef %59, i32 noundef 47) #4
  %61 = icmp ne ptr %60, null
  br i1 %61, label %62, label %69

62:                                               ; preds = %53
  %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
  %65 = load ptr, ptr %64, align 8, !tbaa !11
  %66 = getelementptr inbounds i8, ptr %65, i64 21
  %67 = call ptr @strrchr(ptr noundef %66, i32 noundef 47) #4
  %68 = getelementptr inbounds i8, ptr %67, i64 1
  br label %74

69:                                               ; preds = %53
  %70 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %71 = getelementptr inbounds %struct.s2n_debug_info, ptr %70, i32 0, i32 0
  %72 = load ptr, ptr %71, align 8, !tbaa !11
  %73 = getelementptr inbounds i8, ptr %72, i64 21
  br label %74

74:                                               ; preds = %69, %62
  %75 = phi ptr [ %68, %62 ], [ %73, %69 ]
  %76 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %77 = getelementptr inbounds %struct.s2n_debug_info, ptr %76, i32 0, i32 1
  store ptr %75, ptr %77, align 8, !tbaa !13
  %78 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %78, align 4, !tbaa !14
  %79 = call i32 @s2n_calculate_stacktrace()
  br label %80

80:                                               ; preds = %74
  store i32 -1, ptr %4, align 4
  br label %225

81:                                               ; No predecessors!
  br label %82

82:                                               ; preds = %81, %46
  br label %83

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %85, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  %88 = icmp ne ptr %87, null
  br i1 %88, label %120, label %89

89:                                               ; preds = %84
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %90
  %92 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %93 = getelementptr inbounds %struct.s2n_debug_info, ptr %92, i32 0, i32 0
  store ptr @.str.11, ptr %93, align 8, !tbaa !11
  %94 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %95 = getelementptr inbounds %struct.s2n_debug_info, ptr %94, i32 0, i32 0
  %96 = load ptr, ptr %95, align 8, !tbaa !11
  %97 = getelementptr inbounds i8, ptr %96, i64 21
  %98 = call ptr @strrchr(ptr noundef %97, i32 noundef 47) #4
  %99 = icmp ne ptr %98, null
  br i1 %99, label %100, label %107

100:                                              ; preds = %91
  %101 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %102 = getelementptr inbounds %struct.s2n_debug_info, ptr %101, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !11
  %104 = getelementptr inbounds i8, ptr %103, i64 21
  %105 = call ptr @strrchr(ptr noundef %104, i32 noundef 47) #4
  %106 = getelementptr inbounds i8, ptr %105, i64 1
  br label %112

107:                                              ; preds = %91
  %108 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %109 = getelementptr inbounds %struct.s2n_debug_info, ptr %108, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !11
  %111 = getelementptr inbounds i8, ptr %110, i64 21
  br label %112

112:                                              ; preds = %107, %100
  %113 = phi ptr [ %106, %100 ], [ %111, %107 ]
  %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 1
  store ptr %113, ptr %115, align 8, !tbaa !13
  %116 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %116, align 4, !tbaa !14
  %117 = call i32 @s2n_calculate_stacktrace()
  br label %118

118:                                              ; preds = %112
  store i32 -1, ptr %4, align 4
  br label %225

119:                                              ; No predecessors!
  br label %120

120:                                              ; preds = %119, %84
  br label %121

121:                                              ; preds = %120
  br label %122

122:                                              ; preds = %121
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %123, i32 0, i32 1
  %125 = load ptr, ptr %124, align 8, !tbaa !16
  %126 = icmp ne ptr %125, null
  br i1 %126, label %158, label %127

127:                                              ; preds = %122
  br label %128

128:                                              ; preds = %127
  br label %129

129:                                              ; preds = %128
  %130 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %131 = getelementptr inbounds %struct.s2n_debug_info, ptr %130, i32 0, i32 0
  store ptr @.str.12, ptr %131, align 8, !tbaa !11
  %132 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %133 = getelementptr inbounds %struct.s2n_debug_info, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !11
  %135 = getelementptr inbounds i8, ptr %134, i64 21
  %136 = call ptr @strrchr(ptr noundef %135, i32 noundef 47) #4
  %137 = icmp ne ptr %136, null
  br i1 %137, label %138, label %145

138:                                              ; preds = %129
  %139 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %140 = getelementptr inbounds %struct.s2n_debug_info, ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !11
  %142 = getelementptr inbounds i8, ptr %141, i64 21
  %143 = call ptr @strrchr(ptr noundef %142, i32 noundef 47) #4
  %144 = getelementptr inbounds i8, ptr %143, i64 1
  br label %150

145:                                              ; preds = %129
  %146 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %147 = getelementptr inbounds %struct.s2n_debug_info, ptr %146, i32 0, i32 0
  %148 = load ptr, ptr %147, align 8, !tbaa !11
  %149 = getelementptr inbounds i8, ptr %148, i64 21
  br label %150

150:                                              ; preds = %145, %138
  %151 = phi ptr [ %144, %138 ], [ %149, %145 ]
  %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 1
  store ptr %151, ptr %153, align 8, !tbaa !13
  %154 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %154, align 4, !tbaa !14
  %155 = call i32 @s2n_calculate_stacktrace()
  br label %156

156:                                              ; preds = %150
  store i32 -1, ptr %4, align 4
  br label %225

157:                                              ; No predecessors!
  br label %158

158:                                              ; preds = %157, %122
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %161, i32 0, i32 0
  %163 = load ptr, ptr %162, align 8, !tbaa !9
  %164 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %163, i32 0, i32 0
  %165 = load i16, ptr %164, align 8, !tbaa !17
  %166 = zext i16 %165 to i32
  %167 = load ptr, ptr %6, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %167, i32 0, i32 0
  %169 = load ptr, ptr %168, align 8, !tbaa !9
  %170 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %169, i32 0, i32 0
  %171 = load i16, ptr %170, align 8, !tbaa !17
  %172 = zext i16 %171 to i32
  %173 = icmp ne i32 %166, %172
  br i1 %173, label %174, label %205

174:                                              ; preds = %160
  br label %175

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175
  %177 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %178 = getelementptr inbounds %struct.s2n_debug_info, ptr %177, i32 0, i32 0
  store ptr @.str.13, ptr %178, align 8, !tbaa !11
  %179 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %180 = getelementptr inbounds %struct.s2n_debug_info, ptr %179, i32 0, i32 0
  %181 = load ptr, ptr %180, align 8, !tbaa !11
  %182 = getelementptr inbounds i8, ptr %181, i64 21
  %183 = call ptr @strrchr(ptr noundef %182, i32 noundef 47) #4
  %184 = icmp ne ptr %183, null
  br i1 %184, label %185, label %192

185:                                              ; preds = %176
  %186 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %187 = getelementptr inbounds %struct.s2n_debug_info, ptr %186, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !11
  %189 = getelementptr inbounds i8, ptr %188, i64 21
  %190 = call ptr @strrchr(ptr noundef %189, i32 noundef 47) #4
  %191 = getelementptr inbounds i8, ptr %190, i64 1
  br label %197

192:                                              ; preds = %176
  %193 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %194 = getelementptr inbounds %struct.s2n_debug_info, ptr %193, i32 0, i32 0
  %195 = load ptr, ptr %194, align 8, !tbaa !11
  %196 = getelementptr inbounds i8, ptr %195, i64 21
  br label %197

197:                                              ; preds = %192, %185
  %198 = phi ptr [ %191, %185 ], [ %196, %192 ]
  %199 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %200 = getelementptr inbounds %struct.s2n_debug_info, ptr %199, i32 0, i32 1
  store ptr %198, ptr %200, align 8, !tbaa !13
  %201 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544356, ptr %201, align 4, !tbaa !14
  %202 = call i32 @s2n_calculate_stacktrace()
  br label %203

203:                                              ; preds = %197
  store i32 -1, ptr %4, align 4
  br label %225

204:                                              ; No predecessors!
  br label %205

205:                                              ; preds = %204, %160
  br label %206

206:                                              ; preds = %205
  br label %207

207:                                              ; preds = %206
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %208, i32 0, i32 1
  %210 = load ptr, ptr %209, align 8, !tbaa !16
  %211 = load ptr, ptr %6, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %211, i32 0, i32 1
  %213 = load ptr, ptr %212, align 8, !tbaa !16
  %214 = load ptr, ptr %5, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %214, i32 0, i32 0
  %216 = load ptr, ptr %215, align 8, !tbaa !9
  %217 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %216, i32 0, i32 0
  %218 = load i16, ptr %217, align 8, !tbaa !17
  %219 = load ptr, ptr %7, align 8, !tbaa !5
  %220 = call i32 @s2n_ecc_evp_compute_shared_secret(ptr noundef %210, ptr noundef %213, i16 noundef zeroext %218, ptr noundef %219)
  %221 = icmp sgt i32 %220, -1
  br i1 %221, label %223, label %222

222:                                              ; preds = %207
  store i32 -1, ptr %4, align 4
  br label %225

223:                                              ; preds = %207
  br label %224

224:                                              ; preds = %223
  store i32 0, ptr %4, align 4
  br label %225

225:                                              ; preds = %224, %222, %203, %156, %118, %80, %42
  %226 = load i32, ptr %4, align 4
  ret i32 %226
}

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_ecc_evp_compute_shared_secret(ptr noundef, ptr noundef, i16 noundef zeroext, ptr noundef) #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"s2n_ecc_evp_params", !6, i64 0, !6, i64 8}
!11 = !{!12, !6, i64 0}
!12 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!10, !6, i64 8}
!17 = !{!18, !19, i64 0}
!18 = !{!"s2n_ecc_named_curve", !19, i64 0, !15, i64 4, !6, i64 8, !7, i64 16, !6, i64 24}
!19 = !{!"short", !7, i64 0}


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

%struct.s2n_debug_info = type { ptr, ptr }

@_s2n_debug_info = external thread_local local_unnamed_addr global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local local_unnamed_addr global i32, align 4
@.str.9 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [91 x i8], align 1

; Function Attrs: 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: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_ecc_evp_compute_shared_secret_from_params(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #3 {
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %5, label %13

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

13:                                               ; preds = %3
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %.not20 = icmp eq ptr %15, null
  br i1 %.not20, label %16, label %24

16:                                               ; preds = %13
  %17 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.10, ptr %17, align 8, !tbaa !10
  %18 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.10, i64 21), i32 noundef 47) #4
  %.not21 = icmp eq ptr %18, null
  %19 = getelementptr inbounds i8, ptr %18, i64 1
  %20 = select i1 %.not21, ptr getelementptr inbounds (i8, ptr @.str.10, i64 21), ptr %19
  %21 = getelementptr inbounds i8, ptr %17, i64 8
  store ptr %20, ptr %21, align 8, !tbaa !12
  %22 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %22, align 4, !tbaa !13
  %23 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %58

24:                                               ; preds = %13
  %25 = load ptr, ptr %1, align 8, !tbaa !5
  %.not22 = icmp eq ptr %25, null
  br i1 %.not22, label %26, label %34

26:                                               ; preds = %24
  %27 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.11, ptr %27, align 8, !tbaa !10
  %28 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.11, i64 21), i32 noundef 47) #4
  %.not23 = icmp eq ptr %28, null
  %29 = getelementptr inbounds i8, ptr %28, i64 1
  %30 = select i1 %.not23, ptr getelementptr inbounds (i8, ptr @.str.11, i64 21), ptr %29
  %31 = getelementptr inbounds i8, ptr %27, i64 8
  store ptr %30, ptr %31, align 8, !tbaa !12
  %32 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %32, align 4, !tbaa !13
  %33 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %58

34:                                               ; preds = %24
  %35 = getelementptr inbounds i8, ptr %1, i64 8
  %36 = load ptr, ptr %35, align 8, !tbaa !15
  %.not24 = icmp eq ptr %36, null
  br i1 %.not24, label %37, label %45

37:                                               ; preds = %34
  %38 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.12, ptr %38, align 8, !tbaa !10
  %39 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.12, i64 21), i32 noundef 47) #4
  %.not25 = icmp eq ptr %39, null
  %40 = getelementptr inbounds i8, ptr %39, i64 1
  %41 = select i1 %.not25, ptr getelementptr inbounds (i8, ptr @.str.12, i64 21), ptr %40
  %42 = getelementptr inbounds i8, ptr %38, i64 8
  store ptr %41, ptr %42, align 8, !tbaa !12
  %43 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %43, align 4, !tbaa !13
  %44 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %58

45:                                               ; preds = %34
  %46 = load i16, ptr %4, align 8, !tbaa !16
  %47 = load i16, ptr %25, align 8, !tbaa !16
  %.not26 = icmp eq i16 %46, %47
  br i1 %.not26, label %56, label %48

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

56:                                               ; preds = %45
  %57 = tail call i32 @s2n_ecc_evp_compute_shared_secret(ptr noundef nonnull %15, ptr noundef nonnull %36, i16 noundef zeroext %46, ptr noundef %2)
  %.lobit = ashr i32 %57, 31
  br label %58

58:                                               ; preds = %56, %48, %37, %26, %16, %5
  %.0 = phi i32 [ -1, %48 ], [ -1, %37 ], [ -1, %26 ], [ -1, %16 ], [ -1, %5 ], [ %.lobit, %56 ]
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_ecc_evp_compute_shared_secret(ptr noundef, ptr noundef, i16 noundef zeroext, ptr noundef) local_unnamed_addr #3

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 = { 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 #4 = { nounwind willreturn memory(read) }
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_ecc_evp_params", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !7, i64 0}
!11 = !{!"s2n_debug_info", !7, i64 0, !7, i64 8}
!12 = !{!11, !7, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!6, !7, i64 8}
!16 = !{!17, !18, i64 0}
!17 = !{!"s2n_ecc_named_curve", !18, i64 0, !14, i64 4, !7, i64 8, !8, i64 16, !7, i64 24}
!18 = !{!"short", !8, i64 0}


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