; LLVM IR from tensorflow/tensorflow :: tensorflow/lite/core/c (operator)

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

; Function Attrs: mustprogress uwtable
define dso_local ptr @TfLiteOperatorCreate(i32 noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !11
  store ptr %3, ptr %8, align 8, !tbaa !9
  %9 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 120) #2
  %10 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 0
  %11 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %11, ptr %10, align 16, !tbaa !13
  %12 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 1
  %13 = load i32, ptr %7, align 4, !tbaa !11
  store i32 %13, ptr %12, align 8, !tbaa !16
  %14 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 2
  store ptr null, ptr %14, align 16, !tbaa !17
  %15 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 3
  store ptr null, ptr %15, align 8, !tbaa !18
  %16 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 4
  store ptr null, ptr %16, align 16, !tbaa !19
  %17 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 5
  store ptr null, ptr %17, align 8, !tbaa !20
  %18 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 6
  store ptr null, ptr %18, align 16, !tbaa !21
  %19 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 7
  %20 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %20, ptr %19, align 8, !tbaa !22
  %21 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 8
  store i32 -1, ptr %21, align 4, !tbaa !23
  %22 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 9
  store i64 0, ptr %22, align 16, !tbaa !24
  %23 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 10
  %24 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %24, ptr %23, align 8, !tbaa !25
  %25 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 11
  store ptr null, ptr %25, align 16, !tbaa !26
  %26 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 12
  store ptr null, ptr %26, align 8, !tbaa !27
  %27 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 13
  store ptr null, ptr %27, align 16, !tbaa !28
  %28 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 14
  store ptr null, ptr %28, align 8, !tbaa !29
  %29 = getelementptr inbounds %struct.TfLiteOperator, ptr %9, i32 0, i32 15
  store ptr null, ptr %29, align 16, !tbaa !30
  ret ptr %9
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #1

attributes #0 = { mustprogress 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 = { nobuiltin 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 #2 = { builtin 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 = !{!"_ZTS21TfLiteBuiltinOperator", !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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTS14TfLiteOperator", !10, i64 0, !12, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !12, i64 56, !12, i64 60, !15, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112}
!15 = !{!"long", !7, i64 0}
!16 = !{!14, !12, i64 8}
!17 = !{!14, !10, i64 16}
!18 = !{!14, !10, i64 24}
!19 = !{!14, !10, i64 32}
!20 = !{!14, !10, i64 40}
!21 = !{!14, !10, i64 48}
!22 = !{!14, !12, i64 56}
!23 = !{!14, !12, i64 60}
!24 = !{!14, !15, i64 64}
!25 = !{!14, !10, i64 72}
!26 = !{!14, !10, i64 80}
!27 = !{!14, !10, i64 88}
!28 = !{!14, !10, i64 96}
!29 = !{!14, !10, i64 104}
!30 = !{!14, !10, i64 112}


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

; Function Attrs: mustprogress uwtable
define dso_local noalias noundef nonnull ptr @TfLiteOperatorCreate(i32 noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = tail call noalias noundef nonnull dereferenceable(120) ptr @_Znwm(i64 noundef 120) #3
  store ptr %1, ptr %5, align 16, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %5, i64 8
  store i32 %2, ptr %6, align 8, !tbaa !12
  %7 = getelementptr inbounds i8, ptr %5, i64 16
  %8 = getelementptr inbounds i8, ptr %5, i64 56
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %7, i8 0, i64 40, i1 false)
  store i32 %0, ptr %8, align 8, !tbaa !13
  %9 = getelementptr inbounds i8, ptr %5, i64 60
  store i32 -1, ptr %9, align 4, !tbaa !14
  %10 = getelementptr inbounds i8, ptr %5, i64 64
  store i64 0, ptr %10, align 16, !tbaa !15
  %11 = getelementptr inbounds i8, ptr %5, i64 72
  store ptr %3, ptr %11, align 8, !tbaa !16
  %12 = getelementptr inbounds i8, ptr %5, i64 80
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %12, i8 0, i64 40, i1 false)
  ret ptr %5
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

attributes #0 = { mustprogress 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 = { nobuiltin 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { builtin 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, !7, i64 0}
!6 = !{!"_ZTS14TfLiteOperator", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !10, i64 56, !10, i64 60, !11, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!6, !10, i64 8}
!13 = !{!6, !10, i64 56}
!14 = !{!6, !10, i64 60}
!15 = !{!6, !11, i64 64}
!16 = !{!6, !7, i64 72}


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