; LLVM IR from elarity/data-structure-php-clanguage :: clang.single-link-list (main)

; 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.node = type { i32, ptr }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %5 = call noalias ptr @malloc(i64 noundef 8) #5
  store ptr %5, ptr %2, align 8, !tbaa !5
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.node, ptr %6, i32 0, i32 0
  store i32 0, ptr %7, align 8, !tbaa !9
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.node, ptr %8, i32 0, i32 1
  store ptr null, ptr %9, align 8, !tbaa !12
  %10 = call noalias ptr @malloc(i64 noundef 8) #5
  store ptr %10, ptr %3, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 0
  store i32 1, ptr %12, align 8, !tbaa !9
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.node, ptr %13, i32 0, i32 1
  store ptr null, ptr %14, align 8, !tbaa !12
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.node, ptr %16, i32 0, i32 1
  store ptr %15, ptr %17, align 8, !tbaa !12
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = call i32 @create_node(ptr noundef %18, i32 noundef 1, i32 noundef 2)
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = call i32 @create_node(ptr noundef %20, i32 noundef 1, i32 noundef 3)
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = call i32 @create_node(ptr noundef %22, i32 noundef 1, i32 noundef 4)
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = call i32 @create_node(ptr noundef %24, i32 noundef 1, i32 noundef 5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = call i32 @read_node(ptr noundef %26, i32 noundef 1)
  store i32 %27, ptr %4, align 4, !tbaa !13
  %28 = load i32, ptr %4, align 4, !tbaa !13
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %28)
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = call i32 @read_node(ptr noundef %30, i32 noundef 2)
  store i32 %31, ptr %4, align 4, !tbaa !13
  %32 = load i32, ptr %4, align 4, !tbaa !13
  %33 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %32)
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = call i32 @read_node(ptr noundef %34, i32 noundef 3)
  store i32 %35, ptr %4, align 4, !tbaa !13
  %36 = load i32, ptr %4, align 4, !tbaa !13
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %36)
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = call i32 @read_node(ptr noundef %38, i32 noundef 4)
  store i32 %39, ptr %4, align 4, !tbaa !13
  %40 = load i32, ptr %4, align 4, !tbaa !13
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %40)
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = call i32 @read_node(ptr noundef %42, i32 noundef 5)
  store i32 %43, ptr %4, align 4, !tbaa !13
  %44 = load i32, ptr %4, align 4, !tbaa !13
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %44)
  %46 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = call i32 @update_node(ptr noundef %47, i32 noundef 1, i32 noundef 11)
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = call i32 @update_node(ptr noundef %49, i32 noundef 2, i32 noundef 22)
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = call i32 @read_node(ptr noundef %51, i32 noundef 1)
  store i32 %52, ptr %4, align 4, !tbaa !13
  %53 = load i32, ptr %4, align 4, !tbaa !13
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %53)
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = call i32 @read_node(ptr noundef %55, i32 noundef 2)
  store i32 %56, ptr %4, align 4, !tbaa !13
  %57 = load i32, ptr %4, align 4, !tbaa !13
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %57)
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = call i32 @read_node(ptr noundef %59, i32 noundef 3)
  store i32 %60, ptr %4, align 4, !tbaa !13
  %61 = load i32, ptr %4, align 4, !tbaa !13
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %61)
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = call i32 @read_node(ptr noundef %63, i32 noundef 4)
  store i32 %64, ptr %4, align 4, !tbaa !13
  %65 = load i32, ptr %4, align 4, !tbaa !13
  %66 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %65)
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = call i32 @read_node(ptr noundef %67, i32 noundef 5)
  store i32 %68, ptr %4, align 4, !tbaa !13
  %69 = load i32, ptr %4, align 4, !tbaa !13
  %70 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %69)
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = call i32 @delete_node(ptr noundef %72, i32 noundef 2)
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = call i32 @read_node(ptr noundef %74, i32 noundef 1)
  store i32 %75, ptr %4, align 4, !tbaa !13
  %76 = load i32, ptr %4, align 4, !tbaa !13
  %77 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %76)
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = call i32 @read_node(ptr noundef %78, i32 noundef 2)
  store i32 %79, ptr %4, align 4, !tbaa !13
  %80 = load i32, ptr %4, align 4, !tbaa !13
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %80)
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = call i32 @read_node(ptr noundef %82, i32 noundef 3)
  store i32 %83, ptr %4, align 4, !tbaa !13
  %84 = load i32, ptr %4, align 4, !tbaa !13
  %85 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %84)
  %86 = load ptr, ptr %2, align 8, !tbaa !5
  %87 = call i32 @read_node(ptr noundef %86, i32 noundef 4)
  store i32 %87, ptr %4, align 4, !tbaa !13
  %88 = load i32, ptr %4, align 4, !tbaa !13
  %89 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %88)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  ret i32 0
}

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @delete_node(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

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 = { nounwind allocsize(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 #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 }
attributes #5 = { nounwind allocsize(0) }

!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, !11, i64 0}
!10 = !{!"node", !11, i64 0, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = !{!11, !11, i64 0}


; 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 [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #3
  %2 = getelementptr inbounds i8, ptr %1, i64 8
  %3 = tail call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #3
  %4 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr null, ptr %4, align 8, !tbaa !5
  store ptr %3, ptr %2, align 8, !tbaa !5
  %5 = tail call i32 @create_node(ptr noundef nonnull %1, i32 noundef 1, i32 noundef 2)
  %6 = tail call i32 @create_node(ptr noundef nonnull %1, i32 noundef 1, i32 noundef 3)
  %7 = tail call i32 @create_node(ptr noundef nonnull %1, i32 noundef 1, i32 noundef 4)
  %8 = tail call i32 @create_node(ptr noundef nonnull %1, i32 noundef 1, i32 noundef 5)
  %9 = tail call i32 @read_node(ptr noundef nonnull %1, i32 noundef 1)
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %9)
  %11 = tail call i32 @read_node(ptr noundef nonnull %1, i32 noundef 2)
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11)
  %13 = tail call i32 @read_node(ptr noundef nonnull %1, i32 noundef 3)
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13)
  %15 = tail call i32 @read_node(ptr noundef nonnull %1, i32 noundef 4)
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
  %17 = tail call i32 @read_node(ptr noundef nonnull %1, i32 noundef 5)
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17)
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %20 = tail call i32 @update_node(ptr noundef nonnull %1, i32 noundef 1, i32 noundef 11)
  %21 = tail call i32 @update_node(ptr noundef nonnull %1, i32 noundef 2, i32 noundef 22)
  %22 = tail call i32 @read_node(ptr noundef nonnull %1, i32 noundef 1)
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %22)
  %24 = tail call i32 @read_node(ptr noundef nonnull %1, i32 noundef 2)
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %24)
  %26 = tail call i32 @read_node(ptr noundef nonnull %1, i32 noundef 3)
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %26)
  %28 = tail call i32 @read_node(ptr noundef nonnull %1, i32 noundef 4)
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %28)
  %30 = tail call i32 @read_node(ptr noundef nonnull %1, i32 noundef 5)
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %30)
  %32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %33 = tail call i32 @delete_node(ptr noundef nonnull %1, i32 noundef 2)
  %34 = tail call i32 @read_node(ptr noundef nonnull %1, i32 noundef 1)
  %35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %34)
  %36 = tail call i32 @read_node(ptr noundef nonnull %1, i32 noundef 2)
  %37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %36)
  %38 = tail call i32 @read_node(ptr noundef nonnull %1, i32 noundef 3)
  %39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %38)
  %40 = tail call i32 @read_node(ptr noundef nonnull %1, i32 noundef 4)
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %40)
  ret i32 0
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @read_node(ptr 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 i32 @update_node(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @delete_node(ptr noundef, i32 noundef) 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 allocsize(0) }

!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, !10, i64 8}
!6 = !{!"node", !7, i64 0, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}


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