; LLVM IR from uber/neuropod :: source/neuropod/bindings/c (c_api)

; 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.NP_RuntimeOptions = type { i8, %"struct.NP_RuntimeOptions::NP_OPEOptions", i32, i8, i8 }
%"struct.NP_RuntimeOptions::NP_OPEOptions" = type { i8, [256 x i8] }
%"struct.neuropod::RuntimeOptions" = type <{ i8, [7 x i8], %"struct.neuropod::RuntimeOptions::OPEOptions", i32, i8, i8, [2 x i8] }>
%"struct.neuropod::RuntimeOptions::OPEOptions" = type { i8, %"class.std::__cxx11::basic_string" }
%"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] }

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @NP_DefaultRuntimeOptions(ptr dead_on_unwind noalias writable sret(%struct.NP_RuntimeOptions) align 4 %0) #1 {
  %2 = alloca %"struct.neuropod::RuntimeOptions", align 8
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr %2) #3
  call void @_ZN8neuropod14RuntimeOptionsC2Ev(ptr noundef nonnull align 8 dereferenceable(54) %2) #3
  %4 = getelementptr inbounds %"struct.neuropod::RuntimeOptions", ptr %2, i32 0, i32 0
  %5 = load i8, ptr %4, align 8, !tbaa !5, !range !16, !noundef !17
  %6 = trunc i8 %5 to i1
  %7 = getelementptr inbounds %struct.NP_RuntimeOptions, ptr %0, i32 0, i32 0
  %8 = zext i1 %6 to i8
  store i8 %8, ptr %7, align 4, !tbaa !18
  %9 = getelementptr inbounds %"struct.neuropod::RuntimeOptions", ptr %2, i32 0, i32 3
  %10 = load i32, ptr %9, align 8, !tbaa !22
  %11 = getelementptr inbounds %struct.NP_RuntimeOptions, ptr %0, i32 0, i32 2
  store i32 %10, ptr %11, align 4, !tbaa !23
  %12 = getelementptr inbounds %"struct.neuropod::RuntimeOptions", ptr %2, i32 0, i32 4
  %13 = load i8, ptr %12, align 4, !tbaa !24, !range !16, !noundef !17
  %14 = trunc i8 %13 to i1
  %15 = getelementptr inbounds %struct.NP_RuntimeOptions, ptr %0, i32 0, i32 3
  %16 = zext i1 %14 to i8
  store i8 %16, ptr %15, align 4, !tbaa !25
  %17 = getelementptr inbounds %"struct.neuropod::RuntimeOptions", ptr %2, i32 0, i32 5
  %18 = load i8, ptr %17, align 1, !tbaa !26, !range !16, !noundef !17
  %19 = trunc i8 %18 to i1
  %20 = getelementptr inbounds %struct.NP_RuntimeOptions, ptr %0, i32 0, i32 4
  %21 = zext i1 %19 to i8
  store i8 %21, ptr %20, align 1, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %22 = getelementptr inbounds %struct.NP_RuntimeOptions, ptr %0, i32 0, i32 1
  store ptr %22, ptr %3, align 8, !tbaa !28
  %23 = getelementptr inbounds %"struct.neuropod::RuntimeOptions", ptr %2, i32 0, i32 2
  %24 = getelementptr inbounds %"struct.neuropod::RuntimeOptions::OPEOptions", ptr %23, i32 0, i32 0
  %25 = load i8, ptr %24, align 8, !tbaa !29, !range !16, !noundef !17
  %26 = trunc i8 %25 to i1
  %27 = load ptr, ptr %3, align 8, !tbaa !28
  %28 = getelementptr inbounds %"struct.NP_RuntimeOptions::NP_OPEOptions", ptr %27, i32 0, i32 0
  %29 = zext i1 %26 to i8
  store i8 %29, ptr %28, align 1, !tbaa !30
  %30 = load ptr, ptr %3, align 8, !tbaa !28
  %31 = getelementptr inbounds %"struct.NP_RuntimeOptions::NP_OPEOptions", ptr %30, i32 0, i32 1
  %32 = getelementptr inbounds [256 x i8], ptr %31, i64 0, i64 0
  store i8 0, ptr %32, align 1, !tbaa !31
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  call void @_ZN8neuropod14RuntimeOptionsD2Ev(ptr noundef nonnull align 8 dereferenceable(54) %2) #3
  call void @llvm.lifetime.end.p0(i64 56, ptr %2) #3
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8neuropod14RuntimeOptionsC2Ev(ptr noundef nonnull align 8 dereferenceable(54)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8neuropod14RuntimeOptionsD2Ev(ptr noundef nonnull align 8 dereferenceable(54)) unnamed_addr #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 #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, !7, i64 0}
!6 = !{!"_ZTSN8neuropod14RuntimeOptionsE", !7, i64 0, !10, i64 8, !15, i64 48, !7, i64 52, !7, i64 53}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN8neuropod14RuntimeOptions10OPEOptionsE", !7, i64 0, !11, i64 8}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !14, i64 8, !8, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !13, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"long", !8, i64 0}
!15 = !{!"int", !8, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!19, !7, i64 0}
!19 = !{!"_ZTS17NP_RuntimeOptions", !7, i64 0, !20, i64 1, !21, i64 260, !7, i64 264, !7, i64 265}
!20 = !{!"_ZTSN17NP_RuntimeOptions13NP_OPEOptionsE", !7, i64 0, !8, i64 1}
!21 = !{!"_ZTSN17NP_RuntimeOptions9NP_DeviceE", !8, i64 0}
!22 = !{!6, !15, i64 48}
!23 = !{!19, !21, i64 260}
!24 = !{!6, !7, i64 52}
!25 = !{!19, !7, i64 264}
!26 = !{!6, !7, i64 53}
!27 = !{!19, !7, i64 265}
!28 = !{!13, !13, i64 0}
!29 = !{!6, !7, i64 8}
!30 = !{!20, !7, i64 0}
!31 = !{!8, !8, 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"

%struct.NP_RuntimeOptions = type { i8, %"struct.NP_RuntimeOptions::NP_OPEOptions", i32, i8, i8 }
%"struct.NP_RuntimeOptions::NP_OPEOptions" = type { i8, [256 x i8] }
%"struct.neuropod::RuntimeOptions" = type <{ i8, [7 x i8], %"struct.neuropod::RuntimeOptions::OPEOptions", i32, i8, i8, [2 x i8] }>
%"struct.neuropod::RuntimeOptions::OPEOptions" = type { i8, %"class.std::__cxx11::basic_string" }
%"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] }

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @NP_DefaultRuntimeOptions(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.NP_RuntimeOptions) align 4 %0) local_unnamed_addr #1 {
  %2 = alloca %"struct.neuropod::RuntimeOptions", align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %2) #3
  call void @_ZN8neuropod14RuntimeOptionsC2Ev(ptr noundef nonnull align 8 dereferenceable(54) %2) #3
  %3 = load i8, ptr %2, align 8, !tbaa !5, !range !16, !noundef !17
  store i8 %3, ptr %0, align 4, !tbaa !18
  %4 = getelementptr inbounds i8, ptr %2, i64 48
  %5 = load i32, ptr %4, align 8, !tbaa !22
  %6 = getelementptr inbounds i8, ptr %0, i64 260
  store i32 %5, ptr %6, align 4, !tbaa !23
  %7 = getelementptr inbounds i8, ptr %2, i64 52
  %8 = load i8, ptr %7, align 4, !tbaa !24, !range !16, !noundef !17
  %9 = getelementptr inbounds i8, ptr %0, i64 264
  store i8 %8, ptr %9, align 4, !tbaa !25
  %10 = getelementptr inbounds i8, ptr %2, i64 53
  %11 = load i8, ptr %10, align 1, !tbaa !26, !range !16, !noundef !17
  %12 = getelementptr inbounds i8, ptr %0, i64 265
  store i8 %11, ptr %12, align 1, !tbaa !27
  %13 = getelementptr inbounds i8, ptr %0, i64 1
  %14 = getelementptr inbounds i8, ptr %2, i64 8
  %15 = load i8, ptr %14, align 8, !tbaa !28, !range !16, !noundef !17
  store i8 %15, ptr %13, align 1, !tbaa !29
  %16 = getelementptr inbounds i8, ptr %0, i64 2
  store i8 0, ptr %16, align 2, !tbaa !30
  call void @_ZN8neuropod14RuntimeOptionsD2Ev(ptr noundef nonnull align 8 dereferenceable(54) %2) #3
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %2) #3
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8neuropod14RuntimeOptionsC2Ev(ptr noundef nonnull align 8 dereferenceable(54)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8neuropod14RuntimeOptionsD2Ev(ptr noundef nonnull align 8 dereferenceable(54)) unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 #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, !7, i64 0}
!6 = !{!"_ZTSN8neuropod14RuntimeOptionsE", !7, i64 0, !10, i64 8, !15, i64 48, !7, i64 52, !7, i64 53}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN8neuropod14RuntimeOptions10OPEOptionsE", !7, i64 0, !11, i64 8}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !14, i64 8, !8, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !13, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"long", !8, i64 0}
!15 = !{!"int", !8, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!19, !7, i64 0}
!19 = !{!"_ZTS17NP_RuntimeOptions", !7, i64 0, !20, i64 1, !21, i64 260, !7, i64 264, !7, i64 265}
!20 = !{!"_ZTSN17NP_RuntimeOptions13NP_OPEOptionsE", !7, i64 0, !8, i64 1}
!21 = !{!"_ZTSN17NP_RuntimeOptions9NP_DeviceE", !8, i64 0}
!22 = !{!6, !15, i64 48}
!23 = !{!19, !21, i64 260}
!24 = !{!6, !7, i64 52}
!25 = !{!19, !7, i64 264}
!26 = !{!6, !7, i64 53}
!27 = !{!19, !7, i64 265}
!28 = !{!6, !7, i64 8}
!29 = !{!20, !7, i64 0}
!30 = !{!8, !8, i64 0}


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