; LLVM IR from MostafaTwfiq/C-DataStructures-And-Algorithms :: Unit Test/Tests/AlgorithmsTests/SearchAlgTests (SearchAlgTest)

; 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.ErrorTestStruct = type { i32 }

@__const.testLinearSearch.arr = external hidden unnamed_addr constant [10 x i32], align 16
@.str = external hidden unnamed_addr constant [141 x i8], align 1
@ERROR_TEST = external dso_local global ptr, align 8
@__const.testLinearSearch.arr2 = external hidden unnamed_addr constant [8 x i32], align 16

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

; Function Attrs: nounwind uwtable
define dso_local void @testLinearSearch(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca [10 x i32], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca [8 x i32], align 16
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %3) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %3, ptr align 16 @__const.testLinearSearch.arr, i64 40, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %9 = call i32 @linearSearch(ptr noundef null, ptr noundef null, i32 noundef -1, i32 noundef 0, ptr noundef null)
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.ErrorTestStruct, ptr %11, i32 0, i32 0
  %13 = load i32, ptr %12, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %10, ptr noundef @.str, i32 noundef 18, ptr noundef null, i32 noundef -83386157, i32 noundef %13)
  %14 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  %15 = call i32 @linearSearch(ptr noundef %14, ptr noundef null, i32 noundef -1, i32 noundef 0, ptr noundef null)
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.ErrorTestStruct, ptr %17, i32 0, i32 0
  %19 = load i32, ptr %18, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %16, ptr noundef @.str, i32 noundef 21, ptr noundef null, i32 noundef -83384987, i32 noundef %19)
  %20 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  %21 = call i32 @linearSearch(ptr noundef %20, ptr noundef %4, i32 noundef -1, i32 noundef 0, ptr noundef null)
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.ErrorTestStruct, ptr %23, i32 0, i32 0
  %25 = load i32, ptr %24, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %22, ptr noundef @.str, i32 noundef 24, ptr noundef null, i32 noundef -83384987, i32 noundef %25)
  %26 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  %27 = call i32 @linearSearch(ptr noundef %26, ptr noundef %4, i32 noundef 0, i32 noundef 0, ptr noundef null)
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.ErrorTestStruct, ptr %29, i32 0, i32 0
  %31 = load i32, ptr %30, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %28, ptr noundef @.str, i32 noundef 27, ptr noundef null, i32 noundef -83384987, i32 noundef %31)
  %32 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  %33 = call i32 @linearSearch(ptr noundef %32, ptr noundef %4, i32 noundef 0, i32 noundef 1, ptr noundef null)
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.ErrorTestStruct, ptr %35, i32 0, i32 0
  %37 = load i32, ptr %36, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %34, ptr noundef @.str, i32 noundef 30, ptr noundef null, i32 noundef -83384987, i32 noundef %37)
  %38 = call i32 @linearSearchGetLast(ptr noundef null, ptr noundef null, i32 noundef -1, i32 noundef 0, ptr noundef null)
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.ErrorTestStruct, ptr %40, i32 0, i32 0
  %42 = load i32, ptr %41, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %39, ptr noundef @.str, i32 noundef 33, ptr noundef null, i32 noundef -83386157, i32 noundef %42)
  %43 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  %44 = call i32 @linearSearchGetLast(ptr noundef %43, ptr noundef null, i32 noundef -1, i32 noundef 0, ptr noundef null)
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ErrorTestStruct, ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %45, ptr noundef @.str, i32 noundef 36, ptr noundef null, i32 noundef -83384987, i32 noundef %48)
  %49 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  %50 = call i32 @linearSearchGetLast(ptr noundef %49, ptr noundef %4, i32 noundef -1, i32 noundef 0, ptr noundef null)
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.ErrorTestStruct, ptr %52, i32 0, i32 0
  %54 = load i32, ptr %53, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %51, ptr noundef @.str, i32 noundef 39, ptr noundef null, i32 noundef -83384987, i32 noundef %54)
  %55 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  %56 = call i32 @linearSearchGetLast(ptr noundef %55, ptr noundef %4, i32 noundef 0, i32 noundef 0, ptr noundef null)
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.ErrorTestStruct, ptr %58, i32 0, i32 0
  %60 = load i32, ptr %59, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %57, ptr noundef @.str, i32 noundef 42, ptr noundef null, i32 noundef -83384987, i32 noundef %60)
  %61 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  %62 = call i32 @linearSearchGetLast(ptr noundef %61, ptr noundef %4, i32 noundef 0, i32 noundef 1, ptr noundef null)
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ErrorTestStruct, ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %63, ptr noundef @.str, i32 noundef 45, ptr noundef null, i32 noundef -83384987, i32 noundef %66)
  %67 = call ptr @linearSearchGetAll(ptr noundef null, ptr noundef null, i32 noundef -1, i32 noundef 0, ptr noundef null)
  %68 = load ptr, ptr %2, align 8, !tbaa !5
  %69 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ErrorTestStruct, ptr %69, i32 0, i32 0
  %71 = load i32, ptr %70, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %68, ptr noundef @.str, i32 noundef 48, ptr noundef null, i32 noundef -83386157, i32 noundef %71)
  %72 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  %73 = call ptr @linearSearchGetAll(ptr noundef %72, ptr noundef null, i32 noundef -1, i32 noundef 0, ptr noundef null)
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ErrorTestStruct, ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %74, ptr noundef @.str, i32 noundef 51, ptr noundef null, i32 noundef -83384987, i32 noundef %77)
  %78 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  %79 = call ptr @linearSearchGetAll(ptr noundef %78, ptr noundef %4, i32 noundef -1, i32 noundef 0, ptr noundef null)
  %80 = load ptr, ptr %2, align 8, !tbaa !5
  %81 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.ErrorTestStruct, ptr %81, i32 0, i32 0
  %83 = load i32, ptr %82, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %80, ptr noundef @.str, i32 noundef 54, ptr noundef null, i32 noundef -83384987, i32 noundef %83)
  %84 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  %85 = call ptr @linearSearchGetAll(ptr noundef %84, ptr noundef %4, i32 noundef 0, i32 noundef 0, ptr noundef null)
  %86 = load ptr, ptr %2, align 8, !tbaa !5
  %87 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.ErrorTestStruct, ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %86, ptr noundef @.str, i32 noundef 57, ptr noundef null, i32 noundef -83384987, i32 noundef %89)
  %90 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  %91 = call ptr @linearSearchGetAll(ptr noundef %90, ptr noundef %4, i32 noundef 0, i32 noundef 1, ptr noundef null)
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.ErrorTestStruct, ptr %93, i32 0, i32 0
  %95 = load i32, ptr %94, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %92, ptr noundef @.str, i32 noundef 60, ptr noundef null, i32 noundef -83384987, i32 noundef %95)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 1, ptr %5, align 4, !tbaa !12
  br label %96

96:                                               ; preds = %106, %1
  %97 = load i32, ptr %5, align 4, !tbaa !12
  %98 = icmp sle i32 %97, 10
  br i1 %98, label %100, label %99

99:                                               ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %109

100:                                              ; preds = %96
  %101 = load ptr, ptr %2, align 8, !tbaa !5
  %102 = load i32, ptr %5, align 4, !tbaa !12
  %103 = sub nsw i32 %102, 1
  %104 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  %105 = call i32 @linearSearch(ptr noundef %104, ptr noundef %5, i32 noundef 10, i32 noundef 4, ptr noundef @intCompareFunSeAT1)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %101, ptr noundef @.str, i32 noundef 63, ptr noundef null, i32 noundef %103, i32 noundef %105)
  br label %106

106:                                              ; preds = %100
  %107 = load i32, ptr %5, align 4, !tbaa !12
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %5, align 4, !tbaa !12
  br label %96, !llvm.loop !13

109:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 @__const.testLinearSearch.arr2, i64 32, i1 false)
  store i32 1, ptr %4, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !12
  br label %110

110:                                              ; preds = %124, %109
  %111 = load i32, ptr %7, align 4, !tbaa !12
  %112 = icmp slt i32 %111, 8
  br i1 %112, label %114, label %113

113:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %129

114:                                              ; preds = %110
  %115 = load ptr, ptr %2, align 8, !tbaa !5
  %116 = load i32, ptr %7, align 4, !tbaa !12
  %117 = getelementptr inbounds [8 x i32], ptr %6, i64 0, i64 0
  %118 = call i32 @linearSearch(ptr noundef %117, ptr noundef %4, i32 noundef 8, i32 noundef 4, ptr noundef @intCompareFunSeAT1)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %115, ptr noundef @.str, i32 noundef 68, ptr noundef null, i32 noundef %116, i32 noundef %118)
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = load i32, ptr %7, align 4, !tbaa !12
  %121 = add nsw i32 %120, 1
  %122 = getelementptr inbounds [8 x i32], ptr %6, i64 0, i64 0
  %123 = call i32 @linearSearchGetLast(ptr noundef %122, ptr noundef %4, i32 noundef 8, i32 noundef 4, ptr noundef @intCompareFunSeAT1)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %119, ptr noundef @.str, i32 noundef 69, ptr noundef null, i32 noundef %121, i32 noundef %123)
  br label %124

124:                                              ; preds = %114
  %125 = load i32, ptr %7, align 4, !tbaa !12
  %126 = add nsw i32 %125, 2
  store i32 %126, ptr %7, align 4, !tbaa !12
  %127 = load i32, ptr %4, align 4, !tbaa !12
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %4, align 4, !tbaa !12
  br label %110, !llvm.loop !15

129:                                              ; preds = %113
  store i32 1, ptr %4, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %130 = getelementptr inbounds [8 x i32], ptr %6, i64 0, i64 0
  %131 = call ptr @linearSearchGetAll(ptr noundef %130, ptr noundef %4, i32 noundef 8, i32 noundef 4, ptr noundef @intCompareFunSeAT1)
  store ptr %131, ptr %8, align 8, !tbaa !5
  %132 = load ptr, ptr %2, align 8, !tbaa !5
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = call i32 @vectorGetLength(ptr noundef %133)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %132, ptr noundef @.str, i32 noundef 75, ptr noundef null, i32 noundef 2, i32 noundef %134)
  %135 = load ptr, ptr %2, align 8, !tbaa !5
  %136 = load ptr, ptr %8, align 8, !tbaa !5
  %137 = call ptr @vectorGet(ptr noundef %136, i32 noundef 0)
  %138 = load i32, ptr %137, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %135, ptr noundef @.str, i32 noundef 76, ptr noundef null, i32 noundef 0, i32 noundef %138)
  %139 = load ptr, ptr %2, align 8, !tbaa !5
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  %141 = call ptr @vectorGet(ptr noundef %140, i32 noundef 1)
  %142 = load i32, ptr %141, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %139, ptr noundef @.str, i32 noundef 77, ptr noundef null, i32 noundef 1, i32 noundef %142)
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  call void @destroyVector(ptr noundef %143)
  store i32 3, ptr %4, align 4, !tbaa !12
  %144 = getelementptr inbounds [8 x i32], ptr %6, i64 0, i64 0
  %145 = call ptr @linearSearchGetAll(ptr noundef %144, ptr noundef %4, i32 noundef 8, i32 noundef 4, ptr noundef @intCompareFunSeAT1)
  store ptr %145, ptr %8, align 8, !tbaa !5
  %146 = load ptr, ptr %2, align 8, !tbaa !5
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = call i32 @vectorGetLength(ptr noundef %147)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %146, ptr noundef @.str, i32 noundef 82, ptr noundef null, i32 noundef 2, i32 noundef %148)
  %149 = load ptr, ptr %2, align 8, !tbaa !5
  %150 = load ptr, ptr %8, align 8, !tbaa !5
  %151 = call ptr @vectorGet(ptr noundef %150, i32 noundef 0)
  %152 = load i32, ptr %151, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %149, ptr noundef @.str, i32 noundef 83, ptr noundef null, i32 noundef 4, i32 noundef %152)
  %153 = load ptr, ptr %2, align 8, !tbaa !5
  %154 = load ptr, ptr %8, align 8, !tbaa !5
  %155 = call ptr @vectorGet(ptr noundef %154, i32 noundef 1)
  %156 = load i32, ptr %155, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %153, ptr noundef @.str, i32 noundef 84, ptr noundef null, i32 noundef 5, i32 noundef %156)
  %157 = load ptr, ptr %8, align 8, !tbaa !5
  call void @destroyVector(ptr noundef %157)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %3) #4
  ret void
}

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare i32 @linearSearch(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) #3

declare void @CuAssertIntEquals_LineMsg(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) #3

declare i32 @linearSearchGetLast(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) #3

declare ptr @linearSearchGetAll(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) #3

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

declare i32 @vectorGetLength(ptr noundef) #3

declare ptr @vectorGet(ptr noundef, i32 noundef) #3

declare void @destroyVector(ptr 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 }

!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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"ErrorTestStruct", !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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

@__const.testLinearSearch.arr = external hidden unnamed_addr constant [10 x i32], align 16
@.str = external hidden unnamed_addr constant [141 x i8], align 1
@ERROR_TEST = external dso_local local_unnamed_addr global ptr, align 8
@__const.testLinearSearch.arr2 = external hidden unnamed_addr constant [8 x i32], align 16

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

; Function Attrs: nounwind uwtable
define dso_local void @testLinearSearch(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca [10 x i32], align 16
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [8 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %2) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %2, ptr noundef nonnull align 16 dereferenceable(40) @__const.testLinearSearch.arr, i64 40, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %6 = tail call i32 @linearSearch(ptr noundef null, ptr noundef null, i32 noundef -1, i32 noundef 0, ptr noundef null) #4
  %7 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %8 = load i32, ptr %7, align 4, !tbaa !9
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 18, ptr noundef null, i32 noundef -83386157, i32 noundef %8) #4
  %9 = call i32 @linearSearch(ptr noundef nonnull %2, ptr noundef null, i32 noundef -1, i32 noundef 0, ptr noundef null) #4
  %10 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %11 = load i32, ptr %10, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 21, ptr noundef null, i32 noundef -83384987, i32 noundef %11) #4
  %12 = call i32 @linearSearch(ptr noundef nonnull %2, ptr noundef nonnull %3, i32 noundef -1, i32 noundef 0, ptr noundef null) #4
  %13 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %14 = load i32, ptr %13, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 24, ptr noundef null, i32 noundef -83384987, i32 noundef %14) #4
  %15 = call i32 @linearSearch(ptr noundef nonnull %2, ptr noundef nonnull %3, i32 noundef 0, i32 noundef 0, ptr noundef null) #4
  %16 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %17 = load i32, ptr %16, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 27, ptr noundef null, i32 noundef -83384987, i32 noundef %17) #4
  %18 = call i32 @linearSearch(ptr noundef nonnull %2, ptr noundef nonnull %3, i32 noundef 0, i32 noundef 1, ptr noundef null) #4
  %19 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %20 = load i32, ptr %19, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 30, ptr noundef null, i32 noundef -83384987, i32 noundef %20) #4
  %21 = call i32 @linearSearchGetLast(ptr noundef null, ptr noundef null, i32 noundef -1, i32 noundef 0, ptr noundef null) #4
  %22 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %23 = load i32, ptr %22, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 33, ptr noundef null, i32 noundef -83386157, i32 noundef %23) #4
  %24 = call i32 @linearSearchGetLast(ptr noundef nonnull %2, ptr noundef null, i32 noundef -1, i32 noundef 0, ptr noundef null) #4
  %25 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %26 = load i32, ptr %25, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 36, ptr noundef null, i32 noundef -83384987, i32 noundef %26) #4
  %27 = call i32 @linearSearchGetLast(ptr noundef nonnull %2, ptr noundef nonnull %3, i32 noundef -1, i32 noundef 0, ptr noundef null) #4
  %28 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %29 = load i32, ptr %28, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 39, ptr noundef null, i32 noundef -83384987, i32 noundef %29) #4
  %30 = call i32 @linearSearchGetLast(ptr noundef nonnull %2, ptr noundef nonnull %3, i32 noundef 0, i32 noundef 0, ptr noundef null) #4
  %31 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %32 = load i32, ptr %31, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 42, ptr noundef null, i32 noundef -83384987, i32 noundef %32) #4
  %33 = call i32 @linearSearchGetLast(ptr noundef nonnull %2, ptr noundef nonnull %3, i32 noundef 0, i32 noundef 1, ptr noundef null) #4
  %34 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %35 = load i32, ptr %34, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 45, ptr noundef null, i32 noundef -83384987, i32 noundef %35) #4
  %36 = call ptr @linearSearchGetAll(ptr noundef null, ptr noundef null, i32 noundef -1, i32 noundef 0, ptr noundef null) #4
  %37 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %38 = load i32, ptr %37, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 48, ptr noundef null, i32 noundef -83386157, i32 noundef %38) #4
  %39 = call ptr @linearSearchGetAll(ptr noundef nonnull %2, ptr noundef null, i32 noundef -1, i32 noundef 0, ptr noundef null) #4
  %40 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %41 = load i32, ptr %40, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 51, ptr noundef null, i32 noundef -83384987, i32 noundef %41) #4
  %42 = call ptr @linearSearchGetAll(ptr noundef nonnull %2, ptr noundef nonnull %3, i32 noundef -1, i32 noundef 0, ptr noundef null) #4
  %43 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %44 = load i32, ptr %43, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 54, ptr noundef null, i32 noundef -83384987, i32 noundef %44) #4
  %45 = call ptr @linearSearchGetAll(ptr noundef nonnull %2, ptr noundef nonnull %3, i32 noundef 0, i32 noundef 0, ptr noundef null) #4
  %46 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %47 = load i32, ptr %46, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 57, ptr noundef null, i32 noundef -83384987, i32 noundef %47) #4
  %48 = call ptr @linearSearchGetAll(ptr noundef nonnull %2, ptr noundef nonnull %3, i32 noundef 0, i32 noundef 1, ptr noundef null) #4
  %49 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %50 = load i32, ptr %49, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 60, ptr noundef null, i32 noundef -83384987, i32 noundef %50) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 1, ptr %4, align 4, !tbaa !12
  br label %78

51:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %5, ptr noundef nonnull align 16 dereferenceable(32) @__const.testLinearSearch.arr2, i64 32, i1 false)
  store i32 1, ptr %3, align 4, !tbaa !12
  %52 = call i32 @linearSearch(ptr noundef nonnull %5, ptr noundef nonnull %3, i32 noundef 8, i32 noundef 4, ptr noundef nonnull @intCompareFunSeAT1) #4
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 68, ptr noundef null, i32 noundef 0, i32 noundef %52) #4
  %53 = call i32 @linearSearchGetLast(ptr noundef nonnull %5, ptr noundef nonnull %3, i32 noundef 8, i32 noundef 4, ptr noundef nonnull @intCompareFunSeAT1) #4
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 69, ptr noundef null, i32 noundef 1, i32 noundef %53) #4
  %54 = load i32, ptr %3, align 4, !tbaa !12
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %3, align 4, !tbaa !12
  %56 = call i32 @linearSearch(ptr noundef nonnull %5, ptr noundef nonnull %3, i32 noundef 8, i32 noundef 4, ptr noundef nonnull @intCompareFunSeAT1) #4
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 68, ptr noundef null, i32 noundef 2, i32 noundef %56) #4
  %57 = call i32 @linearSearchGetLast(ptr noundef nonnull %5, ptr noundef nonnull %3, i32 noundef 8, i32 noundef 4, ptr noundef nonnull @intCompareFunSeAT1) #4
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 69, ptr noundef null, i32 noundef 3, i32 noundef %57) #4
  %58 = load i32, ptr %3, align 4, !tbaa !12
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %3, align 4, !tbaa !12
  %60 = call i32 @linearSearch(ptr noundef nonnull %5, ptr noundef nonnull %3, i32 noundef 8, i32 noundef 4, ptr noundef nonnull @intCompareFunSeAT1) #4
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 68, ptr noundef null, i32 noundef 4, i32 noundef %60) #4
  %61 = call i32 @linearSearchGetLast(ptr noundef nonnull %5, ptr noundef nonnull %3, i32 noundef 8, i32 noundef 4, ptr noundef nonnull @intCompareFunSeAT1) #4
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 69, ptr noundef null, i32 noundef 5, i32 noundef %61) #4
  %62 = load i32, ptr %3, align 4, !tbaa !12
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %3, align 4, !tbaa !12
  %64 = call i32 @linearSearch(ptr noundef nonnull %5, ptr noundef nonnull %3, i32 noundef 8, i32 noundef 4, ptr noundef nonnull @intCompareFunSeAT1) #4
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 68, ptr noundef null, i32 noundef 6, i32 noundef %64) #4
  %65 = call i32 @linearSearchGetLast(ptr noundef nonnull %5, ptr noundef nonnull %3, i32 noundef 8, i32 noundef 4, ptr noundef nonnull @intCompareFunSeAT1) #4
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 69, ptr noundef null, i32 noundef 7, i32 noundef %65) #4
  store i32 1, ptr %3, align 4, !tbaa !12
  %66 = call ptr @linearSearchGetAll(ptr noundef nonnull %5, ptr noundef nonnull %3, i32 noundef 8, i32 noundef 4, ptr noundef nonnull @intCompareFunSeAT1) #4
  %67 = call i32 @vectorGetLength(ptr noundef %66) #4
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 75, ptr noundef null, i32 noundef 2, i32 noundef %67) #4
  %68 = call ptr @vectorGet(ptr noundef %66, i32 noundef 0) #4
  %69 = load i32, ptr %68, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 76, ptr noundef null, i32 noundef 0, i32 noundef %69) #4
  %70 = call ptr @vectorGet(ptr noundef %66, i32 noundef 1) #4
  %71 = load i32, ptr %70, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 77, ptr noundef null, i32 noundef 1, i32 noundef %71) #4
  call void @destroyVector(ptr noundef %66) #4
  store i32 3, ptr %3, align 4, !tbaa !12
  %72 = call ptr @linearSearchGetAll(ptr noundef nonnull %5, ptr noundef nonnull %3, i32 noundef 8, i32 noundef 4, ptr noundef nonnull @intCompareFunSeAT1) #4
  %73 = call i32 @vectorGetLength(ptr noundef %72) #4
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 82, ptr noundef null, i32 noundef 2, i32 noundef %73) #4
  %74 = call ptr @vectorGet(ptr noundef %72, i32 noundef 0) #4
  %75 = load i32, ptr %74, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 83, ptr noundef null, i32 noundef 4, i32 noundef %75) #4
  %76 = call ptr @vectorGet(ptr noundef %72, i32 noundef 1) #4
  %77 = load i32, ptr %76, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 84, ptr noundef null, i32 noundef 5, i32 noundef %77) #4
  call void @destroyVector(ptr noundef %72) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #4
  ret void

78:                                               ; preds = %1, %78
  %storemerge37 = phi i32 [ 0, %1 ], [ %80, %78 ]
  %79 = call i32 @linearSearch(ptr noundef nonnull %2, ptr noundef nonnull %4, i32 noundef 10, i32 noundef 4, ptr noundef nonnull @intCompareFunSeAT1) #4
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 63, ptr noundef null, i32 noundef %storemerge37, i32 noundef %79) #4
  %80 = load i32, ptr %4, align 4, !tbaa !12
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %4, align 4, !tbaa !12
  %82 = icmp slt i32 %80, 10
  br i1 %82, label %78, label %51, !llvm.loop !13
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare i32 @linearSearch(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare void @CuAssertIntEquals_LineMsg(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @linearSearchGetLast(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare ptr @linearSearchGetAll(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) 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

declare i32 @vectorGetLength(ptr noundef) local_unnamed_addr #3

declare ptr @vectorGet(ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @destroyVector(ptr noundef) local_unnamed_addr #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 }

!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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"ErrorTestStruct", !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass