; LLVM IR from stivalaa/EstimNetDirected :: src/Random123-1.09/examples (kat_c)

; 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.kat_instance = type { i32, i32, %union.anon }
%union.anon = type { %struct.threefry4x64_kat }
%struct.threefry4x64_kat = type { %struct.r123array4x64, %struct.r123array4x64, %struct.r123array4x64, %struct.r123array4x64 }
%struct.r123array4x64 = type { [4 x i64] }

@stderr = external global ptr, align 8
@have_aesni = external dso_local global i32, align 4
@verbose = external dso_local global i32, align 4
@debug = external dso_local global i32, align 4
@nfailed = external dso_local global i64, align 8
@progname = external dso_local global ptr, align 8
@.str.22 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.26 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [31 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 allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

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

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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #4

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @report_unknowns() #7

declare i32 @printf(ptr noundef, ...) #8

; Function Attrs: nounwind uwtable
declare dso_local void @analyze_tests(ptr noundef, i64 noundef) #7

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #7 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca [1024 x i8], align 16
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca [1024 x i8], align 16
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #10
  store i64 1000, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1024, ptr %9) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.start.p0(i64 1024, ptr %13) #10
  %16 = load ptr, ptr %5, align 8, !tbaa !9
  %17 = getelementptr inbounds ptr, ptr %16, i64 0
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  store ptr %18, ptr @progname, align 8, !tbaa !9
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 1
  br i1 %20, label %21, label %25

21:                                               ; preds = %2
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 1
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  store ptr %24, ptr %12, align 8, !tbaa !9
  br label %35

25:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #10
  %26 = call ptr @getenv(ptr noundef @.str.22) #10
  store ptr %26, ptr %14, align 8, !tbaa !9
  %27 = load ptr, ptr %14, align 8, !tbaa !9
  %28 = icmp ne ptr %27, null
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  store ptr @.str.23, ptr %14, align 8, !tbaa !9
  br label %30

30:                                               ; preds = %29, %25
  %31 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 0
  %32 = load ptr, ptr %14, align 8, !tbaa !9
  %33 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %31, ptr noundef @.str.24, ptr noundef %32) #10
  %34 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 0
  store ptr %34, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #10
  br label %35

35:                                               ; preds = %30, %21
  %36 = load ptr, ptr %12, align 8, !tbaa !9
  %37 = call i32 @strcmp(ptr noundef %36, ptr noundef @.str.25) #11
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %41

39:                                               ; preds = %35
  %40 = load ptr, ptr @stdin, align 8, !tbaa !9
  store ptr %40, ptr %10, align 8, !tbaa !9
  br label %55

41:                                               ; preds = %35
  %42 = load ptr, ptr %12, align 8, !tbaa !9
  %43 = call noalias ptr @fopen(ptr noundef %42, ptr noundef @.str.26)
  store ptr %43, ptr %10, align 8, !tbaa !9
  %44 = load ptr, ptr %10, align 8, !tbaa !9
  %45 = icmp eq ptr %44, null
  br i1 %45, label %46, label %54

46:                                               ; preds = %41
  %47 = load ptr, ptr @stderr, align 8, !tbaa !9
  %48 = load ptr, ptr @progname, align 8, !tbaa !9
  %49 = load ptr, ptr %12, align 8, !tbaa !9
  %50 = call ptr @__errno_location() #12
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = call ptr @strerror(i32 noundef %51) #10
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str.27, ptr noundef %48, ptr noundef %49, ptr noundef %52) #10
  call void @exit(i32 noundef 1) #13
  unreachable

54:                                               ; preds = %41
  br label %55

55:                                               ; preds = %54, %39
  %56 = call ptr @getenv(ptr noundef @.str.28) #10
  store ptr %56, ptr %11, align 8, !tbaa !9
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %61

58:                                               ; preds = %55
  %59 = load ptr, ptr %11, align 8, !tbaa !9
  %60 = call i32 @atoi(ptr noundef %59) #11
  store i32 %60, ptr @verbose, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %58, %55
  %62 = call ptr @getenv(ptr noundef @.str.29) #10
  store ptr %62, ptr %11, align 8, !tbaa !9
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %67

64:                                               ; preds = %61
  %65 = load ptr, ptr %11, align 8, !tbaa !9
  %66 = call i32 @atoi(ptr noundef %65) #11
  store i32 %66, ptr @debug, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %64, %61
  store i32 0, ptr @have_aesni, align 4, !tbaa !5
  %68 = load i64, ptr %8, align 8, !tbaa !11
  %69 = mul i64 136, %68
  %70 = call noalias ptr @malloc(i64 noundef %69) #14
  store ptr %70, ptr %6, align 8, !tbaa !9
  %71 = load ptr, ptr %6, align 8, !tbaa !9
  %72 = icmp eq ptr %71, null
  br i1 %72, label %73, label %77

73:                                               ; preds = %67
  %74 = load ptr, ptr @stderr, align 8, !tbaa !9
  %75 = load i64, ptr %8, align 8, !tbaa !11
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str.30, i64 noundef %75) #10
  call void @exit(i32 noundef 1) #13
  unreachable

77:                                               ; preds = %67
  store i64 0, ptr %7, align 8, !tbaa !11
  br label %78

78:                                               ; preds = %111, %77
  %79 = getelementptr inbounds [1024 x i8], ptr %9, i64 0, i64 0
  %80 = load ptr, ptr %10, align 8, !tbaa !9
  %81 = call ptr @fgets(ptr noundef %79, i32 noundef 1024, ptr noundef %80)
  %82 = icmp ne ptr %81, null
  br i1 %82, label %83, label %112

83:                                               ; preds = %78
  %84 = load i64, ptr %7, align 8, !tbaa !11
  %85 = load i64, ptr %8, align 8, !tbaa !11
  %86 = icmp eq i64 %84, %85
  br i1 %86, label %87, label %101

87:                                               ; preds = %83
  %88 = load i64, ptr %8, align 8, !tbaa !11
  %89 = mul i64 %88, 2
  store i64 %89, ptr %8, align 8, !tbaa !11
  %90 = load ptr, ptr %6, align 8, !tbaa !9
  %91 = load i64, ptr %8, align 8, !tbaa !11
  %92 = mul i64 136, %91
  %93 = call ptr @realloc(ptr noundef %90, i64 noundef %92) #15
  store ptr %93, ptr %6, align 8, !tbaa !9
  %94 = load ptr, ptr %6, align 8, !tbaa !9
  %95 = icmp eq ptr %94, null
  br i1 %95, label %96, label %100

96:                                               ; preds = %87
  %97 = load ptr, ptr @stderr, align 8, !tbaa !9
  %98 = load i64, ptr %8, align 8, !tbaa !11
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef @.str.31, i64 noundef %98) #10
  call void @exit(i32 noundef 1) #13
  unreachable

100:                                              ; preds = %87
  br label %101

101:                                              ; preds = %100, %83
  %102 = getelementptr inbounds [1024 x i8], ptr %9, i64 0, i64 0
  %103 = load ptr, ptr %6, align 8, !tbaa !9
  %104 = load i64, ptr %7, align 8, !tbaa !11
  %105 = getelementptr inbounds %struct.kat_instance, ptr %103, i64 %104
  %106 = call i32 @readtest(ptr noundef %102, ptr noundef %105)
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %111

108:                                              ; preds = %101
  %109 = load i64, ptr %7, align 8, !tbaa !11
  %110 = add i64 %109, 1
  store i64 %110, ptr %7, align 8, !tbaa !11
  br label %111

111:                                              ; preds = %108, %101
  br label %78, !llvm.loop !13

112:                                              ; preds = %78
  call void @report_unknowns()
  %113 = load i64, ptr %7, align 8, !tbaa !11
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.32, i64 noundef %113)
  %115 = load ptr, ptr %6, align 8, !tbaa !9
  %116 = load i64, ptr %7, align 8, !tbaa !11
  call void @host_execute_tests(ptr noundef %115, i64 noundef %116)
  %117 = load ptr, ptr %6, align 8, !tbaa !9
  %118 = load i64, ptr %7, align 8, !tbaa !11
  call void @analyze_tests(ptr noundef %117, i64 noundef %118)
  %119 = load ptr, ptr %6, align 8, !tbaa !9
  call void @free(ptr noundef %119) #10
  %120 = load i64, ptr @nfailed, align 8, !tbaa !11
  %121 = icmp ne i64 %120, 0
  br i1 %121, label %122, label %126

122:                                              ; preds = %112
  %123 = load i64, ptr @nfailed, align 8, !tbaa !11
  %124 = load i64, ptr %7, align 8, !tbaa !11
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.33, i64 noundef %123, i64 noundef %124)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %129

126:                                              ; preds = %112
  %127 = load i64, ptr %7, align 8, !tbaa !11
  %128 = call i32 (ptr, ...) @printf(ptr noundef @.str.34, i64 noundef %127)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %129

129:                                              ; preds = %126, %122
  call void @llvm.lifetime.end.p0(i64 1024, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 1024, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  %130 = load i32, ptr %3, align 4
  ret i32 %130
}

; Function Attrs: nounwind
declare ptr @getenv(ptr noundef) #3

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #3

declare noalias ptr @fopen(ptr noundef, ptr noundef) #8

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

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #8

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #9

; Function Attrs: nounwind uwtable
declare hidden i32 @readtest(ptr noundef, ptr noundef) #7

; Function Attrs: nounwind uwtable
declare dso_local void @host_execute_tests(ptr noundef, i64 noundef) #7

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(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 = { 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 #3 = { 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 #4 = { inlinehint nounwind willreturn memory(read) 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) "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 = { 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 #7 = { 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 #8 = { "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 allocsize(1) "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(read) }
attributes #12 = { nounwind willreturn memory(none) }
attributes #13 = { noreturn nounwind }
attributes #14 = { nounwind allocsize(0) }
attributes #15 = { nounwind allocsize(1) }

!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 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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.kat_instance = type { i32, i32, %union.anon }
%union.anon = type { %struct.threefry4x64_kat }
%struct.threefry4x64_kat = type { %struct.r123array4x64, %struct.r123array4x64, %struct.r123array4x64, %struct.r123array4x64 }
%struct.r123array4x64 = type { [4 x i64] }

@stderr = external local_unnamed_addr global ptr, align 8
@have_aesni = external dso_local local_unnamed_addr global i32, align 4
@verbose = external dso_local local_unnamed_addr global i32, align 4
@debug = external dso_local local_unnamed_addr global i32, align 4
@nfailed = external dso_local local_unnamed_addr global i64, align 8
@progname = external dso_local local_unnamed_addr global ptr, align 8
@.str.22 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.26 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [31 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

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

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #4

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @report_unknowns() local_unnamed_addr #7

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

; Function Attrs: nounwind uwtable
declare dso_local void @analyze_tests(ptr noundef, i64 noundef) local_unnamed_addr #7

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #7 {
  %3 = alloca [1024 x i8], align 16
  %4 = alloca [1024 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %3) #12
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %4) #12
  %5 = load ptr, ptr %1, align 8, !tbaa !5
  store ptr %5, ptr @progname, align 8, !tbaa !5
  %6 = icmp sgt i32 %0, 1
  br i1 %6, label %7, label %10

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  br label %13

10:                                               ; preds = %2
  %11 = tail call ptr @getenv(ptr noundef nonnull @.str.22) #12
  %.not = icmp eq ptr %11, null
  %spec.store.select = select i1 %.not, ptr @.str.23, ptr %11
  %12 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.24, ptr noundef nonnull %spec.store.select) #12
  br label %13

13:                                               ; preds = %10, %7
  %.033 = phi ptr [ %9, %7 ], [ %4, %10 ]
  %14 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %.033, ptr noundef nonnull dereferenceable(1) @.str.25) #13
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %18

16:                                               ; preds = %13
  %17 = load ptr, ptr @stdin, align 8, !tbaa !5
  br label %28

18:                                               ; preds = %13
  %19 = call noalias ptr @fopen(ptr noundef %.033, ptr noundef nonnull @.str.26)
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %28

21:                                               ; preds = %18
  %22 = load ptr, ptr @stderr, align 8, !tbaa !5
  %23 = load ptr, ptr @progname, align 8, !tbaa !5
  %24 = tail call ptr @__errno_location() #14
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = tail call ptr @strerror(i32 noundef %25) #12
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.27, ptr noundef %23, ptr noundef %.033, ptr noundef %26) #15
  call void @exit(i32 noundef 1) #16
  unreachable

28:                                               ; preds = %18, %16
  %.034 = phi ptr [ %17, %16 ], [ %19, %18 ]
  %29 = tail call ptr @getenv(ptr noundef nonnull @.str.28) #12
  %.not46 = icmp eq ptr %29, null
  br i1 %.not46, label %32, label %30

30:                                               ; preds = %28
  %31 = tail call i32 @atoi(ptr nocapture noundef %29) #13
  store i32 %31, ptr @verbose, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %30, %28
  %33 = tail call ptr @getenv(ptr noundef nonnull @.str.29) #12
  %.not47 = icmp eq ptr %33, null
  br i1 %.not47, label %36, label %34

34:                                               ; preds = %32
  %35 = tail call i32 @atoi(ptr nocapture noundef %33) #13
  store i32 %35, ptr @debug, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %34, %32
  store i32 0, ptr @have_aesni, align 4, !tbaa !9
  %37 = tail call noalias dereferenceable_or_null(136000) ptr @malloc(i64 noundef 136000) #17
  %38 = icmp eq ptr %37, null
  br i1 %38, label %40, label %.preheader

.preheader:                                       ; preds = %36
  %39 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef %.034)
  %.not4853 = icmp eq ptr %39, null
  br i1 %.not4853, label %._crit_edge, label %.lr.ph

40:                                               ; preds = %36
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef nonnull @.str.30, i64 noundef 1000) #15
  tail call void @exit(i32 noundef 1) #16
  unreachable

.lr.ph:                                           ; preds = %.preheader, %52
  %.03556 = phi i64 [ %.1, %52 ], [ 1000, %.preheader ]
  %.03655 = phi i64 [ %spec.select, %52 ], [ 0, %.preheader ]
  %.03854 = phi ptr [ %.139, %52 ], [ %37, %.preheader ]
  %43 = icmp eq i64 %.03655, %.03556
  br i1 %43, label %44, label %52

44:                                               ; preds = %.lr.ph
  %45 = shl i64 %.03556, 1
  %46 = mul i64 %.03556, 272
  %47 = call ptr @realloc(ptr noundef %.03854, i64 noundef %46) #18
  %48 = icmp eq ptr %47, null
  br i1 %48, label %49, label %52

49:                                               ; preds = %44
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.31, i64 noundef %45) #15
  call void @exit(i32 noundef 1) #16
  unreachable

52:                                               ; preds = %44, %.lr.ph
  %.139 = phi ptr [ %47, %44 ], [ %.03854, %.lr.ph ]
  %.1 = phi i64 [ %45, %44 ], [ %.03556, %.lr.ph ]
  %53 = getelementptr inbounds %struct.kat_instance, ptr %.139, i64 %.03655
  %54 = call i32 @readtest(ptr noundef nonnull %3, ptr noundef %53)
  %.not50 = icmp ne i32 %54, 0
  %55 = zext i1 %.not50 to i64
  %spec.select = add i64 %.03655, %55
  %56 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef %.034)
  %.not48 = icmp eq ptr %56, null
  br i1 %.not48, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %52, %.preheader
  %.038.lcssa = phi ptr [ %37, %.preheader ], [ %.139, %52 ]
  %.036.lcssa = phi i64 [ 0, %.preheader ], [ %spec.select, %52 ]
  call void @report_unknowns()
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.32, i64 noundef %.036.lcssa)
  call void @host_execute_tests(ptr noundef %.038.lcssa, i64 noundef %.036.lcssa)
  call void @analyze_tests(ptr noundef %.038.lcssa, i64 noundef %.036.lcssa)
  call void @free(ptr noundef %.038.lcssa) #12
  %58 = load i64, ptr @nfailed, align 8, !tbaa !13
  %.not49 = icmp eq i64 %58, 0
  br i1 %.not49, label %61, label %59

59:                                               ; preds = %._crit_edge
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.33, i64 noundef %58, i64 noundef %.036.lcssa)
  br label %63

61:                                               ; preds = %._crit_edge
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.34, i64 noundef %.036.lcssa)
  br label %63

63:                                               ; preds = %61, %59
  %.0 = phi i32 [ 1, %59 ], [ 0, %61 ]
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %4) #12
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #12
  ret i32 %.0
}

; Function Attrs: nofree nounwind memory(read)
declare noundef ptr @getenv(ptr nocapture noundef) local_unnamed_addr #8

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #10

; Function Attrs: nounwind uwtable
declare hidden i32 @readtest(ptr noundef, ptr noundef) local_unnamed_addr #7

; Function Attrs: nounwind uwtable
declare dso_local void @host_execute_tests(ptr noundef, i64 noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #11

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 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 #3 = { 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 #4 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 = { 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 #6 = { 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 #7 = { 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 #8 = { nofree nounwind 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 #9 = { 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 #10 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #11 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #12 = { nounwind }
attributes #13 = { nounwind willreturn memory(read) }
attributes #14 = { nounwind willreturn memory(none) }
attributes #15 = { cold nounwind }
attributes #16 = { noreturn nounwind }
attributes #17 = { nounwind allocsize(0) }
attributes #18 = { nounwind allocsize(1) }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass