; LLVM IR from salogranada/Robotics-Test-Integration-Engineer :: robotics/ros2/src/motion_control/src/pid_controller.ll (ZN13PIDControllerC2Ev)

; 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.PIDController = type <{ i8, i8, [2 x i8], float, float, float, float, float, float, float, float, float, float, [4 x i8], double, double, double, float, float, float, [4 x i8] }>

@.str = external hidden unnamed_addr constant [34 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13PIDControllerC2Ev(ptr noundef nonnull align 8 dereferenceable(84) %0) unnamed_addr #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 0
  %5 = call noundef zeroext i1 @_Z6getEnvPKcb(ptr noundef @.str, i1 noundef zeroext true)
  %6 = zext i1 %5 to i8
  store i8 %6, ptr %4, align 8, !tbaa !9
  %7 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 1
  %8 = call noundef zeroext i1 @_Z6getEnvPKcb(ptr noundef @.str.1, i1 noundef zeroext true)
  %9 = zext i1 %8 to i8
  store i8 %9, ptr %7, align 1, !tbaa !14
  %10 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 3
  %11 = call noundef float @_Z6getEnvPKcf(ptr noundef @.str.2, float noundef 0x3FC99999A0000000)
  store float %11, ptr %10, align 4, !tbaa !15
  %12 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 4
  %13 = call noundef float @_Z6getEnvPKcf(ptr noundef @.str.3, float noundef 0x3FC99999A0000000)
  store float %13, ptr %12, align 8, !tbaa !16
  %14 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 5
  %15 = call noundef float @_Z6getEnvPKcf(ptr noundef @.str.4, float noundef 0.000000e+00)
  store float %15, ptr %14, align 4, !tbaa !17
  %16 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 6
  %17 = call noundef float @_Z6getEnvPKcf(ptr noundef @.str.5, float noundef 1.000000e+00)
  store float %17, ptr %16, align 8, !tbaa !18
  %18 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 7
  %19 = call noundef float @_Z6getEnvPKcf(ptr noundef @.str.6, float noundef 5.000000e-01)
  store float %19, ptr %18, align 4, !tbaa !19
  %20 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 8
  %21 = call noundef float @_Z6getEnvPKcf(ptr noundef @.str.7, float noundef 1.000000e+00)
  store float %21, ptr %20, align 8, !tbaa !20
  %22 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 9
  %23 = call noundef float @_Z6getEnvPKcf(ptr noundef @.str.8, float noundef 0.000000e+00)
  store float %23, ptr %22, align 4, !tbaa !21
  %24 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 10
  %25 = call noundef float @_Z6getEnvPKcf(ptr noundef @.str.9, float noundef 1.000000e+00)
  store float %25, ptr %24, align 8, !tbaa !22
  %26 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 11
  %27 = call noundef float @_Z6getEnvPKcf(ptr noundef @.str.10, float noundef 0x3FF47AE140000000)
  store float %27, ptr %26, align 4, !tbaa !23
  %28 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 12
  %29 = call noundef float @_Z6getEnvPKcf(ptr noundef @.str.11, float noundef 0x3FE19999A0000000)
  store float %29, ptr %28, align 8, !tbaa !24
  %30 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 14
  store double 0.000000e+00, ptr %30, align 8, !tbaa !25
  %31 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 15
  store double 0.000000e+00, ptr %31, align 8, !tbaa !26
  %32 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 16
  store double 0.000000e+00, ptr %32, align 8, !tbaa !27
  %33 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 17
  store float 0.000000e+00, ptr %33, align 8, !tbaa !28
  %34 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 18
  store float 0.000000e+00, ptr %34, align 4, !tbaa !29
  %35 = getelementptr inbounds %class.PIDController, ptr %3, i32 0, i32 19
  store float 0.000000e+00, ptr %35, align 8, !tbaa !30
  ret void
}

declare noundef zeroext i1 @_Z6getEnvPKcb(ptr noundef, i1 noundef zeroext) #1

declare noundef float @_Z6getEnvPKcf(ptr noundef, float 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 = { "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++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS13PIDController", !11, i64 0, !11, i64 1, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !12, i64 72, !12, i64 76, !12, i64 80}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!10, !11, i64 1}
!15 = !{!10, !12, i64 4}
!16 = !{!10, !12, i64 8}
!17 = !{!10, !12, i64 12}
!18 = !{!10, !12, i64 16}
!19 = !{!10, !12, i64 20}
!20 = !{!10, !12, i64 24}
!21 = !{!10, !12, i64 28}
!22 = !{!10, !12, i64 32}
!23 = !{!10, !12, i64 36}
!24 = !{!10, !12, i64 40}
!25 = !{!10, !13, i64 48}
!26 = !{!10, !13, i64 56}
!27 = !{!10, !13, i64 64}
!28 = !{!10, !12, i64 72}
!29 = !{!10, !12, i64 76}
!30 = !{!10, !12, i64 80}


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

@.str = external hidden unnamed_addr constant [34 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13PIDControllerC2Ev(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(84) %0) unnamed_addr #0 align 2 {
  %2 = tail call noundef zeroext i1 @_Z6getEnvPKcb(ptr noundef nonnull @.str, i1 noundef zeroext true)
  %3 = zext i1 %2 to i8
  store i8 %3, ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 1
  %5 = tail call noundef zeroext i1 @_Z6getEnvPKcb(ptr noundef nonnull @.str.1, i1 noundef zeroext true)
  %6 = zext i1 %5 to i8
  store i8 %6, ptr %4, align 1, !tbaa !12
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  %8 = tail call noundef float @_Z6getEnvPKcf(ptr noundef nonnull @.str.2, float noundef 0x3FC99999A0000000)
  store float %8, ptr %7, align 4, !tbaa !13
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = tail call noundef float @_Z6getEnvPKcf(ptr noundef nonnull @.str.3, float noundef 0x3FC99999A0000000)
  store float %10, ptr %9, align 8, !tbaa !14
  %11 = getelementptr inbounds i8, ptr %0, i64 12
  %12 = tail call noundef float @_Z6getEnvPKcf(ptr noundef nonnull @.str.4, float noundef 0.000000e+00)
  store float %12, ptr %11, align 4, !tbaa !15
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = tail call noundef float @_Z6getEnvPKcf(ptr noundef nonnull @.str.5, float noundef 1.000000e+00)
  store float %14, ptr %13, align 8, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %0, i64 20
  %16 = tail call noundef float @_Z6getEnvPKcf(ptr noundef nonnull @.str.6, float noundef 5.000000e-01)
  store float %16, ptr %15, align 4, !tbaa !17
  %17 = getelementptr inbounds i8, ptr %0, i64 24
  %18 = tail call noundef float @_Z6getEnvPKcf(ptr noundef nonnull @.str.7, float noundef 1.000000e+00)
  store float %18, ptr %17, align 8, !tbaa !18
  %19 = getelementptr inbounds i8, ptr %0, i64 28
  %20 = tail call noundef float @_Z6getEnvPKcf(ptr noundef nonnull @.str.8, float noundef 0.000000e+00)
  store float %20, ptr %19, align 4, !tbaa !19
  %21 = getelementptr inbounds i8, ptr %0, i64 32
  %22 = tail call noundef float @_Z6getEnvPKcf(ptr noundef nonnull @.str.9, float noundef 1.000000e+00)
  store float %22, ptr %21, align 8, !tbaa !20
  %23 = getelementptr inbounds i8, ptr %0, i64 36
  %24 = tail call noundef float @_Z6getEnvPKcf(ptr noundef nonnull @.str.10, float noundef 0x3FF47AE140000000)
  store float %24, ptr %23, align 4, !tbaa !21
  %25 = getelementptr inbounds i8, ptr %0, i64 40
  %26 = tail call noundef float @_Z6getEnvPKcf(ptr noundef nonnull @.str.11, float noundef 0x3FE19999A0000000)
  store float %26, ptr %25, align 8, !tbaa !22
  %27 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(36) %27, i8 0, i64 36, i1 false)
  ret void
}

declare noundef zeroext i1 @_Z6getEnvPKcb(ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

declare noundef float @_Z6getEnvPKcf(ptr noundef, float 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 = { "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) }

!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 = !{!"_ZTS13PIDController", !7, i64 0, !7, i64 1, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !10, i64 72, !10, i64 76, !10, i64 80}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!6, !7, i64 1}
!13 = !{!6, !10, i64 4}
!14 = !{!6, !10, i64 8}
!15 = !{!6, !10, i64 12}
!16 = !{!6, !10, i64 16}
!17 = !{!6, !10, i64 20}
!18 = !{!6, !10, i64 24}
!19 = !{!6, !10, i64 28}
!20 = !{!6, !10, i64 32}
!21 = !{!6, !10, i64 36}
!22 = !{!6, !10, i64 40}


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