; LLVM IR from Montimage/mmt-security :: test (mmt_hash_void)

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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %7 = call ptr @mmt_hash_create()
  store ptr %7, ptr %6, align 8, !tbaa !9
  br label %8

8:                                                ; preds = %2
  %9 = load ptr, ptr %6, align 8, !tbaa !9
  %10 = call ptr @mmt_hash_add(ptr noundef %9, ptr noundef @.str, i8 noundef zeroext 2, ptr noundef @.str.1, i1 noundef zeroext false)
  %11 = icmp eq ptr %10, null
  %12 = xor i1 %11, true
  %13 = xor i1 %12, true
  %14 = xor i1 %13, true
  %15 = zext i1 %14 to i32
  %16 = sext i32 %15 to i64
  %17 = call i64 @llvm.expect.i64(i64 %16, i64 0)
  %18 = icmp ne i64 %17, 0
  br i1 %18, label %19, label %20

19:                                               ; preds = %8
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 4, ptr noundef @.str.2)
  call void @exit(i32 noundef 0) #7
  unreachable

20:                                               ; preds = %8
  br label %21

21:                                               ; preds = %20
  %22 = load ptr, ptr %6, align 8, !tbaa !9
  %23 = call ptr @mmt_hash_add(ptr noundef %22, ptr noundef @.str.3, i8 noundef zeroext 2, ptr noundef @.str.4, i1 noundef zeroext false)
  %24 = icmp eq ptr %23, null
  %25 = xor i1 %24, true
  %26 = xor i1 %25, true
  %27 = xor i1 %26, true
  %28 = zext i1 %27 to i32
  %29 = sext i32 %28 to i64
  %30 = call i64 @llvm.expect.i64(i64 %29, i64 0)
  %31 = icmp ne i64 %30, 0
  br i1 %31, label %32, label %33

32:                                               ; preds = %21
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 4, ptr noundef @.str.2)
  call void @exit(i32 noundef 0) #7
  unreachable

33:                                               ; preds = %21
  br label %34

34:                                               ; preds = %33
  %35 = load ptr, ptr %6, align 8, !tbaa !9
  %36 = call ptr @mmt_hash_add(ptr noundef %35, ptr noundef @.str.5, i8 noundef zeroext 10, ptr noundef @.str.6, i1 noundef zeroext false)
  %37 = icmp eq ptr %36, null
  %38 = xor i1 %37, true
  %39 = xor i1 %38, true
  %40 = xor i1 %39, true
  %41 = zext i1 %40 to i32
  %42 = sext i32 %41 to i64
  %43 = call i64 @llvm.expect.i64(i64 %42, i64 0)
  %44 = icmp ne i64 %43, 0
  br i1 %44, label %45, label %46

45:                                               ; preds = %34
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 4, ptr noundef @.str.2)
  call void @exit(i32 noundef 0) #7
  unreachable

46:                                               ; preds = %34
  %47 = load ptr, ptr %6, align 8, !tbaa !9
  %48 = call ptr @mmt_hash_search(ptr noundef %47, ptr noundef @.str, i8 noundef zeroext 2)
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 0, ptr noundef @.str.7, ptr noundef %48)
  %49 = load ptr, ptr %6, align 8, !tbaa !9
  %50 = call ptr @mmt_hash_search(ptr noundef %49, ptr noundef @.str.3, i8 noundef zeroext 2)
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 0, ptr noundef @.str.7, ptr noundef %50)
  %51 = load ptr, ptr %6, align 8, !tbaa !9
  %52 = call ptr @mmt_hash_search(ptr noundef %51, ptr noundef @.str.5, i8 noundef zeroext 10)
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 0, ptr noundef @.str.7, ptr noundef %52)
  %53 = load ptr, ptr %6, align 8, !tbaa !9
  call void @mmt_hash_free(ptr noundef %53)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  ret i32 0
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mmt_hash_add(ptr noundef, ptr noundef, i8 noundef zeroext, ptr noundef, i1 noundef zeroext) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #3

declare void @mmt_sec_log(i32 noundef, ptr noundef, ...) #4

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mmt_hash_search(ptr noundef, ptr noundef, i8 noundef zeroext) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mmt_hash_free(ptr noundef) #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mmt_hash_create() #2

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #4 = { "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 = { noreturn 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 #6 = { nounwind }
attributes #7 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, 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"

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = tail call ptr @mmt_hash_create()
  %4 = tail call ptr @mmt_hash_add(ptr noundef %3, ptr noundef nonnull @.str, i8 noundef zeroext 2, ptr noundef nonnull @.str.1, i1 noundef zeroext false)
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %6, label %5, !prof !5

5:                                                ; preds = %2
  tail call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 4, ptr noundef nonnull @.str.2) #4
  tail call void @exit(i32 noundef 0) #5
  unreachable

6:                                                ; preds = %2
  %7 = tail call ptr @mmt_hash_add(ptr noundef %3, ptr noundef nonnull @.str.3, i8 noundef zeroext 2, ptr noundef nonnull @.str.4, i1 noundef zeroext false)
  %.not7 = icmp eq ptr %7, null
  br i1 %.not7, label %9, label %8, !prof !5

8:                                                ; preds = %6
  tail call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 4, ptr noundef nonnull @.str.2) #4
  tail call void @exit(i32 noundef 0) #5
  unreachable

9:                                                ; preds = %6
  %10 = tail call ptr @mmt_hash_add(ptr noundef %3, ptr noundef nonnull @.str.5, i8 noundef zeroext 10, ptr noundef nonnull @.str.6, i1 noundef zeroext false)
  %.not8 = icmp eq ptr %10, null
  br i1 %.not8, label %12, label %11, !prof !5

11:                                               ; preds = %9
  tail call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 4, ptr noundef nonnull @.str.2) #4
  tail call void @exit(i32 noundef 0) #5
  unreachable

12:                                               ; preds = %9
  %13 = tail call ptr @mmt_hash_search(ptr noundef %3, ptr noundef nonnull @.str, i8 noundef zeroext 2)
  tail call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 0, ptr noundef nonnull @.str.7, ptr noundef %13) #4
  %14 = tail call ptr @mmt_hash_search(ptr noundef %3, ptr noundef nonnull @.str.3, i8 noundef zeroext 2)
  tail call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 0, ptr noundef nonnull @.str.7, ptr noundef %14) #4
  %15 = tail call ptr @mmt_hash_search(ptr noundef %3, ptr noundef nonnull @.str.5, i8 noundef zeroext 10)
  tail call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 0, ptr noundef nonnull @.str.7, ptr noundef %15) #4
  tail call void @mmt_hash_free(ptr noundef %3)
  ret i32 0
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mmt_hash_add(ptr noundef, ptr noundef, i8 noundef zeroext, ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mmt_hash_search(ptr noundef, ptr noundef, i8 noundef zeroext) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mmt_hash_free(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mmt_hash_create() local_unnamed_addr #1

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 = { inlinehint 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 = { "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 = { noreturn 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 }
attributes #5 = { noreturn 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 = !{!"branch_weights", !"expected", i32 2000, i32 1}


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