; LLVM IR from scemama/slaterlib :: src (test)

; 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.20 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [23 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 uwtable
declare dso_local i32 @test_trailz() #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @test_popcnt() #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @test_exc_degree(i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @test_to_of_list(i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @test_get_holes_particles(i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @test_nperm(i32 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = 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 4, ptr %6) #4
  store i32 4, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %8 = call i64 @time(ptr noundef null) #4
  %9 = trunc i64 %8 to i32
  call void @srand(i32 noundef %9) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  %10 = call i32 (ptr, ...) @printf(ptr noundef @.str.20, i32 noundef 6)
  %11 = call i32 (ptr, ...) @printf(ptr noundef @.str.21, i32 noundef 64)
  %12 = call i32 (ptr, ...) @printf(ptr noundef @.str.22)
  %13 = call i32 @test_trailz()
  %14 = icmp ne i32 %13, 0
  br i1 %14, label %15, label %17

15:                                               ; preds = %2
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  store i32 -1, ptr %7, align 4, !tbaa !5
  br label %19

17:                                               ; preds = %2
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  br label %19

19:                                               ; preds = %17, %15
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str.25)
  %21 = call i32 @test_popcnt()
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %25

23:                                               ; preds = %19
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  store i32 -1, ptr %7, align 4, !tbaa !5
  br label %27

25:                                               ; preds = %19
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  br label %27

27:                                               ; preds = %25, %23
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.26)
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = call i32 @test_exc_degree(i32 noundef %29)
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %34

32:                                               ; preds = %27
  %33 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  store i32 -1, ptr %7, align 4, !tbaa !5
  br label %36

34:                                               ; preds = %27
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  br label %36

36:                                               ; preds = %34, %32
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.27)
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = call i32 @test_to_of_list(i32 noundef %38)
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %43

41:                                               ; preds = %36
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  store i32 -1, ptr %7, align 4, !tbaa !5
  br label %45

43:                                               ; preds = %36
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  br label %45

45:                                               ; preds = %43, %41
  %46 = call i32 (ptr, ...) @printf(ptr noundef @.str.28)
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = call i32 @test_get_holes_particles(i32 noundef %47)
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %52

50:                                               ; preds = %45
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  store i32 -1, ptr %7, align 4, !tbaa !5
  br label %54

52:                                               ; preds = %45
  %53 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  br label %54

54:                                               ; preds = %52, %50
  %55 = call i32 (ptr, ...) @printf(ptr noundef @.str.29)
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = call i32 @test_nperm(i32 noundef %56)
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %61

59:                                               ; preds = %54
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  store i32 -1, ptr %7, align 4, !tbaa !5
  br label %63

61:                                               ; preds = %54
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  br label %63

63:                                               ; preds = %61, %59
  %64 = load i32, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  ret i32 %64
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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"}
!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.20 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @test_trailz() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @test_popcnt() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @test_exc_degree(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @test_to_of_list(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @test_get_holes_particles(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @test_nperm(i32 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = tail call i64 @time(ptr noundef null) #3
  %4 = trunc i64 %3 to i32
  tail call void @srand(i32 noundef %4) #3
  %5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, i32 noundef 6)
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21, i32 noundef 64)
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22)
  %8 = tail call i32 @test_trailz()
  %.not.not = icmp eq i32 %8, 0
  %.str.24..str.23 = select i1 %.not.not, ptr @.str.24, ptr @.str.23
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.24..str.23)
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25)
  %11 = tail call i32 @test_popcnt()
  %.not5.not = icmp eq i32 %11, 0
  %.str.24.sink10 = select i1 %.not5.not, ptr @.str.24, ptr @.str.23
  %12 = or i32 %11, %8
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.24.sink10)
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26)
  %15 = tail call i32 @test_exc_degree(i32 noundef 4)
  %.not6.not = icmp eq i32 %15, 0
  %.str.24.sink11 = select i1 %.not6.not, ptr @.str.24, ptr @.str.23
  %16 = or i32 %15, %12
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.24.sink11)
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27)
  %19 = tail call i32 @test_to_of_list(i32 noundef 4)
  %.not7.not = icmp eq i32 %19, 0
  %.str.24.sink12 = select i1 %.not7.not, ptr @.str.24, ptr @.str.23
  %20 = or i32 %19, %16
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.24.sink12)
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28)
  %23 = tail call i32 @test_get_holes_particles(i32 noundef 4)
  %.not8.not = icmp eq i32 %23, 0
  %.str.24.sink13 = select i1 %.not8.not, ptr @.str.24, ptr @.str.23
  %24 = or i32 %23, %20
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.24.sink13)
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29)
  %27 = tail call i32 @test_nperm(i32 noundef 4)
  %.not9.not = icmp eq i32 %27, 0
  %.str.24.sink14 = select i1 %.not9.not, ptr @.str.24, ptr @.str.23
  %28 = or i32 %27, %24
  %narrow = icmp ne i32 %28, 0
  %.5 = sext i1 %narrow to i32
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.24.sink14)
  ret i32 %.5
}

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

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

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 = { 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 = { 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 #3 = { 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)"}


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