; LLVM IR from openvinotoolkit/model_server :: src/test/custom_nodes (node_perform_different_operations)

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

@_ZL18OUTPUT_TENSOR_NAME = external hidden global ptr, align 8
@_ZL19OUTPUT_FACTORS_NAME = external hidden global ptr, align 8

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local i32 @getOutputsInfo(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) #1 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  %11 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 2, ptr %11, align 4, !tbaa !9
  %12 = load ptr, ptr %7, align 8, !tbaa !5
  %13 = load i32, ptr %12, align 4, !tbaa !9
  %14 = sext i32 %13 to i64
  %15 = mul i64 %14, 32
  %16 = call noalias ptr @malloc(i64 noundef %15) #2
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %16, ptr %17, align 8, !tbaa !5
  %18 = load ptr, ptr @_ZL18OUTPUT_TENSOR_NAME, align 8, !tbaa !5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %20, i64 0
  %22 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %21, i32 0, i32 0
  store ptr %18, ptr %22, align 8, !tbaa !11
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %24, i64 0
  %26 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %25, i32 0, i32 2
  store i64 3, ptr %26, align 8, !tbaa !15
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %28, i64 0
  %30 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %29, i32 0, i32 2
  %31 = load i64, ptr %30, align 8, !tbaa !15
  %32 = mul i64 %31, 8
  %33 = call noalias ptr @malloc(i64 noundef %32) #2
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %35, i64 0
  %37 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %36, i32 0, i32 1
  store ptr %33, ptr %37, align 8, !tbaa !16
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %39, i64 0
  %41 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %40, i32 0, i32 1
  %42 = load ptr, ptr %41, align 8, !tbaa !16
  %43 = getelementptr inbounds i64, ptr %42, i64 0
  store i64 4, ptr %43, align 8, !tbaa !17
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %45, i64 0
  %47 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %46, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8, !tbaa !16
  %49 = getelementptr inbounds i64, ptr %48, i64 1
  store i64 1, ptr %49, align 8, !tbaa !17
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %51, i64 0
  %53 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  %55 = getelementptr inbounds i64, ptr %54, i64 2
  store i64 10, ptr %55, align 8, !tbaa !17
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %57, i64 0
  %59 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %58, i32 0, i32 3
  store i32 1, ptr %59, align 8, !tbaa !18
  %60 = load ptr, ptr @_ZL19OUTPUT_FACTORS_NAME, align 8, !tbaa !5
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %62, i64 1
  %64 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %63, i32 0, i32 0
  store ptr %60, ptr %64, align 8, !tbaa !11
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %66, i64 1
  %68 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %67, i32 0, i32 2
  store i64 3, ptr %68, align 8, !tbaa !15
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %70, i64 1
  %72 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %71, i32 0, i32 2
  %73 = load i64, ptr %72, align 8, !tbaa !15
  %74 = mul i64 %73, 8
  %75 = call noalias ptr @malloc(i64 noundef %74) #2
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %77, i64 1
  %79 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %78, i32 0, i32 1
  store ptr %75, ptr %79, align 8, !tbaa !16
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %81, i64 1
  %83 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %82, i32 0, i32 1
  %84 = load ptr, ptr %83, align 8, !tbaa !16
  %85 = getelementptr inbounds i64, ptr %84, i64 0
  store i64 4, ptr %85, align 8, !tbaa !17
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %87, i64 1
  %89 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %88, i32 0, i32 1
  %90 = load ptr, ptr %89, align 8, !tbaa !16
  %91 = getelementptr inbounds i64, ptr %90, i64 1
  store i64 1, ptr %91, align 8, !tbaa !17
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = load ptr, ptr %92, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %93, i64 1
  %95 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %94, i32 0, i32 1
  %96 = load ptr, ptr %95, align 8, !tbaa !16
  %97 = getelementptr inbounds i64, ptr %96, i64 2
  store i64 4, ptr %97, align 8, !tbaa !17
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %99, i64 1
  %101 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %100, i32 0, i32 3
  store i32 1, ptr %101, align 8, !tbaa !18
  ret i32 0
}

attributes #0 = { 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 #1 = { mustprogress 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 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS20CustomNodeTensorInfo", !6, i64 0, !6, i64 8, !13, i64 16, !14, i64 24}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTS25CustomNodeTensorPrecision", !7, i64 0}
!15 = !{!12, !13, i64 16}
!16 = !{!12, !6, i64 8}
!17 = !{!13, !13, i64 0}
!18 = !{!12, !14, i64 24}


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

@_ZL18OUTPUT_TENSOR_NAME = external hidden local_unnamed_addr global ptr, align 8
@_ZL19OUTPUT_FACTORS_NAME = external hidden local_unnamed_addr global ptr, align 8

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(readwrite, argmem: write) uwtable
define dso_local noundef i32 @getOutputsInfo(ptr nocapture noundef writeonly %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef readnone %2, i32 noundef %3, ptr nocapture noundef readnone %4) local_unnamed_addr #1 {
  store i32 2, ptr %1, align 4, !tbaa !5
  %6 = tail call noalias dereferenceable_or_null(64) ptr @malloc(i64 noundef 64) #2
  store ptr %6, ptr %0, align 8, !tbaa !9
  %7 = load ptr, ptr @_ZL18OUTPUT_TENSOR_NAME, align 8, !tbaa !9
  store ptr %7, ptr %6, align 8, !tbaa !11
  %8 = getelementptr inbounds i8, ptr %6, i64 16
  store i64 3, ptr %8, align 8, !tbaa !15
  %9 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #2
  %10 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %9, ptr %10, align 8, !tbaa !16
  store i64 4, ptr %9, align 8, !tbaa !17
  %11 = getelementptr inbounds i8, ptr %9, i64 8
  store i64 1, ptr %11, align 8, !tbaa !17
  %12 = getelementptr inbounds i8, ptr %9, i64 16
  store i64 10, ptr %12, align 8, !tbaa !17
  %13 = getelementptr inbounds i8, ptr %6, i64 24
  store i32 1, ptr %13, align 8, !tbaa !18
  %14 = load ptr, ptr @_ZL19OUTPUT_FACTORS_NAME, align 8, !tbaa !9
  %15 = getelementptr inbounds i8, ptr %6, i64 32
  store ptr %14, ptr %15, align 8, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %6, i64 48
  store i64 3, ptr %16, align 8, !tbaa !15
  %17 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #2
  %18 = getelementptr inbounds i8, ptr %6, i64 40
  store ptr %17, ptr %18, align 8, !tbaa !16
  store i64 4, ptr %17, align 8, !tbaa !17
  %19 = getelementptr inbounds i8, ptr %17, i64 8
  store i64 1, ptr %19, align 8, !tbaa !17
  %20 = getelementptr inbounds i8, ptr %17, i64 16
  store i64 4, ptr %20, align 8, !tbaa !17
  %21 = getelementptr inbounds i8, ptr %6, i64 56
  store i32 1, ptr %21, align 8, !tbaa !18
  ret i32 0
}

attributes #0 = { 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 #1 = { mustprogress nofree nounwind willreturn memory(readwrite, 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" }
attributes #2 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS20CustomNodeTensorInfo", !10, i64 0, !10, i64 8, !13, i64 16, !14, i64 24}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTS25CustomNodeTensorPrecision", !7, i64 0}
!15 = !{!12, !13, i64 16}
!16 = !{!12, !10, i64 8}
!17 = !{!13, !13, i64 0}
!18 = !{!12, !14, i64 24}


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