; LLVM IR from oswald2/AURIS :: hashtables-mo/cbits (check)

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

@num_tests = external hidden global i32, align 4
@num_errors = external hidden global i32, align 4
@.str.81 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [22 x i8], align 1

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @check_line_search_3() #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 @check_forward_search_2()
  call void @check_forward_search_3()
  call void @check_line_search()
  call void @check_line_search_2()
  call void @check_line_search_3()
  call void (...) @check_impl_specific()
  %2 = load i32, ptr @num_errors, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %4, label %8

4:                                                ; preds = %0
  %5 = load i32, ptr @num_errors, align 4, !tbaa !5
  %6 = load i32, ptr @num_tests, align 4, !tbaa !5
  %7 = call i32 (ptr, ...) @printf(ptr noundef @.str.81, i32 noundef %5, i32 noundef %6)
  br label %11

8:                                                ; preds = %0
  %9 = load i32, ptr @num_tests, align 4, !tbaa !5
  %10 = call i32 (ptr, ...) @printf(ptr noundef @.str.82, i32 noundef %9)
  br label %11

11:                                               ; preds = %8, %4
  %12 = load i32, ptr @num_errors, align 4, !tbaa !5
  %13 = icmp slt i32 %12, 255
  br i1 %13, label %14, label %16

14:                                               ; preds = %11
  %15 = load i32, ptr @num_errors, align 4, !tbaa !5
  br label %17

16:                                               ; preds = %11
  br label %17

17:                                               ; preds = %16, %14
  %18 = phi i32 [ %15, %14 ], [ 255, %16 ]
  call void @exit(i32 noundef %18) #3
  unreachable
}

declare void @check_impl_specific(...) #1

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #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 = { "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 "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 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"

@num_tests = external hidden local_unnamed_addr global i32, align 4
@num_errors = external hidden local_unnamed_addr global i32, align 4
@.str.81 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [22 x i8], align 1

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

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

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

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

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

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  tail call void @check_forward_search_2()
  tail call void @check_forward_search_3()
  tail call void @check_line_search()
  tail call void @check_line_search_2()
  tail call void @check_line_search_3()
  tail call void (...) @check_impl_specific() #6
  %1 = load i32, ptr @num_errors, align 4, !tbaa !5
  %2 = icmp sgt i32 %1, 0
  %3 = load i32, ptr @num_tests, align 4, !tbaa !5
  br i1 %2, label %4, label %6

4:                                                ; preds = %0
  %5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.81, i32 noundef %1, i32 noundef %3)
  br label %8

6:                                                ; preds = %0
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.82, i32 noundef %3)
  br label %8

8:                                                ; preds = %6, %4
  %9 = load i32, ptr @num_errors, align 4
  %10 = tail call i32 @llvm.smin.i32(i32 %9, i32 255)
  tail call void @exit(i32 noundef %10) #7
  unreachable
}

declare void @check_impl_specific(...) local_unnamed_addr #2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5

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 = { 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 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { 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: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass