; LLVM IR from xtaci/algorithms :: src (skiplist_demo)

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

%"class.alg::SkipList" = type { ptr, i32, %"class.alg::SkipList<int, int>::NotFoundException" }
%"class.alg::SkipList<int, int>::NotFoundException" = type { %"class.std::exception" }
%"class.std::exception" = type { ptr }

@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@_ZTISt9exception = external constant ptr
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.alg::SkipList", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #9
  call void @_ZN3alg8SkipListIiiEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  store i32 20, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  store i32 0, ptr %4, align 4, !tbaa !5
  %10 = call i64 @time(ptr noundef null) #9
  %11 = trunc i64 %10 to i32
  call void @srand(i32 noundef %11) #9
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %20, %0
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = icmp slt i32 %13, 20
  br i1 %14, label %15, label %27

15:                                               ; preds = %12
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = call i32 @rand() #9
  %18 = srem i32 %17, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %16, i32 noundef %18)
          to label %19 unwind label %23

19:                                               ; preds = %15
  br label %20

20:                                               ; preds = %19
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr %4, align 4, !tbaa !5
  br label %12, !llvm.loop !9

23:                                               ; preds = %102, %100, %79, %30, %29, %27, %15
  %24 = landingpad { ptr, i32 }
          cleanup
  %25 = extractvalue { ptr, i32 } %24, 0
  store ptr %25, ptr %5, align 8
  %26 = extractvalue { ptr, i32 } %24, 1
  store i32 %26, ptr %6, align 4
  br label %105

27:                                               ; preds = %12
  %28 = invoke i32 (ptr, ...) @printf(ptr noundef @.str)
          to label %29 unwind label %23

29:                                               ; preds = %27
  invoke void @_ZN3alg8SkipListIiiE5printEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %30 unwind label %23

30:                                               ; preds = %29
  %31 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1)
          to label %32 unwind label %23

32:                                               ; preds = %30
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %65, %32
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = icmp slt i32 %34, 20
  br i1 %35, label %36, label %79

36:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  %37 = call i32 @rand() #9
  %38 = srem i32 %37, 100
  store i32 %38, ptr %7, align 4, !tbaa !5
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = invoke noundef i32 @_ZNK3alg8SkipListIiiEixEi(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %40)
          to label %42 unwind label %45

42:                                               ; preds = %36
  %43 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %39, i32 noundef %41)
          to label %44 unwind label %45

44:                                               ; preds = %42
  br label %64

45:                                               ; preds = %42, %36
  %46 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %5, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %6, align 4
  br label %49

49:                                               ; preds = %45
  %50 = load i32, ptr %6, align 4
  %51 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #9
  %52 = icmp eq i32 %50, %51
  br i1 %52, label %53, label %78

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %54 = load ptr, ptr %5, align 8
  %55 = call ptr @__cxa_begin_catch(ptr %54) #9
  store ptr %55, ptr %8, align 8
  %56 = load ptr, ptr %8, align 8, !tbaa !11
  %57 = load ptr, ptr %56, align 8, !tbaa !13
  %58 = getelementptr inbounds ptr, ptr %57, i64 2
  %59 = load ptr, ptr %58, align 8
  %60 = call noundef ptr %59(ptr noundef nonnull align 8 dereferenceable(8) %56) #9
  %61 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, ptr noundef %60)
          to label %62 unwind label %68

62:                                               ; preds = %53
  invoke void @__cxa_end_catch()
          to label %63 unwind label %72

63:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  br label %64

64:                                               ; preds = %63, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %4, align 4, !tbaa !5
  br label %33, !llvm.loop !15

68:                                               ; preds = %53
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %5, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %6, align 4
  invoke void @__cxa_end_catch()
          to label %76 unwind label %111

72:                                               ; preds = %62
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %5, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %6, align 4
  br label %77

76:                                               ; preds = %68
  br label %77

77:                                               ; preds = %76, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  br label %78

78:                                               ; preds = %77, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %105

79:                                               ; preds = %33
  %80 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4)
          to label %81 unwind label %23

81:                                               ; preds = %79
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %93, %81
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = icmp slt i32 %83, 20
  br i1 %84, label %85, label %100

85:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  %86 = call i32 @rand() #9
  %87 = srem i32 %86, 100
  store i32 %87, ptr %9, align 4, !tbaa !5
  %88 = load i32, ptr %9, align 4, !tbaa !5
  %89 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %88)
          to label %90 unwind label %96

90:                                               ; preds = %85
  %91 = load i32, ptr %9, align 4, !tbaa !5
  invoke void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %91)
          to label %92 unwind label %96

92:                                               ; preds = %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %4, align 4, !tbaa !5
  br label %82, !llvm.loop !16

96:                                               ; preds = %90, %85
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %5, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  br label %105

100:                                              ; preds = %82
  %101 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.6)
          to label %102 unwind label %23

102:                                              ; preds = %100
  invoke void @_ZN3alg8SkipListIiiE5printEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %103 unwind label %23

103:                                              ; preds = %102
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  call void @_ZN3alg8SkipListIiiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #9
  %104 = load i32, ptr %1, align 4
  ret i32 %104

105:                                              ; preds = %96, %78, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  call void @_ZN3alg8SkipListIiiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #9
  br label %106

106:                                              ; preds = %105
  %107 = load ptr, ptr %5, align 8
  %108 = load i32, ptr %6, align 4
  %109 = insertvalue { ptr, i32 } poison, ptr %107, 0
  %110 = insertvalue { ptr, i32 } %109, i32 %108, 1
  resume { ptr, i32 } %110

111:                                              ; preds = %68
  %112 = landingpad { ptr, i32 }
          catch ptr null
  %113 = extractvalue { ptr, i32 } %112, 0
  call void @__clang_call_terminate(ptr %113) #10
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3alg8SkipListIiiEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @srand(i32 noundef) #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #3

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

; Function Attrs: nounwind
declare i32 @rand() #3

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3alg8SkipListIiiE5printEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK3alg8SkipListIiiEixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #5 align 2

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #6

declare ptr @__cxa_begin_catch(ptr)

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #7

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3alg8SkipListIiiED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #8 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 = { "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 = { inlinehint 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 #6 = { nounwind memory(none) }
attributes #7 = { noinline noreturn nounwind uwtable "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 #8 = { 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 #9 = { nounwind }
attributes #10 = { 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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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

%"class.alg::SkipList" = type { ptr, i32, %"class.alg::SkipList<int, int>::NotFoundException" }
%"class.alg::SkipList<int, int>::NotFoundException" = type { %"class.std::exception" }
%"class.std::exception" = type { ptr }

@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@_ZTISt9exception = external constant ptr
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.alg::SkipList", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #8
  call void @_ZN3alg8SkipListIiiEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %2 = call i64 @time(ptr noundef null) #8
  %3 = trunc i64 %2 to i32
  call void @srand(i32 noundef %3) #8
  %4 = call i32 @rand() #8
  %5 = srem i32 %4, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 0, i32 noundef %5)
          to label %6 unwind label %.loopexit21

6:                                                ; preds = %0
  %7 = call i32 @rand() #8
  %8 = srem i32 %7, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 1, i32 noundef %8)
          to label %9 unwind label %.loopexit21

9:                                                ; preds = %6
  %10 = call i32 @rand() #8
  %11 = srem i32 %10, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 2, i32 noundef %11)
          to label %12 unwind label %.loopexit21

12:                                               ; preds = %9
  %13 = call i32 @rand() #8
  %14 = srem i32 %13, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 3, i32 noundef %14)
          to label %15 unwind label %.loopexit21

15:                                               ; preds = %12
  %16 = call i32 @rand() #8
  %17 = srem i32 %16, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 4, i32 noundef %17)
          to label %18 unwind label %.loopexit21

18:                                               ; preds = %15
  %19 = call i32 @rand() #8
  %20 = srem i32 %19, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 5, i32 noundef %20)
          to label %21 unwind label %.loopexit21

21:                                               ; preds = %18
  %22 = call i32 @rand() #8
  %23 = srem i32 %22, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 6, i32 noundef %23)
          to label %24 unwind label %.loopexit21

24:                                               ; preds = %21
  %25 = call i32 @rand() #8
  %26 = srem i32 %25, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 7, i32 noundef %26)
          to label %27 unwind label %.loopexit21

27:                                               ; preds = %24
  %28 = call i32 @rand() #8
  %29 = srem i32 %28, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 8, i32 noundef %29)
          to label %30 unwind label %.loopexit21

30:                                               ; preds = %27
  %31 = call i32 @rand() #8
  %32 = srem i32 %31, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 9, i32 noundef %32)
          to label %33 unwind label %.loopexit21

33:                                               ; preds = %30
  %34 = call i32 @rand() #8
  %35 = srem i32 %34, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 10, i32 noundef %35)
          to label %36 unwind label %.loopexit21

36:                                               ; preds = %33
  %37 = call i32 @rand() #8
  %38 = srem i32 %37, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 11, i32 noundef %38)
          to label %39 unwind label %.loopexit21

39:                                               ; preds = %36
  %40 = call i32 @rand() #8
  %41 = srem i32 %40, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 12, i32 noundef %41)
          to label %42 unwind label %.loopexit21

42:                                               ; preds = %39
  %43 = call i32 @rand() #8
  %44 = srem i32 %43, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 13, i32 noundef %44)
          to label %45 unwind label %.loopexit21

45:                                               ; preds = %42
  %46 = call i32 @rand() #8
  %47 = srem i32 %46, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 14, i32 noundef %47)
          to label %48 unwind label %.loopexit21

48:                                               ; preds = %45
  %49 = call i32 @rand() #8
  %50 = srem i32 %49, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 15, i32 noundef %50)
          to label %51 unwind label %.loopexit21

51:                                               ; preds = %48
  %52 = call i32 @rand() #8
  %53 = srem i32 %52, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 16, i32 noundef %53)
          to label %54 unwind label %.loopexit21

54:                                               ; preds = %51
  %55 = call i32 @rand() #8
  %56 = srem i32 %55, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 17, i32 noundef %56)
          to label %57 unwind label %.loopexit21

57:                                               ; preds = %54
  %58 = call i32 @rand() #8
  %59 = srem i32 %58, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 18, i32 noundef %59)
          to label %60 unwind label %.loopexit21

60:                                               ; preds = %57
  %61 = call i32 @rand() #8
  %62 = srem i32 %61, 100
  invoke void @_ZN3alg8SkipListIiiE6insertEii(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 19, i32 noundef %62)
          to label %63 unwind label %.loopexit21

63:                                               ; preds = %60
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  invoke void @_ZN3alg8SkipListIiiE5printEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
          to label %65 unwind label %.loopexit.split-lp

.loopexit21:                                      ; preds = %60, %57, %54, %51, %48, %45, %42, %39, %36, %33, %30, %27, %24, %21, %18, %15, %12, %9, %6, %0
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit.split-lp:                               ; preds = %63, %90
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

65:                                               ; preds = %63
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %67

67:                                               ; preds = %65, %86
  %.124 = phi i32 [ 0, %65 ], [ %87, %86 ]
  %68 = call i32 @rand() #8
  %69 = srem i32 %68, 100
  %70 = invoke noundef i32 @_ZNK3alg8SkipListIiiEixEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %69)
          to label %71 unwind label %73

71:                                               ; preds = %67
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %69, i32 noundef %70)
  br label %86

73:                                               ; preds = %67
  %74 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %75 = extractvalue { ptr, i32 } %74, 1
  %76 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #8
  %77 = icmp eq i32 %75, %76
  br i1 %77, label %78, label %.loopexit

78:                                               ; preds = %73
  %79 = extractvalue { ptr, i32 } %74, 0
  %80 = call ptr @__cxa_begin_catch(ptr %79) #8
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i64 16
  %83 = load ptr, ptr %82, align 8
  %84 = call noundef ptr %83(ptr noundef nonnull align 8 dereferenceable(8) %80) #8
  %85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef %84)
  invoke void @__cxa_end_catch()
          to label %86 unwind label %88

86:                                               ; preds = %78, %71
  %87 = add nuw nsw i32 %.124, 1
  %exitcond.not = icmp eq i32 %87, 20
  br i1 %exitcond.not, label %90, label %67, !llvm.loop !8

88:                                               ; preds = %78
  %89 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

90:                                               ; preds = %86
  %91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %92 = call i32 @rand() #8
  %93 = srem i32 %92, 100
  %94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %93)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %93)
  %95 = call i32 @rand() #8
  %96 = srem i32 %95, 100
  %97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %96)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %96)
  %98 = call i32 @rand() #8
  %99 = srem i32 %98, 100
  %100 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %99)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %99)
  %101 = call i32 @rand() #8
  %102 = srem i32 %101, 100
  %103 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %102)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %102)
  %104 = call i32 @rand() #8
  %105 = srem i32 %104, 100
  %106 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %105)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %105)
  %107 = call i32 @rand() #8
  %108 = srem i32 %107, 100
  %109 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %108)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %108)
  %110 = call i32 @rand() #8
  %111 = srem i32 %110, 100
  %112 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %111)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %111)
  %113 = call i32 @rand() #8
  %114 = srem i32 %113, 100
  %115 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %114)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %114)
  %116 = call i32 @rand() #8
  %117 = srem i32 %116, 100
  %118 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %117)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %117)
  %119 = call i32 @rand() #8
  %120 = srem i32 %119, 100
  %121 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %120)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %120)
  %122 = call i32 @rand() #8
  %123 = srem i32 %122, 100
  %124 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %123)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %123)
  %125 = call i32 @rand() #8
  %126 = srem i32 %125, 100
  %127 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %126)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %126)
  %128 = call i32 @rand() #8
  %129 = srem i32 %128, 100
  %130 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %129)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %129)
  %131 = call i32 @rand() #8
  %132 = srem i32 %131, 100
  %133 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %132)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %132)
  %134 = call i32 @rand() #8
  %135 = srem i32 %134, 100
  %136 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %135)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %135)
  %137 = call i32 @rand() #8
  %138 = srem i32 %137, 100
  %139 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %138)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %138)
  %140 = call i32 @rand() #8
  %141 = srem i32 %140, 100
  %142 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %141)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %141)
  %143 = call i32 @rand() #8
  %144 = srem i32 %143, 100
  %145 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %144)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %144)
  %146 = call i32 @rand() #8
  %147 = srem i32 %146, 100
  %148 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %147)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %147)
  %149 = call i32 @rand() #8
  %150 = srem i32 %149, 100
  %151 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %150)
  call void @_ZN3alg8SkipListIiiE10delete_keyEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %150)
  %152 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  invoke void @_ZN3alg8SkipListIiiE5printEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
          to label %153 unwind label %.loopexit.split-lp

153:                                              ; preds = %90
  call void @_ZN3alg8SkipListIiiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #8
  ret i32 0

.loopexit:                                        ; preds = %73, %.loopexit21, %.loopexit.split-lp, %88
  %.merged = phi { ptr, i32 } [ %89, %88 ], [ %lpad.loopexit, %.loopexit21 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ], [ %74, %73 ]
  call void @_ZN3alg8SkipListIiiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #8
  resume { ptr, i32 } %.merged
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3alg8SkipListIiiEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

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

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3alg8SkipListIiiE5printEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK3alg8SkipListIiiEixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #6

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare void @__cxa_end_catch() local_unnamed_addr

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3alg8SkipListIiiED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #7 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 = { 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 = { inlinehint 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 #6 = { nofree nosync nounwind memory(none) }
attributes #7 = { 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 #8 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass