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

; 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 allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

declare void @free_wrapper(ptr noundef) #1

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

declare ptr @ordered_set_add(ptr noundef, ptr noundef) #1

declare void @ordered_set_destroy(ptr noundef, ptr noundef) #1

declare ptr @ordered_set_get(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @test_pointer_uint_pair() #3 {
  %1 = alloca [10 x i32], align 16
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr %1) #5
  call void @llvm.memset.p0.i64(ptr align 16 %1, i8 0, i64 40, i1 false)
  %5 = getelementptr inbounds [10 x i32], ptr %1, i32 0, i32 0
  store i32 1, ptr %5, align 16
  %6 = getelementptr inbounds [10 x i32], ptr %1, i32 0, i32 1
  store i32 2, ptr %6, align 4
  %7 = getelementptr inbounds [10 x i32], ptr %1, i32 0, i32 2
  store i32 3, ptr %7, align 8
  %8 = getelementptr inbounds [10 x i32], ptr %1, i32 0, i32 3
  store i32 4, ptr %8, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %9 = call ptr @ordered_set_init(i32 noundef 3, ptr noundef @pointer_uint_pair_sort_element_cmp, ptr noundef @pointer_uint_pair_search_element_cmp, ptr noundef @pointer_uint_pair_search_key_cmp)
  store ptr %9, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %10 = call noalias ptr @malloc(i64 noundef 16) #6
  store ptr %10, ptr %3, align 8, !tbaa !5
  %11 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %12 = getelementptr inbounds i32, ptr %11, i64 3
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.pointer_uint_pair, ptr %13, i32 0, i32 0
  store ptr %12, ptr %14, align 8, !tbaa !9
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.pointer_uint_pair, ptr %15, i32 0, i32 1
  store i32 3, ptr %16, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = call ptr @ordered_set_add(ptr noundef %17, ptr noundef %18)
  store ptr %19, ptr %4, align 8, !tbaa !5
  %20 = call noalias ptr @malloc(i64 noundef 16) #6
  store ptr %20, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %22 = getelementptr inbounds i32, ptr %21, i64 1
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.pointer_uint_pair, ptr %23, i32 0, i32 0
  store ptr %22, ptr %24, align 8, !tbaa !9
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.pointer_uint_pair, ptr %25, i32 0, i32 1
  store i32 1, ptr %26, align 8, !tbaa !12
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = call ptr @ordered_set_add(ptr noundef %27, ptr noundef %28)
  store ptr %29, ptr %4, align 8, !tbaa !5
  %30 = call noalias ptr @malloc(i64 noundef 16) #6
  store ptr %30, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.pointer_uint_pair, ptr %32, i32 0, i32 0
  store ptr %31, ptr %33, align 8, !tbaa !9
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.pointer_uint_pair, ptr %34, i32 0, i32 1
  store i32 0, ptr %35, align 8, !tbaa !12
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = call ptr @ordered_set_add(ptr noundef %36, ptr noundef %37)
  store ptr %38, ptr %4, align 8, !tbaa !5
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %41 = call ptr @ordered_set_get(ptr noundef %39, ptr noundef %40)
  store ptr %41, ptr %4, align 8, !tbaa !5
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.pointer_uint_pair, ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 8, !tbaa !12
  %45 = zext i32 %44 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %45, ptr noundef null, i64 noundef 519, i32 noundef 148)
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %48 = getelementptr inbounds i32, ptr %47, i64 1
  %49 = call ptr @ordered_set_get(ptr noundef %46, ptr noundef %48)
  store ptr %49, ptr %4, align 8, !tbaa !5
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.pointer_uint_pair, ptr %50, i32 0, i32 1
  %52 = load i32, ptr %51, align 8, !tbaa !12
  %53 = zext i32 %52 to i64
  call void @UnityAssertEqualNumber(i64 noundef 1, i64 noundef %53, ptr noundef null, i64 noundef 521, i32 noundef 148)
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %56 = getelementptr inbounds i32, ptr %55, i64 3
  %57 = call ptr @ordered_set_get(ptr noundef %54, ptr noundef %56)
  store ptr %57, ptr %4, align 8, !tbaa !5
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.pointer_uint_pair, ptr %58, i32 0, i32 1
  %60 = load i32, ptr %59, align 8, !tbaa !12
  %61 = zext i32 %60 to i64
  call void @UnityAssertEqualNumber(i64 noundef 3, i64 noundef %61, ptr noundef null, i64 noundef 523, i32 noundef 148)
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  %63 = getelementptr inbounds [10 x i32], ptr %1, i64 0, i64 0
  %64 = getelementptr inbounds i32, ptr %63, i64 2
  %65 = call ptr @ordered_set_get(ptr noundef %62, ptr noundef %64)
  store ptr %65, ptr %4, align 8, !tbaa !5
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = ptrtoint ptr %66 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %67, ptr noundef null, i64 noundef 525, i32 noundef 148)
  call void @ordered_set_destroy(ptr noundef %2, ptr noundef @free_wrapper)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %1) #5
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

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

declare i32 @pointer_uint_pair_search_key_cmp(ptr noundef, 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 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 #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
attributes #6 = { 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, !6, i64 0}
!10 = !{!"pointer_uint_pair", !6, i64 0, !11, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 8}


; 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: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

declare void @free_wrapper(ptr noundef) #1

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

declare ptr @ordered_set_add(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @ordered_set_destroy(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @ordered_set_get(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @test_pointer_uint_pair() local_unnamed_addr #3 {
  %1 = alloca [10 x i32], align 16
  %2 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %1) #5
  %3 = getelementptr inbounds i8, ptr %1, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %3, i8 0, i64 24, i1 false)
  %4 = getelementptr inbounds i8, ptr %1, i64 4
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = getelementptr inbounds i8, ptr %1, i64 12
  store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, ptr %1, align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %7 = tail call ptr @ordered_set_init(i32 noundef 3, ptr noundef nonnull @pointer_uint_pair_sort_element_cmp, ptr noundef nonnull @pointer_uint_pair_search_element_cmp, ptr noundef nonnull @pointer_uint_pair_search_key_cmp) #5
  store ptr %7, ptr %2, align 8, !tbaa !5
  %8 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #6
  store ptr %6, ptr %8, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %8, i64 8
  store i32 3, ptr %9, align 8, !tbaa !12
  %10 = call ptr @ordered_set_add(ptr noundef %7, ptr noundef nonnull %8) #5
  %11 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #6
  store ptr %4, ptr %11, align 8, !tbaa !9
  %12 = getelementptr inbounds i8, ptr %11, i64 8
  store i32 1, ptr %12, align 8, !tbaa !12
  %13 = call ptr @ordered_set_add(ptr noundef %7, ptr noundef nonnull %11) #5
  %14 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #6
  store ptr %1, ptr %14, align 8, !tbaa !9
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  store i32 0, ptr %15, align 8, !tbaa !12
  %16 = call ptr @ordered_set_add(ptr noundef %7, ptr noundef nonnull %14) #5
  %17 = call ptr @ordered_set_get(ptr noundef %7, ptr noundef nonnull %1) #5
  %18 = getelementptr inbounds i8, ptr %17, i64 8
  %19 = load i32, ptr %18, align 8, !tbaa !12
  %20 = zext i32 %19 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %20, ptr noundef null, i64 noundef 519, i32 noundef 148) #5
  %21 = call ptr @ordered_set_get(ptr noundef %7, ptr noundef nonnull %4) #5
  %22 = getelementptr inbounds i8, ptr %21, i64 8
  %23 = load i32, ptr %22, align 8, !tbaa !12
  %24 = zext i32 %23 to i64
  call void @UnityAssertEqualNumber(i64 noundef 1, i64 noundef %24, ptr noundef null, i64 noundef 521, i32 noundef 148) #5
  %25 = call ptr @ordered_set_get(ptr noundef %7, ptr noundef nonnull %6) #5
  %26 = getelementptr inbounds i8, ptr %25, i64 8
  %27 = load i32, ptr %26, align 8, !tbaa !12
  %28 = zext i32 %27 to i64
  call void @UnityAssertEqualNumber(i64 noundef 3, i64 noundef %28, ptr noundef null, i64 noundef 523, i32 noundef 148) #5
  %29 = call ptr @ordered_set_get(ptr noundef %7, ptr noundef nonnull %5) #5
  %30 = ptrtoint ptr %29 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %30, ptr noundef null, i64 noundef 525, i32 noundef 148) #5
  call void @ordered_set_destroy(ptr noundef nonnull %2, ptr noundef nonnull @free_wrapper) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %1) #5
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

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

declare i32 @pointer_uint_pair_search_key_cmp(ptr noundef, ptr noundef) #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 = { 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 #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
attributes #6 = { 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, !6, i64 0}
!10 = !{!"pointer_uint_pair", !6, i64 0, !11, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 8}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass