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

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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.CustomNodeTensorInfo = type { ptr, ptr, i64, i32 }

@_ZL17INPUT_TENSOR_NAMEB5cxx11 = external hidden global %"class.std::__cxx11::basic_string", align 8

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local i32 @getInputsInfo(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 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) @_ZL17INPUT_TENSOR_NAMEB5cxx11) #3
  %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, i32 0, i32 0
  store ptr %18, 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, i32 0, i32 2
  store i64 3, ptr %24, align 8, !tbaa !15
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %26, i32 0, i32 2
  %28 = load i64, ptr %27, align 8, !tbaa !15
  %29 = mul i64 %28, 8
  %30 = call noalias ptr @malloc(i64 noundef %29) #2
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.CustomNodeTensorInfo, ptr %32, i32 0, i32 1
  store ptr %30, ptr %33, align 8, !tbaa !16
  %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, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  %38 = getelementptr inbounds i64, ptr %37, i64 0
  store i64 4, ptr %38, align 8, !tbaa !17
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  %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 1
  store i64 1, 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, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !16
  %48 = getelementptr inbounds i64, ptr %47, i64 2
  store i64 10, 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, i32 0, i32 3
  store i32 1, ptr %51, 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) }
attributes #3 = { 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++ 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"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZL17INPUT_TENSOR_NAMEB5cxx11 = external hidden global %"class.std::__cxx11::basic_string", 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 nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @getInputsInfo(ptr nocapture noundef %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
  %7 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) @_ZL17INPUT_TENSOR_NAMEB5cxx11) #3
  %8 = load ptr, ptr %0, align 8, !tbaa !9
  store ptr %7, ptr %8, align 8, !tbaa !11
  %9 = load ptr, ptr %0, align 8, !tbaa !9
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  store i64 3, ptr %10, align 8, !tbaa !15
  %11 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #2
  %12 = getelementptr inbounds i8, ptr %9, i64 8
  store ptr %11, ptr %12, align 8, !tbaa !16
  %13 = load ptr, ptr %0, align 8, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = load ptr, ptr %14, align 8, !tbaa !16
  store i64 4, ptr %15, align 8, !tbaa !17
  %16 = getelementptr inbounds i8, ptr %15, i64 8
  store i64 1, ptr %16, align 8, !tbaa !17
  %17 = getelementptr inbounds i8, ptr %15, i64 16
  store i64 10, ptr %17, align 8, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %13, i64 24
  store i32 1, ptr %18, 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 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) }
attributes #3 = { 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 = !{!"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