; LLVM IR from PetarV-/Algorithms :: Data Structures (Splay Tree)

; 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.4 = external hidden unnamed_addr constant [66 x i8], align 1

; 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: mustprogress uwtable
declare dso_local void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9SplayTree6DeleteEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4 align 2

declare i32 @printf(ptr noundef, ...) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) #1 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #6 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  %5 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 8) #8
  invoke void @_ZN9SplayTreeC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %6 unwind label %45

6:                                                ; preds = %0
  store ptr %5, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %7, i1 noundef zeroext true)
  %8 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %9, i32 noundef 68)
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %10, i1 noundef zeroext true)
  %11 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %12, i32 noundef 73)
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %13, i1 noundef zeroext true)
  %14 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %15, i32 noundef 78)
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %16, i1 noundef zeroext true)
  %17 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %18, i32 noundef 79)
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %19, i1 noundef zeroext true)
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %21, i32 noundef 83)
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %22, i1 noundef zeroext true)
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %24, i32 noundef 65)
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %25, i1 noundef zeroext true)
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %27, i32 noundef 85)
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %28, i1 noundef zeroext true)
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %30, i32 noundef 82)
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %31, i1 noundef zeroext true)
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree6DeleteEi(ptr noundef nonnull align 8 dereferenceable(8) %33, i32 noundef 73)
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %34, i1 noundef zeroext true)
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %36, i32 noundef 90)
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %37, i1 noundef zeroext true)
  %38 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree6DeleteEi(ptr noundef nonnull align 8 dereferenceable(8) %39, i32 noundef 83)
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %40, i1 noundef zeroext true)
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %42, i32 noundef 83)
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %43, i1 noundef zeroext true)
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  ret i32 0

45:                                               ; preds = %0
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %3, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %5, i64 noundef 8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %49

49:                                               ; preds = %45
  %50 = load ptr, ptr %3, align 8
  %51 = load i32, ptr %4, align 4
  %52 = insertvalue { ptr, i32 } poison, ptr %50, 0
  %53 = insertvalue { ptr, i32 } %52, i32 %51, 1
  resume { ptr, i32 } %53
}

declare void @_ZN9SplayTreeC1Ev(ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { nobuiltin 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 = { nobuiltin 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 = { mustprogress 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 #5 = { "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 = { mustprogress norecurse 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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++ TBAA"}


; 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.4 = external hidden unnamed_addr constant [66 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9SplayTree6DeleteEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %1 = tail call noalias noundef nonnull dereferenceable(8) ptr @_Znwm(i64 noundef 8) #6
  invoke void @_ZN9SplayTreeC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %2 unwind label %16

2:                                                ; preds = %0
  tail call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext true)
  %3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 68)
  tail call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext true)
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 73)
  tail call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext true)
  %5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 78)
  tail call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext true)
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 79)
  tail call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext true)
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 83)
  tail call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext true)
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 65)
  tail call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext true)
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 85)
  tail call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext true)
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 82)
  tail call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext true)
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @_ZN9SplayTree6DeleteEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 73)
  tail call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext true)
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 90)
  tail call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext true)
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @_ZN9SplayTree6DeleteEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 83)
  tail call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext true)
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @_ZN9SplayTree6insertEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 83)
  tail call void @_ZN9SplayTree12inOrderPrintEb(ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext true)
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  ret i32 0

16:                                               ; preds = %0
  %17 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %1, i64 noundef 8) #7
  resume { ptr, i32 } %17
}

declare void @_ZN9SplayTreeC1Ev(ptr) local_unnamed_addr

attributes #0 = { mustprogress 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 = { nobuiltin 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 #2 = { nobuiltin 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 #3 = { mustprogress 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 = { nofree 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 #5 = { mustprogress norecurse 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 #6 = { builtin allocsize(0) }
attributes #7 = { builtin 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)"}


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