; LLVM IR from chrxh/alien :: source/EngineInterface (SpaceCalculator)

; 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.RealVector2D = type { float, float }
%"class.std::initializer_list" = type { ptr, i64 }
%class.SpaceCalculator = type { %struct.IntVector2D, %struct.RealVector2D }
%struct.IntVector2D = type { i32, i32 }

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

declare void @_ZN12RealVector2DC1ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(8), ptr, i64) unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK15SpaceCalculator19correctDisplacementER12RealVector2D(ptr noundef nonnull align 4 dereferenceable(16) %0, ptr noundef nonnull align 4 dereferenceable(8) %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.RealVector2D, align 4
  %6 = alloca %"class.std::initializer_list", align 8
  %7 = alloca [2 x float], align 4
  %8 = alloca %struct.RealVector2D, align 4
  %9 = alloca %"class.std::initializer_list", align 8
  %10 = alloca [2 x float], align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.RealVector2D, ptr %12, i32 0, i32 0
  %14 = load float, ptr %13, align 4, !tbaa !9
  %15 = call noundef float @_ZSt5floorf(float noundef %14)
  store float %15, ptr %7, align 4, !tbaa !12
  %16 = getelementptr inbounds float, ptr %7, i64 1
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.RealVector2D, ptr %17, i32 0, i32 1
  %19 = load float, ptr %18, align 4, !tbaa !13
  %20 = call noundef float @_ZSt5floorf(float noundef %19)
  store float %20, ptr %16, align 4, !tbaa !12
  %21 = getelementptr inbounds %"class.std::initializer_list", ptr %6, i32 0, i32 0
  store ptr %7, ptr %21, align 8, !tbaa !14
  %22 = getelementptr inbounds %"class.std::initializer_list", ptr %6, i32 0, i32 1
  store i64 2, ptr %22, align 8, !tbaa !17
  %23 = getelementptr inbounds { ptr, i64 }, ptr %6, i32 0, i32 0
  %24 = load ptr, ptr %23, align 8
  %25 = getelementptr inbounds { ptr, i64 }, ptr %6, i32 0, i32 1
  %26 = load i64, ptr %25, align 8
  call void @_ZN12RealVector2DC1ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr %24, i64 %26)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.RealVector2D, ptr %27, i32 0, i32 0
  %29 = load float, ptr %28, align 4, !tbaa !9
  %30 = getelementptr inbounds %struct.RealVector2D, ptr %5, i32 0, i32 0
  %31 = load float, ptr %30, align 4, !tbaa !9
  %32 = fsub float %29, %31
  store float %32, ptr %10, align 4, !tbaa !12
  %33 = getelementptr inbounds float, ptr %10, i64 1
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.RealVector2D, ptr %34, i32 0, i32 1
  %36 = load float, ptr %35, align 4, !tbaa !13
  %37 = getelementptr inbounds %struct.RealVector2D, ptr %5, i32 0, i32 1
  %38 = load float, ptr %37, align 4, !tbaa !13
  %39 = fsub float %36, %38
  store float %39, ptr %33, align 4, !tbaa !12
  %40 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 0
  store ptr %10, ptr %40, align 8, !tbaa !14
  %41 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 1
  store i64 2, ptr %41, align 8, !tbaa !17
  %42 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 0
  %43 = load ptr, ptr %42, align 8
  %44 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 1
  %45 = load i64, ptr %44, align 8
  call void @_ZN12RealVector2DC1ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr %43, i64 %45)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %46 = getelementptr inbounds %class.SpaceCalculator, ptr %11, i32 0, i32 1
  %47 = getelementptr inbounds %struct.RealVector2D, ptr %46, i32 0, i32 0
  %48 = load float, ptr %47, align 4, !tbaa !18
  %49 = fdiv float %48, 2.000000e+00
  %50 = getelementptr inbounds %struct.RealVector2D, ptr %5, i32 0, i32 0
  %51 = load float, ptr %50, align 4, !tbaa !9
  %52 = fadd float %51, %49
  store float %52, ptr %50, align 4, !tbaa !9
  %53 = getelementptr inbounds %class.SpaceCalculator, ptr %11, i32 0, i32 1
  %54 = getelementptr inbounds %struct.RealVector2D, ptr %53, i32 0, i32 1
  %55 = load float, ptr %54, align 4, !tbaa !22
  %56 = fdiv float %55, 2.000000e+00
  %57 = getelementptr inbounds %struct.RealVector2D, ptr %5, i32 0, i32 1
  %58 = load float, ptr %57, align 4, !tbaa !13
  %59 = fadd float %58, %56
  store float %59, ptr %57, align 4, !tbaa !13
  call void @_ZNK15SpaceCalculator15correctPositionER12RealVector2D(ptr noundef nonnull align 4 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %60 = getelementptr inbounds %class.SpaceCalculator, ptr %11, i32 0, i32 1
  %61 = getelementptr inbounds %struct.RealVector2D, ptr %60, i32 0, i32 0
  %62 = load float, ptr %61, align 4, !tbaa !18
  %63 = fdiv float %62, 2.000000e+00
  %64 = getelementptr inbounds %struct.RealVector2D, ptr %5, i32 0, i32 0
  %65 = load float, ptr %64, align 4, !tbaa !9
  %66 = fsub float %65, %63
  store float %66, ptr %64, align 4, !tbaa !9
  %67 = getelementptr inbounds %class.SpaceCalculator, ptr %11, i32 0, i32 1
  %68 = getelementptr inbounds %struct.RealVector2D, ptr %67, i32 0, i32 1
  %69 = load float, ptr %68, align 4, !tbaa !22
  %70 = fdiv float %69, 2.000000e+00
  %71 = getelementptr inbounds %struct.RealVector2D, ptr %5, i32 0, i32 1
  %72 = load float, ptr %71, align 4, !tbaa !13
  %73 = fsub float %72, %70
  store float %73, ptr %71, align 4, !tbaa !13
  %74 = getelementptr inbounds %struct.RealVector2D, ptr %5, i32 0, i32 0
  %75 = load float, ptr %74, align 4, !tbaa !9
  %76 = getelementptr inbounds %struct.RealVector2D, ptr %8, i32 0, i32 0
  %77 = load float, ptr %76, align 4, !tbaa !9
  %78 = fadd float %75, %77
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.RealVector2D, ptr %79, i32 0, i32 0
  store float %78, ptr %80, align 4, !tbaa !9
  %81 = getelementptr inbounds %struct.RealVector2D, ptr %5, i32 0, i32 1
  %82 = load float, ptr %81, align 4, !tbaa !13
  %83 = getelementptr inbounds %struct.RealVector2D, ptr %8, i32 0, i32 1
  %84 = load float, ptr %83, align 4, !tbaa !13
  %85 = fadd float %82, %84
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.RealVector2D, ptr %86, i32 0, i32 1
  store float %85, ptr %87, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt5floorf(float noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK15SpaceCalculator15correctPositionER12RealVector2D(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #3 = { 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 #4 = { 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, !11, i64 0}
!10 = !{!"_ZTS12RealVector2D", !11, i64 0, !11, i64 4}
!11 = !{!"float", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 4}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSSt16initializer_listIfE", !6, i64 0, !16, i64 8}
!16 = !{!"long", !7, i64 0}
!17 = !{!15, !16, i64 8}
!18 = !{!19, !11, i64 8}
!19 = !{!"_ZTS15SpaceCalculator", !20, i64 0, !10, i64 8}
!20 = !{!"_ZTS11IntVector2D", !21, i64 0, !21, i64 4}
!21 = !{!"int", !7, i64 0}
!22 = !{!19, !11, 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"

%struct.RealVector2D = type { float, float }

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

declare void @_ZN12RealVector2DC1ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(8), ptr, i64) unnamed_addr #1

; 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 uwtable
define dso_local void @_ZNK15SpaceCalculator19correctDisplacementER12RealVector2D(ptr noundef nonnull align 4 dereferenceable(16) %0, ptr nocapture noundef nonnull align 4 dereferenceable(8) %1) local_unnamed_addr #2 align 2 {
  %3 = alloca %struct.RealVector2D, align 8
  %4 = alloca [2 x float], align 4
  %5 = alloca %struct.RealVector2D, align 8
  %6 = alloca [2 x float], align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %7 = load float, ptr %1, align 4, !tbaa !5
  %8 = tail call noundef float @_ZSt5floorf(float noundef %7)
  store float %8, ptr %4, align 4, !tbaa !10
  %9 = getelementptr inbounds i8, ptr %4, i64 4
  %10 = getelementptr inbounds i8, ptr %1, i64 4
  %11 = load float, ptr %10, align 4, !tbaa !11
  %12 = tail call noundef float @_ZSt5floorf(float noundef %11)
  store float %12, ptr %9, align 4, !tbaa !10
  call void @_ZN12RealVector2DC1ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr nonnull %4, i64 2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %13 = load <2 x float>, ptr %1, align 4, !tbaa !10
  %14 = load <2 x float>, ptr %3, align 8, !tbaa !10
  %15 = fsub <2 x float> %13, %14
  store <2 x float> %15, ptr %6, align 8, !tbaa !10
  call void @_ZN12RealVector2DC1ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr nonnull %6, i64 2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load <2 x float>, ptr %16, align 4, !tbaa !10
  %18 = fmul <2 x float> %17, <float 5.000000e-01, float 5.000000e-01>
  %19 = load <2 x float>, ptr %3, align 8, !tbaa !10
  %20 = fadd <2 x float> %19, %18
  store <2 x float> %20, ptr %3, align 8, !tbaa !10
  call void @_ZNK15SpaceCalculator15correctPositionER12RealVector2D(ptr noundef nonnull align 4 dereferenceable(16) %0, ptr noundef nonnull align 4 dereferenceable(8) %3)
  %21 = load <2 x float>, ptr %16, align 4, !tbaa !10
  %22 = fmul <2 x float> %21, <float 5.000000e-01, float 5.000000e-01>
  %23 = load <2 x float>, ptr %3, align 8, !tbaa !10
  %24 = fsub <2 x float> %23, %22
  %25 = load <2 x float>, ptr %5, align 8, !tbaa !10
  %26 = fadd <2 x float> %24, %25
  store <2 x float> %26, ptr %1, align 4, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt5floorf(float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK15SpaceCalculator15correctPositionER12RealVector2D(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #3 = { 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 #4 = { 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 = !{!"_ZTS12RealVector2D", !7, i64 0, !7, i64 4}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{!6, !7, i64 4}


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