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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @intCompareFunSoAT2(ptr 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 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 void @CuAssertIntEquals_LineMsg(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 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: nounwind uwtable
define dso_local void @testMergeSort(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 [10 x i32], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  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.testMergeSort.arr, i64 40, i1 false)
  call void @mergeSort(ptr noundef null, i32 noundef 0, i32 noundef 0, ptr noundef null)
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.ErrorTestStruct, ptr %10, i32 0, i32 0
  %12 = load i32, ptr %11, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %9, ptr noundef @.str, i32 noundef 105, ptr noundef null, i32 noundef -83386157, i32 noundef %12)
  %13 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  call void @mergeSort(ptr noundef %13, i32 noundef -1, i32 noundef 0, ptr noundef null)
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.ErrorTestStruct, ptr %15, i32 0, i32 0
  %17 = load i32, ptr %16, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %14, ptr noundef @.str, i32 noundef 108, ptr noundef null, i32 noundef -83384987, i32 noundef %17)
  %18 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  call void @mergeSort(ptr noundef %18, i32 noundef 1, i32 noundef 0, ptr noundef null)
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.ErrorTestStruct, ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %19, ptr noundef @.str, i32 noundef 111, ptr noundef null, i32 noundef -83384987, i32 noundef %22)
  %23 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  call void @mergeSort(ptr noundef %23, i32 noundef 1, i32 noundef 1, ptr noundef null)
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.ErrorTestStruct, ptr %25, i32 0, i32 0
  %27 = load i32, ptr %26, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %24, ptr noundef @.str, i32 noundef 114, ptr noundef null, i32 noundef -83384987, i32 noundef %27)
  %28 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  call void @mergeSort(ptr noundef %28, i32 noundef 10, i32 noundef 4, ptr noundef @intCompareFunSoAT1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !12
  br label %29

29:                                               ; preds = %41, %1
  %30 = load i32, ptr %4, align 4, !tbaa !12
  %31 = icmp slt i32 %30, 10
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %44

33:                                               ; preds = %29
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = load i32, ptr %4, align 4, !tbaa !12
  %36 = add nsw i32 %35, 1
  %37 = load i32, ptr %4, align 4, !tbaa !12
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %34, ptr noundef @.str, i32 noundef 119, ptr noundef null, i32 noundef %36, i32 noundef %40)
  br label %41

41:                                               ; preds = %33
  %42 = load i32, ptr %4, align 4, !tbaa !12
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %4, align 4, !tbaa !12
  br label %29, !llvm.loop !13

44:                                               ; preds = %32
  %45 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 0
  call void @mergeSort(ptr noundef %45, i32 noundef 10, i32 noundef 4, ptr noundef @intCompareFunSoAT2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 9, ptr %5, align 4, !tbaa !12
  br label %46

46:                                               ; preds = %59, %44
  %47 = load i32, ptr %5, align 4, !tbaa !12
  %48 = icmp sge i32 %47, 0
  br i1 %48, label %50, label %49

49:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %62

50:                                               ; preds = %46
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = load i32, ptr %5, align 4, !tbaa !12
  %53 = add nsw i32 %52, 1
  %54 = load i32, ptr %5, align 4, !tbaa !12
  %55 = sub nsw i32 9, %54
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [10 x i32], ptr %3, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %51, ptr noundef @.str, i32 noundef 123, ptr noundef null, i32 noundef %53, i32 noundef %58)
  br label %59

59:                                               ; preds = %50
  %60 = load i32, ptr %5, align 4, !tbaa !12
  %61 = add nsw i32 %60, -1
  store i32 %61, ptr %5, align 4, !tbaa !12
  br label %46, !llvm.loop !15

62:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 40, ptr %6) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 @__const.testMergeSort.arr2, i64 40, i1 false)
  call void @mergeSortWS(ptr noundef null, i32 noundef 0, i32 noundef 0, 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 128, ptr noundef null, i32 noundef -83386157, i32 noundef %66)
  %67 = getelementptr inbounds [10 x i32], ptr %6, i64 0, i64 0
  call void @mergeSortWS(ptr noundef %67, 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 131, ptr noundef null, i32 noundef -83384987, i32 noundef %71)
  %72 = getelementptr inbounds [10 x i32], ptr %6, i64 0, i64 0
  call void @mergeSortWS(ptr noundef %72, i32 noundef 1, i32 noundef 0, ptr noundef null)
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.ErrorTestStruct, ptr %74, i32 0, i32 0
  %76 = load i32, ptr %75, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %73, ptr noundef @.str, i32 noundef 134, ptr noundef null, i32 noundef -83384987, i32 noundef %76)
  %77 = getelementptr inbounds [10 x i32], ptr %6, i64 0, i64 0
  call void @mergeSortWS(ptr noundef %77, i32 noundef 1, i32 noundef 1, ptr noundef null)
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.ErrorTestStruct, ptr %79, i32 0, i32 0
  %81 = load i32, ptr %80, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %78, ptr noundef @.str, i32 noundef 137, ptr noundef null, i32 noundef -83384987, i32 noundef %81)
  %82 = getelementptr inbounds [10 x i32], ptr %6, i64 0, i64 0
  call void @mergeSortWS(ptr noundef %82, i32 noundef 10, i32 noundef 4, ptr noundef @intCompareFunSoAT1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !12
  br label %83

83:                                               ; preds = %95, %62
  %84 = load i32, ptr %7, align 4, !tbaa !12
  %85 = icmp slt i32 %84, 10
  br i1 %85, label %87, label %86

86:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %98

87:                                               ; preds = %83
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = load i32, ptr %7, align 4, !tbaa !12
  %90 = add nsw i32 %89, 1
  %91 = load i32, ptr %7, align 4, !tbaa !12
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [10 x i32], ptr %6, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %88, ptr noundef @.str, i32 noundef 142, ptr noundef null, i32 noundef %90, i32 noundef %94)
  br label %95

95:                                               ; preds = %87
  %96 = load i32, ptr %7, align 4, !tbaa !12
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %7, align 4, !tbaa !12
  br label %83, !llvm.loop !16

98:                                               ; preds = %86
  %99 = getelementptr inbounds [10 x i32], ptr %6, i64 0, i64 0
  call void @mergeSortWS(ptr noundef %99, i32 noundef 10, i32 noundef 4, ptr noundef @intCompareFunSoAT2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 9, ptr %8, align 4, !tbaa !12
  br label %100

100:                                              ; preds = %113, %98
  %101 = load i32, ptr %8, align 4, !tbaa !12
  %102 = icmp sge i32 %101, 0
  br i1 %102, label %104, label %103

103:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %116

104:                                              ; preds = %100
  %105 = load ptr, ptr %2, align 8, !tbaa !5
  %106 = load i32, ptr %8, align 4, !tbaa !12
  %107 = add nsw i32 %106, 1
  %108 = load i32, ptr %8, align 4, !tbaa !12
  %109 = sub nsw i32 9, %108
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [10 x i32], ptr %6, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %105, ptr noundef @.str, i32 noundef 146, ptr noundef null, i32 noundef %107, i32 noundef %112)
  br label %113

113:                                              ; preds = %104
  %114 = load i32, ptr %8, align 4, !tbaa !12
  %115 = add nsw i32 %114, -1
  store i32 %115, ptr %8, align 4, !tbaa !12
  br label %100, !llvm.loop !17

116:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %3) #4
  ret void
}

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

declare void @mergeSortWS(ptr noundef, i32 noundef, i32 noundef, 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}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !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"

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

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

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

; 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 void @CuAssertIntEquals_LineMsg(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 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

; Function Attrs: nounwind uwtable
define dso_local void @testMergeSort(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca [10 x i32], align 16
  %3 = alloca [10 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.testMergeSort.arr, i64 40, i1 false)
  tail call void @mergeSort(ptr noundef null, i32 noundef 0, i32 noundef 0, ptr noundef null) #4
  %4 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %5 = load i32, ptr %4, align 4, !tbaa !9
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 105, ptr noundef null, i32 noundef -83386157, i32 noundef %5) #4
  call void @mergeSort(ptr noundef nonnull %2, i32 noundef -1, i32 noundef 0, ptr noundef null) #4
  %6 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %7 = load i32, ptr %6, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 108, ptr noundef null, i32 noundef -83384987, i32 noundef %7) #4
  call void @mergeSort(ptr noundef nonnull %2, i32 noundef 1, i32 noundef 0, ptr noundef null) #4
  %8 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %9 = load i32, ptr %8, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 111, ptr noundef null, i32 noundef -83384987, i32 noundef %9) #4
  call void @mergeSort(ptr noundef nonnull %2, i32 noundef 1, i32 noundef 1, 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 114, ptr noundef null, i32 noundef -83384987, i32 noundef %11) #4
  call void @mergeSort(ptr noundef nonnull %2, i32 noundef 10, i32 noundef 4, ptr noundef nonnull @intCompareFunSoAT1) #4
  %12 = load i32, ptr %2, align 16, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 119, ptr noundef null, i32 noundef 1, i32 noundef %12) #4
  %13 = getelementptr inbounds i8, ptr %2, i64 4
  %14 = load i32, ptr %13, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 119, ptr noundef null, i32 noundef 2, i32 noundef %14) #4
  %15 = getelementptr inbounds i8, ptr %2, i64 8
  %16 = load i32, ptr %15, align 8, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 119, ptr noundef null, i32 noundef 3, i32 noundef %16) #4
  %17 = getelementptr inbounds i8, ptr %2, i64 12
  %18 = load i32, ptr %17, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 119, ptr noundef null, i32 noundef 4, i32 noundef %18) #4
  %19 = getelementptr inbounds i8, ptr %2, i64 16
  %20 = load i32, ptr %19, align 16, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 119, ptr noundef null, i32 noundef 5, i32 noundef %20) #4
  %21 = getelementptr inbounds i8, ptr %2, i64 20
  %22 = load i32, ptr %21, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 119, ptr noundef null, i32 noundef 6, i32 noundef %22) #4
  %23 = getelementptr inbounds i8, ptr %2, i64 24
  %24 = load i32, ptr %23, align 8, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 119, ptr noundef null, i32 noundef 7, i32 noundef %24) #4
  %25 = getelementptr inbounds i8, ptr %2, i64 28
  %26 = load i32, ptr %25, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 119, ptr noundef null, i32 noundef 8, i32 noundef %26) #4
  %27 = getelementptr inbounds i8, ptr %2, i64 32
  %28 = load i32, ptr %27, align 16, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 119, ptr noundef null, i32 noundef 9, i32 noundef %28) #4
  %29 = getelementptr inbounds i8, ptr %2, i64 36
  %30 = load i32, ptr %29, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 119, ptr noundef null, i32 noundef 10, i32 noundef %30) #4
  call void @mergeSort(ptr noundef nonnull %2, i32 noundef 10, i32 noundef 4, ptr noundef nonnull @intCompareFunSoAT2) #4
  %31 = load i32, ptr %2, align 16, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 123, ptr noundef null, i32 noundef 10, i32 noundef %31) #4
  %32 = load i32, ptr %13, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 123, ptr noundef null, i32 noundef 9, i32 noundef %32) #4
  %33 = load i32, ptr %15, align 8, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 123, ptr noundef null, i32 noundef 8, i32 noundef %33) #4
  %34 = load i32, ptr %17, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 123, ptr noundef null, i32 noundef 7, i32 noundef %34) #4
  %35 = load i32, ptr %19, align 16, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 123, ptr noundef null, i32 noundef 6, i32 noundef %35) #4
  %36 = load i32, ptr %21, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 123, ptr noundef null, i32 noundef 5, i32 noundef %36) #4
  %37 = load i32, ptr %23, align 8, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 123, ptr noundef null, i32 noundef 4, i32 noundef %37) #4
  %38 = load i32, ptr %25, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 123, ptr noundef null, i32 noundef 3, i32 noundef %38) #4
  %39 = load i32, ptr %27, align 16, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 123, ptr noundef null, i32 noundef 2, i32 noundef %39) #4
  %40 = load i32, ptr %29, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 123, ptr noundef null, i32 noundef 1, i32 noundef %40) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %3, ptr noundef nonnull align 16 dereferenceable(40) @__const.testMergeSort.arr2, i64 40, i1 false)
  call void @mergeSortWS(ptr noundef null, i32 noundef 0, i32 noundef 0, ptr noundef null) #4
  %41 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %42 = load i32, ptr %41, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 128, ptr noundef null, i32 noundef -83386157, i32 noundef %42) #4
  call void @mergeSortWS(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 131, ptr noundef null, i32 noundef -83384987, i32 noundef %44) #4
  call void @mergeSortWS(ptr noundef nonnull %3, i32 noundef 1, i32 noundef 0, ptr noundef null) #4
  %45 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %46 = load i32, ptr %45, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 134, ptr noundef null, i32 noundef -83384987, i32 noundef %46) #4
  call void @mergeSortWS(ptr noundef nonnull %3, i32 noundef 1, i32 noundef 1, ptr noundef null) #4
  %47 = load ptr, ptr @ERROR_TEST, align 8, !tbaa !5
  %48 = load i32, ptr %47, align 4, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 137, ptr noundef null, i32 noundef -83384987, i32 noundef %48) #4
  call void @mergeSortWS(ptr noundef nonnull %3, i32 noundef 10, i32 noundef 4, ptr noundef nonnull @intCompareFunSoAT1) #4
  %49 = load i32, ptr %3, align 16, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 142, ptr noundef null, i32 noundef 1, i32 noundef %49) #4
  %50 = getelementptr inbounds i8, ptr %3, i64 4
  %51 = load i32, ptr %50, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 142, ptr noundef null, i32 noundef 2, i32 noundef %51) #4
  %52 = getelementptr inbounds i8, ptr %3, i64 8
  %53 = load i32, ptr %52, align 8, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 142, ptr noundef null, i32 noundef 3, i32 noundef %53) #4
  %54 = getelementptr inbounds i8, ptr %3, i64 12
  %55 = load i32, ptr %54, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 142, ptr noundef null, i32 noundef 4, i32 noundef %55) #4
  %56 = getelementptr inbounds i8, ptr %3, i64 16
  %57 = load i32, ptr %56, align 16, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 142, ptr noundef null, i32 noundef 5, i32 noundef %57) #4
  %58 = getelementptr inbounds i8, ptr %3, i64 20
  %59 = load i32, ptr %58, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 142, ptr noundef null, i32 noundef 6, i32 noundef %59) #4
  %60 = getelementptr inbounds i8, ptr %3, i64 24
  %61 = load i32, ptr %60, align 8, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 142, ptr noundef null, i32 noundef 7, i32 noundef %61) #4
  %62 = getelementptr inbounds i8, ptr %3, i64 28
  %63 = load i32, ptr %62, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 142, ptr noundef null, i32 noundef 8, i32 noundef %63) #4
  %64 = getelementptr inbounds i8, ptr %3, i64 32
  %65 = load i32, ptr %64, align 16, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 142, ptr noundef null, i32 noundef 9, i32 noundef %65) #4
  %66 = getelementptr inbounds i8, ptr %3, i64 36
  %67 = load i32, ptr %66, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 142, ptr noundef null, i32 noundef 10, i32 noundef %67) #4
  call void @mergeSortWS(ptr noundef nonnull %3, i32 noundef 10, i32 noundef 4, ptr noundef nonnull @intCompareFunSoAT2) #4
  %68 = load i32, ptr %3, align 16, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 146, ptr noundef null, i32 noundef 10, i32 noundef %68) #4
  %69 = load i32, ptr %50, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 146, ptr noundef null, i32 noundef 9, i32 noundef %69) #4
  %70 = load i32, ptr %52, align 8, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 146, ptr noundef null, i32 noundef 8, i32 noundef %70) #4
  %71 = load i32, ptr %54, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 146, ptr noundef null, i32 noundef 7, i32 noundef %71) #4
  %72 = load i32, ptr %56, align 16, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 146, ptr noundef null, i32 noundef 6, i32 noundef %72) #4
  %73 = load i32, ptr %58, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 146, ptr noundef null, i32 noundef 5, i32 noundef %73) #4
  %74 = load i32, ptr %60, align 8, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 146, ptr noundef null, i32 noundef 4, i32 noundef %74) #4
  %75 = load i32, ptr %62, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 146, ptr noundef null, i32 noundef 3, i32 noundef %75) #4
  %76 = load i32, ptr %64, align 16, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 146, ptr noundef null, i32 noundef 2, i32 noundef %76) #4
  %77 = load i32, ptr %66, align 4, !tbaa !12
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 146, ptr noundef null, i32 noundef 1, i32 noundef %77) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #4
  ret void
}

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

declare void @mergeSortWS(ptr noundef, i32 noundef, i32 noundef, 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}


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