; LLVM IR from HarshCasper/NeoAlgo :: C/ds (Circular_LL)

; 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.14 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [20 x i8], align 1

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @delete_at_beg(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @delete_at_end(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @count_length(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @display(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @check_empty(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @sortList(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @reverseList(ptr noundef) #0

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

6:                                                ; preds = %105, %0
  %7 = load i32, ptr %5, align 4, !tbaa !9
  %8 = icmp ne i32 %7, 6
  br i1 %8, label %9, label %106

9:                                                ; preds = %6
  %10 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  %11 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  %12 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  %13 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  %14 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  %15 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  %17 = call i32 (ptr, ...) @printf(ptr noundef @.str.21)
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str.22)
  %19 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.25)
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str.26)
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.27)
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.28, ptr noundef %5)
  %25 = load i32, ptr %5, align 4, !tbaa !9
  switch i32 %25, label %103 [
    i32 1, label %26
    i32 2, label %33
    i32 3, label %43
    i32 4, label %50
    i32 5, label %56
    i32 6, label %63
    i32 7, label %69
    i32 8, label %73
    i32 9, label %77
    i32 10, label %81
    i32 11, label %98
    i32 12, label %100
    i32 13, label %102
  ]

26:                                               ; preds = %9
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.29)
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.28, ptr noundef %2)
  %29 = load ptr, ptr %1, align 8, !tbaa !5
  %30 = load i32, ptr %2, align 4, !tbaa !9
  %31 = call ptr @insert_at_beg(ptr noundef %29, i32 noundef %30)
  store ptr %31, ptr %1, align 8, !tbaa !5
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.30)
  br label %105

33:                                               ; preds = %9
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str.29)
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.28, ptr noundef %2)
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.31)
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.28, ptr noundef %3)
  %38 = load ptr, ptr %1, align 8, !tbaa !5
  %39 = load i32, ptr %2, align 4, !tbaa !9
  %40 = load i32, ptr %3, align 4, !tbaa !9
  %41 = call ptr @insert_at_pos(ptr noundef %38, i32 noundef %39, i32 noundef %40)
  store ptr %41, ptr %1, align 8, !tbaa !5
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.30)
  br label %105

43:                                               ; preds = %9
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.29)
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.28, ptr noundef %2)
  %46 = load ptr, ptr %1, align 8, !tbaa !5
  %47 = load i32, ptr %2, align 4, !tbaa !9
  %48 = call ptr @insert_at_end(ptr noundef %46, i32 noundef %47)
  store ptr %48, ptr %1, align 8, !tbaa !5
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.30)
  br label %105

50:                                               ; preds = %9
  %51 = load ptr, ptr %1, align 8, !tbaa !5
  %52 = call ptr @delete_at_beg(ptr noundef %51)
  store ptr %52, ptr %1, align 8, !tbaa !5
  %53 = load ptr, ptr %1, align 8, !tbaa !5
  %54 = call ptr @display(ptr noundef %53)
  store ptr %54, ptr %1, align 8, !tbaa !5
  %55 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  br label %105

56:                                               ; preds = %9
  %57 = call i32 (ptr, ...) @printf(ptr noundef @.str.31)
  %58 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.28, ptr noundef %3)
  %59 = load ptr, ptr %1, align 8, !tbaa !5
  %60 = load i32, ptr %3, align 4, !tbaa !9
  %61 = call ptr @delete_at_pos(ptr noundef %59, i32 noundef %60)
  store ptr %61, ptr %1, align 8, !tbaa !5
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.33)
  br label %105

63:                                               ; preds = %9
  %64 = load ptr, ptr %1, align 8, !tbaa !5
  %65 = call ptr @delete_at_end(ptr noundef %64)
  store ptr %65, ptr %1, align 8, !tbaa !5
  %66 = load ptr, ptr %1, align 8, !tbaa !5
  %67 = call ptr @display(ptr noundef %66)
  store ptr %67, ptr %1, align 8, !tbaa !5
  %68 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  br label %105

69:                                               ; preds = %9
  %70 = load ptr, ptr %1, align 8, !tbaa !5
  %71 = call ptr @count_length(ptr noundef %70)
  store ptr %71, ptr %1, align 8, !tbaa !5
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  br label %105

73:                                               ; preds = %9
  %74 = load ptr, ptr %1, align 8, !tbaa !5
  %75 = call ptr @display(ptr noundef %74)
  store ptr %75, ptr %1, align 8, !tbaa !5
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  br label %105

77:                                               ; preds = %9
  %78 = load ptr, ptr %1, align 8, !tbaa !5
  %79 = call ptr @check_empty(ptr noundef %78)
  store ptr %79, ptr %1, align 8, !tbaa !5
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  br label %105

81:                                               ; preds = %9
  %82 = call i32 (ptr, ...) @printf(ptr noundef @.str.34)
  %83 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.28, ptr noundef %2)
  %84 = load ptr, ptr %1, align 8, !tbaa !5
  %85 = load i32, ptr %2, align 4, !tbaa !9
  %86 = call i32 @search_element(ptr noundef %84, i32 noundef %85)
  store i32 %86, ptr %4, align 4, !tbaa !9
  %87 = load i32, ptr %4, align 4, !tbaa !9
  %88 = icmp eq i32 %87, -1
  br i1 %88, label %89, label %92

89:                                               ; preds = %81
  %90 = load i32, ptr %2, align 4, !tbaa !9
  %91 = call i32 (ptr, ...) @printf(ptr noundef @.str.35, i32 noundef %90)
  br label %97

92:                                               ; preds = %81
  %93 = load i32, ptr %2, align 4, !tbaa !9
  %94 = load i32, ptr %4, align 4, !tbaa !9
  %95 = add nsw i32 %94, 1
  %96 = call i32 (ptr, ...) @printf(ptr noundef @.str.36, i32 noundef %93, i32 noundef %95)
  br label %97

97:                                               ; preds = %92, %89
  br label %105

98:                                               ; preds = %9
  %99 = load ptr, ptr %1, align 8, !tbaa !5
  call void @sortList(ptr noundef %99)
  br label %105

100:                                              ; preds = %9
  call void @reverseList(ptr noundef %1)
  %101 = call i32 (ptr, ...) @printf(ptr noundef @.str.37)
  br label %105

102:                                              ; preds = %9
  call void @exit(i32 noundef 0) #5
  unreachable

103:                                              ; preds = %9
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str.38)
  br label %105

105:                                              ; preds = %103, %100, %98, %97, %77, %73, %69, %63, %56, %50, %43, %33, %26
  br label %6, !llvm.loop !11

106:                                              ; preds = %6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

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 = { "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 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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.14 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [20 x i8], align 1

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

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

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

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

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

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

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

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

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

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

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

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

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

5:                                                ; preds = %0, %95
  %6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  %7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  %8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16)
  %9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18)
  %11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19)
  %12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20)
  %13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21)
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22)
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23)
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24)
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25)
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26)
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27)
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.28, ptr noundef nonnull %4)
  %21 = load i32, ptr %4, align 4, !tbaa !9
  switch i32 %21, label %93 [
    i32 1, label %22
    i32 2, label %29
    i32 3, label %39
    i32 4, label %46
    i32 5, label %51
    i32 6, label %58
    i32 7, label %63
    i32 8, label %67
    i32 9, label %71
    i32 10, label %75
    i32 11, label %88
    i32 12, label %90
    i32 13, label %92
  ]

22:                                               ; preds = %5
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29)
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.28, ptr noundef nonnull %2)
  %25 = load ptr, ptr %1, align 8, !tbaa !5
  %26 = load i32, ptr %2, align 4, !tbaa !9
  %27 = call ptr @insert_at_beg(ptr noundef %25, i32 noundef %26)
  store ptr %27, ptr %1, align 8, !tbaa !5
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30)
  br label %95

29:                                               ; preds = %5
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29)
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.28, ptr noundef nonnull %2)
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.31)
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.28, ptr noundef nonnull %3)
  %34 = load ptr, ptr %1, align 8, !tbaa !5
  %35 = load i32, ptr %2, align 4, !tbaa !9
  %36 = load i32, ptr %3, align 4, !tbaa !9
  %37 = call ptr @insert_at_pos(ptr noundef %34, i32 noundef %35, i32 noundef %36)
  store ptr %37, ptr %1, align 8, !tbaa !5
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30)
  br label %95

39:                                               ; preds = %5
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29)
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.28, ptr noundef nonnull %2)
  %42 = load ptr, ptr %1, align 8, !tbaa !5
  %43 = load i32, ptr %2, align 4, !tbaa !9
  %44 = call ptr @insert_at_end(ptr noundef %42, i32 noundef %43)
  store ptr %44, ptr %1, align 8, !tbaa !5
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30)
  br label %95

46:                                               ; preds = %5
  %47 = load ptr, ptr %1, align 8, !tbaa !5
  %48 = call ptr @delete_at_beg(ptr noundef %47)
  store ptr %48, ptr %1, align 8, !tbaa !5
  %49 = call ptr @display(ptr noundef %48)
  store ptr %49, ptr %1, align 8, !tbaa !5
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.32)
  br label %95

51:                                               ; preds = %5
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.31)
  %53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.28, ptr noundef nonnull %3)
  %54 = load ptr, ptr %1, align 8, !tbaa !5
  %55 = load i32, ptr %3, align 4, !tbaa !9
  %56 = call ptr @delete_at_pos(ptr noundef %54, i32 noundef %55)
  store ptr %56, ptr %1, align 8, !tbaa !5
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.33)
  br label %95

58:                                               ; preds = %5
  %59 = load ptr, ptr %1, align 8, !tbaa !5
  %60 = call ptr @delete_at_end(ptr noundef %59)
  store ptr %60, ptr %1, align 8, !tbaa !5
  %61 = call ptr @display(ptr noundef %60)
  store ptr %61, ptr %1, align 8, !tbaa !5
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.32)
  br label %95

63:                                               ; preds = %5
  %64 = load ptr, ptr %1, align 8, !tbaa !5
  %65 = call ptr @count_length(ptr noundef %64)
  store ptr %65, ptr %1, align 8, !tbaa !5
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.32)
  br label %95

67:                                               ; preds = %5
  %68 = load ptr, ptr %1, align 8, !tbaa !5
  %69 = call ptr @display(ptr noundef %68)
  store ptr %69, ptr %1, align 8, !tbaa !5
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.32)
  br label %95

71:                                               ; preds = %5
  %72 = load ptr, ptr %1, align 8, !tbaa !5
  %73 = call ptr @check_empty(ptr noundef %72)
  store ptr %73, ptr %1, align 8, !tbaa !5
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.32)
  br label %95

75:                                               ; preds = %5
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.34)
  %77 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.28, ptr noundef nonnull %2)
  %78 = load ptr, ptr %1, align 8, !tbaa !5
  %79 = load i32, ptr %2, align 4, !tbaa !9
  %80 = call i32 @search_element(ptr noundef %78, i32 noundef %79)
  %81 = icmp eq i32 %80, -1
  %82 = load i32, ptr %2, align 4, !tbaa !9
  br i1 %81, label %83, label %85

83:                                               ; preds = %75
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.35, i32 noundef %82)
  br label %95

85:                                               ; preds = %75
  %86 = add nuw nsw i32 %80, 1
  %87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.36, i32 noundef %82, i32 noundef %86)
  br label %95

88:                                               ; preds = %5
  %89 = load ptr, ptr %1, align 8, !tbaa !5
  call void @sortList(ptr noundef %89)
  br label %95

90:                                               ; preds = %5
  call void @reverseList(ptr noundef nonnull %1)
  %91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.37)
  br label %95

92:                                               ; preds = %5
  call void @exit(i32 noundef 0) #5
  unreachable

93:                                               ; preds = %5
  %94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.38)
  br label %95

95:                                               ; preds = %83, %85, %93, %90, %88, %71, %67, %63, %58, %51, %46, %39, %29, %22
  %.pr = load i32, ptr %4, align 4, !tbaa !9
  %.not = icmp eq i32 %.pr, 6
  br i1 %.not, label %96, label %5, !llvm.loop !11

96:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #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
}

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

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,SROAPass,SimplifyCFGPass