; LLVM IR from MRPT/mrpt :: 3rdparty/xspublic/xstypes (xsversion)

; 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.XsSimpleVersion = type { i8, i8, i8 }
%struct.XsVersion = type { i32, i32, i32, i32, i32, %struct.XsString }
%struct.XsString = type { ptr, i64, i64, i64, ptr }

declare void @XsString_resize(ptr noundef, i64 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @XsVersion_fromSimpleVersion(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.XsSimpleVersion, ptr %5, i32 0, i32 0
  %7 = load i8, ptr %6, align 1, !tbaa !9
  %8 = zext i8 %7 to i32
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.XsVersion, ptr %9, i32 0, i32 0
  store i32 %8, ptr %10, align 8, !tbaa !11
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.XsSimpleVersion, ptr %11, i32 0, i32 1
  %13 = load i8, ptr %12, align 1, !tbaa !16
  %14 = zext i8 %13 to i32
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.XsVersion, ptr %15, i32 0, i32 1
  store i32 %14, ptr %16, align 4, !tbaa !17
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.XsSimpleVersion, ptr %17, i32 0, i32 2
  %19 = load i8, ptr %18, align 1, !tbaa !18
  %20 = zext i8 %19 to i32
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.XsVersion, ptr %21, i32 0, i32 2
  store i32 %20, ptr %22, align 8, !tbaa !19
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.XsVersion, ptr %23, i32 0, i32 3
  store i32 0, ptr %24, align 4, !tbaa !20
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.XsVersion, ptr %25, i32 0, i32 4
  store i32 0, ptr %26, align 8, !tbaa !21
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.XsVersion, ptr %27, i32 0, i32 5
  call void @XsString_resize(ptr noundef %28, i64 noundef 0)
  ret void
}

attributes #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 = { 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" }

!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/C++ TBAA"}
!9 = !{!10, !7, i64 0}
!10 = !{!"XsSimpleVersion", !7, i64 0, !7, i64 1, !7, i64 2}
!11 = !{!12, !13, i64 0}
!12 = !{!"XsVersion", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !14, i64 24}
!13 = !{!"int", !7, i64 0}
!14 = !{!"XsString", !6, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !6, i64 32}
!15 = !{!"long", !7, i64 0}
!16 = !{!10, !7, i64 1}
!17 = !{!12, !13, i64 4}
!18 = !{!10, !7, i64 2}
!19 = !{!12, !13, i64 8}
!20 = !{!12, !13, i64 12}
!21 = !{!12, !13, i64 16}


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

declare void @XsString_resize(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @XsVersion_fromSimpleVersion(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #1 {
  %3 = load <2 x i8>, ptr %1, align 1, !tbaa !5
  %4 = zext <2 x i8> %3 to <2 x i32>
  store <2 x i32> %4, ptr %0, align 8, !tbaa !8
  %5 = getelementptr inbounds i8, ptr %1, i64 2
  %6 = load i8, ptr %5, align 1, !tbaa !10
  %7 = zext i8 %6 to i32
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %7, ptr %8, align 8, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 0, ptr %9, align 4, !tbaa !17
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 0, ptr %10, align 8, !tbaa !18
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  tail call void @XsString_resize(ptr noundef nonnull %11, i64 noundef 0) #2
  ret void
}

attributes #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 = { 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 }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !6, i64 2}
!11 = !{!"XsSimpleVersion", !6, i64 0, !6, i64 1, !6, i64 2}
!12 = !{!13, !9, i64 8}
!13 = !{!"XsVersion", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !9, i64 16, !14, i64 24}
!14 = !{!"XsString", !15, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !15, i64 32}
!15 = !{!"any pointer", !6, i64 0}
!16 = !{!"long", !6, i64 0}
!17 = !{!13, !9, i64 12}
!18 = !{!13, !9, i64 16}


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