; LLVM IR from ryanlayer/giggle :: test/unit (test_lists)

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

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

declare void @UnityAssertEqualNumber(i64 noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @test_uint32_t_array() #2 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #3
  %5 = call ptr @uint32_t_array_init(i32 noundef 10)
  store ptr %5, ptr %1, align 8, !tbaa !5
  %6 = load ptr, ptr %1, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.uint32_t_array, ptr %6, i32 0, i32 1
  %8 = load i32, ptr %7, align 4, !tbaa !9
  %9 = zext i32 %8 to i64
  call void @UnityAssertEqualNumber(i64 noundef 10, i64 noundef %9, ptr noundef null, i64 noundef 976, i32 noundef 148)
  %10 = load ptr, ptr %1, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.uint32_t_array, ptr %10, i32 0, i32 0
  %12 = load i32, ptr %11, align 8, !tbaa !12
  %13 = zext i32 %12 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %13, ptr noundef null, i64 noundef 977, i32 noundef 148)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  %14 = load ptr, ptr %1, align 8, !tbaa !5
  %15 = call i32 @uint32_t_array_add(ptr noundef %14, i32 noundef 5)
  store i32 %15, ptr %2, align 4, !tbaa !13
  %16 = load ptr, ptr %1, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.uint32_t_array, ptr %16, i32 0, i32 1
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %19 = zext i32 %18 to i64
  call void @UnityAssertEqualNumber(i64 noundef 10, i64 noundef %19, ptr noundef null, i64 noundef 981, i32 noundef 148)
  %20 = load i32, ptr %2, align 4, !tbaa !13
  %21 = zext i32 %20 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %21, ptr noundef null, i64 noundef 982, i32 noundef 148)
  %22 = load ptr, ptr %1, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.uint32_t_array, ptr %22, i32 0, i32 0
  %24 = load i32, ptr %23, align 8, !tbaa !12
  %25 = zext i32 %24 to i64
  call void @UnityAssertEqualNumber(i64 noundef 1, i64 noundef %25, ptr noundef null, i64 noundef 983, i32 noundef 148)
  %26 = load ptr, ptr %1, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.uint32_t_array, ptr %26, i32 0, i32 2
  %28 = load ptr, ptr %27, align 8, !tbaa !14
  %29 = getelementptr inbounds i32, ptr %28, i64 0
  %30 = load i32, ptr %29, align 4, !tbaa !13
  %31 = zext i32 %30 to i64
  call void @UnityAssertEqualNumber(i64 noundef 5, i64 noundef %31, ptr noundef null, i64 noundef 984, i32 noundef 148)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %32 = load ptr, ptr %1, align 8, !tbaa !5
  %33 = call ptr @uint32_t_array_get(ptr noundef %32, i32 noundef 0)
  store ptr %33, ptr %3, align 8, !tbaa !5
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = load i32, ptr %34, align 4, !tbaa !13
  %36 = zext i32 %35 to i64
  call void @UnityAssertEqualNumber(i64 noundef 5, i64 noundef %36, ptr noundef null, i64 noundef 987, i32 noundef 148)
  %37 = load ptr, ptr %1, align 8, !tbaa !5
  %38 = call ptr @uint32_t_array_get(ptr noundef %37, i32 noundef 100)
  store ptr %38, ptr %3, align 8, !tbaa !5
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = ptrtoint ptr %39 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %40, ptr noundef null, i64 noundef 990, i32 noundef 148)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !13
  br label %41

41:                                               ; preds = %52, %0
  %42 = load i32, ptr %4, align 4, !tbaa !13
  %43 = icmp ult i32 %42, 10
  br i1 %43, label %44, label %55

44:                                               ; preds = %41
  %45 = load ptr, ptr %1, align 8, !tbaa !5
  %46 = call i32 @uint32_t_array_add(ptr noundef %45, i32 noundef 5)
  store i32 %46, ptr %2, align 4, !tbaa !13
  %47 = load i32, ptr %4, align 4, !tbaa !13
  %48 = add i32 %47, 1
  %49 = zext i32 %48 to i64
  %50 = load i32, ptr %2, align 4, !tbaa !13
  %51 = zext i32 %50 to i64
  call void @UnityAssertEqualNumber(i64 noundef %49, i64 noundef %51, ptr noundef null, i64 noundef 996, i32 noundef 148)
  br label %52

52:                                               ; preds = %44
  %53 = load i32, ptr %4, align 4, !tbaa !13
  %54 = add i32 %53, 1
  store i32 %54, ptr %4, align 4, !tbaa !13
  br label %41, !llvm.loop !15

55:                                               ; preds = %41
  %56 = load ptr, ptr %1, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.uint32_t_array, ptr %56, i32 0, i32 1
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = zext i32 %58 to i64
  call void @UnityAssertEqualNumber(i64 noundef 20, i64 noundef %59, ptr noundef null, i64 noundef 999, i32 noundef 148)
  %60 = load ptr, ptr %1, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.uint32_t_array, ptr %60, i32 0, i32 0
  %62 = load i32, ptr %61, align 8, !tbaa !12
  %63 = zext i32 %62 to i64
  call void @UnityAssertEqualNumber(i64 noundef 11, i64 noundef %63, ptr noundef null, i64 noundef 1000, i32 noundef 148)
  call void @uint32_t_array_destroy(ptr noundef %1)
  %64 = load ptr, ptr %1, align 8, !tbaa !5
  %65 = ptrtoint ptr %64 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %65, ptr noundef null, i64 noundef 1004, i32 noundef 148)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  ret void
}

declare ptr @uint32_t_array_init(i32 noundef) #1

declare i32 @uint32_t_array_add(ptr noundef, i32 noundef) #1

declare ptr @uint32_t_array_get(ptr noundef, i32 noundef) #1

declare void @uint32_t_array_destroy(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 4}
!10 = !{!"uint32_t_array", !11, i64 0, !11, i64 4, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @test_uint32_t_array() local_unnamed_addr #2 {
  %1 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #3
  %2 = tail call ptr @uint32_t_array_init(i32 noundef 10) #3
  store ptr %2, ptr %1, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %2, i64 4
  %4 = load i32, ptr %3, align 4, !tbaa !9
  %5 = zext i32 %4 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 10, i64 noundef %5, ptr noundef null, i64 noundef 976, i32 noundef 148) #3
  %6 = load i32, ptr %2, align 8, !tbaa !12
  %7 = zext i32 %6 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %7, ptr noundef null, i64 noundef 977, i32 noundef 148) #3
  %8 = tail call i32 @uint32_t_array_add(ptr noundef nonnull %2, i32 noundef 5) #3
  %9 = load i32, ptr %3, align 4, !tbaa !9
  %10 = zext i32 %9 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 10, i64 noundef %10, ptr noundef null, i64 noundef 981, i32 noundef 148) #3
  %11 = zext i32 %8 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %11, ptr noundef null, i64 noundef 982, i32 noundef 148) #3
  %12 = load i32, ptr %2, align 8, !tbaa !12
  %13 = zext i32 %12 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 1, i64 noundef %13, ptr noundef null, i64 noundef 983, i32 noundef 148) #3
  %14 = getelementptr inbounds i8, ptr %2, i64 8
  %15 = load ptr, ptr %14, align 8, !tbaa !13
  %16 = load i32, ptr %15, align 4, !tbaa !14
  %17 = zext i32 %16 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 5, i64 noundef %17, ptr noundef null, i64 noundef 984, i32 noundef 148) #3
  %18 = tail call ptr @uint32_t_array_get(ptr noundef nonnull %2, i32 noundef 0) #3
  %19 = load i32, ptr %18, align 4, !tbaa !14
  %20 = zext i32 %19 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 5, i64 noundef %20, ptr noundef null, i64 noundef 987, i32 noundef 148) #3
  %21 = tail call ptr @uint32_t_array_get(ptr noundef nonnull %2, i32 noundef 100) #3
  %22 = ptrtoint ptr %21 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %22, ptr noundef null, i64 noundef 990, i32 noundef 148) #3
  %23 = tail call i32 @uint32_t_array_add(ptr noundef nonnull %2, i32 noundef 5) #3
  %24 = zext i32 %23 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 1, i64 noundef %24, ptr noundef null, i64 noundef 996, i32 noundef 148) #3
  %25 = tail call i32 @uint32_t_array_add(ptr noundef nonnull %2, i32 noundef 5) #3
  %26 = zext i32 %25 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 2, i64 noundef %26, ptr noundef null, i64 noundef 996, i32 noundef 148) #3
  %27 = tail call i32 @uint32_t_array_add(ptr noundef nonnull %2, i32 noundef 5) #3
  %28 = zext i32 %27 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 3, i64 noundef %28, ptr noundef null, i64 noundef 996, i32 noundef 148) #3
  %29 = tail call i32 @uint32_t_array_add(ptr noundef nonnull %2, i32 noundef 5) #3
  %30 = zext i32 %29 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 4, i64 noundef %30, ptr noundef null, i64 noundef 996, i32 noundef 148) #3
  %31 = tail call i32 @uint32_t_array_add(ptr noundef nonnull %2, i32 noundef 5) #3
  %32 = zext i32 %31 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 5, i64 noundef %32, ptr noundef null, i64 noundef 996, i32 noundef 148) #3
  %33 = tail call i32 @uint32_t_array_add(ptr noundef nonnull %2, i32 noundef 5) #3
  %34 = zext i32 %33 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 6, i64 noundef %34, ptr noundef null, i64 noundef 996, i32 noundef 148) #3
  %35 = tail call i32 @uint32_t_array_add(ptr noundef nonnull %2, i32 noundef 5) #3
  %36 = zext i32 %35 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 7, i64 noundef %36, ptr noundef null, i64 noundef 996, i32 noundef 148) #3
  %37 = tail call i32 @uint32_t_array_add(ptr noundef nonnull %2, i32 noundef 5) #3
  %38 = zext i32 %37 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 8, i64 noundef %38, ptr noundef null, i64 noundef 996, i32 noundef 148) #3
  %39 = tail call i32 @uint32_t_array_add(ptr noundef nonnull %2, i32 noundef 5) #3
  %40 = zext i32 %39 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 9, i64 noundef %40, ptr noundef null, i64 noundef 996, i32 noundef 148) #3
  %41 = tail call i32 @uint32_t_array_add(ptr noundef nonnull %2, i32 noundef 5) #3
  %42 = zext i32 %41 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 10, i64 noundef %42, ptr noundef null, i64 noundef 996, i32 noundef 148) #3
  %43 = load i32, ptr %3, align 4, !tbaa !9
  %44 = zext i32 %43 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 20, i64 noundef %44, ptr noundef null, i64 noundef 999, i32 noundef 148) #3
  %45 = load i32, ptr %2, align 8, !tbaa !12
  %46 = zext i32 %45 to i64
  tail call void @UnityAssertEqualNumber(i64 noundef 11, i64 noundef %46, ptr noundef null, i64 noundef 1000, i32 noundef 148) #3
  call void @uint32_t_array_destroy(ptr noundef nonnull %1) #3
  %47 = load ptr, ptr %1, align 8, !tbaa !5
  %48 = ptrtoint ptr %47 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %48, ptr noundef null, i64 noundef 1004, i32 noundef 148) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  ret void
}

declare ptr @uint32_t_array_init(i32 noundef) local_unnamed_addr #1

declare i32 @uint32_t_array_add(ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @uint32_t_array_get(ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @uint32_t_array_destroy(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 4}
!10 = !{!"uint32_t_array", !11, i64 0, !11, i64 4, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 0}
!13 = !{!10, !6, i64 8}
!14 = !{!11, !11, i64 0}


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