; LLVM IR from MostafaTwfiq/C-DataStructures-And-Algorithms :: Unit Test/Tests/DataStructuresTests/QueuesTest/HeapPriorityQueueTest (generalHPriorityQueueTest)

; 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.PQueueTestStruct = type { i32, ptr }

@.str = external hidden unnamed_addr constant [171 x i8], align 1
@__const.generalHPriorityQueueTest.numbersStr = external hidden unnamed_addr constant [14 x [10 x i8]], align 16
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

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

declare ptr @hPriorityQueueInitialization(ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

declare void @destroyHPQueue(ptr noundef) #2

declare void @hpQueueEnqueue(ptr noundef, ptr noundef) #2

declare ptr @hpQueueToArray(ptr noundef) #2

declare i32 @hpQueueGetLength(ptr noundef) #2

declare void @hpQueueEnqueueAll(ptr noundef, ptr noundef, i32 noundef) #2

declare ptr @hpQueueDequeue(ptr noundef) #2

declare ptr @hpQueuePeek(ptr noundef) #2

declare i32 @hpQueueIsEmpty(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @freeHPriorityQueueTestStruct(ptr noundef) #4

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

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

; Function Attrs: nounwind uwtable
define dso_local void @generalHPriorityQueueTest(ptr noundef %0) #4 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca [14 x [10 x i8]], align 16
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %11 = call ptr @hPriorityQueueInitialization(ptr noundef @freeHPriorityQueueTestStruct, ptr noundef @hpQueueTestStructComp)
  store ptr %11, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 140, ptr %4) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %4, ptr align 16 @__const.generalHPriorityQueueTest.numbersStr, i64 140, i1 false)
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = call i32 @hpQueueGetLength(ptr noundef %13)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %12, ptr noundef @.str, i32 noundef 361, ptr noundef null, i32 noundef 0, i32 noundef %14)
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = call i32 @hpQueueIsEmpty(ptr noundef %16)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %15, ptr noundef @.str, i32 noundef 362, ptr noundef null, i32 noundef 1, i32 noundef %17)
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = call ptr @generateHPriorityQueueTestStruct(i32 noundef 3, ptr noundef @.str.2)
  call void @hpQueueEnqueue(ptr noundef %18, ptr noundef %19)
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = call ptr @generateHPriorityQueueTestStruct(i32 noundef 1, ptr noundef @.str.3)
  call void @hpQueueEnqueue(ptr noundef %20, ptr noundef %21)
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = call ptr @generateHPriorityQueueTestStruct(i32 noundef 2, ptr noundef @.str.4)
  call void @hpQueueEnqueue(ptr noundef %22, ptr noundef %23)
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = call i32 @hpQueueGetLength(ptr noundef %25)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %24, ptr noundef @.str, i32 noundef 368, ptr noundef null, i32 noundef 3, i32 noundef %26)
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = call i32 @hpQueueIsEmpty(ptr noundef %28)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %27, ptr noundef @.str, i32 noundef 369, ptr noundef null, i32 noundef 0, i32 noundef %29)
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = call ptr @hpQueuePeek(ptr noundef %31)
  %33 = getelementptr inbounds %struct.PQueueTestStruct, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %30, ptr noundef @.str, i32 noundef 371, ptr noundef null, i32 noundef 1, i32 noundef %34)
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = call ptr @hpQueuePeek(ptr noundef %36)
  %38 = getelementptr inbounds %struct.PQueueTestStruct, ptr %37, i32 0, i32 1
  %39 = load ptr, ptr %38, align 8, !tbaa !12
  call void @CuAssertStrEquals_LineMsg(ptr noundef %35, ptr noundef @.str, i32 noundef 372, ptr noundef null, ptr noundef @.str.3, ptr noundef %39)
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = call ptr @hpQueueDequeue(ptr noundef %40)
  call void @free(ptr noundef %41) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %42 = call noalias ptr @malloc(i64 noundef 88) #7
  store ptr %42, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !13
  br label %43

43:                                               ; preds = %60, %1
  %44 = load i32, ptr %6, align 4, !tbaa !13
  %45 = icmp slt i32 %44, 11
  br i1 %45, label %47, label %46

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

47:                                               ; preds = %43
  %48 = load i32, ptr %6, align 4, !tbaa !13
  %49 = add nsw i32 %48, 4
  %50 = load i32, ptr %6, align 4, !tbaa !13
  %51 = add nsw i32 %50, 3
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [14 x [10 x i8]], ptr %4, i64 0, i64 %52
  %54 = getelementptr inbounds [10 x i8], ptr %53, i64 0, i64 0
  %55 = call ptr @generateHPriorityQueueTestStruct(i32 noundef %49, ptr noundef %54)
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = load i32, ptr %6, align 4, !tbaa !13
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds ptr, ptr %56, i64 %58
  store ptr %55, ptr %59, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %47
  %61 = load i32, ptr %6, align 4, !tbaa !13
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %6, align 4, !tbaa !13
  br label %43, !llvm.loop !14

63:                                               ; preds = %46
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  call void @hpQueueEnqueueAll(ptr noundef %64, ptr noundef %65, i32 noundef 11)
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = call i32 @hpQueueGetLength(ptr noundef %67)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %66, ptr noundef @.str, i32 noundef 382, ptr noundef null, i32 noundef 13, i32 noundef %68)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = call ptr @hpQueueToArray(ptr noundef %69)
  store ptr %70, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !13
  br label %71

71:                                               ; preds = %101, %63
  %72 = load i32, ptr %8, align 4, !tbaa !13
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = call i32 @hpQueueGetLength(ptr noundef %73)
  %75 = icmp slt i32 %72, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %104

77:                                               ; preds = %71
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = load i32, ptr %8, align 4, !tbaa !13
  %80 = add nsw i32 %79, 2
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = load i32, ptr %8, align 4, !tbaa !13
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds ptr, ptr %81, i64 %83
  %85 = load ptr, ptr %84, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.PQueueTestStruct, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %78, ptr noundef @.str, i32 noundef 386, ptr noundef null, i32 noundef %80, i32 noundef %87)
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = load i32, ptr %8, align 4, !tbaa !13
  %90 = add nsw i32 %89, 1
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [14 x [10 x i8]], ptr %4, i64 0, i64 %91
  %93 = getelementptr inbounds [10 x i8], ptr %92, i64 0, i64 0
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = load i32, ptr %8, align 4, !tbaa !13
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds ptr, ptr %94, i64 %96
  %98 = load ptr, ptr %97, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.PQueueTestStruct, ptr %98, i32 0, i32 1
  %100 = load ptr, ptr %99, align 8, !tbaa !12
  call void @CuAssertStrEquals_LineMsg(ptr noundef %88, ptr noundef @.str, i32 noundef 387, ptr noundef null, ptr noundef %93, ptr noundef %100)
  br label %101

101:                                              ; preds = %77
  %102 = load i32, ptr %8, align 4, !tbaa !13
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %8, align 4, !tbaa !13
  br label %71, !llvm.loop !16

104:                                              ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !13
  br label %105

105:                                              ; preds = %110, %104
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = call i32 @hpQueueIsEmpty(ptr noundef %106)
  %108 = icmp ne i32 %107, 0
  %109 = xor i1 %108, true
  br i1 %109, label %110, label %130

110:                                              ; preds = %105
  %111 = load i32, ptr %9, align 4, !tbaa !13
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = call ptr @hpQueueDequeue(ptr noundef %113)
  store ptr %114, ptr %10, align 8, !tbaa !5
  %115 = load ptr, ptr %2, align 8, !tbaa !5
  %116 = load i32, ptr %9, align 4, !tbaa !13
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.PQueueTestStruct, ptr %117, i32 0, i32 0
  %119 = load i32, ptr %118, align 8, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %115, ptr noundef @.str, i32 noundef 394, ptr noundef null, i32 noundef %116, i32 noundef %119)
  %120 = load ptr, ptr %2, align 8, !tbaa !5
  %121 = load i32, ptr %9, align 4, !tbaa !13
  %122 = sub nsw i32 %121, 1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [14 x [10 x i8]], ptr %4, i64 0, i64 %123
  %125 = getelementptr inbounds [10 x i8], ptr %124, i64 0, i64 0
  %126 = load ptr, ptr %10, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.PQueueTestStruct, ptr %126, i32 0, i32 1
  %128 = load ptr, ptr %127, align 8, !tbaa !12
  call void @CuAssertStrEquals_LineMsg(ptr noundef %120, ptr noundef @.str, i32 noundef 395, ptr noundef null, ptr noundef %125, ptr noundef %128)
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  call void @freeHPriorityQueueTestStruct(ptr noundef %129)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %105, !llvm.loop !17

130:                                              ; preds = %105
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %131) #6
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %132) #6
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  call void @destroyHPQueue(ptr noundef %133)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 140, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret void
}

; 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) #5

declare void @CuAssertStrEquals_LineMsg(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

!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 = !{!"PQueueTestStruct", !11, i64 0, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = !{!11, !11, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}


; 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 [171 x i8], align 1
@__const.generalHPriorityQueueTest.numbersStr = external hidden unnamed_addr constant [14 x [10 x i8]], align 16
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

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

declare ptr @hPriorityQueueInitialization(ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

declare void @destroyHPQueue(ptr noundef) local_unnamed_addr #2

declare void @hpQueueEnqueue(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @hpQueueToArray(ptr noundef) local_unnamed_addr #2

declare i32 @hpQueueGetLength(ptr noundef) local_unnamed_addr #2

declare void @hpQueueEnqueueAll(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare ptr @hpQueueDequeue(ptr noundef) local_unnamed_addr #2

declare ptr @hpQueuePeek(ptr noundef) local_unnamed_addr #2

declare i32 @hpQueueIsEmpty(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @freeHPriorityQueueTestStruct(ptr noundef) #4

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @generateHPriorityQueueTestStruct(i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local void @generalHPriorityQueueTest(ptr noundef %0) local_unnamed_addr #4 {
  %2 = alloca [14 x [10 x i8]], align 16
  %3 = tail call ptr @hPriorityQueueInitialization(ptr noundef nonnull @freeHPriorityQueueTestStruct, ptr noundef nonnull @hpQueueTestStructComp) #6
  call void @llvm.lifetime.start.p0(i64 140, ptr nonnull %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(140) %2, ptr noundef nonnull align 16 dereferenceable(140) @__const.generalHPriorityQueueTest.numbersStr, i64 140, i1 false)
  %4 = tail call i32 @hpQueueGetLength(ptr noundef %3) #6
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 361, ptr noundef null, i32 noundef 0, i32 noundef %4) #6
  %5 = tail call i32 @hpQueueIsEmpty(ptr noundef %3) #6
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 362, ptr noundef null, i32 noundef 1, i32 noundef %5) #6
  %6 = tail call ptr @generateHPriorityQueueTestStruct(i32 noundef 3, ptr noundef nonnull @.str.2)
  tail call void @hpQueueEnqueue(ptr noundef %3, ptr noundef %6) #6
  %7 = tail call ptr @generateHPriorityQueueTestStruct(i32 noundef 1, ptr noundef nonnull @.str.3)
  tail call void @hpQueueEnqueue(ptr noundef %3, ptr noundef %7) #6
  %8 = tail call ptr @generateHPriorityQueueTestStruct(i32 noundef 2, ptr noundef nonnull @.str.4)
  tail call void @hpQueueEnqueue(ptr noundef %3, ptr noundef %8) #6
  %9 = tail call i32 @hpQueueGetLength(ptr noundef %3) #6
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 368, ptr noundef null, i32 noundef 3, i32 noundef %9) #6
  %10 = tail call i32 @hpQueueIsEmpty(ptr noundef %3) #6
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 369, ptr noundef null, i32 noundef 0, i32 noundef %10) #6
  %11 = tail call ptr @hpQueuePeek(ptr noundef %3) #6
  %12 = load i32, ptr %11, align 8, !tbaa !5
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 371, ptr noundef null, i32 noundef 1, i32 noundef %12) #6
  %13 = tail call ptr @hpQueuePeek(ptr noundef %3) #6
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  tail call void @CuAssertStrEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 372, ptr noundef null, ptr noundef nonnull @.str.3, ptr noundef %15) #6
  %16 = tail call ptr @hpQueueDequeue(ptr noundef %3) #6
  tail call void @free(ptr noundef %16) #6
  %17 = tail call noalias dereferenceable_or_null(88) ptr @malloc(i64 noundef 88) #7
  %18 = getelementptr inbounds i8, ptr %2, i64 30
  %19 = call ptr @generateHPriorityQueueTestStruct(i32 noundef 4, ptr noundef nonnull %18)
  store ptr %19, ptr %17, align 8, !tbaa !12
  %20 = getelementptr inbounds i8, ptr %2, i64 40
  %21 = call ptr @generateHPriorityQueueTestStruct(i32 noundef 5, ptr noundef nonnull %20)
  %22 = getelementptr inbounds i8, ptr %17, i64 8
  store ptr %21, ptr %22, align 8, !tbaa !12
  %23 = getelementptr inbounds i8, ptr %2, i64 50
  %24 = call ptr @generateHPriorityQueueTestStruct(i32 noundef 6, ptr noundef nonnull %23)
  %25 = getelementptr inbounds i8, ptr %17, i64 16
  store ptr %24, ptr %25, align 8, !tbaa !12
  %26 = getelementptr inbounds i8, ptr %2, i64 60
  %27 = call ptr @generateHPriorityQueueTestStruct(i32 noundef 7, ptr noundef nonnull %26)
  %28 = getelementptr inbounds i8, ptr %17, i64 24
  store ptr %27, ptr %28, align 8, !tbaa !12
  %29 = getelementptr inbounds i8, ptr %2, i64 70
  %30 = call ptr @generateHPriorityQueueTestStruct(i32 noundef 8, ptr noundef nonnull %29)
  %31 = getelementptr inbounds i8, ptr %17, i64 32
  store ptr %30, ptr %31, align 8, !tbaa !12
  %32 = getelementptr inbounds i8, ptr %2, i64 80
  %33 = call ptr @generateHPriorityQueueTestStruct(i32 noundef 9, ptr noundef nonnull %32)
  %34 = getelementptr inbounds i8, ptr %17, i64 40
  store ptr %33, ptr %34, align 8, !tbaa !12
  %35 = getelementptr inbounds i8, ptr %2, i64 90
  %36 = call ptr @generateHPriorityQueueTestStruct(i32 noundef 10, ptr noundef nonnull %35)
  %37 = getelementptr inbounds i8, ptr %17, i64 48
  store ptr %36, ptr %37, align 8, !tbaa !12
  %38 = getelementptr inbounds i8, ptr %2, i64 100
  %39 = call ptr @generateHPriorityQueueTestStruct(i32 noundef 11, ptr noundef nonnull %38)
  %40 = getelementptr inbounds i8, ptr %17, i64 56
  store ptr %39, ptr %40, align 8, !tbaa !12
  %41 = getelementptr inbounds i8, ptr %2, i64 110
  %42 = call ptr @generateHPriorityQueueTestStruct(i32 noundef 12, ptr noundef nonnull %41)
  %43 = getelementptr inbounds i8, ptr %17, i64 64
  store ptr %42, ptr %43, align 8, !tbaa !12
  %44 = getelementptr inbounds i8, ptr %2, i64 120
  %45 = call ptr @generateHPriorityQueueTestStruct(i32 noundef 13, ptr noundef nonnull %44)
  %46 = getelementptr inbounds i8, ptr %17, i64 72
  store ptr %45, ptr %46, align 8, !tbaa !12
  %47 = getelementptr inbounds i8, ptr %2, i64 130
  %48 = call ptr @generateHPriorityQueueTestStruct(i32 noundef 14, ptr noundef nonnull %47)
  %49 = getelementptr inbounds i8, ptr %17, i64 80
  store ptr %48, ptr %49, align 8, !tbaa !12
  call void @hpQueueEnqueueAll(ptr noundef %3, ptr noundef nonnull %17, i32 noundef 11) #6
  %50 = call i32 @hpQueueGetLength(ptr noundef %3) #6
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 382, ptr noundef null, i32 noundef 13, i32 noundef %50) #6
  %51 = call ptr @hpQueueToArray(ptr noundef %3) #6
  %52 = call i32 @hpQueueGetLength(ptr noundef %3) #6
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %1
  %54 = call i32 @hpQueueIsEmpty(ptr noundef %3) #6
  %.not54 = icmp eq i32 %54, 0
  br i1 %.not54, label %.lr.ph56, label %._crit_edge

.lr.ph:                                           ; preds = %1, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %1 ]
  %55 = getelementptr inbounds ptr, ptr %51, i64 %indvars.iv
  %56 = load ptr, ptr %55, align 8, !tbaa !12
  %57 = load i32, ptr %56, align 8, !tbaa !5
  %58 = trunc i64 %indvars.iv to i32
  %59 = add i32 %58, 2
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 386, ptr noundef null, i32 noundef %59, i32 noundef %57) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %60 = getelementptr inbounds [14 x [10 x i8]], ptr %2, i64 0, i64 %indvars.iv.next
  %61 = load ptr, ptr %55, align 8, !tbaa !12
  %62 = getelementptr inbounds i8, ptr %61, i64 8
  %63 = load ptr, ptr %62, align 8, !tbaa !11
  call void @CuAssertStrEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 387, ptr noundef null, ptr noundef nonnull %60, ptr noundef %63) #6
  %64 = call i32 @hpQueueGetLength(ptr noundef %3) #6
  %65 = sext i32 %64 to i64
  %66 = icmp slt i64 %indvars.iv.next, %65
  br i1 %66, label %.lr.ph, label %.preheader, !llvm.loop !13

.lr.ph56:                                         ; preds = %.preheader, %.lr.ph56
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %.lr.ph56 ], [ 1, %.preheader ]
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %67 = call ptr @hpQueueDequeue(ptr noundef %3) #6
  %68 = load i32, ptr %67, align 8, !tbaa !5
  %69 = trunc nuw i64 %indvars.iv.next60 to i32
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 394, ptr noundef null, i32 noundef %69, i32 noundef %68) #6
  %70 = getelementptr inbounds [14 x [10 x i8]], ptr %2, i64 0, i64 %indvars.iv59
  %71 = getelementptr inbounds i8, ptr %67, i64 8
  %72 = load ptr, ptr %71, align 8, !tbaa !11
  call void @CuAssertStrEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 395, ptr noundef null, ptr noundef nonnull %70, ptr noundef %72) #6
  call void @freeHPriorityQueueTestStruct(ptr noundef nonnull %67)
  %73 = call i32 @hpQueueIsEmpty(ptr noundef %3) #6
  %.not = icmp eq i32 %73, 0
  br i1 %.not, label %.lr.ph56, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph56, %.preheader
  call void @free(ptr noundef %17) #6
  call void @free(ptr noundef %51) #6
  call void @destroyHPQueue(ptr noundef %3) #6
  call void @llvm.lifetime.end.p0(i64 140, ptr nonnull %2) #6
  ret void
}

; 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) #5

declare void @CuAssertStrEquals_LineMsg(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

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


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