; LLVM IR from sgtlaugh/algovault :: code_library (eulerian_numbers)

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

@dp = external dso_local global [5010 x [5010 x i32]], align 16
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @generate() #0

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @generate()
  %2 = load i32, ptr getelementptr inbounds ([5010 x [5010 x i32]], ptr @dp, i64 0, i64 1), align 8, !tbaa !5
  %3 = icmp eq i32 %2, 1
  br i1 %3, label %4, label %5

4:                                                ; preds = %0
  br label %6

5:                                                ; preds = %0
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 37, ptr noundef @__PRETTY_FUNCTION__.main) #2
  unreachable

6:                                                ; preds = %4
  %7 = load i32, ptr getelementptr inbounds ([5010 x [5010 x i32]], ptr @dp, i64 0, i64 4), align 16, !tbaa !5
  %8 = icmp eq i32 %7, 1
  br i1 %8, label %9, label %22

9:                                                ; preds = %6
  %10 = load i32, ptr getelementptr inbounds ([5010 x i32], ptr getelementptr inbounds ([5010 x [5010 x i32]], ptr @dp, i64 0, i64 4), i64 0, i64 1), align 4, !tbaa !5
  %11 = icmp eq i32 %10, 11
  br i1 %11, label %12, label %22

12:                                               ; preds = %9
  %13 = load i32, ptr getelementptr inbounds ([5010 x i32], ptr getelementptr inbounds ([5010 x [5010 x i32]], ptr @dp, i64 0, i64 4), i64 0, i64 2), align 8, !tbaa !5
  %14 = icmp eq i32 %13, 11
  br i1 %14, label %15, label %22

15:                                               ; preds = %12
  %16 = load i32, ptr getelementptr inbounds ([5010 x i32], ptr getelementptr inbounds ([5010 x [5010 x i32]], ptr @dp, i64 0, i64 4), i64 0, i64 3), align 4, !tbaa !5
  %17 = icmp eq i32 %16, 1
  br i1 %17, label %18, label %22

18:                                               ; preds = %15
  %19 = load i32, ptr getelementptr inbounds ([5010 x i32], ptr getelementptr inbounds ([5010 x [5010 x i32]], ptr @dp, i64 0, i64 4), i64 0, i64 4), align 16, !tbaa !5
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %18
  br label %23

22:                                               ; preds = %18, %15, %12, %9, %6
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 38, ptr noundef @__PRETTY_FUNCTION__.main) #2
  unreachable

23:                                               ; preds = %21
  %24 = load i32, ptr getelementptr inbounds ([5010 x i32], ptr getelementptr inbounds ([5010 x [5010 x i32]], ptr @dp, i64 0, i64 1000), i64 0, i64 500), align 16, !tbaa !5
  %25 = icmp eq i32 %24, 948656644
  br i1 %25, label %26, label %27

26:                                               ; preds = %23
  br label %28

27:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 39, ptr noundef @__PRETTY_FUNCTION__.main) #2
  unreachable

28:                                               ; preds = %26
  ret i32 0
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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" }
attributes #1 = { 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 #2 = { 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"}


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

@dp = external dso_local local_unnamed_addr global [5010 x [5010 x i32]], align 16
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @generate() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  tail call void @generate()
  %1 = load i32, ptr getelementptr inbounds (i8, ptr @dp, i64 20040), align 8, !tbaa !5
  %2 = icmp eq i32 %1, 1
  br i1 %2, label %4, label %3

3:                                                ; preds = %0
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 37, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #2
  unreachable

4:                                                ; preds = %0
  %5 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @dp, i64 80160), align 16
  %.fr = freeze <4 x i32> %5
  %6 = load i32, ptr getelementptr inbounds (i8, ptr @dp, i64 80176), align 16
  %7 = icmp eq i32 %6, 0
  %8 = icmp ne <4 x i32> %.fr, <i32 1, i32 11, i32 11, i32 1>
  %9 = bitcast <4 x i1> %8 to i4
  %10 = icmp eq i4 %9, 0
  %op.rdx = select i1 %10, i1 %7, i1 false
  br i1 %op.rdx, label %12, label %11

11:                                               ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 38, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #2
  unreachable

12:                                               ; preds = %4
  %13 = load i32, ptr getelementptr inbounds (i8, ptr @dp, i64 20042000), align 16, !tbaa !5
  %14 = icmp eq i32 %13, 948656644
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 39, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #2
  unreachable

16:                                               ; preds = %12
  ret i32 0
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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" }
attributes #1 = { 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 #2 = { 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"}


; Effective O3 passes: GlobalDCEPass,GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass