; LLVM IR from aws/s2n-tls :: tests/unit (s2n_self_talk_npn_test)

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

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.78 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.80 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.81 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [93 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

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

declare ptr @s2n_ensure_memmove_trace(ptr noundef, ptr noundef, i64 noundef) #2

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

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

13:                                               ; preds = %4
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %47, label %16

16:                                               ; preds = %13
  br label %17

17:                                               ; preds = %16
  br label %18

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

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

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

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

45:                                               ; preds = %39
  store i32 -1, ptr %5, align 4
  br label %235

46:                                               ; No predecessors!
  br label %47

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

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %83, label %52

52:                                               ; preds = %49
  br label %53

53:                                               ; preds = %52
  br label %54

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

63:                                               ; preds = %54
  %64 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %65 = getelementptr inbounds %struct.s2n_debug_info, ptr %64, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !11
  %67 = getelementptr inbounds i8, ptr %66, i64 21
  %68 = call ptr @strrchr(ptr noundef %67, i32 noundef 47) #6
  %69 = getelementptr inbounds i8, ptr %68, i64 1
  br label %75

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

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

81:                                               ; preds = %75
  store i32 -1, ptr %5, align 4
  br label %235

82:                                               ; No predecessors!
  br label %83

83:                                               ; preds = %82, %49
  br label %84

84:                                               ; preds = %83
  br label %85

85:                                               ; preds = %84
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = icmp ne ptr %86, null
  br i1 %87, label %119, label %88

88:                                               ; preds = %85
  br label %89

89:                                               ; preds = %88
  br label %90

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

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

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

111:                                              ; preds = %106, %99
  %112 = phi ptr [ %105, %99 ], [ %110, %106 ]
  %113 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %114 = getelementptr inbounds %struct.s2n_debug_info, ptr %113, i32 0, i32 1
  store ptr %112, ptr %114, align 8, !tbaa !13
  %115 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %115, align 4, !tbaa !9
  %116 = call i32 @s2n_calculate_stacktrace()
  br label %117

117:                                              ; preds = %111
  store i32 -1, ptr %5, align 4
  br label %235

118:                                              ; No predecessors!
  br label %119

119:                                              ; preds = %118, %85
  br label %120

120:                                              ; preds = %119
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %8, align 4, !tbaa !9
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.s2n_client_hello, ptr %123, i32 0, i32 4
  %125 = getelementptr inbounds %struct.s2n_blob, ptr %124, i32 0, i32 1
  %126 = load i32, ptr %125, align 8, !tbaa !14
  %127 = icmp uge i32 %122, %126
  br i1 %127, label %159, label %128

128:                                              ; preds = %121
  br label %129

129:                                              ; preds = %128
  br label %130

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

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

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

151:                                              ; preds = %146, %139
  %152 = phi ptr [ %145, %139 ], [ %150, %146 ]
  %153 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %154 = getelementptr inbounds %struct.s2n_debug_info, ptr %153, i32 0, i32 1
  store ptr %152, ptr %154, align 8, !tbaa !13
  %155 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762120, ptr %155, align 4, !tbaa !9
  %156 = call i32 @s2n_calculate_stacktrace()
  br label %157

157:                                              ; preds = %151
  store i32 -1, ptr %5, align 4
  br label %235

158:                                              ; No predecessors!
  br label %159

159:                                              ; preds = %158, %121
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.s2n_client_hello, ptr %162, i32 0, i32 4
  %164 = getelementptr inbounds %struct.s2n_blob, ptr %163, i32 0, i32 1
  %165 = load i32, ptr %164, align 8, !tbaa !14
  store i32 %165, ptr %10, align 4, !tbaa !9
  %166 = load i32, ptr %10, align 4, !tbaa !9
  %167 = icmp ne i32 %166, 0
  %168 = xor i1 %167, true
  %169 = xor i1 %168, true
  %170 = zext i1 %169 to i32
  %171 = sext i32 %170 to i64
  %172 = call i64 @llvm.expect.i64(i64 %171, i64 1)
  %173 = icmp ne i64 %172, 0
  br i1 %173, label %174, label %225

174:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.s2n_client_hello, ptr %176, i32 0, i32 4
  %178 = getelementptr inbounds %struct.s2n_blob, ptr %177, i32 0, i32 0
  %179 = load ptr, ptr %178, align 8, !tbaa !19
  %180 = load i32, ptr %10, align 4, !tbaa !9
  %181 = zext i32 %180 to i64
  %182 = call ptr @s2n_ensure_memmove_trace(ptr noundef %175, ptr noundef %179, i64 noundef %181)
  store ptr %182, ptr %11, align 8, !tbaa !5
  br label %183

183:                                              ; preds = %174
  %184 = load ptr, ptr %11, align 8, !tbaa !5
  %185 = icmp ne ptr %184, null
  br i1 %185, label %219, label %186

186:                                              ; preds = %183
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  %189 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %190 = getelementptr inbounds %struct.s2n_debug_info, ptr %189, i32 0, i32 0
  store ptr @.str.82, ptr %190, align 8, !tbaa !11
  %191 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %192 = getelementptr inbounds %struct.s2n_debug_info, ptr %191, i32 0, i32 0
  %193 = load ptr, ptr %192, align 8, !tbaa !11
  %194 = getelementptr inbounds i8, ptr %193, i64 21
  %195 = call ptr @strrchr(ptr noundef %194, i32 noundef 47) #6
  %196 = icmp ne ptr %195, null
  br i1 %196, label %197, label %204

197:                                              ; preds = %188
  %198 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %199 = getelementptr inbounds %struct.s2n_debug_info, ptr %198, i32 0, i32 0
  %200 = load ptr, ptr %199, align 8, !tbaa !11
  %201 = getelementptr inbounds i8, ptr %200, i64 21
  %202 = call ptr @strrchr(ptr noundef %201, i32 noundef 47) #6
  %203 = getelementptr inbounds i8, ptr %202, i64 1
  br label %209

204:                                              ; preds = %188
  %205 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %206 = getelementptr inbounds %struct.s2n_debug_info, ptr %205, i32 0, i32 0
  %207 = load ptr, ptr %206, align 8, !tbaa !11
  %208 = getelementptr inbounds i8, ptr %207, i64 21
  br label %209

209:                                              ; preds = %204, %197
  %210 = phi ptr [ %203, %197 ], [ %208, %204 ]
  %211 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %212 = getelementptr inbounds %struct.s2n_debug_info, ptr %211, i32 0, i32 1
  store ptr %210, ptr %212, align 8, !tbaa !13
  %213 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %213, align 4, !tbaa !9
  %214 = call i32 @s2n_calculate_stacktrace()
  br label %215

215:                                              ; preds = %209
  br label %216

216:                                              ; preds = %215
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %222

217:                                              ; No predecessors!
  br label %218

218:                                              ; preds = %217
  br label %219

219:                                              ; preds = %218, %183
  br label %220

220:                                              ; preds = %219
  br label %221

221:                                              ; preds = %220
  store i32 0, ptr %12, align 4
  br label %222

222:                                              ; preds = %221, %216
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  %223 = load i32, ptr %12, align 4
  switch i32 %223, label %226 [
    i32 0, label %224
  ]

224:                                              ; preds = %222
  br label %225

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

226:                                              ; preds = %225, %222
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %227 = load i32, ptr %12, align 4
  switch i32 %227, label %237 [
    i32 0, label %228
    i32 1, label %235
  ]

228:                                              ; preds = %226
  br label %229

229:                                              ; preds = %228
  %230 = load ptr, ptr %6, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.s2n_client_hello, ptr %230, i32 0, i32 4
  %232 = getelementptr inbounds %struct.s2n_blob, ptr %231, i32 0, i32 1
  %233 = load i32, ptr %232, align 8, !tbaa !14
  %234 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %233, ptr %234, align 4, !tbaa !9
  store i32 0, ptr %5, align 4
  br label %235

235:                                              ; preds = %229, %226, %157, %117, %81, %45
  %236 = load i32, ptr %5, align 4
  ret i32 %236

237:                                              ; preds = %226
  unreachable
}

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 nosync nounwind willreturn memory(none) }
attributes #5 = { 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 willreturn memory(read) }
attributes #7 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}
!14 = !{!15, !10, i64 784}
!15 = !{!"s2n_client_hello", !16, i64 0, !17, i64 24, !16, i64 728, !16, i64 752, !16, i64 776, !7, i64 800, !7, i64 801, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802}
!16 = !{!"s2n_blob", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!17 = !{!"", !7, i64 0, !16, i64 672, !18, i64 696}
!18 = !{!"short", !7, i64 0}
!19 = !{!15, !6, i64 776}


; 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.78 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.80 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.81 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [93 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

declare ptr @s2n_ensure_memmove_trace(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_client_hello_get_compression_methods(ptr noundef readonly %0, ptr noundef %1, i32 noundef %2, ptr noundef writeonly %3) local_unnamed_addr #3 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %5, label %13

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

13:                                               ; preds = %4
  %.not27 = icmp eq ptr %1, null
  br i1 %.not27, label %14, label %22

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

22:                                               ; preds = %13
  %.not29 = icmp eq ptr %3, null
  br i1 %.not29, label %23, label %31

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

31:                                               ; preds = %22
  %32 = getelementptr inbounds i8, ptr %0, i64 776
  %33 = getelementptr inbounds i8, ptr %0, i64 784
  %34 = load i32, ptr %33, align 8, !tbaa !13
  %.not31 = icmp ugt i32 %34, %2
  br i1 %.not31, label %35, label %43

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

43:                                               ; preds = %31
  %.not33 = icmp eq i32 %34, 0
  br i1 %.not33, label %55, label %44, !prof !18

44:                                               ; preds = %43
  %45 = load ptr, ptr %32, align 8, !tbaa !19
  %46 = zext i32 %34 to i64
  %47 = tail call ptr @s2n_ensure_memmove_trace(ptr noundef nonnull %1, ptr noundef %45, i64 noundef %46) #5
  %.not34.not = icmp eq ptr %47, null
  br i1 %.not34.not, label %.critedge, label %._crit_edge

._crit_edge:                                      ; preds = %44
  %.pre = load i32, ptr %33, align 8, !tbaa !13
  br label %55

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

55:                                               ; preds = %._crit_edge, %43
  %56 = phi i32 [ %.pre, %._crit_edge ], [ 0, %43 ]
  store i32 %56, ptr %3, align 4, !tbaa !11
  br label %57

57:                                               ; preds = %.critedge, %55, %35, %23, %14, %5
  %.3 = phi i32 [ -1, %.critedge ], [ 0, %55 ], [ -1, %35 ], [ -1, %23 ], [ -1, %14 ], [ -1, %5 ]
  ret i32 %.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_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 = !{!14, !12, i64 784}
!14 = !{!"s2n_client_hello", !15, i64 0, !16, i64 24, !15, i64 728, !15, i64 752, !15, i64 776, !8, i64 800, !8, i64 801, !12, i64 802, !12, i64 802, !12, i64 802, !12, i64 802, !12, i64 802, !12, i64 802, !12, i64 802}
!15 = !{!"s2n_blob", !7, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!16 = !{!"", !8, i64 0, !15, i64 672, !17, i64 696}
!17 = !{!"short", !8, i64 0}
!18 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!19 = !{!14, !7, i64 776}


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