; LLVM IR from LeoVen/C-Macro-Collections :: tests (types)

; 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.hashmultimap0 = type { ptr, i64, i64, double, i32, ptr, ptr, ptr }
%struct.hashmultimap0_fkey = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.hashmultimap0_entry = type { ptr, ptr, ptr, ptr }

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

; 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 zeroext i1 @hmm0_insert(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = call zeroext i1 @hmm0_full(ptr noundef %11)
  br i1 %12, label %13, label %22

13:                                               ; preds = %3
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.hashmultimap0, ptr %15, i32 0, i32 1
  %17 = load i64, ptr %16, align 8, !tbaa !9
  %18 = add i64 %17, 1
  %19 = call zeroext i1 @hmm0_resize(ptr noundef %14, i64 noundef %18)
  br i1 %19, label %21, label %20

20:                                               ; preds = %13
  store i1 false, ptr %4, align 1
  br label %95

21:                                               ; preds = %13
  br label %22

22:                                               ; preds = %21, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.hashmultimap0, ptr %23, i32 0, i32 5
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = getelementptr inbounds %struct.hashmultimap0_fkey, ptr %25, i32 0, i32 4
  %27 = load ptr, ptr %26, align 8, !tbaa !15
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = call i64 %27(ptr noundef %28)
  store i64 %29, ptr %8, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  %30 = load i64, ptr %8, align 8, !tbaa !17
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.hashmultimap0, ptr %31, i32 0, i32 1
  %33 = load i64, ptr %32, align 8, !tbaa !9
  %34 = urem i64 %30, %33
  store i64 %34, ptr %9, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = call ptr @hmm0_impl_new_entry(ptr noundef %35, ptr noundef %36, ptr noundef %37)
  store ptr %38, ptr %10, align 8, !tbaa !5
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.hashmultimap0, ptr %39, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !18
  %42 = load i64, ptr %9, align 8, !tbaa !17
  %43 = getelementptr inbounds [2 x ptr], ptr %41, i64 %42
  %44 = getelementptr inbounds [2 x ptr], ptr %43, i64 0, i64 0
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = icmp eq ptr %45, null
  br i1 %46, label %47, label %62

47:                                               ; preds = %22
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.hashmultimap0, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !18
  %52 = load i64, ptr %9, align 8, !tbaa !17
  %53 = getelementptr inbounds [2 x ptr], ptr %51, i64 %52
  %54 = getelementptr inbounds [2 x ptr], ptr %53, i64 0, i64 0
  store ptr %48, ptr %54, align 8, !tbaa !5
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.hashmultimap0, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !18
  %59 = load i64, ptr %9, align 8, !tbaa !17
  %60 = getelementptr inbounds [2 x ptr], ptr %58, i64 %59
  %61 = getelementptr inbounds [2 x ptr], ptr %60, i64 0, i64 1
  store ptr %55, ptr %61, align 8, !tbaa !5
  br label %88

62:                                               ; preds = %22
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.hashmultimap0, ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !18
  %66 = load i64, ptr %9, align 8, !tbaa !17
  %67 = getelementptr inbounds [2 x ptr], ptr %65, i64 %66
  %68 = getelementptr inbounds [2 x ptr], ptr %67, i64 0, i64 1
  %69 = load ptr, ptr %68, align 8, !tbaa !5
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.hashmultimap0_entry, ptr %70, i32 0, i32 3
  store ptr %69, ptr %71, align 8, !tbaa !19
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.hashmultimap0, ptr %73, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !18
  %76 = load i64, ptr %9, align 8, !tbaa !17
  %77 = getelementptr inbounds [2 x ptr], ptr %75, i64 %76
  %78 = getelementptr inbounds [2 x ptr], ptr %77, i64 0, i64 1
  %79 = load ptr, ptr %78, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.hashmultimap0_entry, ptr %79, i32 0, i32 2
  store ptr %72, ptr %80, align 8, !tbaa !21
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.hashmultimap0, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !18
  %85 = load i64, ptr %9, align 8, !tbaa !17
  %86 = getelementptr inbounds [2 x ptr], ptr %84, i64 %85
  %87 = getelementptr inbounds [2 x ptr], ptr %86, i64 0, i64 1
  store ptr %81, ptr %87, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %62, %47
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.hashmultimap0, ptr %89, i32 0, i32 2
  %91 = load i64, ptr %90, align 8, !tbaa !22
  %92 = add i64 %91, 1
  store i64 %92, ptr %90, align 8, !tbaa !22
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.hashmultimap0, ptr %93, i32 0, i32 4
  store i32 0, ptr %94, align 8, !tbaa !23
  store i1 true, ptr %4, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  br label %95

95:                                               ; preds = %88, %20
  %96 = load i1, ptr %4, align 1
  ret i1 %96
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @hmm0_full(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @hmm0_resize(ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @hmm0_impl_new_entry(ptr noundef, ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 8}
!10 = !{!"hashmultimap0", !6, i64 0, !11, i64 8, !11, i64 16, !12, i64 24, !13, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!11 = !{!"long", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!10, !6, i64 40}
!15 = !{!16, !6, i64 32}
!16 = !{!"hashmultimap0_fkey", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!17 = !{!11, !11, i64 0}
!18 = !{!10, !6, i64 0}
!19 = !{!20, !6, i64 24}
!20 = !{!"hashmultimap0_entry", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!21 = !{!20, !6, i64 16}
!22 = !{!10, !11, i64 16}
!23 = !{!10, !13, i64 32}


; 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: nounwind uwtable
define dso_local noundef zeroext i1 @hmm0_insert(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = tail call zeroext i1 @hmm0_full(ptr noundef %0)
  br i1 %4, label %5, label %10

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load i64, ptr %6, align 8, !tbaa !5
  %8 = add i64 %7, 1
  %9 = tail call zeroext i1 @hmm0_resize(ptr noundef %0, i64 noundef %8)
  br i1 %9, label %10, label %36

10:                                               ; preds = %5, %3
  %11 = getelementptr inbounds i8, ptr %0, i64 40
  %12 = load ptr, ptr %11, align 8, !tbaa !13
  %13 = getelementptr inbounds i8, ptr %12, i64 32
  %14 = load ptr, ptr %13, align 8, !tbaa !14
  %15 = tail call i64 %14(ptr noundef %1) #1
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load i64, ptr %16, align 8, !tbaa !5
  %18 = urem i64 %15, %17
  %19 = tail call ptr @hmm0_impl_new_entry(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %20 = load ptr, ptr %0, align 8, !tbaa !16
  %21 = getelementptr inbounds [2 x ptr], ptr %20, i64 %18
  %22 = load ptr, ptr %21, align 8, !tbaa !17
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %26

24:                                               ; preds = %10
  store ptr %19, ptr %21, align 8, !tbaa !17
  %25 = load ptr, ptr %0, align 8, !tbaa !16
  br label %31

26:                                               ; preds = %10
  %27 = getelementptr inbounds i8, ptr %21, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !17
  %29 = getelementptr inbounds i8, ptr %19, i64 24
  store ptr %28, ptr %29, align 8, !tbaa !18
  %30 = getelementptr inbounds i8, ptr %28, i64 16
  store ptr %19, ptr %30, align 8, !tbaa !20
  br label %31

31:                                               ; preds = %26, %24
  %.pn = phi ptr [ %20, %26 ], [ %25, %24 ]
  %.sink = getelementptr inbounds [2 x ptr], ptr %.pn, i64 %18, i64 1
  store ptr %19, ptr %.sink, align 8, !tbaa !17
  %32 = getelementptr inbounds i8, ptr %0, i64 16
  %33 = load i64, ptr %32, align 8, !tbaa !21
  %34 = add i64 %33, 1
  store i64 %34, ptr %32, align 8, !tbaa !21
  %35 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 0, ptr %35, align 8, !tbaa !22
  br label %36

36:                                               ; preds = %5, %31
  %.0 = phi i1 [ true, %31 ], [ false, %5 ]
  ret i1 %.0
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @hmm0_full(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @hmm0_resize(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @hmm0_impl_new_entry(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

attributes #0 = { 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 #1 = { 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, !10, i64 8}
!6 = !{!"hashmultimap0", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !12, i64 32, !7, i64 40, !7, i64 48, !7, i64 56}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!6, !7, i64 40}
!14 = !{!15, !7, i64 32}
!15 = !{!"hashmultimap0_fkey", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!16 = !{!6, !7, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !7, i64 24}
!19 = !{!"hashmultimap0_entry", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!20 = !{!19, !7, i64 16}
!21 = !{!6, !10, i64 16}
!22 = !{!6, !12, i64 32}


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