; LLVM IR from MostafaTwfiq/C-DataStructures-And-Algorithms :: Unit Test/Tests/DataStructuresTests/StacksTest/DLinkedListStackTest (generalDLStackTest)

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

@.str = external hidden unnamed_addr constant [169 x i8], align 1
@__const.generalDLStackTest.numbersStr = external hidden unnamed_addr constant [10 x [6 x i8]], align 16
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 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 @dlStackInitialization(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 @destroyDLStack(ptr noundef) #2

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

declare i32 @dlStackGetLength(ptr noundef) #2

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

declare ptr @dlStackPop(ptr noundef) #2

declare i32 @dlStackIsEmpty(ptr noundef) #2

declare ptr @dlStackPeek(ptr noundef) #2

declare ptr @dlStackToArray(ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @generalDLStackTest(ptr noundef %0) #4 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca [10 x [6 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 ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %10 = call ptr @dlStackInitialization(ptr noundef @freeDLStackTestStruct)
  store ptr %10, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 60, ptr %4) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %4, ptr align 16 @__const.generalDLStackTest.numbersStr, i64 60, i1 false)
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = call i32 @dlStackGetLength(ptr noundef %12)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %11, ptr noundef @.str, i32 noundef 435, ptr noundef null, i32 noundef 0, i32 noundef %13)
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = call i32 @dlStackIsEmpty(ptr noundef %15)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %14, ptr noundef @.str, i32 noundef 436, ptr noundef null, i32 noundef 1, i32 noundef %16)
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = call ptr @generateDLStackTestStruct(i32 noundef 1, ptr noundef @.str.2)
  call void @dlStackPush(ptr noundef %17, ptr noundef %18)
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = call ptr @generateDLStackTestStruct(i32 noundef 2, ptr noundef @.str.3)
  call void @dlStackPush(ptr noundef %19, ptr noundef %20)
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = call ptr @generateDLStackTestStruct(i32 noundef 3, ptr noundef @.str.4)
  call void @dlStackPush(ptr noundef %21, ptr noundef %22)
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = call i32 @dlStackGetLength(ptr noundef %24)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %23, ptr noundef @.str, i32 noundef 442, ptr noundef null, i32 noundef 3, i32 noundef %25)
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = call i32 @dlStackIsEmpty(ptr noundef %27)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %26, ptr noundef @.str, i32 noundef 443, ptr noundef null, i32 noundef 0, i32 noundef %28)
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = call ptr @dlStackPeek(ptr noundef %30)
  %32 = getelementptr inbounds %struct.DLStackTestStruct, ptr %31, i32 0, i32 0
  %33 = load i32, ptr %32, align 8, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %29, ptr noundef @.str, i32 noundef 445, ptr noundef null, i32 noundef 3, i32 noundef %33)
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = call ptr @dlStackPeek(ptr noundef %35)
  %37 = getelementptr inbounds %struct.DLStackTestStruct, ptr %36, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !12
  call void @CuAssertStrEquals_LineMsg(ptr noundef %34, ptr noundef @.str, i32 noundef 446, ptr noundef null, ptr noundef @.str.4, ptr noundef %38)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %39 = call noalias ptr @malloc(i64 noundef 24) #7
  store ptr %39, 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 %40

40:                                               ; preds = %57, %1
  %41 = load i32, ptr %6, align 4, !tbaa !13
  %42 = icmp slt i32 %41, 3
  br i1 %42, label %44, label %43

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

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

57:                                               ; preds = %44
  %58 = load i32, ptr %6, align 4, !tbaa !13
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %6, align 4, !tbaa !13
  br label %40, !llvm.loop !14

60:                                               ; preds = %43
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  call void @dlStackAddAll(ptr noundef %61, ptr noundef %62, i32 noundef 3)
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = call i32 @dlStackGetLength(ptr noundef %64)
  call void @CuAssertIntEquals_LineMsg(ptr noundef %63, ptr noundef @.str, i32 noundef 454, ptr noundef null, i32 noundef 6, i32 noundef %65)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = call ptr @dlStackToArray(ptr noundef %66)
  store ptr %67, 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 %68

68:                                               ; preds = %97, %60
  %69 = load i32, ptr %8, align 4, !tbaa !13
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = call i32 @dlStackGetLength(ptr noundef %70)
  %72 = icmp slt i32 %69, %71
  br i1 %72, label %74, label %73

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

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

97:                                               ; preds = %74
  %98 = load i32, ptr %8, align 4, !tbaa !13
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %8, align 4, !tbaa !13
  br label %68, !llvm.loop !16

100:                                              ; preds = %73
  br label %101

101:                                              ; preds = %106, %100
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = call i32 @dlStackIsEmpty(ptr noundef %102)
  %104 = icmp ne i32 %103, 0
  %105 = xor i1 %104, true
  br i1 %105, label %106, label %126

106:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = call ptr @dlStackPop(ptr noundef %107)
  store ptr %108, ptr %9, align 8, !tbaa !5
  %109 = load ptr, ptr %2, align 8, !tbaa !5
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = call i32 @dlStackGetLength(ptr noundef %110)
  %112 = add nsw i32 %111, 1
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.DLStackTestStruct, ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 8, !tbaa !9
  call void @CuAssertIntEquals_LineMsg(ptr noundef %109, ptr noundef @.str, i32 noundef 464, ptr noundef null, i32 noundef %112, i32 noundef %115)
  %116 = load ptr, ptr %2, align 8, !tbaa !5
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = call i32 @dlStackGetLength(ptr noundef %117)
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [10 x [6 x i8]], ptr %4, i64 0, i64 %119
  %121 = getelementptr inbounds [6 x i8], ptr %120, i64 0, i64 0
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.DLStackTestStruct, ptr %122, i32 0, i32 1
  %124 = load ptr, ptr %123, align 8, !tbaa !12
  call void @CuAssertStrEquals_LineMsg(ptr noundef %116, ptr noundef @.str, i32 noundef 465, ptr noundef null, ptr noundef %121, ptr noundef %124)
  %125 = load ptr, ptr %9, align 8, !tbaa !5
  call void @freeDLStackTestStruct(ptr noundef %125)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %101, !llvm.loop !17

126:                                              ; preds = %101
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %127) #6
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %128) #6
  %129 = load ptr, ptr %3, align 8, !tbaa !5
  call void @destroyDLStack(ptr noundef %129)
  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 60, 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 = !{!"DLStackTestStruct", !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 [169 x i8], align 1
@__const.generalDLStackTest.numbersStr = external hidden unnamed_addr constant [10 x [6 x i8]], align 16
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 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 @dlStackInitialization(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 @destroyDLStack(ptr noundef) local_unnamed_addr #2

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

declare i32 @dlStackGetLength(ptr noundef) local_unnamed_addr #2

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

declare ptr @dlStackPop(ptr noundef) local_unnamed_addr #2

declare i32 @dlStackIsEmpty(ptr noundef) local_unnamed_addr #2

declare ptr @dlStackPeek(ptr noundef) local_unnamed_addr #2

declare ptr @dlStackToArray(ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @generalDLStackTest(ptr noundef %0) local_unnamed_addr #4 {
  %2 = alloca [10 x [6 x i8]], align 16
  %3 = tail call ptr @dlStackInitialization(ptr noundef nonnull @freeDLStackTestStruct) #6
  call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) %2, ptr noundef nonnull align 16 dereferenceable(60) @__const.generalDLStackTest.numbersStr, i64 60, i1 false)
  %4 = tail call i32 @dlStackGetLength(ptr noundef %3) #6
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 435, ptr noundef null, i32 noundef 0, i32 noundef %4) #6
  %5 = tail call i32 @dlStackIsEmpty(ptr noundef %3) #6
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 436, ptr noundef null, i32 noundef 1, i32 noundef %5) #6
  %6 = tail call ptr @generateDLStackTestStruct(i32 noundef 1, ptr noundef nonnull @.str.2)
  tail call void @dlStackPush(ptr noundef %3, ptr noundef %6) #6
  %7 = tail call ptr @generateDLStackTestStruct(i32 noundef 2, ptr noundef nonnull @.str.3)
  tail call void @dlStackPush(ptr noundef %3, ptr noundef %7) #6
  %8 = tail call ptr @generateDLStackTestStruct(i32 noundef 3, ptr noundef nonnull @.str.4)
  tail call void @dlStackPush(ptr noundef %3, ptr noundef %8) #6
  %9 = tail call i32 @dlStackGetLength(ptr noundef %3) #6
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 442, ptr noundef null, i32 noundef 3, i32 noundef %9) #6
  %10 = tail call i32 @dlStackIsEmpty(ptr noundef %3) #6
  tail call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 443, ptr noundef null, i32 noundef 0, i32 noundef %10) #6
  %11 = tail call ptr @dlStackPeek(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 445, ptr noundef null, i32 noundef 3, i32 noundef %12) #6
  %13 = tail call ptr @dlStackPeek(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 446, ptr noundef null, ptr noundef nonnull @.str.4, ptr noundef %15) #6
  %16 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #7
  %17 = getelementptr inbounds i8, ptr %2, i64 18
  %18 = call ptr @generateDLStackTestStruct(i32 noundef 4, ptr noundef nonnull %17)
  store ptr %18, ptr %16, align 8, !tbaa !12
  %19 = getelementptr inbounds i8, ptr %2, i64 24
  %20 = call ptr @generateDLStackTestStruct(i32 noundef 5, ptr noundef nonnull %19)
  %21 = getelementptr inbounds i8, ptr %16, i64 8
  store ptr %20, ptr %21, align 8, !tbaa !12
  %22 = getelementptr inbounds i8, ptr %2, i64 30
  %23 = call ptr @generateDLStackTestStruct(i32 noundef 6, ptr noundef nonnull %22)
  %24 = getelementptr inbounds i8, ptr %16, i64 16
  store ptr %23, ptr %24, align 8, !tbaa !12
  call void @dlStackAddAll(ptr noundef %3, ptr noundef nonnull %16, i32 noundef 3) #6
  %25 = call i32 @dlStackGetLength(ptr noundef %3) #6
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 454, ptr noundef null, i32 noundef 6, i32 noundef %25) #6
  %26 = call ptr @dlStackToArray(ptr noundef %3) #6
  %27 = call i32 @dlStackGetLength(ptr noundef %3) #6
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %1
  %29 = call i32 @dlStackIsEmpty(ptr noundef %3) #6
  %.not51 = icmp eq i32 %29, 0
  br i1 %.not51, label %.lr.ph52, label %._crit_edge

.lr.ph:                                           ; preds = %1, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %1 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = getelementptr inbounds ptr, ptr %26, i64 %indvars.iv
  %31 = load ptr, ptr %30, align 8, !tbaa !12
  %32 = load i32, ptr %31, align 8, !tbaa !5
  %33 = trunc nuw nsw i64 %indvars.iv.next to i32
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 458, ptr noundef null, i32 noundef %33, i32 noundef %32) #6
  %34 = getelementptr inbounds [10 x [6 x i8]], ptr %2, i64 0, i64 %indvars.iv
  %35 = load ptr, ptr %30, align 8, !tbaa !12
  %36 = getelementptr inbounds i8, ptr %35, i64 8
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  call void @CuAssertStrEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 459, ptr noundef null, ptr noundef nonnull %34, ptr noundef %37) #6
  %38 = call i32 @dlStackGetLength(ptr noundef %3) #6
  %39 = sext i32 %38 to i64
  %40 = icmp slt i64 %indvars.iv.next, %39
  br i1 %40, label %.lr.ph, label %.preheader, !llvm.loop !13

.lr.ph52:                                         ; preds = %.preheader, %.lr.ph52
  %41 = call ptr @dlStackPop(ptr noundef %3) #6
  %42 = call i32 @dlStackGetLength(ptr noundef %3) #6
  %43 = add nsw i32 %42, 1
  %44 = load i32, ptr %41, align 8, !tbaa !5
  call void @CuAssertIntEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 464, ptr noundef null, i32 noundef %43, i32 noundef %44) #6
  %45 = call i32 @dlStackGetLength(ptr noundef %3) #6
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [10 x [6 x i8]], ptr %2, i64 0, i64 %46
  %48 = getelementptr inbounds i8, ptr %41, i64 8
  %49 = load ptr, ptr %48, align 8, !tbaa !11
  call void @CuAssertStrEquals_LineMsg(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef 465, ptr noundef null, ptr noundef nonnull %47, ptr noundef %49) #6
  call void @freeDLStackTestStruct(ptr noundef nonnull %41)
  %50 = call i32 @dlStackIsEmpty(ptr noundef %3) #6
  %.not = icmp eq i32 %50, 0
  br i1 %.not, label %.lr.ph52, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph52, %.preheader
  call void @free(ptr noundef %16) #6
  call void @free(ptr noundef %26) #6
  call void @destroyDLStack(ptr noundef %3) #6
  call void @llvm.lifetime.end.p0(i64 60, 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 = !{!"DLStackTestStruct", !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