; LLVM IR from aws/s2n-tls :: tests/testlib (s2n_ktls_test_utils)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.s2n_debug_info = type { ptr, ptr }
%struct.s2n_result = type { i32 }
%struct.s2n_test_ktls_io_stuffer_pair = type { %struct.s2n_test_ktls_io_stuffer, %struct.s2n_test_ktls_io_stuffer }
%struct.s2n_test_ktls_io_stuffer = type { %struct.s2n_stuffer, %struct.s2n_stuffer, i64, i64 }
%struct.s2n_stuffer = type { %struct.s2n_blob, i32, i32, i32, 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.11 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [106 x i8], align 1

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

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

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

declare i32 @s2n_calculate_stacktrace() #3

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_test_init_ktls_io_stuffer(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca %struct.s2n_result, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %struct.s2n_result, align 4
  %9 = alloca %struct.s2n_result, align 4
  %10 = alloca %struct.s2n_result, align 4
  %11 = alloca %struct.s2n_result, align 4
  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 %12

12:                                               ; preds = %3
  %13 = load ptr, ptr %5, 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.11, 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) #5
  %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) #5
  %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 %4, i32 0, i32 0
  store i32 -1, ptr %45, align 4, !tbaa !14
  br label %216

46:                                               ; No predecessors!
  br label %47

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

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %84, 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.12, ptr %56, align 8, !tbaa !9
  %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 !9
  %60 = getelementptr inbounds i8, ptr %59, i64 21
  %61 = call ptr @strrchr(ptr noundef %60, i32 noundef 47) #5
  %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 !9
  %67 = getelementptr inbounds i8, ptr %66, i64 21
  %68 = call ptr @strrchr(ptr noundef %67, i32 noundef 47) #5
  %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 !9
  %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 !11
  %79 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %79, align 4, !tbaa !12
  %80 = call i32 @s2n_calculate_stacktrace()
  br label %81

81:                                               ; preds = %75
  %82 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %82, align 4, !tbaa !14
  br label %216

83:                                               ; No predecessors!
  br label %84

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

85:                                               ; preds = %84
  br label %86

86:                                               ; preds = %85
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = icmp ne ptr %87, null
  br i1 %88, label %121, label %89

89:                                               ; preds = %86
  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.13, ptr %93, align 8, !tbaa !9
  %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 !9
  %97 = getelementptr inbounds i8, ptr %96, i64 21
  %98 = call ptr @strrchr(ptr noundef %97, i32 noundef 47) #5
  %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 !9
  %104 = getelementptr inbounds i8, ptr %103, i64 21
  %105 = call ptr @strrchr(ptr noundef %104, i32 noundef 47) #5
  %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 !9
  %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 !11
  %116 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %116, align 4, !tbaa !12
  %117 = call i32 @s2n_calculate_stacktrace()
  br label %118

118:                                              ; preds = %112
  %119 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %119, align 4, !tbaa !14
  br label %216

120:                                              ; No predecessors!
  br label %121

121:                                              ; preds = %120, %86
  br label %122

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer_pair, ptr %124, i32 0, i32 1
  %126 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer, ptr %125, i32 0, i32 1
  %127 = call i32 @s2n_stuffer_growable_alloc(ptr noundef %126, i32 noundef 0)
  %128 = icmp sgt i32 %127, -1
  br i1 %128, label %131, label %129

129:                                              ; preds = %123
  %130 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %130, align 4, !tbaa !14
  br label %216

131:                                              ; preds = %123
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer_pair, ptr %134, i32 0, i32 1
  %136 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer, ptr %135, i32 0, i32 0
  %137 = call i32 @s2n_stuffer_growable_alloc(ptr noundef %136, i32 noundef 0)
  %138 = icmp sgt i32 %137, -1
  br i1 %138, label %141, label %139

139:                                              ; preds = %133
  %140 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %140, align 4, !tbaa !14
  br label %216

141:                                              ; preds = %133
  br label %142

142:                                              ; preds = %141
  br label %143

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

149:                                              ; preds = %143
  %150 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %150, align 4, !tbaa !14
  br label %216

151:                                              ; preds = %143
  br label %152

152:                                              ; preds = %151
  br label %153

153:                                              ; preds = %152
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer_pair, ptr %154, i32 0, i32 0
  %156 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer, ptr %155, i32 0, i32 0
  %157 = call i32 @s2n_stuffer_growable_alloc(ptr noundef %156, i32 noundef 0)
  %158 = icmp sgt i32 %157, -1
  br i1 %158, label %161, label %159

159:                                              ; preds = %153
  %160 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %160, align 4, !tbaa !14
  br label %216

161:                                              ; preds = %153
  br label %162

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162
  %164 = load ptr, ptr %5, align 8, !tbaa !5
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer_pair, ptr %165, i32 0, i32 0
  %167 = call i32 @s2n_ktls_set_sendmsg_cb(ptr noundef %164, ptr noundef @s2n_test_ktls_sendmsg_io_stuffer, ptr noundef %166)
  %168 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  store i32 %167, ptr %168, align 4
  %169 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  %170 = load i32, ptr %169, align 4
  %171 = call zeroext i1 @s2n_result_is_ok(i32 %170)
  br i1 %171, label %174, label %172

172:                                              ; preds = %163
  %173 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %173, align 4, !tbaa !14
  br label %216

174:                                              ; preds = %163
  br label %175

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer_pair, ptr %178, i32 0, i32 1
  %180 = call i32 @s2n_ktls_set_recvmsg_cb(ptr noundef %177, ptr noundef @s2n_test_ktls_recvmsg_io_stuffer, ptr noundef %179)
  %181 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  store i32 %180, ptr %181, align 4
  %182 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  %183 = load i32, ptr %182, align 4
  %184 = call zeroext i1 @s2n_result_is_ok(i32 %183)
  br i1 %184, label %187, label %185

185:                                              ; preds = %176
  %186 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %186, align 4, !tbaa !14
  br label %216

187:                                              ; preds = %176
  br label %188

188:                                              ; preds = %187
  br label %189

189:                                              ; preds = %188
  %190 = load ptr, ptr %6, align 8, !tbaa !5
  %191 = load ptr, ptr %7, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer_pair, ptr %191, i32 0, i32 1
  %193 = call i32 @s2n_ktls_set_sendmsg_cb(ptr noundef %190, ptr noundef @s2n_test_ktls_sendmsg_io_stuffer, ptr noundef %192)
  %194 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  store i32 %193, ptr %194, align 4
  %195 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  %196 = load i32, ptr %195, align 4
  %197 = call zeroext i1 @s2n_result_is_ok(i32 %196)
  br i1 %197, label %200, label %198

198:                                              ; preds = %189
  %199 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %199, align 4, !tbaa !14
  br label %216

200:                                              ; preds = %189
  br label %201

201:                                              ; preds = %200
  br label %202

202:                                              ; preds = %201
  %203 = load ptr, ptr %6, align 8, !tbaa !5
  %204 = load ptr, ptr %7, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer_pair, ptr %204, i32 0, i32 0
  %206 = call i32 @s2n_ktls_set_recvmsg_cb(ptr noundef %203, ptr noundef @s2n_test_ktls_recvmsg_io_stuffer, ptr noundef %205)
  %207 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  store i32 %206, ptr %207, align 4
  %208 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  %209 = load i32, ptr %208, align 4
  %210 = call zeroext i1 @s2n_result_is_ok(i32 %209)
  br i1 %210, label %213, label %211

211:                                              ; preds = %202
  %212 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %212, align 4, !tbaa !14
  br label %216

213:                                              ; preds = %202
  br label %214

214:                                              ; preds = %213
  %215 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 0, ptr %215, align 4, !tbaa !14
  br label %216

216:                                              ; preds = %214, %211, %198, %185, %172, %159, %149, %139, %129, %118, %81, %44
  %217 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  %218 = load i32, ptr %217, align 4
  ret i32 %218
}

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

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


; 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.11 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [106 x i8], align 1

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

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

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #3

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

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

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

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

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

4:                                                ; preds = %3
  %5 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.11, ptr %5, align 8, !tbaa !5
  %6 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.11, i64 21), i32 noundef 47) #5
  %.not24 = icmp eq ptr %6, null
  %7 = getelementptr inbounds i8, ptr %6, i64 1
  %8 = select i1 %.not24, ptr getelementptr inbounds (i8, ptr @.str.11, 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() #6
  br label %57

12:                                               ; preds = %3
  %.not25 = icmp eq ptr %1, null
  br i1 %.not25, label %13, label %21

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

21:                                               ; preds = %12
  %.not27 = icmp eq ptr %2, null
  br i1 %.not27, label %22, label %30

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

30:                                               ; preds = %21
  %31 = getelementptr inbounds i8, ptr %2, i64 96
  %32 = getelementptr inbounds i8, ptr %2, i64 136
  %33 = tail call i32 @s2n_stuffer_growable_alloc(ptr noundef nonnull %32, i32 noundef 0) #6
  %34 = icmp sgt i32 %33, -1
  br i1 %34, label %35, label %57

35:                                               ; preds = %30
  %36 = tail call i32 @s2n_stuffer_growable_alloc(ptr noundef nonnull %31, i32 noundef 0) #6
  %37 = icmp sgt i32 %36, -1
  br i1 %37, label %38, label %57

38:                                               ; preds = %35
  %39 = getelementptr inbounds i8, ptr %2, i64 40
  %40 = tail call i32 @s2n_stuffer_growable_alloc(ptr noundef nonnull %39, i32 noundef 0) #6
  %41 = icmp sgt i32 %40, -1
  br i1 %41, label %42, label %57

42:                                               ; preds = %38
  %43 = tail call i32 @s2n_stuffer_growable_alloc(ptr noundef nonnull %2, i32 noundef 0) #6
  %44 = icmp sgt i32 %43, -1
  br i1 %44, label %45, label %57

45:                                               ; preds = %42
  %46 = tail call i32 @s2n_ktls_set_sendmsg_cb(ptr noundef nonnull %0, ptr noundef nonnull @s2n_test_ktls_sendmsg_io_stuffer, ptr noundef nonnull %2) #6
  %47 = tail call zeroext i1 @s2n_result_is_ok(i32 %46)
  br i1 %47, label %48, label %57

48:                                               ; preds = %45
  %49 = tail call i32 @s2n_ktls_set_recvmsg_cb(ptr noundef nonnull %0, ptr noundef nonnull @s2n_test_ktls_recvmsg_io_stuffer, ptr noundef nonnull %31) #6
  %50 = tail call zeroext i1 @s2n_result_is_ok(i32 %49)
  br i1 %50, label %51, label %57

51:                                               ; preds = %48
  %52 = tail call i32 @s2n_ktls_set_sendmsg_cb(ptr noundef nonnull %1, ptr noundef nonnull @s2n_test_ktls_sendmsg_io_stuffer, ptr noundef nonnull %31) #6
  %53 = tail call zeroext i1 @s2n_result_is_ok(i32 %52)
  br i1 %53, label %54, label %57

54:                                               ; preds = %51
  %55 = tail call i32 @s2n_ktls_set_recvmsg_cb(ptr noundef nonnull %1, ptr noundef nonnull @s2n_test_ktls_recvmsg_io_stuffer, ptr noundef nonnull %2) #6
  %56 = tail call zeroext i1 @s2n_result_is_ok(i32 %55)
  %not. = xor i1 %56, true
  %. = sext i1 %not. to i32
  br label %57

57:                                               ; preds = %54, %51, %48, %45, %42, %38, %35, %30, %22, %13, %4
  %.sroa.018.0 = phi i32 [ -1, %22 ], [ -1, %13 ], [ -1, %4 ], [ -1, %30 ], [ -1, %35 ], [ -1, %38 ], [ -1, %42 ], [ -1, %45 ], [ -1, %48 ], [ -1, %51 ], [ %., %54 ]
  ret i32 %.sroa.018.0
}

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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}


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