; LLVM IR from nragland37/cpp-projects :: data_structures-I/13-DLList/main.ll (Z7processR6DLListI7StudentE)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7processR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i8, align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #2
  br label %4

4:                                                ; preds = %33, %1
  %5 = call noundef signext i8 @_Z9getChoicev()
  store i8 %5, ptr %3, align 1, !tbaa !9
  %6 = load i8, ptr %3, align 1, !tbaa !9
  %7 = sext i8 %6 to i32
  switch i32 %7, label %32 [
    i32 65, label %8
    i32 73, label %10
    i32 66, label %12
    i32 79, label %14
    i32 85, label %16
    i32 70, label %18
    i32 82, label %20
    i32 69, label %22
    i32 90, label %24
    i32 67, label %26
    i32 86, label %28
    i32 68, label %30
    i32 81, label %32
  ]

8:                                                ; preds = %4
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_Z13addNewStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %9)
  br label %32

10:                                               ; preds = %4
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_Z11insertFrontR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %11)
  br label %32

12:                                               ; preds = %4
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_Z10insertRearR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %13)
  br label %32

14:                                               ; preds = %4
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_Z11insertAfterR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %15)
  br label %32

16:                                               ; preds = %4
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_Z12insertBeforeR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %17)
  br label %32

18:                                               ; preds = %4
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_Z11findStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %19)
  br label %32

20:                                               ; preds = %4
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_Z13removeStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %21)
  br label %32

22:                                               ; preds = %4
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_Z11removeFrontR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %23)
  br label %32

24:                                               ; preds = %4
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_Z10removeRearR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %25)
  br label %32

26:                                               ; preds = %4
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_Z13countStudentsR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %27)
  br label %32

28:                                               ; preds = %4
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_Z17displayStudentRevR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %29)
  br label %32

30:                                               ; preds = %4
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_Z14displayStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %31)
  br label %32

32:                                               ; preds = %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %4, %4
  br label %33

33:                                               ; preds = %32
  %34 = load i8, ptr %3, align 1, !tbaa !9
  %35 = sext i8 %34 to i32
  %36 = icmp ne i32 %35, 81
  br i1 %36, label %4, label %37, !llvm.loop !10

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #2
  ret void
}

; 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 noundef signext i8 @_Z9getChoicev() #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z13addNewStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11insertFrontR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10insertRearR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11insertAfterR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12insertBeforeR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11findStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z13removeStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11removeFrontR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10removeRearR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z13countStudentsR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17displayStudentRevR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z14displayStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) #1

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 = { 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"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"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"

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7processR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %0) local_unnamed_addr #0 {
  br label %.backedge

.backedge:                                        ; preds = %.backedge.backedge, %1
  %2 = tail call noundef signext i8 @_Z9getChoicev()
  switch i8 %2, label %.backedge.backedge [
    i8 65, label %3
    i8 73, label %4
    i8 66, label %5
    i8 79, label %6
    i8 85, label %7
    i8 70, label %8
    i8 82, label %9
    i8 69, label %10
    i8 90, label %11
    i8 67, label %12
    i8 86, label %13
    i8 68, label %14
    i8 81, label %15
  ]

3:                                                ; preds = %.backedge
  tail call void @_Z13addNewStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.backedge.backedge

4:                                                ; preds = %.backedge
  tail call void @_Z11insertFrontR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.backedge.backedge

5:                                                ; preds = %.backedge
  tail call void @_Z10insertRearR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.backedge.backedge

6:                                                ; preds = %.backedge
  tail call void @_Z11insertAfterR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.backedge.backedge

7:                                                ; preds = %.backedge
  tail call void @_Z12insertBeforeR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.backedge.backedge

8:                                                ; preds = %.backedge
  tail call void @_Z11findStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.backedge.backedge

9:                                                ; preds = %.backedge
  tail call void @_Z13removeStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.backedge.backedge

10:                                               ; preds = %.backedge
  tail call void @_Z11removeFrontR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.backedge.backedge

11:                                               ; preds = %.backedge
  tail call void @_Z10removeRearR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.backedge.backedge

12:                                               ; preds = %.backedge
  tail call void @_Z13countStudentsR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.backedge.backedge

13:                                               ; preds = %.backedge
  tail call void @_Z17displayStudentRevR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.backedge.backedge

14:                                               ; preds = %.backedge
  tail call void @_Z14displayStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %.backedge.backedge

.backedge.backedge:                               ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %.backedge
  br label %.backedge, !llvm.loop !5

15:                                               ; preds = %.backedge
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_Z9getChoicev() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z13addNewStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11insertFrontR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10insertRearR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11insertAfterR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12insertBeforeR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11findStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z13removeStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11removeFrontR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10removeRearR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z13countStudentsR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17displayStudentRevR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z14displayStudentR6DLListI7StudentE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

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

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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