; LLVM IR from ritikbanger/Hacktoberfest2022-DSA :: 10. Linked List/c lang (Linked List)

; 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 [29 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [41 x i8], align 1

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

8:                                                ; preds = %119, %0
  %9 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %10 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %11 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %12 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %13 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %14 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %15 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %17 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %19 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.19, ptr noundef %2)
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  %30 = load i32, ptr %2, align 4, !tbaa !9
  %31 = icmp sgt i32 %30, 1
  br i1 %31, label %32, label %41

32:                                               ; preds = %8
  %33 = load i32, ptr %2, align 4, !tbaa !9
  %34 = icmp slt i32 %33, 15
  br i1 %34, label %35, label %41

35:                                               ; preds = %32
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = call i32 @isNull(ptr noundef %36)
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %35
  br label %119

40:                                               ; preds = %35
  br label %41

41:                                               ; preds = %40, %32, %8
  %42 = load i32, ptr %2, align 4, !tbaa !9
  switch i32 %42, label %116 [
    i32 1, label %43
    i32 2, label %45
    i32 3, label %47
    i32 4, label %52
    i32 5, label %57
    i32 6, label %64
    i32 7, label %66
    i32 8, label %70
    i32 9, label %76
    i32 10, label %82
    i32 11, label %88
    i32 12, label %91
    i32 13, label %97
    i32 14, label %103
    i32 15, label %118
  ]

43:                                               ; preds = %41
  %44 = call ptr @create()
  store ptr %44, ptr %5, align 8, !tbaa !5
  br label %118

45:                                               ; preds = %41
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  call void @display(ptr noundef %46)
  br label %118

47:                                               ; preds = %41
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = call i32 @length(ptr noundef %48)
  store i32 %49, ptr %4, align 4, !tbaa !9
  %50 = load i32, ptr %4, align 4, !tbaa !9
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.21, i32 noundef %50)
  br label %118

52:                                               ; preds = %41
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = call i32 @maximum(ptr noundef %53)
  store i32 %54, ptr %4, align 4, !tbaa !9
  %55 = load i32, ptr %4, align 4, !tbaa !9
  %56 = call i32 (ptr, ...) @printf(ptr noundef @.str.22, i32 noundef %55)
  br label %118

57:                                               ; preds = %41
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  %59 = call ptr @create()
  store ptr %59, ptr %6, align 8, !tbaa !5
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = call ptr @merge(ptr noundef %60, ptr noundef %61)
  store ptr %62, ptr %5, align 8, !tbaa !5
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  call void @display(ptr noundef %63)
  br label %118

64:                                               ; preds = %41
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sort(ptr noundef %65)
  br label %118

66:                                               ; preds = %41
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = call ptr @reverse(ptr noundef %67)
  store ptr %68, ptr %5, align 8, !tbaa !5
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  call void @display(ptr noundef %69)
  br label %118

70:                                               ; preds = %41
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  %72 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.19, ptr noundef %3)
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = load i32, ptr %3, align 4, !tbaa !9
  %75 = call ptr @insert_front(ptr noundef %73, i32 noundef %74)
  store ptr %75, ptr %5, align 8, !tbaa !5
  br label %118

76:                                               ; preds = %41
  %77 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  %78 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.19, ptr noundef %3)
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = load i32, ptr %3, align 4, !tbaa !9
  %81 = call ptr @insert_end(ptr noundef %79, i32 noundef %80)
  store ptr %81, ptr %5, align 8, !tbaa !5
  br label %118

82:                                               ; preds = %41
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  %84 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.19, ptr noundef %3)
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = load i32, ptr %3, align 4, !tbaa !9
  %87 = call ptr @insert_sort(ptr noundef %85, i32 noundef %86)
  store ptr %87, ptr %5, align 8, !tbaa !5
  br label %118

88:                                               ; preds = %41
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = call ptr @delete_first(ptr noundef %89)
  store ptr %90, ptr %5, align 8, !tbaa !5
  br label %118

91:                                               ; preds = %41
  %92 = call i32 (ptr, ...) @printf(ptr noundef @.str.25)
  %93 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.19, ptr noundef %3)
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = load i32, ptr %3, align 4, !tbaa !9
  %96 = call ptr @delete_before(ptr noundef %94, i32 noundef %95)
  store ptr %96, ptr %5, align 8, !tbaa !5
  br label %118

97:                                               ; preds = %41
  %98 = call i32 (ptr, ...) @printf(ptr noundef @.str.25)
  %99 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.19, ptr noundef %3)
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = load i32, ptr %3, align 4, !tbaa !9
  %102 = call ptr @delete_after(ptr noundef %100, i32 noundef %101)
  store ptr %102, ptr %5, align 8, !tbaa !5
  br label %103

103:                                              ; preds = %97, %41
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str.26)
  %105 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.19, ptr noundef %3)
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = load i32, ptr %3, align 4, !tbaa !9
  %108 = call i32 @search(ptr noundef %106, i32 noundef %107)
  store i32 %108, ptr %4, align 4, !tbaa !9
  %109 = load i32, ptr %4, align 4, !tbaa !9
  %110 = icmp eq i32 %109, -1
  br i1 %110, label %111, label %113

111:                                              ; preds = %103
  %112 = call i32 (ptr, ...) @printf(ptr noundef @.str.27)
  br label %118

113:                                              ; preds = %103
  %114 = load i32, ptr %4, align 4, !tbaa !9
  %115 = call i32 (ptr, ...) @printf(ptr noundef @.str.28, i32 noundef %114)
  br label %118

116:                                              ; preds = %41
  %117 = call i32 (ptr, ...) @printf(ptr noundef @.str.29)
  br label %118

118:                                              ; preds = %116, %113, %111, %91, %88, %82, %76, %70, %66, %64, %57, %52, %47, %45, %43, %41
  br label %119

119:                                              ; preds = %118, %39
  %120 = load i32, ptr %2, align 4, !tbaa !9
  %121 = icmp ne i32 %120, 15
  br i1 %121, label %8, label %122, !llvm.loop !11

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; 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 @create() #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 = { 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 = { 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 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [41 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  %3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %4

4:                                                ; preds = %87, %0
  %.0 = phi ptr [ null, %0 ], [ %.2, %87 ]
  %5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16)
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18)
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.19, ptr noundef nonnull %1)
  %25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20)
  %26 = load i32, ptr %1, align 4
  %27 = add i32 %26, -2
  %or.cond = icmp ult i32 %27, 13
  br i1 %or.cond, label %28, label %30

28:                                               ; preds = %4
  %29 = call i32 @isNull(ptr noundef %.0)
  %.not = icmp eq i32 %29, 0
  br i1 %.not, label %thread-pre-split, label %87

thread-pre-split:                                 ; preds = %28
  %.pr = load i32, ptr %1, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %thread-pre-split, %4
  %31 = phi i32 [ %.pr, %thread-pre-split ], [ %26, %4 ]
  switch i32 %31, label %85 [
    i32 1, label %32
    i32 2, label %34
    i32 3, label %35
    i32 4, label %38
    i32 5, label %41
    i32 6, label %45
    i32 7, label %46
    i32 8, label %48
    i32 9, label %53
    i32 10, label %58
    i32 11, label %63
    i32 12, label %65
    i32 13, label %70
    i32 14, label %75
    i32 15, label %87
  ]

32:                                               ; preds = %30
  %33 = call ptr @create()
  br label %87

34:                                               ; preds = %30
  call void @display(ptr noundef %.0)
  br label %87

35:                                               ; preds = %30
  %36 = call i32 @length(ptr noundef %.0)
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21, i32 noundef %36)
  br label %87

38:                                               ; preds = %30
  %39 = call i32 @maximum(ptr noundef %.0)
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, i32 noundef %39)
  br label %87

41:                                               ; preds = %30
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23)
  %43 = call ptr @create()
  %44 = call ptr @merge(ptr noundef %.0, ptr noundef %43)
  call void @display(ptr noundef %44)
  br label %87

45:                                               ; preds = %30
  call void @sort(ptr noundef %.0)
  br label %87

46:                                               ; preds = %30
  %47 = call ptr @reverse(ptr noundef %.0)
  call void @display(ptr noundef %47)
  br label %87

48:                                               ; preds = %30
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24)
  %50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.19, ptr noundef nonnull %2)
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = call ptr @insert_front(ptr noundef %.0, i32 noundef %51)
  br label %87

53:                                               ; preds = %30
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24)
  %55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.19, ptr noundef nonnull %2)
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = call ptr @insert_end(ptr noundef %.0, i32 noundef %56)
  br label %87

58:                                               ; preds = %30
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24)
  %60 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.19, ptr noundef nonnull %2)
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = call ptr @insert_sort(ptr noundef %.0, i32 noundef %61)
  br label %87

63:                                               ; preds = %30
  %64 = call ptr @delete_first(ptr noundef %.0)
  br label %87

65:                                               ; preds = %30
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25)
  %67 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.19, ptr noundef nonnull %2)
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = call ptr @delete_before(ptr noundef %.0, i32 noundef %68)
  br label %87

70:                                               ; preds = %30
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25)
  %72 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.19, ptr noundef nonnull %2)
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = call ptr @delete_after(ptr noundef %.0, i32 noundef %73)
  br label %75

75:                                               ; preds = %70, %30
  %.1 = phi ptr [ %.0, %30 ], [ %74, %70 ]
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26)
  %77 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.19, ptr noundef nonnull %2)
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = call i32 @search(ptr noundef %.1, i32 noundef %78)
  %80 = icmp eq i32 %79, -1
  br i1 %80, label %81, label %83

81:                                               ; preds = %75
  %82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27)
  br label %87

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

85:                                               ; preds = %30
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29)
  br label %87

87:                                               ; preds = %30, %32, %34, %35, %38, %41, %45, %46, %48, %53, %58, %63, %65, %81, %83, %85, %28
  %.2 = phi ptr [ %.0, %28 ], [ %.0, %85 ], [ %.0, %30 ], [ %.1, %81 ], [ %.1, %83 ], [ %69, %65 ], [ %64, %63 ], [ %62, %58 ], [ %57, %53 ], [ %52, %48 ], [ %47, %46 ], [ %.0, %45 ], [ %44, %41 ], [ %.0, %38 ], [ %.0, %35 ], [ %.0, %34 ], [ %33, %32 ]
  %88 = load i32, ptr %1, align 4, !tbaa !5
  %.not23 = icmp eq i32 %88, 15
  br i1 %.not23, label %89, label %4, !llvm.loop !9

89:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #3
  ret i32 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; 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 @create() 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 = { 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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