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

%struct.__va_list_tag = type { i32, i32, ptr, ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@acutest_test_already_logged_ = external hidden global i32, align 4
@acutest_current_test_ = external hidden global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@acutest_test_failures_ = external hidden global i32, align 4
@acutest_verbose_level_ = external hidden global i32, align 4
@acutest_case_already_logged_ = external hidden global i32, align 4
@acutest_case_name_ = external hidden global [64 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@acutest_cond_failed_ = external hidden global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @acutest_check_(i32 noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ...) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [1 x %struct.__va_list_tag], align 16
  %13 = alloca ptr, align 8
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %14 = load i32, ptr %5, align 4, !tbaa !5
  %15 = icmp ne i32 %14, 0
  br i1 %15, label %16, label %17

16:                                               ; preds = %4
  store ptr @.str, ptr %9, align 8, !tbaa !9
  store i32 1, ptr %10, align 4, !tbaa !5
  store i32 3, ptr %11, align 4, !tbaa !5
  br label %29

17:                                               ; preds = %4
  %18 = load i32, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %24, label %20

20:                                               ; preds = %17
  %21 = load ptr, ptr @acutest_current_test_, align 8, !tbaa !9
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %24

23:                                               ; preds = %20
  call void @acutest_finish_test_line_(i32 noundef -1)
  br label %24

24:                                               ; preds = %23, %20, %17
  store ptr @.str.1, ptr %9, align 8, !tbaa !9
  store i32 2, ptr %10, align 4, !tbaa !5
  store i32 2, ptr %11, align 4, !tbaa !5
  %25 = load i32, ptr @acutest_test_failures_, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr @acutest_test_failures_, align 4, !tbaa !5
  %27 = load i32, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %24, %16
  %30 = load i32, ptr @acutest_verbose_level_, align 4, !tbaa !5
  %31 = load i32, ptr %11, align 4, !tbaa !5
  %32 = icmp sge i32 %30, %31
  br i1 %32, label %33, label %79

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #6
  %34 = load i32, ptr @acutest_case_already_logged_, align 4, !tbaa !5
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %46, label %36

36:                                               ; preds = %33
  %37 = load i8, ptr @acutest_case_name_, align 16, !tbaa !11
  %38 = sext i8 %37 to i32
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %46

40:                                               ; preds = %36
  call void @acutest_line_indent_(i32 noundef 1)
  %41 = call i32 (i32, ptr, ...) @acutest_colored_printf_(i32 noundef 3, ptr noundef @.str.2, ptr noundef @acutest_case_name_)
  %42 = load i32, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  %44 = load i32, ptr @acutest_case_already_logged_, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr @acutest_case_already_logged_, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %40, %36, %33
  %47 = load i8, ptr @acutest_case_name_, align 16, !tbaa !11
  %48 = sext i8 %47 to i32
  %49 = icmp ne i32 %48, 0
  %50 = zext i1 %49 to i64
  %51 = select i1 %49, i32 2, i32 1
  call void @acutest_line_indent_(i32 noundef %51)
  %52 = load ptr, ptr %6, align 8, !tbaa !9
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %66

54:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %55 = load ptr, ptr %6, align 8, !tbaa !9
  %56 = call ptr @strrchr(ptr noundef %55, i32 noundef 47) #7
  store ptr %56, ptr %13, align 8, !tbaa !9
  %57 = load ptr, ptr %13, align 8, !tbaa !9
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %62

59:                                               ; preds = %54
  %60 = load ptr, ptr %13, align 8, !tbaa !9
  %61 = getelementptr inbounds i8, ptr %60, i64 1
  store ptr %61, ptr %6, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %59, %54
  %63 = load ptr, ptr %6, align 8, !tbaa !9
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, ptr noundef %63, i32 noundef %64)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %66

66:                                               ; preds = %62, %46
  %67 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %12, i64 0, i64 0
  call void @llvm.va_start.p0(ptr %67)
  %68 = load ptr, ptr %8, align 8, !tbaa !9
  %69 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %12, i64 0, i64 0
  %70 = call i32 @vprintf(ptr noundef %68, ptr noundef %69) #6
  %71 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %12, i64 0, i64 0
  call void @llvm.va_end.p0(ptr %71)
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %73 = load i32, ptr %10, align 4, !tbaa !5
  %74 = load ptr, ptr %9, align 8, !tbaa !9
  %75 = call i32 (i32, ptr, ...) @acutest_colored_printf_(i32 noundef %73, ptr noundef @.str.5, ptr noundef %74)
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %77 = load i32, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  br label %79

79:                                               ; preds = %66, %29
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = icmp eq i32 %80, 0
  %82 = zext i1 %81 to i32
  store i32 %82, ptr @acutest_cond_failed_, align 4, !tbaa !5
  %83 = load i32, ptr @acutest_cond_failed_, align 4, !tbaa !5
  %84 = icmp ne i32 %83, 0
  %85 = xor i1 %84, true
  %86 = zext i1 %85 to i32
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  ret i32 %86
}

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

; Function Attrs: nounwind uwtable
declare hidden void @acutest_finish_test_line_(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @acutest_line_indent_(i32 noundef) #0

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #4

; Function Attrs: inlinehint nounwind uwtable
declare i32 @vprintf(ptr noalias noundef, ptr noundef) #5

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_end.p0(ptr) #4

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 = { 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 = { nocallback nofree nosync nounwind willreturn }
attributes #5 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !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"

%struct.__va_list_tag = type { i32, i32, ptr, ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@acutest_test_already_logged_ = external hidden local_unnamed_addr global i32, align 4
@acutest_current_test_ = external hidden local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@acutest_test_failures_ = external hidden local_unnamed_addr global i32, align 4
@acutest_verbose_level_ = external hidden local_unnamed_addr global i32, align 4
@acutest_case_already_logged_ = external hidden local_unnamed_addr global i32, align 4
@acutest_case_name_ = external hidden global [64 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@acutest_cond_failed_ = external hidden local_unnamed_addr global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @acutest_check_(i32 noundef %0, ptr noundef %1, i32 noundef %2, ptr nocapture noundef readonly %3, ...) local_unnamed_addr #0 {
  %5 = alloca [1 x %struct.__va_list_tag], align 16
  %.not = icmp eq i32 %0, 0
  br i1 %.not, label %6, label %17

6:                                                ; preds = %4
  %7 = load i32, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  %8 = icmp eq i32 %7, 0
  %9 = load ptr, ptr @acutest_current_test_, align 8
  %10 = icmp ne ptr %9, null
  %or.cond = select i1 %8, i1 %10, i1 false
  br i1 %or.cond, label %11, label %12

11:                                               ; preds = %6
  tail call void @acutest_finish_test_line_(i32 noundef -1)
  %.pre = load i32, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %11, %6
  %13 = phi i32 [ %.pre, %11 ], [ %7, %6 ]
  %14 = load i32, ptr @acutest_test_failures_, align 4, !tbaa !5
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr @acutest_test_failures_, align 4, !tbaa !5
  %16 = add nsw i32 %13, 1
  store i32 %16, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %4, %12
  %.017 = phi ptr [ @.str.1, %12 ], [ @.str, %4 ]
  %.016 = phi i32 [ 2, %12 ], [ 1, %4 ]
  %.015 = phi i32 [ 2, %12 ], [ 3, %4 ]
  %18 = load i32, ptr @acutest_verbose_level_, align 4, !tbaa !5
  %.not20 = icmp slt i32 %18, %.015
  br i1 %.not20, label %44, label %19

19:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  %20 = load i32, ptr @acutest_case_already_logged_, align 4, !tbaa !5
  %21 = icmp eq i32 %20, 0
  %22 = load i8, ptr @acutest_case_name_, align 16
  %23 = icmp ne i8 %22, 0
  %or.cond4 = select i1 %21, i1 %23, i1 false
  br i1 %or.cond4, label %24, label %30

24:                                               ; preds = %19
  tail call void @acutest_line_indent_(i32 noundef 1)
  %25 = tail call i32 (i32, ptr, ...) @acutest_colored_printf_(i32 noundef 3, ptr noundef nonnull @.str.2, ptr noundef nonnull @acutest_case_name_)
  %26 = load i32, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  %28 = load i32, ptr @acutest_case_already_logged_, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr @acutest_case_already_logged_, align 4, !tbaa !5
  %.pre24 = load i8, ptr @acutest_case_name_, align 16, !tbaa !9
  br label %30

30:                                               ; preds = %24, %19
  %31 = phi i8 [ %.pre24, %24 ], [ %22, %19 ]
  %.not21 = icmp eq i8 %31, 0
  %32 = select i1 %.not21, i32 1, i32 2
  tail call void @acutest_line_indent_(i32 noundef %32)
  %.not22 = icmp eq ptr %1, null
  br i1 %.not22, label %37, label %33

33:                                               ; preds = %30
  %34 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %1, i32 noundef 47) #7
  %.not23 = icmp eq ptr %34, null
  %35 = getelementptr inbounds i8, ptr %34, i64 1
  %spec.select = select i1 %.not23, ptr %1, ptr %35
  %36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %spec.select, i32 noundef %2)
  br label %37

37:                                               ; preds = %33, %30
  call void @llvm.va_start.p0(ptr nonnull %5)
  %38 = call i32 @vprintf(ptr noundef %3, ptr noundef nonnull %5) #6
  call void @llvm.va_end.p0(ptr nonnull %5)
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %40 = call i32 (i32, ptr, ...) @acutest_colored_printf_(i32 noundef %.016, ptr noundef nonnull @.str.5, ptr noundef nonnull %.017)
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %42 = load i32, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr @acutest_test_already_logged_, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %44

44:                                               ; preds = %37, %17
  %45 = zext i1 %.not to i32
  store i32 %45, ptr @acutest_cond_failed_, align 4, !tbaa !5
  %46 = xor i1 %.not, true
  %47 = zext i1 %46 to i32
  ret i32 %47
}

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

; Function Attrs: nounwind uwtable
declare hidden void @acutest_finish_test_line_(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @acutest_line_indent_(i32 noundef) local_unnamed_addr #0

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #4

; Function Attrs: inlinehint nofree nounwind uwtable
declare noundef i32 @vprintf(ptr noalias nocapture noundef readonly, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_end.p0(ptr) #4

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { inlinehint nofree 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 #6 = { nounwind }
attributes #7 = { 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/C++ TBAA"}
!9 = !{!7, !7, i64 0}


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