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

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

@.str.10 = external hidden unnamed_addr constant [28 x i8], align 1

; 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 1, 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 %6, align 8, !tbaa !5
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %19, i64 0
  %21 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %20, i32 0, i32 0
  store ptr @.str.10, ptr %21, align 8, !tbaa !11
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %23, i64 0
  %25 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %24, i32 0, i32 2
  store i64 3, ptr %25, align 8, !tbaa !15
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %27, i64 0
  %29 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %28, i32 0, i32 2
  %30 = load i64, ptr %29, align 8, !tbaa !15
  %31 = mul i64 %30, 8
  %32 = call noalias ptr @malloc(i64 noundef %31) #2
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %34, i64 0
  %36 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %35, i32 0, i32 1
  store ptr %32, ptr %36, align 8, !tbaa !16
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %38, i64 0
  %40 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %39, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !16
  %42 = getelementptr inbounds i64, ptr %41, i64 0
  store i64 0, ptr %42, align 8, !tbaa !17
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %44, i64 0
  %46 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %45, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !16
  %48 = getelementptr inbounds i64, ptr %47, i64 1
  store i64 1, ptr %48, align 8, !tbaa !17
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %50, i64 0
  %52 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %51, i32 0, i32 1
  %53 = load ptr, ptr %52, align 8, !tbaa !16
  %54 = getelementptr inbounds i64, ptr %53, i64 2
  store i64 10, ptr %54, align 8, !tbaa !17
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %56, i64 0
  %58 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %57, i32 0, i32 3
  store i32 1, ptr %58, 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"

@.str.10 = external hidden unnamed_addr constant [28 x i8], align 1

; 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(write, inaccessiblemem: readwrite) 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 1, ptr %1, align 4, !tbaa !5
  %6 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #2
  store ptr %6, ptr %0, align 8, !tbaa !9
  store ptr @.str.10, ptr %6, align 8, !tbaa !11
  %7 = getelementptr inbounds i8, ptr %6, i64 16
  store i64 3, ptr %7, align 8, !tbaa !15
  %8 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #2
  %9 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %8, ptr %9, align 8, !tbaa !16
  store i64 0, ptr %8, align 8, !tbaa !17
  %10 = getelementptr inbounds i8, ptr %8, i64 8
  store i64 1, ptr %10, align 8, !tbaa !17
  %11 = getelementptr inbounds i8, ptr %8, i64 16
  store i64 10, ptr %11, align 8, !tbaa !17
  %12 = getelementptr inbounds i8, ptr %6, i64 24
  store i32 1, ptr %12, 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(write, inaccessiblemem: readwrite) 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