; LLVM IR from venumb/ZSPACE :: cpp/depends/alglib/cpp/tests (test_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"

%union.anon.1 = type { double }

@seed = external dso_local global i32, align 4
@global_failure_flag = external dso_local global i32, align 4
@use_smp = external dso_local global i8, align 1
@stdout = external global ptr, align 8
@.str.858 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.859 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.860 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.861 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.862 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.863 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.864 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.865 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.866 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.867 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.868 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.869 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.870 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.871 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.872 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.873 = external hidden unnamed_addr constant [26 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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z15tester_functionPv(ptr noundef) #2

declare i32 @fflush(ptr noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %union.anon.1, align 8
  %9 = alloca i64, align 8
  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) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %10 = load i32, ptr %4, align 4, !tbaa !5
  %11 = icmp eq i32 %10, 2
  br i1 %11, label %12, label %17

12:                                               ; preds = %2
  %13 = load ptr, ptr %5, align 8, !tbaa !9
  %14 = getelementptr inbounds ptr, ptr %13, i64 1
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = call i32 @atoi(ptr noundef %15) #8
  store i32 %16, ptr @seed, align 4, !tbaa !5
  br label %20

17:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %18 = call i64 @time(ptr noundef %9) #7
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr @seed, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %20

20:                                               ; preds = %17, %12
  store i8 0, ptr @use_smp, align 1, !tbaa !11
  %21 = load i32, ptr @seed, align 4, !tbaa !5
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str.858, i32 noundef %21)
  %23 = load i32, ptr @seed, align 4, !tbaa !5
  call void @srand(i32 noundef %23) #7
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str.859)
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.860)
  store double 0x3F408642DF569FD3, ptr %8, align 8, !tbaa !13
  %26 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 1
  %27 = load i32, ptr %26, align 4, !tbaa !13
  %28 = icmp eq i32 %27, 1061193282
  br i1 %28, label %29, label %31

29:                                               ; preds = %20
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str.861)
  br label %40

31:                                               ; preds = %20
  %32 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 0
  %33 = load i32, ptr %32, align 8, !tbaa !13
  %34 = icmp eq i32 %33, 1061193282
  br i1 %34, label %35, label %37

35:                                               ; preds = %31
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.862)
  br label %39

37:                                               ; preds = %31
  %38 = call i32 (ptr, ...) @printf(ptr noundef @.str.863)
  br label %39

39:                                               ; preds = %37, %35
  br label %40

40:                                               ; preds = %39, %29
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str.864)
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.865)
  %43 = call i32 (ptr, ...) @printf(ptr noundef @.str.866)
  %44 = call noundef i64 @_ZN11alglib_impl8ae_cpuidEv()
  %45 = and i64 %44, 1
  %46 = icmp ne i64 %45, 0
  %47 = zext i1 %46 to i64
  %48 = select i1 %46, ptr @.str.868, ptr @.str.869
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.867, ptr noundef %48)
  %50 = call i32 (ptr, ...) @printf(ptr noundef @.str.870)
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.871)
  %52 = call i64 @time(ptr noundef %6) #7
  %53 = load ptr, ptr @stdout, align 8, !tbaa !9
  %54 = call i32 @fflush(ptr noundef %53)
  call void @_Z15tester_functionPv(ptr noundef null)
  %55 = call i64 @time(ptr noundef %7) #7
  %56 = load i64, ptr %7, align 8, !tbaa !14
  %57 = load i64, ptr %6, align 8, !tbaa !14
  %58 = call double @difftime(i64 noundef %56, i64 noundef %57) #9
  %59 = fptosi double %58 to i64
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.872, i64 noundef %59)
  %61 = load i32, ptr @global_failure_flag, align 4, !tbaa !5
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %68

63:                                               ; preds = %40
  %64 = call noundef ptr @_ZN11alglib_impl22ae_get_last_error_fileEv()
  %65 = call noundef i32 @_ZN11alglib_impl22ae_get_last_error_lineEv()
  %66 = call noundef ptr @_ZN11alglib_impl23ae_get_last_error_xdescEv()
  %67 = call i32 (ptr, ...) @printf(ptr noundef @.str.873, ptr noundef %64, i32 noundef %65, ptr noundef %66)
  br label %68

68:                                               ; preds = %63, %40
  %69 = load i32, ptr @global_failure_flag, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  ret i32 %69
}

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

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #5

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

declare noundef i64 @_ZN11alglib_impl8ae_cpuidEv() #1

; Function Attrs: nounwind willreturn memory(none)
declare double @difftime(i64 noundef, i64 noundef) #6

declare noundef ptr @_ZN11alglib_impl22ae_get_last_error_fileEv() #1

declare noundef i32 @_ZN11alglib_impl22ae_get_last_error_lineEv() #1

declare noundef ptr @_ZN11alglib_impl23ae_get_last_error_xdescEv() #1

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

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"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"

@seed = external dso_local local_unnamed_addr global i32, align 4
@global_failure_flag = external dso_local local_unnamed_addr global i32, align 4
@use_smp = external dso_local local_unnamed_addr global i8, align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.858 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.859 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.860 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.861 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.864 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.865 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.866 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.867 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.868 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.869 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.870 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.871 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.872 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.873 = external hidden unnamed_addr constant [26 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; 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 uwtable
declare dso_local void @_Z15tester_functionPv(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #3 {
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %6 = icmp eq i32 %0, 2
  br i1 %6, label %7, label %11

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call i32 @atoi(ptr nocapture noundef %9) #9
  br label %14

11:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %12 = call i64 @time(ptr noundef nonnull %5) #8
  %13 = trunc i64 %12 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %14

14:                                               ; preds = %11, %7
  %.sink = phi i32 [ %10, %7 ], [ %13, %11 ]
  store i32 %.sink, ptr @seed, align 4
  store i8 0, ptr @use_smp, align 1, !tbaa !9
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.858, i32 noundef %.sink)
  %16 = load i32, ptr @seed, align 4, !tbaa !11
  call void @srand(i32 noundef %16) #8
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.859)
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.860)
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.861)
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.864)
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.865)
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.866)
  %23 = call noundef i64 @_ZN11alglib_impl8ae_cpuidEv()
  %24 = and i64 %23, 1
  %.not = icmp eq i64 %24, 0
  %25 = select i1 %.not, ptr @.str.869, ptr @.str.868
  %26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.867, ptr noundef nonnull %25)
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.870)
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.871)
  %29 = call i64 @time(ptr noundef nonnull %3) #8
  %30 = load ptr, ptr @stdout, align 8, !tbaa !5
  %31 = call i32 @fflush(ptr noundef %30)
  call void @_Z15tester_functionPv(ptr noundef null)
  %32 = call i64 @time(ptr noundef nonnull %4) #8
  %33 = load i64, ptr %4, align 8, !tbaa !13
  %34 = load i64, ptr %3, align 8, !tbaa !13
  %35 = call double @difftime(i64 noundef %33, i64 noundef %34) #10
  %36 = fptosi double %35 to i64
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.872, i64 noundef %36)
  %38 = load i32, ptr @global_failure_flag, align 4, !tbaa !11
  %.not1 = icmp eq i32 %38, 0
  br i1 %.not1, label %44, label %39

39:                                               ; preds = %14
  %40 = call noundef ptr @_ZN11alglib_impl22ae_get_last_error_fileEv()
  %41 = call noundef i32 @_ZN11alglib_impl22ae_get_last_error_lineEv()
  %42 = call noundef ptr @_ZN11alglib_impl23ae_get_last_error_xdescEv()
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.873, ptr noundef %40, i32 noundef %41, ptr noundef %42)
  %.pre = load i32, ptr @global_failure_flag, align 4, !tbaa !11
  br label %44

44:                                               ; preds = %39, %14
  %45 = phi i32 [ %.pre, %39 ], [ 0, %14 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  ret i32 %45
}

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

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #5

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

declare noundef i64 @_ZN11alglib_impl8ae_cpuidEv() local_unnamed_addr #6

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare double @difftime(i64 noundef, i64 noundef) local_unnamed_addr #7

declare noundef ptr @_ZN11alglib_impl22ae_get_last_error_fileEv() local_unnamed_addr #6

declare noundef i32 @_ZN11alglib_impl22ae_get_last_error_lineEv() local_unnamed_addr #6

declare noundef ptr @_ZN11alglib_impl23ae_get_last_error_xdescEv() local_unnamed_addr #6

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

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}


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