; LLVM IR from xxks-kkk/algo :: linkedList/integerList (integerListTestMain)

; 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.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@__const.test_add.digits0 = external hidden unnamed_addr constant [3 x i32], align 4
@__const.test_add.digits1 = external hidden unnamed_addr constant [3 x i32], align 4
@__const.test_add.digits2 = external hidden unnamed_addr constant [2 x i32], align 4
@__const.test_add.digits3 = external hidden unnamed_addr constant [3 x i32], align 4
@__const.test_add.digits4 = external hidden unnamed_addr constant [5 x i32], align 16

declare i32 @printf(ptr 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare ptr @initializeInteger(ptr noundef, i32 noundef) #0

declare void @printIntegerList(ptr noundef) #0

declare void @deleteAll(ptr 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
define dso_local void @test_add() #3 {
  %1 = alloca [3 x i32], align 4
  %2 = alloca [3 x i32], align 4
  %3 = alloca [2 x i32], align 4
  %4 = alloca [3 x i32], align 4
  %5 = alloca [5 x i32], align 16
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  call void @llvm.lifetime.start.p0(i64 12, ptr %1) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %1, ptr align 4 @__const.test_add.digits0, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %2) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %2, ptr align 4 @__const.test_add.digits1, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 4 @__const.test_add.digits2, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %4) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 4 @__const.test_add.digits3, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 20, ptr %5) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %5, ptr align 16 @__const.test_add.digits4, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %16 = getelementptr inbounds [3 x i32], ptr %1, i64 0, i64 0
  %17 = call ptr @initializeInteger(ptr noundef %16, i32 noundef 3)
  store ptr %17, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %18 = getelementptr inbounds [3 x i32], ptr %2, i64 0, i64 0
  %19 = call ptr @initializeInteger(ptr noundef %18, i32 noundef 3)
  store ptr %19, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %20 = getelementptr inbounds [2 x i32], ptr %3, i64 0, i64 0
  %21 = call ptr @initializeInteger(ptr noundef %20, i32 noundef 2)
  store ptr %21, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %22 = getelementptr inbounds [3 x i32], ptr %4, i64 0, i64 0
  %23 = call ptr @initializeInteger(ptr noundef %22, i32 noundef 3)
  store ptr %23, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %24 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 0
  %25 = call ptr @initializeInteger(ptr noundef %24, i32 noundef 5)
  store ptr %25, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = call ptr @add(ptr noundef %26, ptr noundef %27)
  store ptr %28, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = call ptr @add(ptr noundef %29, ptr noundef %30)
  store ptr %31, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = call ptr @add(ptr noundef %32, ptr noundef %33)
  store ptr %34, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = call ptr @add(ptr noundef %35, ptr noundef %36)
  store ptr %37, ptr %14, align 8, !tbaa !5
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  call void @printIntegerList(ptr noundef %38)
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  call void @printIntegerList(ptr noundef %40)
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %42 = load ptr, ptr %13, align 8, !tbaa !5
  call void @printIntegerList(ptr noundef %42)
  %43 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %44 = load ptr, ptr %14, align 8, !tbaa !5
  call void @printIntegerList(ptr noundef %44)
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  call void @deleteAll(ptr noundef %46)
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  call void @deleteAll(ptr noundef %47)
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  call void @deleteAll(ptr noundef %48)
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  call void @deleteAll(ptr noundef %49)
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  call void @deleteAll(ptr noundef %50)
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  call void @deleteAll(ptr noundef %51)
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  call void @deleteAll(ptr noundef %52)
  %53 = load ptr, ptr %13, align 8, !tbaa !5
  call void @deleteAll(ptr noundef %53)
  %54 = load ptr, ptr %14, align 8, !tbaa !5
  call void @deleteAll(ptr noundef %54)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %1) #4
  ret void
}

declare ptr @add(ptr noundef, ptr noundef) #0

attributes #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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"}


; 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.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@__const.test_add.digits0 = external hidden unnamed_addr constant [3 x i32], align 4
@__const.test_add.digits1 = external hidden unnamed_addr constant [3 x i32], align 4
@__const.test_add.digits2 = external hidden unnamed_addr constant [2 x i32], align 4
@__const.test_add.digits3 = external hidden unnamed_addr constant [3 x i32], align 4
@__const.test_add.digits4 = external hidden unnamed_addr constant [5 x i32], align 16

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare ptr @initializeInteger(ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @printIntegerList(ptr noundef) local_unnamed_addr #3

declare void @deleteAll(ptr noundef) local_unnamed_addr #3

; 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
define dso_local void @test_add() local_unnamed_addr #4 {
  %1 = alloca [3 x i32], align 4
  %2 = alloca [3 x i32], align 4
  %3 = alloca [2 x i32], align 8
  %4 = alloca [3 x i32], align 4
  %5 = alloca [5 x i32], align 16
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %1) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) @__const.test_add.digits0, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) @__const.test_add.digits1, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %7 = load i64, ptr @__const.test_add.digits2, align 4
  store i64 %7, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) @__const.test_add.digits3, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %5) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %5, ptr noundef nonnull align 16 dereferenceable(20) @__const.test_add.digits4, i64 20, i1 false)
  %8 = call ptr @initializeInteger(ptr noundef nonnull %1, i32 noundef 3) #5
  %9 = call ptr @initializeInteger(ptr noundef nonnull %2, i32 noundef 3) #5
  %10 = call ptr @initializeInteger(ptr noundef nonnull %3, i32 noundef 2) #5
  %11 = call ptr @initializeInteger(ptr noundef nonnull %4, i32 noundef 3) #5
  %12 = call ptr @initializeInteger(ptr noundef nonnull %5, i32 noundef 5) #5
  %13 = call ptr @add(ptr noundef %8, ptr noundef %9) #5
  %14 = call ptr @add(ptr noundef %8, ptr noundef %10) #5
  %15 = call ptr @add(ptr noundef %8, ptr noundef %11) #5
  %16 = call ptr @add(ptr noundef %8, ptr noundef %12) #5
  call void @printIntegerList(ptr noundef %13) #5
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @printIntegerList(ptr noundef %14) #5
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @printIntegerList(ptr noundef %15) #5
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @printIntegerList(ptr noundef %16) #5
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @deleteAll(ptr noundef %8) #5
  call void @deleteAll(ptr noundef %9) #5
  call void @deleteAll(ptr noundef %10) #5
  call void @deleteAll(ptr noundef %11) #5
  call void @deleteAll(ptr noundef %12) #5
  call void @deleteAll(ptr noundef %13) #5
  call void @deleteAll(ptr noundef %14) #5
  call void @deleteAll(ptr noundef %15) #5
  call void @deleteAll(ptr noundef %16) #5
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %1) #5
  ret void
}

declare ptr @add(ptr noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 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 #5 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,TailCallElimPass