; LLVM IR from HiroIshida/tinyfk :: urdf_parser/src/pose.ll (ZN19urdf_export_helpers10values2strB5cxx11EN4urdf5ColorE)

; 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] }
%"class.urdf::Color" = type { float, float, float, float }

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN19urdf_export_helpers10values2strB5cxx11EjPKdPFddE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef, ptr noundef, ptr noundef) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN19urdf_export_helpers10values2strB5cxx11EN4urdf5ColorE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, <2 x float> %1, <2 x float> %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca %"class.urdf::Color", align 4
  %6 = alloca [4 x double], align 16
  store ptr %0, ptr %4, align 8
  %7 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 0
  store <2 x float> %1, ptr %7, align 4
  %8 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 1
  store <2 x float> %2, ptr %8, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #3
  %9 = getelementptr inbounds %"class.urdf::Color", ptr %5, i32 0, i32 0
  %10 = load float, ptr %9, align 4, !tbaa !5
  %11 = fpext float %10 to double
  %12 = getelementptr inbounds [4 x double], ptr %6, i64 0, i64 0
  store double %11, ptr %12, align 16, !tbaa !10
  %13 = getelementptr inbounds %"class.urdf::Color", ptr %5, i32 0, i32 1
  %14 = load float, ptr %13, align 4, !tbaa !12
  %15 = fpext float %14 to double
  %16 = getelementptr inbounds [4 x double], ptr %6, i64 0, i64 1
  store double %15, ptr %16, align 8, !tbaa !10
  %17 = getelementptr inbounds %"class.urdf::Color", ptr %5, i32 0, i32 2
  %18 = load float, ptr %17, align 4, !tbaa !13
  %19 = fpext float %18 to double
  %20 = getelementptr inbounds [4 x double], ptr %6, i64 0, i64 2
  store double %19, ptr %20, align 16, !tbaa !10
  %21 = getelementptr inbounds %"class.urdf::Color", ptr %5, i32 0, i32 3
  %22 = load float, ptr %21, align 4, !tbaa !14
  %23 = fpext float %22 to double
  %24 = getelementptr inbounds [4 x double], ptr %6, i64 0, i64 3
  store double %23, ptr %24, align 8, !tbaa !10
  %25 = getelementptr inbounds [4 x double], ptr %6, i64 0, i64 0
  call void @_ZN19urdf_export_helpers10values2strB5cxx11EjPKdPFddE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %0, i32 noundef 4, ptr noundef %25, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #3
  ret void
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = !{!"_ZTSN4urdf5ColorE", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!6, !7, i64 4}
!13 = !{!6, !7, i64 8}
!14 = !{!6, !7, i64 12}


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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN19urdf_export_helpers10values2strB5cxx11EjPKdPFddE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN19urdf_export_helpers10values2strB5cxx11EN4urdf5ColorE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, <2 x float> %1, <2 x float> %2) local_unnamed_addr #2 {
  %4 = alloca [4 x double], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #3
  %5 = fpext <2 x float> %1 to <2 x double>
  store <2 x double> %5, ptr %4, align 16, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %4, i64 16
  %7 = fpext <2 x float> %2 to <2 x double>
  store <2 x double> %7, ptr %6, align 16, !tbaa !5
  call void @_ZN19urdf_export_helpers10values2strB5cxx11EjPKdPFddE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %0, i32 noundef 4, ptr noundef nonnull %4, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #3
  ret void
}

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="64" "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, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass