; LLVM IR from jdeokkim/ferox :: tests/src (ferox_tests)

; 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.greatest_run_info = type { i8, i8, i8, i8, i32, %struct.greatest_suite_info, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, ptr, ptr, [128 x i8], [2 x %struct.greatest_prng], i64, i64 }
%struct.greatest_suite_info = type { i32, i32, i32, i32, i64, i64, i64, i64 }
%struct.greatest_prng = type { i8, i8, [6 x i8], i64, i64, i64, i64, i64, i64, i64 }
%struct.greatest_report_t = type { i32, i32, i32, i32 }

@greatest_info = external dso_local global %struct.greatest_run_info, align 8

; Function Attrs: nounwind uwtable
define dso_local void @greatest_get_report(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = icmp ne ptr %3, null
  br i1 %4, label %5, label %18

5:                                                ; preds = %1
  %6 = load i32, ptr getelementptr inbounds (%struct.greatest_run_info, ptr @greatest_info, i32 0, i32 6), align 8, !tbaa !9
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.greatest_report_t, ptr %7, i32 0, i32 0
  store i32 %6, ptr %8, align 4, !tbaa !14
  %9 = load i32, ptr getelementptr inbounds (%struct.greatest_run_info, ptr @greatest_info, i32 0, i32 7), align 4, !tbaa !16
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.greatest_report_t, ptr %10, i32 0, i32 1
  store i32 %9, ptr %11, align 4, !tbaa !17
  %12 = load i32, ptr getelementptr inbounds (%struct.greatest_run_info, ptr @greatest_info, i32 0, i32 8), align 8, !tbaa !18
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.greatest_report_t, ptr %13, i32 0, i32 2
  store i32 %12, ptr %14, align 4, !tbaa !19
  %15 = load i32, ptr getelementptr inbounds (%struct.greatest_run_info, ptr @greatest_info, i32 0, i32 9), align 4, !tbaa !20
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.greatest_report_t, ptr %16, i32 0, i32 3
  store i32 %15, ptr %17, align 4, !tbaa !21
  br label %18

18:                                               ; preds = %5, %1
  ret void
}

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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, !11, i64 56}
!10 = !{!"greatest_run_info", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !11, i64 4, !12, i64 8, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !11, i64 128, !11, i64 132, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !7, i64 168, !7, i64 296, !13, i64 424, !13, i64 432}
!11 = !{!"int", !7, i64 0}
!12 = !{!"greatest_suite_info", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !11, i64 0}
!15 = !{!"greatest_report_t", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!16 = !{!10, !11, i64 60}
!17 = !{!15, !11, i64 4}
!18 = !{!10, !11, i64 64}
!19 = !{!15, !11, i64 8}
!20 = !{!10, !11, i64 68}
!21 = !{!15, !11, i64 12}


; 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.greatest_run_info = type { i8, i8, i8, i8, i32, %struct.greatest_suite_info, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, ptr, ptr, [128 x i8], [2 x %struct.greatest_prng], i64, i64 }
%struct.greatest_suite_info = type { i32, i32, i32, i32, i64, i64, i64, i64 }
%struct.greatest_prng = type { i8, i8, [6 x i8], i64, i64, i64, i64, i64, i64, i64 }

@greatest_info = external dso_local local_unnamed_addr global %struct.greatest_run_info, align 8

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: write, inaccessiblemem: none) uwtable
define dso_local void @greatest_get_report(ptr noundef writeonly %0) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %2

2:                                                ; preds = %1
  %3 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @greatest_info, i64 56), align 8, !tbaa !5
  store <4 x i32> %3, ptr %0, align 4, !tbaa !5
  br label %4

4:                                                ; preds = %2, %1
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: write, inaccessiblemem: none) 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" }

!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"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass