; LLVM IR from microsoft/Multiverso :: Test (main)

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

@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10PrintUsagev() #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, 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
  %6 = load i32, ptr %4, align 4, !tbaa !5
  %7 = icmp ne i32 %6, 2
  br i1 %7, label %8, label %9

8:                                                ; preds = %2
  call void @_Z10PrintUsagev()
  br label %60

9:                                                ; preds = %2
  %10 = load ptr, ptr %5, align 8, !tbaa !9
  %11 = getelementptr inbounds ptr, ptr %10, i64 1
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = call i32 @strcmp(ptr noundef %12, ptr noundef @.str.1) #4
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %18

15:                                               ; preds = %9
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN10multiverso4test6TestKVEiPPc(i32 noundef %16, ptr noundef %17)
  br label %59

18:                                               ; preds = %9
  %19 = load ptr, ptr %5, align 8, !tbaa !9
  %20 = getelementptr inbounds ptr, ptr %19, i64 1
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = call i32 @strcmp(ptr noundef %21, ptr noundef @.str.2) #4
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %27

24:                                               ; preds = %18
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN10multiverso4test9TestArrayEiPPc(i32 noundef %25, ptr noundef %26)
  br label %58

27:                                               ; preds = %18
  %28 = load ptr, ptr %5, align 8, !tbaa !9
  %29 = getelementptr inbounds ptr, ptr %28, i64 1
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = call i32 @strcmp(ptr noundef %30, ptr noundef @.str.3) #4
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %36

33:                                               ; preds = %27
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN10multiverso4test7TestNetEiPPc(i32 noundef %34, ptr noundef %35)
  br label %57

36:                                               ; preds = %27
  %37 = load ptr, ptr %5, align 8, !tbaa !9
  %38 = getelementptr inbounds ptr, ptr %37, i64 1
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = call i32 @strcmp(ptr noundef %39, ptr noundef @.str.4) #4
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %45

42:                                               ; preds = %36
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN10multiverso4test10TestMatrixEiPPc(i32 noundef %43, ptr noundef %44)
  br label %56

45:                                               ; preds = %36
  %46 = load ptr, ptr %5, align 8, !tbaa !9
  %47 = getelementptr inbounds ptr, ptr %46, i64 1
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  %49 = call i32 @strcmp(ptr noundef %48, ptr noundef @.str.5) #4
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %54

51:                                               ; preds = %45
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN10multiverso4test13TestAllreduceEiPPc(i32 noundef %52, ptr noundef %53)
  br label %55

54:                                               ; preds = %45
  call void @_Z10PrintUsagev()
  br label %55

55:                                               ; preds = %54, %51
  br label %56

56:                                               ; preds = %55, %42
  br label %57

57:                                               ; preds = %56, %33
  br label %58

58:                                               ; preds = %57, %24
  br label %59

59:                                               ; preds = %58, %15
  br label %60

60:                                               ; preds = %59, %8
  ret i32 0
}

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

declare void @_ZN10multiverso4test6TestKVEiPPc(i32 noundef, ptr noundef) #3

declare void @_ZN10multiverso4test9TestArrayEiPPc(i32 noundef, ptr noundef) #3

declare void @_ZN10multiverso4test7TestNetEiPPc(i32 noundef, ptr noundef) #3

declare void @_ZN10multiverso4test10TestMatrixEiPPc(i32 noundef, ptr noundef) #3

declare void @_ZN10multiverso4test13TestAllreduceEiPPc(i32 noundef, ptr noundef) #3

attributes #0 = { 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 #1 = { 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 #2 = { 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 #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(read) }

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


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

@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10PrintUsagev() local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %.not = icmp eq i32 %0, 2
  br i1 %.not, label %4, label %3

3:                                                ; preds = %2
  tail call void @_Z10PrintUsagev()
  br label %27

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str.1) #4
  %8 = icmp eq i32 %7, 0
  br i1 %8, label %9, label %10

9:                                                ; preds = %4
  tail call void @_ZN10multiverso4test6TestKVEiPPc(i32 noundef 2, ptr noundef nonnull %1)
  br label %27

10:                                               ; preds = %4
  %11 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str.2) #4
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %14

13:                                               ; preds = %10
  tail call void @_ZN10multiverso4test9TestArrayEiPPc(i32 noundef 2, ptr noundef nonnull %1)
  br label %27

14:                                               ; preds = %10
  %15 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str.3) #4
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %14
  tail call void @_ZN10multiverso4test7TestNetEiPPc(i32 noundef 2, ptr noundef nonnull %1)
  br label %27

18:                                               ; preds = %14
  %19 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str.4) #4
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %18
  tail call void @_ZN10multiverso4test10TestMatrixEiPPc(i32 noundef 2, ptr noundef nonnull %1)
  br label %27

22:                                               ; preds = %18
  %23 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str.5) #4
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %22
  tail call void @_ZN10multiverso4test13TestAllreduceEiPPc(i32 noundef 2, ptr noundef nonnull %1)
  br label %27

26:                                               ; preds = %22
  tail call void @_Z10PrintUsagev()
  br label %27

27:                                               ; preds = %9, %17, %25, %26, %21, %13, %3
  ret i32 0
}

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

declare void @_ZN10multiverso4test6TestKVEiPPc(i32 noundef, ptr noundef) local_unnamed_addr #3

declare void @_ZN10multiverso4test9TestArrayEiPPc(i32 noundef, ptr noundef) local_unnamed_addr #3

declare void @_ZN10multiverso4test7TestNetEiPPc(i32 noundef, ptr noundef) local_unnamed_addr #3

declare void @_ZN10multiverso4test10TestMatrixEiPPc(i32 noundef, ptr noundef) local_unnamed_addr #3

declare void @_ZN10multiverso4test13TestAllreduceEiPPc(i32 noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { 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 #1 = { 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 #2 = { 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 #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(read) }

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


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