; LLVM IR from themisvaltinos/Partitioned-Hash-Join :: tests (test_helpers)

; 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.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @acutest_check_(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #0

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

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

; Function Attrs: noreturn nounwind uwtable
declare dso_local void @acutest_abort_() #2

; Function Attrs: nounwind uwtable
define dso_local void @testHelpers() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %6

6:                                                ; preds = %38, %0
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = icmp ult i32 %7, 25
  br i1 %8, label %10, label %9

9:                                                ; preds = %6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %43

10:                                               ; preds = %6
  br label %11

11:                                               ; preds = %10
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = shl i32 1, %12
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp eq i32 %13, %14
  %16 = zext i1 %15 to i32
  %17 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %16, ptr noundef @.str.36, i32 noundef 11, ptr noundef @.str.5, ptr noundef @.str.37)
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %20, label %19

19:                                               ; preds = %11
  call void @acutest_abort_() #5
  unreachable

20:                                               ; preds = %11
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = add i32 %25, 1
  %27 = sub i32 %26, 1
  %28 = lshr i32 %24, %27
  %29 = and i32 %28, 1
  %30 = icmp eq i32 %29, 1
  %31 = zext i1 %30 to i32
  %32 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %31, ptr noundef @.str.36, i32 noundef 12, ptr noundef @.str.5, ptr noundef @.str.38)
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %35, label %34

34:                                               ; preds = %23
  call void @acutest_abort_() #5
  unreachable

35:                                               ; preds = %23
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  %39 = load i32, ptr %1, align 4, !tbaa !5
  %40 = add i32 %39, 1
  store i32 %40, ptr %1, align 4, !tbaa !5
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = mul i32 %41, 2
  store i32 %42, ptr %2, align 4, !tbaa !5
  br label %6, !llvm.loop !9

43:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 33554432, ptr %5, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %82, %43
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = icmp ult i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %85

49:                                               ; preds = %44
  br label %50

50:                                               ; preds = %49
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = lshr i32 %51, 0
  %53 = and i32 %52, 33554431
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = icmp eq i32 %53, %54
  %56 = zext i1 %55 to i32
  %57 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %56, ptr noundef @.str.36, i32 noundef 16, ptr noundef @.str.5, ptr noundef @.str.39)
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %60, label %59

59:                                               ; preds = %50
  call void @acutest_abort_() #5
  unreachable

60:                                               ; preds = %50
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = call i32 @gtePow2(i32 noundef %64)
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = icmp eq i32 %65, %66
  %68 = zext i1 %67 to i32
  %69 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %68, ptr noundef @.str.36, i32 noundef 17, ptr noundef @.str.5, ptr noundef @.str.40)
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %72, label %71

71:                                               ; preds = %63
  call void @acutest_abort_() #5
  unreachable

72:                                               ; preds = %63
  br label %73

73:                                               ; preds = %72
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %3, align 4, !tbaa !5
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = icmp eq i32 %75, %76
  br i1 %77, label %78, label %81

78:                                               ; preds = %74
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = mul i32 %79, 2
  store i32 %80, ptr %4, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %78, %74
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = add i32 %83, 1
  store i32 %84, ptr %3, align 4, !tbaa !5
  br label %44, !llvm.loop !11

85:                                               ; preds = %48
  ret void
}

declare i32 @gtePow2(i32 noundef) #3

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn 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 #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 }
attributes #5 = { noreturn }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


; 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.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @acutest_check_(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: noreturn nounwind uwtable
declare dso_local void @acutest_abort_() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @testHelpers() local_unnamed_addr #0 {
  br label %1

1:                                                ; preds = %0, %12
  %.024 = phi i32 [ 0, %0 ], [ %13, %12 ]
  %.01923 = phi i32 [ 1, %0 ], [ %14, %12 ]
  %2 = shl nuw nsw i32 1, %.024
  %3 = icmp eq i32 %2, %.01923
  %4 = zext i1 %3 to i32
  %5 = tail call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %4, ptr noundef nonnull @.str.36, i32 noundef 11, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.37)
  %.not21 = icmp eq i32 %5, 0
  br i1 %.not21, label %6, label %7

6:                                                ; preds = %1
  tail call void @acutest_abort_() #3
  unreachable

7:                                                ; preds = %1
  %8 = lshr i32 %.01923, %.024
  %9 = and i32 %8, 1
  %10 = tail call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %9, ptr noundef nonnull @.str.36, i32 noundef 12, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.38)
  %.not22 = icmp eq i32 %10, 0
  br i1 %.not22, label %11, label %12

11:                                               ; preds = %7
  tail call void @acutest_abort_() #3
  unreachable

12:                                               ; preds = %7
  %13 = add nuw nsw i32 %.024, 1
  %14 = shl i32 %.01923, 1
  %exitcond.not = icmp eq i32 %13, 25
  br i1 %exitcond.not, label %.preheader, label %1, !llvm.loop !5

15:                                               ; preds = %24
  ret void

.preheader:                                       ; preds = %12, %24
  %.01726 = phi i32 [ %spec.select, %24 ], [ 1, %12 ]
  %.01825 = phi i32 [ %27, %24 ], [ 0, %12 ]
  %16 = tail call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef 1, ptr noundef nonnull @.str.36, i32 noundef 16, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.39)
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %17, label %18

17:                                               ; preds = %.preheader
  tail call void @acutest_abort_() #3
  unreachable

18:                                               ; preds = %.preheader
  %19 = tail call i32 @gtePow2(i32 noundef %.01825) #4
  %20 = icmp eq i32 %19, %.01726
  %21 = zext i1 %20 to i32
  %22 = tail call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %21, ptr noundef nonnull @.str.36, i32 noundef 17, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.40)
  %.not20 = icmp eq i32 %22, 0
  br i1 %.not20, label %23, label %24

23:                                               ; preds = %18
  tail call void @acutest_abort_() #3
  unreachable

24:                                               ; preds = %18
  %25 = icmp eq i32 %.01825, %.01726
  %26 = zext i1 %25 to i32
  %spec.select = shl nuw nsw i32 %.01726, %26
  %27 = add nuw nsw i32 %.01825, 1
  %exitcond27.not = icmp eq i32 %27, 33554432
  br i1 %exitcond27.not, label %15, label %.preheader, !llvm.loop !7
}

declare i32 @gtePow2(i32 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 = { noreturn 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 = { noreturn }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass