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

; 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 }

@s2n_errno = external thread_local global i32, align 4
@.str = external hidden unnamed_addr constant [109 x i8], align 1
@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@.str.1 = external hidden unnamed_addr constant [109 x i8], align 1
@__const.s2n_send_and_recv_test.send_data = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [109 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [109 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [109 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_send_and_recv_test(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca %struct.s2n_result, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca [12 x i8], align 1
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca [12 x i8], align 1
  %11 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  br label %12

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

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 %5, 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.1, 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) #7
  %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) #7
  %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 %3, i32 0, i32 0
  store i32 -1, ptr %82, align 4, !tbaa !14
  br label %236

83:                                               ; No predecessors!
  br label %84

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

85:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 0, ptr %6, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %7, ptr align 1 @__const.s2n_send_and_recv_test.send_data, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds [12 x i8], ptr %7, i64 0, i64 0
  %88 = call i64 @s2n_send(ptr noundef %86, ptr noundef %87, i64 noundef 12, ptr noundef %6)
  store i64 %88, ptr %8, align 8, !tbaa !16
  br label %89

89:                                               ; preds = %85
  %90 = load i64, ptr %8, align 8, !tbaa !16
  %91 = icmp sgt i64 %90, -1
  br i1 %91, label %94, label %92

92:                                               ; preds = %89
  %93 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %93, align 4, !tbaa !14
  store i32 1, ptr %9, align 4
  br label %235

94:                                               ; preds = %89
  br label %95

95:                                               ; preds = %94
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96
  %98 = load i64, ptr %8, align 8, !tbaa !16
  %99 = icmp eq i64 %98, 12
  br i1 %99, label %134, label %100

100:                                              ; preds = %97
  br label %101

101:                                              ; preds = %100
  br label %102

102:                                              ; preds = %101
  %103 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %104 = getelementptr inbounds %struct.s2n_debug_info, ptr %103, i32 0, i32 0
  store ptr @.str.2, ptr %104, align 8, !tbaa !9
  %105 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %106 = getelementptr inbounds %struct.s2n_debug_info, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !9
  %108 = getelementptr inbounds i8, ptr %107, i64 21
  %109 = call ptr @strrchr(ptr noundef %108, i32 noundef 47) #7
  %110 = icmp ne ptr %109, null
  br i1 %110, label %111, label %118

111:                                              ; preds = %102
  %112 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %113 = getelementptr inbounds %struct.s2n_debug_info, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !9
  %115 = getelementptr inbounds i8, ptr %114, i64 21
  %116 = call ptr @strrchr(ptr noundef %115, i32 noundef 47) #7
  %117 = getelementptr inbounds i8, ptr %116, i64 1
  br label %123

118:                                              ; preds = %102
  %119 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %120 = getelementptr inbounds %struct.s2n_debug_info, ptr %119, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8, !tbaa !9
  %122 = getelementptr inbounds i8, ptr %121, i64 21
  br label %123

123:                                              ; preds = %118, %111
  %124 = phi ptr [ %117, %111 ], [ %122, %118 ]
  %125 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %126 = getelementptr inbounds %struct.s2n_debug_info, ptr %125, i32 0, i32 1
  store ptr %124, ptr %126, align 8, !tbaa !11
  %127 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %127, align 4, !tbaa !12
  %128 = call i32 @s2n_calculate_stacktrace()
  br label %129

129:                                              ; preds = %123
  br label %130

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

132:                                              ; No predecessors!
  br label %133

133:                                              ; preds = %132
  br label %134

134:                                              ; preds = %133, %97
  br label %135

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #8
  call void @llvm.memset.p0.i64(ptr align 1 %10, i8 0, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = getelementptr inbounds [12 x i8], ptr %10, i64 0, i64 0
  %139 = load i64, ptr %8, align 8, !tbaa !16
  %140 = call i64 @s2n_recv(ptr noundef %137, ptr noundef %138, i64 noundef %139, ptr noundef %6)
  store i64 %140, ptr %11, align 8, !tbaa !16
  br label %141

141:                                              ; preds = %136
  %142 = load i64, ptr %11, align 8, !tbaa !16
  %143 = icmp sgt i64 %142, -1
  br i1 %143, label %146, label %144

144:                                              ; preds = %141
  %145 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %145, align 4, !tbaa !14
  store i32 1, ptr %9, align 4
  br label %234

146:                                              ; preds = %141
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148
  %150 = load i64, ptr %11, align 8, !tbaa !16
  %151 = load i64, ptr %8, align 8, !tbaa !16
  %152 = icmp eq i64 %150, %151
  br i1 %152, label %187, label %153

153:                                              ; preds = %149
  br label %154

154:                                              ; preds = %153
  br label %155

155:                                              ; preds = %154
  %156 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %157 = getelementptr inbounds %struct.s2n_debug_info, ptr %156, i32 0, i32 0
  store ptr @.str.3, ptr %157, align 8, !tbaa !9
  %158 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %159 = getelementptr inbounds %struct.s2n_debug_info, ptr %158, i32 0, i32 0
  %160 = load ptr, ptr %159, align 8, !tbaa !9
  %161 = getelementptr inbounds i8, ptr %160, i64 21
  %162 = call ptr @strrchr(ptr noundef %161, i32 noundef 47) #7
  %163 = icmp ne ptr %162, null
  br i1 %163, label %164, label %171

164:                                              ; preds = %155
  %165 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %166 = getelementptr inbounds %struct.s2n_debug_info, ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %166, align 8, !tbaa !9
  %168 = getelementptr inbounds i8, ptr %167, i64 21
  %169 = call ptr @strrchr(ptr noundef %168, i32 noundef 47) #7
  %170 = getelementptr inbounds i8, ptr %169, i64 1
  br label %176

171:                                              ; preds = %155
  %172 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %173 = getelementptr inbounds %struct.s2n_debug_info, ptr %172, i32 0, i32 0
  %174 = load ptr, ptr %173, align 8, !tbaa !9
  %175 = getelementptr inbounds i8, ptr %174, i64 21
  br label %176

176:                                              ; preds = %171, %164
  %177 = phi ptr [ %170, %164 ], [ %175, %171 ]
  %178 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %179 = getelementptr inbounds %struct.s2n_debug_info, ptr %178, i32 0, i32 1
  store ptr %177, ptr %179, align 8, !tbaa !11
  %180 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %180, align 4, !tbaa !12
  %181 = call i32 @s2n_calculate_stacktrace()
  br label %182

182:                                              ; preds = %176
  br label %183

183:                                              ; preds = %182
  %184 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %184, align 4, !tbaa !14
  store i32 1, ptr %9, align 4
  br label %234

185:                                              ; No predecessors!
  br label %186

186:                                              ; preds = %185
  br label %187

187:                                              ; preds = %186, %149
  br label %188

188:                                              ; preds = %187
  br label %189

189:                                              ; preds = %188
  br label %190

190:                                              ; preds = %189
  %191 = getelementptr inbounds [12 x i8], ptr %10, i64 0, i64 0
  %192 = getelementptr inbounds [12 x i8], ptr %7, i64 0, i64 0
  %193 = load i64, ptr %8, align 8, !tbaa !16
  %194 = call i32 @memcmp(ptr noundef %191, ptr noundef %192, i64 noundef %193) #7
  %195 = icmp eq i32 %194, 0
  br i1 %195, label %230, label %196

196:                                              ; preds = %190
  br label %197

197:                                              ; preds = %196
  br label %198

198:                                              ; preds = %197
  %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 0
  store ptr @.str.4, ptr %200, align 8, !tbaa !9
  %201 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %202 = getelementptr inbounds %struct.s2n_debug_info, ptr %201, i32 0, i32 0
  %203 = load ptr, ptr %202, align 8, !tbaa !9
  %204 = getelementptr inbounds i8, ptr %203, i64 21
  %205 = call ptr @strrchr(ptr noundef %204, i32 noundef 47) #7
  %206 = icmp ne ptr %205, null
  br i1 %206, label %207, label %214

207:                                              ; preds = %198
  %208 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %209 = getelementptr inbounds %struct.s2n_debug_info, ptr %208, i32 0, i32 0
  %210 = load ptr, ptr %209, align 8, !tbaa !9
  %211 = getelementptr inbounds i8, ptr %210, i64 21
  %212 = call ptr @strrchr(ptr noundef %211, i32 noundef 47) #7
  %213 = getelementptr inbounds i8, ptr %212, i64 1
  br label %219

214:                                              ; preds = %198
  %215 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %216 = getelementptr inbounds %struct.s2n_debug_info, ptr %215, i32 0, i32 0
  %217 = load ptr, ptr %216, align 8, !tbaa !9
  %218 = getelementptr inbounds i8, ptr %217, i64 21
  br label %219

219:                                              ; preds = %214, %207
  %220 = phi ptr [ %213, %207 ], [ %218, %214 ]
  %221 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %222 = getelementptr inbounds %struct.s2n_debug_info, ptr %221, i32 0, i32 1
  store ptr %220, ptr %222, align 8, !tbaa !11
  %223 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %223, align 4, !tbaa !12
  %224 = call i32 @s2n_calculate_stacktrace()
  br label %225

225:                                              ; preds = %219
  br label %226

226:                                              ; preds = %225
  %227 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %227, align 4, !tbaa !14
  store i32 1, ptr %9, align 4
  br label %234

228:                                              ; No predecessors!
  br label %229

229:                                              ; preds = %228
  br label %230

230:                                              ; preds = %229, %190
  br label %231

231:                                              ; preds = %230
  br label %232

232:                                              ; preds = %231
  %233 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 0, ptr %233, align 4, !tbaa !14
  store i32 1, ptr %9, align 4
  br label %234

234:                                              ; preds = %232, %226, %183, %144
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #8
  br label %235

235:                                              ; preds = %234, %130, %92
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %236

236:                                              ; preds = %235, %81, %44
  %237 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  %238 = load i32, ptr %237, align 4
  ret i32 %238
}

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

declare i32 @s2n_calculate_stacktrace() #4

; 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) #5

declare i64 @s2n_send(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #4

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

declare i64 @s2n_recv(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #4

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { 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 #4 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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 = !{!17, !17, i64 0}
!17 = !{!"long", !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_errno = external thread_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [109 x i8], align 1
@_s2n_debug_info = external thread_local local_unnamed_addr global %struct.s2n_debug_info, align 8
@.str.1 = external hidden unnamed_addr constant [109 x i8], align 1
@__const.s2n_send_and_recv_test.send_data = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [109 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [109 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [109 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_send_and_recv_test(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca i32, align 4
  %4 = alloca [12 x i8], align 1
  %5 = alloca [12 x i8], align 1
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %6, label %14

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

14:                                               ; preds = %2
  %.not19 = icmp eq ptr %1, null
  br i1 %.not19, label %15, label %23

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

23:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  store i32 0, ptr %3, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(12) %4, ptr noundef nonnull align 1 dereferenceable(12) @__const.s2n_send_and_recv_test.send_data, i64 12, i1 false)
  %24 = call i64 @s2n_send(ptr noundef nonnull %0, ptr noundef nonnull %4, i64 noundef 12, ptr noundef nonnull %3) #9
  %25 = icmp sgt i64 %24, -1
  br i1 %25, label %26, label %51

26:                                               ; preds = %23
  %27 = icmp eq i64 %24, 12
  br i1 %27, label %36, label %28

28:                                               ; preds = %26
  %29 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.2, ptr %29, align 8, !tbaa !5
  %30 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.2, i64 21), i32 noundef 47) #8
  %.not21 = icmp eq ptr %30, null
  %31 = getelementptr inbounds i8, ptr %30, i64 1
  %32 = select i1 %.not21, ptr getelementptr inbounds (i8, ptr @.str.2, i64 21), ptr %31
  %33 = getelementptr inbounds i8, ptr %29, i64 8
  store ptr %32, ptr %33, align 8, !tbaa !10
  %34 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %34, align 4, !tbaa !11
  %35 = call i32 @s2n_calculate_stacktrace() #9
  br label %51

36:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(12) %5, i8 0, i64 12, i1 false)
  %37 = call i64 @s2n_recv(ptr noundef nonnull %1, ptr noundef nonnull %5, i64 noundef 12, ptr noundef nonnull %3) #9
  %38 = icmp sgt i64 %37, -1
  br i1 %38, label %39, label %50

39:                                               ; preds = %36
  %40 = icmp eq i64 %37, 12
  br i1 %40, label %41, label %.sink.split

41:                                               ; preds = %39
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(12) %5, ptr noundef nonnull dereferenceable(12) %4, i64 12)
  %42 = icmp eq i32 %bcmp, 0
  br i1 %42, label %50, label %.sink.split

.sink.split:                                      ; preds = %41, %39
  %.str.4.sink = phi ptr [ @.str.3, %39 ], [ @.str.4, %41 ]
  %.sink29 = phi ptr [ getelementptr inbounds (i8, ptr @.str.3, i64 21), %39 ], [ getelementptr inbounds (i8, ptr @.str.4, i64 21), %41 ]
  %43 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.4.sink, ptr %43, align 8, !tbaa !5
  %44 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink29, i32 noundef 47) #8
  %.not23 = icmp eq ptr %44, null
  %45 = getelementptr inbounds i8, ptr %44, i64 1
  %46 = select i1 %.not23, ptr %.sink29, ptr %45
  %47 = getelementptr inbounds i8, ptr %43, i64 8
  store ptr %46, ptr %47, align 8, !tbaa !10
  %48 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %48, align 4, !tbaa !11
  %49 = call i32 @s2n_calculate_stacktrace() #9
  br label %50

50:                                               ; preds = %.sink.split, %41, %36
  %.sroa.0.0 = phi i32 [ -1, %36 ], [ 0, %41 ], [ -1, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #9
  br label %51

51:                                               ; preds = %23, %50, %28
  %.sroa.0.1 = phi i32 [ %.sroa.0.0, %50 ], [ -1, %28 ], [ -1, %23 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  br label %52

52:                                               ; preds = %51, %15, %6
  %.sroa.0.2 = phi i32 [ %.sroa.0.1, %51 ], [ -1, %15 ], [ -1, %6 ]
  ret i32 %.sroa.0.2
}

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #4

; 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) #5

declare i64 @s2n_send(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #4

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

declare i64 @s2n_recv(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #7

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


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