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

; 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_uint_offset_size_pair() #3 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  %5 = call ptr @ordered_set_init(i32 noundef 3, ptr noundef @uint_offset_size_pair_sort_element_cmp, ptr noundef @uint_offset_size_pair_search_element_cmp, ptr noundef @uint_offset_size_pair_search_key_cmp)
  store ptr %5, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  %6 = call noalias ptr @malloc(i64 noundef 16) #5
  store ptr %6, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %7, i32 0, i32 0
  store i32 1, ptr %8, align 8, !tbaa !9
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %9, i32 0, i32 2
  store i64 50, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %11 = load ptr, ptr %1, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = call ptr @ordered_set_add(ptr noundef %11, ptr noundef %12)
  store ptr %13, ptr %3, align 8, !tbaa !5
  %14 = call noalias ptr @malloc(i64 noundef 16) #5
  store ptr %14, ptr %2, align 8, !tbaa !5
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %15, i32 0, i32 0
  store i32 5, ptr %16, align 8, !tbaa !9
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %17, i32 0, i32 2
  store i64 200, ptr %18, align 8, !tbaa !13
  %19 = load ptr, ptr %1, align 8, !tbaa !5
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = call ptr @ordered_set_add(ptr noundef %19, ptr noundef %20)
  store ptr %21, ptr %3, align 8, !tbaa !5
  %22 = call noalias ptr @malloc(i64 noundef 16) #5
  store ptr %22, ptr %2, align 8, !tbaa !5
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %23, i32 0, i32 0
  store i32 2, ptr %24, align 8, !tbaa !9
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %25, i32 0, i32 2
  store i64 100, ptr %26, align 8, !tbaa !13
  %27 = load ptr, ptr %1, align 8, !tbaa !5
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = call ptr @ordered_set_add(ptr noundef %27, ptr noundef %28)
  store ptr %29, ptr %3, align 8, !tbaa !5
  %30 = call noalias ptr @malloc(i64 noundef 16) #5
  store ptr %30, ptr %2, align 8, !tbaa !5
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %31, i32 0, i32 0
  store i32 4, ptr %32, align 8, !tbaa !9
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %33, i32 0, i32 2
  store i64 175, ptr %34, align 8, !tbaa !13
  %35 = load ptr, ptr %1, align 8, !tbaa !5
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = call ptr @ordered_set_add(ptr noundef %35, ptr noundef %36)
  store ptr %37, ptr %3, align 8, !tbaa !5
  %38 = call noalias ptr @malloc(i64 noundef 16) #5
  store ptr %38, ptr %2, align 8, !tbaa !5
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %39, i32 0, i32 0
  store i32 3, ptr %40, align 8, !tbaa !9
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %41, i32 0, i32 2
  store i64 150, ptr %42, align 8, !tbaa !13
  %43 = load ptr, ptr %1, align 8, !tbaa !5
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = call ptr @ordered_set_add(ptr noundef %43, ptr noundef %44)
  store ptr %45, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !14
  %46 = load ptr, ptr %1, align 8, !tbaa !5
  %47 = call ptr @ordered_set_get(ptr noundef %46, ptr noundef %4)
  store ptr %47, ptr %3, align 8, !tbaa !5
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %48, i32 0, i32 2
  %50 = load i64, ptr %49, align 8, !tbaa !13
  call void @UnityAssertEqualNumber(i64 noundef 50, i64 noundef %50, ptr noundef null, i64 noundef 574, i32 noundef 148)
  store i32 2, ptr %4, align 4, !tbaa !14
  %51 = load ptr, ptr %1, align 8, !tbaa !5
  %52 = call ptr @ordered_set_get(ptr noundef %51, ptr noundef %4)
  store ptr %52, ptr %3, align 8, !tbaa !5
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %53, i32 0, i32 2
  %55 = load i64, ptr %54, align 8, !tbaa !13
  call void @UnityAssertEqualNumber(i64 noundef 100, i64 noundef %55, ptr noundef null, i64 noundef 578, i32 noundef 148)
  store i32 3, ptr %4, align 4, !tbaa !14
  %56 = load ptr, ptr %1, align 8, !tbaa !5
  %57 = call ptr @ordered_set_get(ptr noundef %56, ptr noundef %4)
  store ptr %57, ptr %3, align 8, !tbaa !5
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %58, i32 0, i32 2
  %60 = load i64, ptr %59, align 8, !tbaa !13
  call void @UnityAssertEqualNumber(i64 noundef 150, i64 noundef %60, ptr noundef null, i64 noundef 582, i32 noundef 148)
  store i32 4, ptr %4, align 4, !tbaa !14
  %61 = load ptr, ptr %1, align 8, !tbaa !5
  %62 = call ptr @ordered_set_get(ptr noundef %61, ptr noundef %4)
  store ptr %62, ptr %3, align 8, !tbaa !5
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %63, i32 0, i32 2
  %65 = load i64, ptr %64, align 8, !tbaa !13
  call void @UnityAssertEqualNumber(i64 noundef 175, i64 noundef %65, ptr noundef null, i64 noundef 586, i32 noundef 148)
  store i32 5, ptr %4, align 4, !tbaa !14
  %66 = load ptr, ptr %1, align 8, !tbaa !5
  %67 = call ptr @ordered_set_get(ptr noundef %66, ptr noundef %4)
  store ptr %67, ptr %3, align 8, !tbaa !5
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.uint_offset_size_pair, ptr %68, i32 0, i32 2
  %70 = load i64, ptr %69, align 8, !tbaa !13
  call void @UnityAssertEqualNumber(i64 noundef 200, i64 noundef %70, ptr noundef null, i64 noundef 590, i32 noundef 148)
  store i32 7, ptr %4, align 4, !tbaa !14
  %71 = load ptr, ptr %1, align 8, !tbaa !5
  %72 = call ptr @ordered_set_get(ptr noundef %71, ptr noundef %4)
  store ptr %72, ptr %3, align 8, !tbaa !5
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = ptrtoint ptr %73 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %74, ptr noundef null, i64 noundef 594, i32 noundef 148)
  store i32 0, ptr %4, align 4, !tbaa !14
  %75 = load ptr, ptr %1, align 8, !tbaa !5
  %76 = call ptr @ordered_set_get(ptr noundef %75, ptr noundef %4)
  store ptr %76, ptr %3, align 8, !tbaa !5
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = ptrtoint ptr %77 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %78, ptr noundef null, i64 noundef 598, i32 noundef 148)
  call void @ordered_set_destroy(ptr noundef %1, ptr noundef @free_wrapper)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

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

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

declare i32 @uint_offset_size_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 = { nounwind }
attributes #5 = { 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 = !{!"uint_offset_size_pair", !11, i64 0, !11, i64 4, !12, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !12, i64 8}
!14 = !{!11, !11, i64 0}


; 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_uint_offset_size_pair() local_unnamed_addr #3 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  %3 = tail call ptr @ordered_set_init(i32 noundef 3, ptr noundef nonnull @uint_offset_size_pair_sort_element_cmp, ptr noundef nonnull @uint_offset_size_pair_search_element_cmp, ptr noundef nonnull @uint_offset_size_pair_search_key_cmp) #4
  store ptr %3, ptr %1, align 8, !tbaa !5
  %4 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #5
  store i32 1, ptr %4, align 8, !tbaa !9
  %5 = getelementptr inbounds i8, ptr %4, i64 8
  store i64 50, ptr %5, align 8, !tbaa !13
  %6 = tail call ptr @ordered_set_add(ptr noundef %3, ptr noundef nonnull %4) #4
  %7 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #5
  store i32 5, ptr %7, align 8, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %7, i64 8
  store i64 200, ptr %8, align 8, !tbaa !13
  %9 = tail call ptr @ordered_set_add(ptr noundef %3, ptr noundef nonnull %7) #4
  %10 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #5
  store i32 2, ptr %10, align 8, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  store i64 100, ptr %11, align 8, !tbaa !13
  %12 = tail call ptr @ordered_set_add(ptr noundef %3, ptr noundef nonnull %10) #4
  %13 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #5
  store i32 4, ptr %13, align 8, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  store i64 175, ptr %14, align 8, !tbaa !13
  %15 = tail call ptr @ordered_set_add(ptr noundef %3, ptr noundef nonnull %13) #4
  %16 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #5
  store i32 3, ptr %16, align 8, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  store i64 150, ptr %17, align 8, !tbaa !13
  %18 = tail call ptr @ordered_set_add(ptr noundef %3, ptr noundef nonnull %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  store i32 1, ptr %2, align 4, !tbaa !14
  %19 = call ptr @ordered_set_get(ptr noundef %3, ptr noundef nonnull %2) #4
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  %21 = load i64, ptr %20, align 8, !tbaa !13
  call void @UnityAssertEqualNumber(i64 noundef 50, i64 noundef %21, ptr noundef null, i64 noundef 574, i32 noundef 148) #4
  store i32 2, ptr %2, align 4, !tbaa !14
  %22 = call ptr @ordered_set_get(ptr noundef %3, ptr noundef nonnull %2) #4
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %24 = load i64, ptr %23, align 8, !tbaa !13
  call void @UnityAssertEqualNumber(i64 noundef 100, i64 noundef %24, ptr noundef null, i64 noundef 578, i32 noundef 148) #4
  store i32 3, ptr %2, align 4, !tbaa !14
  %25 = call ptr @ordered_set_get(ptr noundef %3, ptr noundef nonnull %2) #4
  %26 = getelementptr inbounds i8, ptr %25, i64 8
  %27 = load i64, ptr %26, align 8, !tbaa !13
  call void @UnityAssertEqualNumber(i64 noundef 150, i64 noundef %27, ptr noundef null, i64 noundef 582, i32 noundef 148) #4
  store i32 4, ptr %2, align 4, !tbaa !14
  %28 = call ptr @ordered_set_get(ptr noundef %3, ptr noundef nonnull %2) #4
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = load i64, ptr %29, align 8, !tbaa !13
  call void @UnityAssertEqualNumber(i64 noundef 175, i64 noundef %30, ptr noundef null, i64 noundef 586, i32 noundef 148) #4
  store i32 5, ptr %2, align 4, !tbaa !14
  %31 = call ptr @ordered_set_get(ptr noundef %3, ptr noundef nonnull %2) #4
  %32 = getelementptr inbounds i8, ptr %31, i64 8
  %33 = load i64, ptr %32, align 8, !tbaa !13
  call void @UnityAssertEqualNumber(i64 noundef 200, i64 noundef %33, ptr noundef null, i64 noundef 590, i32 noundef 148) #4
  store i32 7, ptr %2, align 4, !tbaa !14
  %34 = call ptr @ordered_set_get(ptr noundef %3, ptr noundef nonnull %2) #4
  %35 = ptrtoint ptr %34 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %35, ptr noundef null, i64 noundef 594, i32 noundef 148) #4
  store i32 0, ptr %2, align 4, !tbaa !14
  %36 = call ptr @ordered_set_get(ptr noundef %3, ptr noundef nonnull %2) #4
  %37 = ptrtoint ptr %36 to i64
  call void @UnityAssertEqualNumber(i64 noundef 0, i64 noundef %37, ptr noundef null, i64 noundef 598, i32 noundef 148) #4
  call void @ordered_set_destroy(ptr noundef nonnull %1, ptr noundef nonnull @free_wrapper) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  ret void
}

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

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

declare i32 @uint_offset_size_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 = { nounwind }
attributes #5 = { 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 = !{!"uint_offset_size_pair", !11, i64 0, !11, i64 4, !12, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !12, i64 8}
!14 = !{!11, !11, i64 0}


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