; LLVM IR from chirag-singhal/Coding-Interview-101 :: Miscellaneous/Labs/Lab1/AssignmentSolution (seqListOps)

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

%struct.Job = type { i32, i32, i32, i32 }

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

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

; Function Attrs: nounwind uwtable
define dso_local void @initialize_elements(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  store i32 0, ptr %3, align 4, !tbaa !9
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.Job, ptr %5, i64 0
  %7 = getelementptr inbounds %struct.Job, ptr %6, i32 0, i32 0
  store i32 1, ptr %7, align 4, !tbaa !11
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.Job, ptr %8, i64 0
  %10 = getelementptr inbounds %struct.Job, ptr %9, i32 0, i32 1
  store i32 0, ptr %10, align 4, !tbaa !13
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.Job, ptr %11, i64 0
  %13 = getelementptr inbounds %struct.Job, ptr %12, i32 0, i32 3
  store i32 1, ptr %13, align 4, !tbaa !14
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.Job, ptr %14, i64 0
  %16 = getelementptr inbounds %struct.Job, ptr %15, i32 0, i32 2
  store i32 5, ptr %16, align 4, !tbaa !15
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.Job, ptr %17, i64 1
  %19 = getelementptr inbounds %struct.Job, ptr %18, i32 0, i32 0
  store i32 2, ptr %19, align 4, !tbaa !11
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.Job, ptr %20, i64 1
  %22 = getelementptr inbounds %struct.Job, ptr %21, i32 0, i32 1
  store i32 1, ptr %22, align 4, !tbaa !13
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.Job, ptr %23, i64 1
  %25 = getelementptr inbounds %struct.Job, ptr %24, i32 0, i32 3
  store i32 9, ptr %25, align 4, !tbaa !14
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.Job, ptr %26, i64 1
  %28 = getelementptr inbounds %struct.Job, ptr %27, i32 0, i32 2
  store i32 3, ptr %28, align 4, !tbaa !15
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.Job, ptr %29, i64 2
  %31 = getelementptr inbounds %struct.Job, ptr %30, i32 0, i32 0
  store i32 3, ptr %31, align 4, !tbaa !11
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.Job, ptr %32, i64 2
  %34 = getelementptr inbounds %struct.Job, ptr %33, i32 0, i32 1
  store i32 2, ptr %34, align 4, !tbaa !13
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.Job, ptr %35, i64 2
  %37 = getelementptr inbounds %struct.Job, ptr %36, i32 0, i32 3
  store i32 11, ptr %37, align 4, !tbaa !14
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.Job, ptr %38, i64 2
  %40 = getelementptr inbounds %struct.Job, ptr %39, i32 0, i32 2
  store i32 12, ptr %40, align 4, !tbaa !15
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.Job, ptr %41, i64 3
  %43 = getelementptr inbounds %struct.Job, ptr %42, i32 0, i32 0
  store i32 4, ptr %43, align 4, !tbaa !11
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.Job, ptr %44, i64 3
  %46 = getelementptr inbounds %struct.Job, ptr %45, i32 0, i32 1
  store i32 0, ptr %46, align 4, !tbaa !13
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.Job, ptr %47, i64 3
  %49 = getelementptr inbounds %struct.Job, ptr %48, i32 0, i32 3
  store i32 4, ptr %49, align 4, !tbaa !14
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.Job, ptr %50, i64 3
  %52 = getelementptr inbounds %struct.Job, ptr %51, i32 0, i32 2
  store i32 7, ptr %52, align 4, !tbaa !15
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.Job, ptr %53, i64 4
  %55 = getelementptr inbounds %struct.Job, ptr %54, i32 0, i32 0
  store i32 5, ptr %55, align 4, !tbaa !11
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.Job, ptr %56, i64 4
  %58 = getelementptr inbounds %struct.Job, ptr %57, i32 0, i32 1
  store i32 1, ptr %58, align 4, !tbaa !13
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.Job, ptr %59, i64 4
  %61 = getelementptr inbounds %struct.Job, ptr %60, i32 0, i32 3
  store i32 8, ptr %61, align 4, !tbaa !14
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.Job, ptr %62, i64 4
  %64 = getelementptr inbounds %struct.Job, ptr %63, i32 0, i32 2
  store i32 2, ptr %64, align 4, !tbaa !15
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.Job, ptr %65, i64 5
  %67 = getelementptr inbounds %struct.Job, ptr %66, i32 0, i32 0
  store i32 6, ptr %67, align 4, !tbaa !11
  %68 = load ptr, ptr %2, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.Job, ptr %68, i64 5
  %70 = getelementptr inbounds %struct.Job, ptr %69, i32 0, i32 1
  store i32 2, ptr %70, align 4, !tbaa !13
  %71 = load ptr, ptr %2, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.Job, ptr %71, i64 5
  %73 = getelementptr inbounds %struct.Job, ptr %72, i32 0, i32 3
  store i32 12, ptr %73, align 4, !tbaa !14
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.Job, ptr %74, i64 5
  %76 = getelementptr inbounds %struct.Job, ptr %75, i32 0, i32 2
  store i32 11, ptr %76, align 4, !tbaa !15
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.Job, ptr %77, i64 6
  %79 = getelementptr inbounds %struct.Job, ptr %78, i32 0, i32 0
  store i32 7, ptr %79, align 4, !tbaa !11
  %80 = load ptr, ptr %2, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.Job, ptr %80, i64 6
  %82 = getelementptr inbounds %struct.Job, ptr %81, i32 0, i32 1
  store i32 0, ptr %82, align 4, !tbaa !13
  %83 = load ptr, ptr %2, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.Job, ptr %83, i64 6
  %85 = getelementptr inbounds %struct.Job, ptr %84, i32 0, i32 3
  store i32 3, ptr %85, align 4, !tbaa !14
  %86 = load ptr, ptr %2, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.Job, ptr %86, i64 6
  %88 = getelementptr inbounds %struct.Job, ptr %87, i32 0, i32 2
  store i32 9, ptr %88, align 4, !tbaa !15
  %89 = load ptr, ptr %2, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.Job, ptr %89, i64 7
  %91 = getelementptr inbounds %struct.Job, ptr %90, i32 0, i32 0
  store i32 8, ptr %91, align 4, !tbaa !11
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.Job, ptr %92, i64 7
  %94 = getelementptr inbounds %struct.Job, ptr %93, i32 0, i32 1
  store i32 1, ptr %94, align 4, !tbaa !13
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.Job, ptr %95, i64 7
  %97 = getelementptr inbounds %struct.Job, ptr %96, i32 0, i32 3
  store i32 7, ptr %97, align 4, !tbaa !14
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.Job, ptr %98, i64 7
  %100 = getelementptr inbounds %struct.Job, ptr %99, i32 0, i32 2
  store i32 4, ptr %100, align 4, !tbaa !15
  %101 = load ptr, ptr %2, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.Job, ptr %101, i64 8
  %103 = getelementptr inbounds %struct.Job, ptr %102, i32 0, i32 0
  store i32 9, ptr %103, align 4, !tbaa !11
  %104 = load ptr, ptr %2, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.Job, ptr %104, i64 8
  %106 = getelementptr inbounds %struct.Job, ptr %105, i32 0, i32 1
  store i32 2, ptr %106, align 4, !tbaa !13
  %107 = load ptr, ptr %2, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.Job, ptr %107, i64 8
  %109 = getelementptr inbounds %struct.Job, ptr %108, i32 0, i32 3
  store i32 13, ptr %109, align 4, !tbaa !14
  %110 = load ptr, ptr %2, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.Job, ptr %110, i64 8
  %112 = getelementptr inbounds %struct.Job, ptr %111, i32 0, i32 2
  store i32 10, ptr %112, align 4, !tbaa !15
  %113 = load ptr, ptr %2, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.Job, ptr %113, i64 9
  %115 = getelementptr inbounds %struct.Job, ptr %114, i32 0, i32 0
  store i32 10, ptr %115, align 4, !tbaa !11
  %116 = load ptr, ptr %2, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.Job, ptr %116, i64 9
  %118 = getelementptr inbounds %struct.Job, ptr %117, i32 0, i32 1
  store i32 0, ptr %118, align 4, !tbaa !13
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.Job, ptr %119, i64 9
  %121 = getelementptr inbounds %struct.Job, ptr %120, i32 0, i32 3
  store i32 2, ptr %121, align 4, !tbaa !14
  %122 = load ptr, ptr %2, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.Job, ptr %122, i64 9
  %124 = getelementptr inbounds %struct.Job, ptr %123, i32 0, i32 2
  store i32 15, ptr %124, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!13 = !{!12, !10, i64 4}
!14 = !{!12, !10, i64 12}
!15 = !{!12, !10, i64 8}


; 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 nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @initialize_elements(ptr nocapture noundef writeonly %0) local_unnamed_addr #0 {
  store <4 x i32> <i32 1, i32 0, i32 5, i32 1>, ptr %0, align 4, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 16
  store <4 x i32> <i32 2, i32 1, i32 3, i32 9>, ptr %2, align 4, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  store <4 x i32> <i32 3, i32 2, i32 12, i32 11>, ptr %3, align 4, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  store <4 x i32> <i32 4, i32 0, i32 7, i32 4>, ptr %4, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 64
  store <4 x i32> <i32 5, i32 1, i32 2, i32 8>, ptr %5, align 4, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 80
  store <4 x i32> <i32 6, i32 2, i32 11, i32 12>, ptr %6, align 4, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 96
  store <4 x i32> <i32 7, i32 0, i32 9, i32 3>, ptr %7, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 112
  store <4 x i32> <i32 8, i32 1, i32 4, i32 7>, ptr %8, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 128
  store <4 x i32> <i32 9, i32 2, i32 10, i32 13>, ptr %9, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 144
  store <4 x i32> <i32 10, i32 0, i32 15, i32 2>, ptr %10, align 4, !tbaa !5
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) 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 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass