; LLVM IR from aws/s2n-tls :: tests/unit (s2n_random_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_blob = type { ptr, i32, i32, i8 }
%struct.s2n_result = type { i32 }
%struct.random_communication = type { ptr, ptr, [100 x i8], ptr }

@s2n_use_color_in_output = external dso_local global i8, align 1
@test_count = external dso_local global i32, align 4
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [101 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [74 x i8], align 1
@s2n_errno = external thread_local global i32, align 4
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [90 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [57 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: nounwind uwtable
define dso_local ptr @s2n_thread_test_cb(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.s2n_blob, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.s2n_result, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.s2n_result, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #9
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %11, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #9
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 24, i1 false)
  br label %12

12:                                               ; preds = %1
  %13 = load i32, ptr @test_count, align 4, !tbaa !9
  %14 = add nsw i32 %13, 1
  store i32 %14, ptr @test_count, align 4, !tbaa !9
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.random_communication, ptr %15, i32 0, i32 2
  %17 = getelementptr inbounds [100 x i8], ptr %16, i64 0, i64 0
  %18 = call i32 @s2n_blob_init(ptr noundef %4, ptr noundef %17, i32 noundef 100)
  %19 = icmp eq i32 %18, -1
  br i1 %19, label %20, label %73

20:                                               ; preds = %12
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  %23 = call ptr @__errno_location() #10
  %24 = load i32, ptr %23, align 4, !tbaa !9
  store i32 %24, ptr %5, align 4, !tbaa !9
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = call i32 @s2n_print_stacktrace(ptr noundef %25)
  %27 = load i8, ptr @s2n_use_color_in_output, align 1, !tbaa !11, !range !13, !noundef !14
  %28 = trunc i8 %27 to i1
  br i1 %28, label %29, label %51

29:                                               ; preds = %22
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = call i32 @fileno(ptr noundef %30) #9
  %32 = call i32 @isatty(i32 noundef %31) #9
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %51

34:                                               ; preds = %29
  %35 = load i32, ptr %5, align 4, !tbaa !9
  %36 = call ptr @__errno_location() #10
  store i32 %35, ptr %36, align 4, !tbaa !9
  %37 = load ptr, ptr @stderr, align 8, !tbaa !5
  %38 = load i32, ptr @test_count, align 4, !tbaa !9
  %39 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = call ptr @s2n_strerror(i32 noundef %40, ptr noundef @.str.3)
  %42 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %43 = load i32, ptr %42, align 4, !tbaa !9
  %44 = call ptr @s2n_strerror_debug(i32 noundef %43, ptr noundef @.str.3)
  %45 = call ptr @__errno_location() #10
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %47 = call ptr @strerror(i32 noundef %46) #9
  %48 = call ptr @__errno_location() #10
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str, i32 noundef %38, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 278, ptr noundef %41, ptr noundef %44, ptr noundef %47, i32 noundef %49) #9
  br label %68

51:                                               ; preds = %29, %22
  %52 = load i32, ptr %5, align 4, !tbaa !9
  %53 = call ptr @__errno_location() #10
  store i32 %52, ptr %53, align 4, !tbaa !9
  %54 = load ptr, ptr @stderr, align 8, !tbaa !5
  %55 = load i32, ptr @test_count, align 4, !tbaa !9
  %56 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = call ptr @s2n_strerror(i32 noundef %57, ptr noundef @.str.3)
  %59 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %61 = call ptr @s2n_strerror_debug(i32 noundef %60, ptr noundef @.str.3)
  %62 = call ptr @__errno_location() #10
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = call ptr @strerror(i32 noundef %63) #9
  %65 = call ptr @__errno_location() #10
  %66 = load i32, ptr %65, align 4, !tbaa !9
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef @.str.4, i32 noundef %55, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 278, ptr noundef %58, ptr noundef %61, ptr noundef %64, i32 noundef %66) #9
  br label %68

68:                                               ; preds = %51, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69
  call void @exit(i32 noundef 1) #11
  unreachable

71:                                               ; No predecessors!
  br label %72

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72, %12
  br label %74

74:                                               ; preds = %73
  br label %75

75:                                               ; preds = %74
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr @test_count, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr @test_count, align 4, !tbaa !9
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.random_communication, ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !15
  %82 = icmp eq ptr %81, null
  br i1 %82, label %83, label %136

83:                                               ; preds = %76
  br label %84

84:                                               ; preds = %83
  br label %85

85:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  %86 = call ptr @__errno_location() #10
  %87 = load i32, ptr %86, align 4, !tbaa !9
  store i32 %87, ptr %6, align 4, !tbaa !9
  %88 = load ptr, ptr @stderr, align 8, !tbaa !5
  %89 = call i32 @s2n_print_stacktrace(ptr noundef %88)
  %90 = load i8, ptr @s2n_use_color_in_output, align 1, !tbaa !11, !range !13, !noundef !14
  %91 = trunc i8 %90 to i1
  br i1 %91, label %92, label %114

92:                                               ; preds = %85
  %93 = load ptr, ptr @stderr, align 8, !tbaa !5
  %94 = call i32 @fileno(ptr noundef %93) #9
  %95 = call i32 @isatty(i32 noundef %94) #9
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %114

97:                                               ; preds = %92
  %98 = load i32, ptr %6, align 4, !tbaa !9
  %99 = call ptr @__errno_location() #10
  store i32 %98, ptr %99, align 4, !tbaa !9
  %100 = load ptr, ptr @stderr, align 8, !tbaa !5
  %101 = load i32, ptr @test_count, align 4, !tbaa !9
  %102 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = call ptr @s2n_strerror(i32 noundef %103, ptr noundef @.str.3)
  %105 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %106 = load i32, ptr %105, align 4, !tbaa !9
  %107 = call ptr @s2n_strerror_debug(i32 noundef %106, ptr noundef @.str.3)
  %108 = call ptr @__errno_location() #10
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = call ptr @strerror(i32 noundef %109) #9
  %111 = call ptr @__errno_location() #10
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef @.str, i32 noundef %101, ptr noundef @.str.5, ptr noundef @.str.2, i32 noundef 280, ptr noundef %104, ptr noundef %107, ptr noundef %110, i32 noundef %112) #9
  br label %131

114:                                              ; preds = %92, %85
  %115 = load i32, ptr %6, align 4, !tbaa !9
  %116 = call ptr @__errno_location() #10
  store i32 %115, ptr %116, align 4, !tbaa !9
  %117 = load ptr, ptr @stderr, align 8, !tbaa !5
  %118 = load i32, ptr @test_count, align 4, !tbaa !9
  %119 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %120 = load i32, ptr %119, align 4, !tbaa !9
  %121 = call ptr @s2n_strerror(i32 noundef %120, ptr noundef @.str.3)
  %122 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %123 = load i32, ptr %122, align 4, !tbaa !9
  %124 = call ptr @s2n_strerror_debug(i32 noundef %123, ptr noundef @.str.3)
  %125 = call ptr @__errno_location() #10
  %126 = load i32, ptr %125, align 4, !tbaa !9
  %127 = call ptr @strerror(i32 noundef %126) #9
  %128 = call ptr @__errno_location() #10
  %129 = load i32, ptr %128, align 4, !tbaa !9
  %130 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %117, ptr noundef @.str.4, i32 noundef %118, ptr noundef @.str.5, ptr noundef @.str.2, i32 noundef 280, ptr noundef %121, ptr noundef %124, ptr noundef %127, i32 noundef %129) #9
  br label %131

131:                                              ; preds = %114, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132
  call void @exit(i32 noundef 1) #11
  unreachable

134:                                              ; No predecessors!
  br label %135

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135, %76
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr @test_count, align 4, !tbaa !9
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr @test_count, align 4, !tbaa !9
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.random_communication, ptr %142, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !15
  %145 = call i32 %144(ptr noundef %4)
  %146 = getelementptr inbounds %struct.s2n_result, ptr %7, i32 0, i32 0
  store i32 %145, ptr %146, align 4
  %147 = getelementptr inbounds %struct.s2n_result, ptr %7, i32 0, i32 0
  %148 = load i32, ptr %147, align 4
  %149 = call zeroext i1 @s2n_result_is_ok(i32 %148)
  br i1 %149, label %203, label %150

150:                                              ; preds = %139
  br label %151

151:                                              ; preds = %150
  br label %152

152:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %153 = call ptr @__errno_location() #10
  %154 = load i32, ptr %153, align 4, !tbaa !9
  store i32 %154, ptr %8, align 4, !tbaa !9
  %155 = load ptr, ptr @stderr, align 8, !tbaa !5
  %156 = call i32 @s2n_print_stacktrace(ptr noundef %155)
  %157 = load i8, ptr @s2n_use_color_in_output, align 1, !tbaa !11, !range !13, !noundef !14
  %158 = trunc i8 %157 to i1
  br i1 %158, label %159, label %181

159:                                              ; preds = %152
  %160 = load ptr, ptr @stderr, align 8, !tbaa !5
  %161 = call i32 @fileno(ptr noundef %160) #9
  %162 = call i32 @isatty(i32 noundef %161) #9
  %163 = icmp ne i32 %162, 0
  br i1 %163, label %164, label %181

164:                                              ; preds = %159
  %165 = load i32, ptr %8, align 4, !tbaa !9
  %166 = call ptr @__errno_location() #10
  store i32 %165, ptr %166, align 4, !tbaa !9
  %167 = load ptr, ptr @stderr, align 8, !tbaa !5
  %168 = load i32, ptr @test_count, align 4, !tbaa !9
  %169 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %170 = load i32, ptr %169, align 4, !tbaa !9
  %171 = call ptr @s2n_strerror(i32 noundef %170, ptr noundef @.str.3)
  %172 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %173 = load i32, ptr %172, align 4, !tbaa !9
  %174 = call ptr @s2n_strerror_debug(i32 noundef %173, ptr noundef @.str.3)
  %175 = call ptr @__errno_location() #10
  %176 = load i32, ptr %175, align 4, !tbaa !9
  %177 = call ptr @strerror(i32 noundef %176) #9
  %178 = call ptr @__errno_location() #10
  %179 = load i32, ptr %178, align 4, !tbaa !9
  %180 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %167, ptr noundef @.str, i32 noundef %168, ptr noundef @.str.6, ptr noundef @.str.2, i32 noundef 281, ptr noundef %171, ptr noundef %174, ptr noundef %177, i32 noundef %179) #9
  br label %198

181:                                              ; preds = %159, %152
  %182 = load i32, ptr %8, align 4, !tbaa !9
  %183 = call ptr @__errno_location() #10
  store i32 %182, ptr %183, align 4, !tbaa !9
  %184 = load ptr, ptr @stderr, align 8, !tbaa !5
  %185 = load i32, ptr @test_count, align 4, !tbaa !9
  %186 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %187 = load i32, ptr %186, align 4, !tbaa !9
  %188 = call ptr @s2n_strerror(i32 noundef %187, ptr noundef @.str.3)
  %189 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %190 = load i32, ptr %189, align 4, !tbaa !9
  %191 = call ptr @s2n_strerror_debug(i32 noundef %190, ptr noundef @.str.3)
  %192 = call ptr @__errno_location() #10
  %193 = load i32, ptr %192, align 4, !tbaa !9
  %194 = call ptr @strerror(i32 noundef %193) #9
  %195 = call ptr @__errno_location() #10
  %196 = load i32, ptr %195, align 4, !tbaa !9
  %197 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %184, ptr noundef @.str.4, i32 noundef %185, ptr noundef @.str.6, ptr noundef @.str.2, i32 noundef 281, ptr noundef %188, ptr noundef %191, ptr noundef %194, i32 noundef %196) #9
  br label %198

198:                                              ; preds = %181, %164
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %199

199:                                              ; preds = %198
  br label %200

200:                                              ; preds = %199
  call void @exit(i32 noundef 1) #11
  unreachable

201:                                              ; No predecessors!
  br label %202

202:                                              ; preds = %201
  br label %203

203:                                              ; preds = %202, %139
  br label %204

204:                                              ; preds = %203
  br label %205

205:                                              ; preds = %204
  br label %206

206:                                              ; preds = %205
  %207 = load i32, ptr @test_count, align 4, !tbaa !9
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr @test_count, align 4, !tbaa !9
  %209 = call i32 @s2n_rand_cleanup_thread()
  %210 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  store i32 %209, ptr %210, align 4
  %211 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  %212 = load i32, ptr %211, align 4
  %213 = call zeroext i1 @s2n_result_is_ok(i32 %212)
  br i1 %213, label %267, label %214

214:                                              ; preds = %206
  br label %215

215:                                              ; preds = %214
  br label %216

216:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  %217 = call ptr @__errno_location() #10
  %218 = load i32, ptr %217, align 4, !tbaa !9
  store i32 %218, ptr %10, align 4, !tbaa !9
  %219 = load ptr, ptr @stderr, align 8, !tbaa !5
  %220 = call i32 @s2n_print_stacktrace(ptr noundef %219)
  %221 = load i8, ptr @s2n_use_color_in_output, align 1, !tbaa !11, !range !13, !noundef !14
  %222 = trunc i8 %221 to i1
  br i1 %222, label %223, label %245

223:                                              ; preds = %216
  %224 = load ptr, ptr @stderr, align 8, !tbaa !5
  %225 = call i32 @fileno(ptr noundef %224) #9
  %226 = call i32 @isatty(i32 noundef %225) #9
  %227 = icmp ne i32 %226, 0
  br i1 %227, label %228, label %245

228:                                              ; preds = %223
  %229 = load i32, ptr %10, align 4, !tbaa !9
  %230 = call ptr @__errno_location() #10
  store i32 %229, ptr %230, align 4, !tbaa !9
  %231 = load ptr, ptr @stderr, align 8, !tbaa !5
  %232 = load i32, ptr @test_count, align 4, !tbaa !9
  %233 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %234 = load i32, ptr %233, align 4, !tbaa !9
  %235 = call ptr @s2n_strerror(i32 noundef %234, ptr noundef @.str.3)
  %236 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %237 = load i32, ptr %236, align 4, !tbaa !9
  %238 = call ptr @s2n_strerror_debug(i32 noundef %237, ptr noundef @.str.3)
  %239 = call ptr @__errno_location() #10
  %240 = load i32, ptr %239, align 4, !tbaa !9
  %241 = call ptr @strerror(i32 noundef %240) #9
  %242 = call ptr @__errno_location() #10
  %243 = load i32, ptr %242, align 4, !tbaa !9
  %244 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %231, ptr noundef @.str, i32 noundef %232, ptr noundef @.str.7, ptr noundef @.str.2, i32 noundef 283, ptr noundef %235, ptr noundef %238, ptr noundef %241, i32 noundef %243) #9
  br label %262

245:                                              ; preds = %223, %216
  %246 = load i32, ptr %10, align 4, !tbaa !9
  %247 = call ptr @__errno_location() #10
  store i32 %246, ptr %247, align 4, !tbaa !9
  %248 = load ptr, ptr @stderr, align 8, !tbaa !5
  %249 = load i32, ptr @test_count, align 4, !tbaa !9
  %250 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %251 = load i32, ptr %250, align 4, !tbaa !9
  %252 = call ptr @s2n_strerror(i32 noundef %251, ptr noundef @.str.3)
  %253 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %254 = load i32, ptr %253, align 4, !tbaa !9
  %255 = call ptr @s2n_strerror_debug(i32 noundef %254, ptr noundef @.str.3)
  %256 = call ptr @__errno_location() #10
  %257 = load i32, ptr %256, align 4, !tbaa !9
  %258 = call ptr @strerror(i32 noundef %257) #9
  %259 = call ptr @__errno_location() #10
  %260 = load i32, ptr %259, align 4, !tbaa !9
  %261 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %248, ptr noundef @.str.4, i32 noundef %249, ptr noundef @.str.7, ptr noundef @.str.2, i32 noundef 283, ptr noundef %252, ptr noundef %255, ptr noundef %258, i32 noundef %260) #9
  br label %262

262:                                              ; preds = %245, %228
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  br label %263

263:                                              ; preds = %262
  br label %264

264:                                              ; preds = %263
  call void @exit(i32 noundef 1) #11
  unreachable

265:                                              ; No predecessors!
  br label %266

266:                                              ; preds = %265
  br label %267

267:                                              ; preds = %266, %206
  br label %268

268:                                              ; preds = %267
  br label %269

269:                                              ; preds = %268
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #9
  ret ptr null
}

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

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #4

declare i32 @s2n_print_stacktrace(ptr noundef) #3

; Function Attrs: nounwind
declare i32 @isatty(i32 noundef) #5

; Function Attrs: nounwind
declare i32 @fileno(ptr noundef) #5

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #5

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

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

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #7

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

declare i32 @s2n_rand_cleanup_thread() #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nounwind willreturn memory(none) "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 "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { noreturn nounwind "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 #8 = { 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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(none) }
attributes #11 = { noreturn 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, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !6, i64 0}
!16 = !{!"random_communication", !6, i64 0, !6, i64 8, !7, i64 16, !6, i64 120}


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

@s2n_use_color_in_output = external dso_local local_unnamed_addr global i8, align 1
@test_count = external dso_local local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [101 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [74 x i8], align 1
@s2n_errno = external thread_local local_unnamed_addr global i32, align 4
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [90 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [57 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: nounwind uwtable
define dso_local noundef ptr @s2n_thread_test_cb(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca %struct.s2n_blob, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #10
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %2, i8 0, i64 24, i1 false)
  %3 = load i32, ptr @test_count, align 4, !tbaa !5
  %4 = add nsw i32 %3, 1
  store i32 %4, ptr @test_count, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  %6 = call i32 @s2n_blob_init(ptr noundef nonnull %2, ptr noundef nonnull %5, i32 noundef 100) #10
  %7 = icmp eq i32 %6, -1
  br i1 %7, label %8, label %32

8:                                                ; preds = %1
  %9 = tail call ptr @__errno_location() #11
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = load ptr, ptr @stderr, align 8, !tbaa !9
  %12 = call i32 @s2n_print_stacktrace(ptr noundef %11) #10
  %13 = load i8, ptr @s2n_use_color_in_output, align 1, !tbaa !11, !range !13, !noundef !14
  %14 = trunc nuw i8 %13 to i1
  br i1 %14, label %15, label %19

15:                                               ; preds = %8
  %16 = load ptr, ptr @stderr, align 8, !tbaa !9
  %17 = call i32 @fileno(ptr noundef %16) #10
  %18 = call i32 @isatty(i32 noundef %17) #10
  %.not14 = icmp eq i32 %18, 0
  br i1 %.not14, label %19, label %20

19:                                               ; preds = %15, %8
  br label %20

20:                                               ; preds = %15, %19
  %.str.4.sink = phi ptr [ @.str.4, %19 ], [ @.str, %15 ]
  store i32 %10, ptr %9, align 4, !tbaa !5
  %21 = load ptr, ptr @stderr, align 8, !tbaa !9
  %22 = load i32, ptr @test_count, align 4, !tbaa !5
  %23 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = call ptr @s2n_strerror(i32 noundef %24, ptr noundef nonnull @.str.3) #10
  %26 = load i32, ptr %23, align 4, !tbaa !5
  %27 = call ptr @s2n_strerror_debug(i32 noundef %26, ptr noundef nonnull @.str.3) #10
  %28 = load i32, ptr %9, align 4, !tbaa !5
  %29 = call ptr @strerror(i32 noundef %28) #10
  %30 = load i32, ptr %9, align 4, !tbaa !5
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef nonnull %.str.4.sink, i32 noundef %22, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 278, ptr noundef %25, ptr noundef %27, ptr noundef %29, i32 noundef %30) #12
  call void @exit(i32 noundef 1) #13
  unreachable

32:                                               ; preds = %1
  %33 = load i32, ptr @test_count, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr @test_count, align 4, !tbaa !5
  %35 = load ptr, ptr %0, align 8, !tbaa !15
  %36 = icmp eq ptr %35, null
  br i1 %36, label %37, label %61

37:                                               ; preds = %32
  %38 = tail call ptr @__errno_location() #11
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = load ptr, ptr @stderr, align 8, !tbaa !9
  %41 = call i32 @s2n_print_stacktrace(ptr noundef %40) #10
  %42 = load i8, ptr @s2n_use_color_in_output, align 1, !tbaa !11, !range !13, !noundef !14
  %43 = trunc nuw i8 %42 to i1
  br i1 %43, label %44, label %48

44:                                               ; preds = %37
  %45 = load ptr, ptr @stderr, align 8, !tbaa !9
  %46 = call i32 @fileno(ptr noundef %45) #10
  %47 = call i32 @isatty(i32 noundef %46) #10
  %.not13 = icmp eq i32 %47, 0
  br i1 %.not13, label %48, label %49

48:                                               ; preds = %44, %37
  br label %49

49:                                               ; preds = %44, %48
  %.str.4.sink25 = phi ptr [ @.str.4, %48 ], [ @.str, %44 ]
  store i32 %39, ptr %38, align 4, !tbaa !5
  %50 = load ptr, ptr @stderr, align 8, !tbaa !9
  %51 = load i32, ptr @test_count, align 4, !tbaa !5
  %52 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = call ptr @s2n_strerror(i32 noundef %53, ptr noundef nonnull @.str.3) #10
  %55 = load i32, ptr %52, align 4, !tbaa !5
  %56 = call ptr @s2n_strerror_debug(i32 noundef %55, ptr noundef nonnull @.str.3) #10
  %57 = load i32, ptr %38, align 4, !tbaa !5
  %58 = call ptr @strerror(i32 noundef %57) #10
  %59 = load i32, ptr %38, align 4, !tbaa !5
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull %.str.4.sink25, i32 noundef %51, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.2, i32 noundef 280, ptr noundef %54, ptr noundef %56, ptr noundef %58, i32 noundef %59) #12
  call void @exit(i32 noundef 1) #13
  unreachable

61:                                               ; preds = %32
  %62 = add nsw i32 %33, 2
  store i32 %62, ptr @test_count, align 4, !tbaa !5
  %63 = call i32 %35(ptr noundef nonnull %2) #10
  %64 = call zeroext i1 @s2n_result_is_ok(i32 %63)
  br i1 %64, label %89, label %65

65:                                               ; preds = %61
  %66 = tail call ptr @__errno_location() #11
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = load ptr, ptr @stderr, align 8, !tbaa !9
  %69 = call i32 @s2n_print_stacktrace(ptr noundef %68) #10
  %70 = load i8, ptr @s2n_use_color_in_output, align 1, !tbaa !11, !range !13, !noundef !14
  %71 = trunc nuw i8 %70 to i1
  br i1 %71, label %72, label %76

72:                                               ; preds = %65
  %73 = load ptr, ptr @stderr, align 8, !tbaa !9
  %74 = call i32 @fileno(ptr noundef %73) #10
  %75 = call i32 @isatty(i32 noundef %74) #10
  %.not = icmp eq i32 %75, 0
  br i1 %.not, label %76, label %77

76:                                               ; preds = %72, %65
  br label %77

77:                                               ; preds = %72, %76
  %.str.4.sink36 = phi ptr [ @.str.4, %76 ], [ @.str, %72 ]
  store i32 %67, ptr %66, align 4, !tbaa !5
  %78 = load ptr, ptr @stderr, align 8, !tbaa !9
  %79 = load i32, ptr @test_count, align 4, !tbaa !5
  %80 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = call ptr @s2n_strerror(i32 noundef %81, ptr noundef nonnull @.str.3) #10
  %83 = load i32, ptr %80, align 4, !tbaa !5
  %84 = call ptr @s2n_strerror_debug(i32 noundef %83, ptr noundef nonnull @.str.3) #10
  %85 = load i32, ptr %66, align 4, !tbaa !5
  %86 = call ptr @strerror(i32 noundef %85) #10
  %87 = load i32, ptr %66, align 4, !tbaa !5
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef nonnull %.str.4.sink36, i32 noundef %79, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.2, i32 noundef 281, ptr noundef %82, ptr noundef %84, ptr noundef %86, i32 noundef %87) #12
  call void @exit(i32 noundef 1) #13
  unreachable

89:                                               ; preds = %61
  %90 = load i32, ptr @test_count, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr @test_count, align 4, !tbaa !5
  %92 = call i32 @s2n_rand_cleanup_thread() #10
  %93 = call zeroext i1 @s2n_result_is_ok(i32 %92)
  br i1 %93, label %118, label %94

94:                                               ; preds = %89
  %95 = tail call ptr @__errno_location() #11
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = load ptr, ptr @stderr, align 8, !tbaa !9
  %98 = call i32 @s2n_print_stacktrace(ptr noundef %97) #10
  %99 = load i8, ptr @s2n_use_color_in_output, align 1, !tbaa !11, !range !13, !noundef !14
  %100 = trunc nuw i8 %99 to i1
  br i1 %100, label %101, label %105

101:                                              ; preds = %94
  %102 = load ptr, ptr @stderr, align 8, !tbaa !9
  %103 = call i32 @fileno(ptr noundef %102) #10
  %104 = call i32 @isatty(i32 noundef %103) #10
  %.not12 = icmp eq i32 %104, 0
  br i1 %.not12, label %105, label %106

105:                                              ; preds = %101, %94
  br label %106

106:                                              ; preds = %101, %105
  %.str.4.sink47 = phi ptr [ @.str.4, %105 ], [ @.str, %101 ]
  store i32 %96, ptr %95, align 4, !tbaa !5
  %107 = load ptr, ptr @stderr, align 8, !tbaa !9
  %108 = load i32, ptr @test_count, align 4, !tbaa !5
  %109 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = call ptr @s2n_strerror(i32 noundef %110, ptr noundef nonnull @.str.3) #10
  %112 = load i32, ptr %109, align 4, !tbaa !5
  %113 = call ptr @s2n_strerror_debug(i32 noundef %112, ptr noundef nonnull @.str.3) #10
  %114 = load i32, ptr %95, align 4, !tbaa !5
  %115 = call ptr @strerror(i32 noundef %114) #10
  %116 = load i32, ptr %95, align 4, !tbaa !5
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %107, ptr noundef nonnull %.str.4.sink47, i32 noundef %108, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.2, i32 noundef 283, ptr noundef %111, ptr noundef %113, ptr noundef %115, i32 noundef %116) #12
  call void @exit(i32 noundef 1) #13
  unreachable

118:                                              ; preds = %89
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #10
  ret ptr null
}

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

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #4

declare i32 @s2n_print_stacktrace(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @isatty(i32 noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @fileno(ptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #6

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

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

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #8

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

declare i32 @s2n_rand_cleanup_thread() local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 "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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { noreturn nounwind "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 #9 = { 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 #10 = { nounwind }
attributes #11 = { nounwind willreturn memory(none) }
attributes #12 = { cold nounwind }
attributes #13 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !10, i64 0}
!16 = !{!"random_communication", !10, i64 0, !10, i64 8, !7, i64 16, !10, i64 120}


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